Re: connecting with javascript

Arwn
New Contributor

connecting with javascript

good day to all this is my code here what am i doing wrong

 

const response = fetch(
{
method: 'POST',
headers: {
Accept: 'application/json',
'Content-Type': 'application/json',
},
body: JSON.stringify({
initiatingPartyId: 1,
rateProductCode: 'BANK',
destinationCurrencyCode: 'GBP',
sourceCurrencyCode: 'USD',
destinationAmount: 10,
}),
}
5 REPLIES 5
jenn_kh
Community Moderator

Re: connecting with javascript

Thank you for reaching out, @Arwn! An agent is looking for a solution for you and will get back with you soon. If any community members know a solution, please feel free to respond in this thread. -Jenn

I_Doroteo3
Visa Developer Support Specialist

Re: connecting with javascript

Hi @Arwn

 

Can you provide more details about the error you're seeing? e.g. error code, request body, etc.

 

Thanks, 

Illana

 

Arwn
New Contributor

Re: connecting with javascript

im not getting any error but what im trying to do is connect to the. api via react.js 'fetch' my question how do i work with the certificates or add them the fetch or axios function to connect. do i need to build my own server with node.js to connect ?

Arwn
New Contributor

Re: connecting with javascript

 LOG  response is : {"_A": null, "_x": 0, "_y": 0, "_z": null}

 WARN  Possible Unhandled Promise Rejection (id: 0):

Axios Error : Request failed with status code 400

I_Doroteo3
Visa Developer Support Specialist

Re: connecting with javascript

Hi @Arwn

 

Appreciate your patience! Since you are inquiring about using the Fetch API within React, I suggest looking for support via React forums/documents.

 

Thanks, 

Illana