I am using visa cybersource rest api for payment. Just trying to impliment visa cybersouce but stuck at some place. Please help me to intigrate cybersource.
Request Body : {
"clientReferenceInformation": {
"code": "TC50171_3"
},
"orderInformation": {
"billTo": {
"country": "US",
"lastName": "VDP",
"address1": "201 S. Division St.",
"postalCode": "48104-2201",
"locality": "Ann Arbor",
"administrativeArea": "MI",
"firstName": "RTS",
"phoneNumber": "999999999",
"district": "MI",
"buildingNumber": "123",
"company": "Visa",
"email": "test@cybs.com"
},
"amountDetails": {
"totalAmount": "102.21",
"currency": "USD"
}
},
"paymentInformation": {
"card": {
"expirationYear": "2031",
"number": "5555555555554444",
"securityCode": "123",
"expirationMonth": "12",
"type": "002"
}
}
}
I have genrated x-pay-token using this string
x-pay-token string : 1521530541v2/paymentsapikey=6XNS7OT5FTPET91M1US821VSwYeGv7nxz0jt1P6Z4QhJkWyBs{"clientReferenceInformation":{"code":"TC50171_3"},"orderInformation":{"billTo":{"country":"US","lastName":"VDP","address1":"201 S. Division St.","postalCode":"48104-2201","locality":"Ann Arbor","administrativeArea":"MI","firstName":"RTS","phoneNumber":"999999999","district":"MI","buildingNumber":"123","company":"Visa","email":"test@cybs.com"},"amountDetails":{"totalAmount":"102.21","currency":"USD"}},"paymentInformation":{"card":{"expirationYear":"2031","number":"5555555555554444","securityCode":"123","expirationMonth":"12","type":"002"}}}
Header Send Is :
Accept : application/json
ex-correlation-id : m6wVcc8p1Zhz_SC
x-pay-token : xv2:1521530541:a5a3db49dba74df65c25ff099ee0492104fc8c851b44d98bd6fe1a7b7bbb911b
Content-Type : application/json
Response Body :
Resource not found
Solved! Go to Solution
Hi Ankur,
Thank you for your inquiry. Can you please verify Url is: https://sandbox.api.visa.com/cybersource/v2/payments?apikey=6XNS7OT5FTPET91M1US821VSwYeGv7nxz0jt1P6Z... and please verify http method is POST.
Thank you,
Vaibhav
Hi Ankur,
Please test calling the API by replacing the APIkey and secret in the TestSuite custom properties with the one assigned to your project. Also, please replace the APIkey and secret in the XPAYTokenGeneration Grrovy Script as well and then execute the TestSuite.
Thanks,
Vaibhav
Hi Ankur,
Thank you for your prompt response. I am not understanding what the questions is. Is it a question about GET vs POST or about Hypermedia links?
Thank you,
Vaibhav
I am asking about this point because the error( "Resource not found" ) i am getting i think related to this point.
"Resources: each payment function is accessed with a “resource”, such as authorizations, captures, etc. Each individual payment object, such as an authorization, can also be accessed with its unique resource id."
Now my response is change and getting response
{"submitTimeUTC":"2018-03-24T09:40:25.021Z","status":"400","statusInformation":{"reason":"INVALID_DATA","message":"Invalid Json Request"}}
for same request in which i was getting response "resource noy found".
I am using nodejs so please give me solution in nodejs.
I'm getting the same problem. "Resource not found" (Status Code 404).
[Update] I don't have a resolution yet, but found I was getting the invalid json error you mentioned above before I removed the carriage returns and line feeds in the json string. I fixed that and it went back to "Resource not found".
If I figure that one out I'll definitely share the solution here.
Hi,
For the Invalid Json Response using NodeJS please download the NodeJS sample code from our github repository (https://github.com/visa/SampleCode/tree/master/vdp-node/test/cybersource) and use the sample unit test in the cybersource folder
(cybersourcepaymentstest.js) as a guide to help you format the json payload.
Thank you,
Vaibhav