AnsweredAssumed Answered

json problem

Question asked by hankshrier on Sep 7, 2018
Latest reply on Sep 10, 2018 by skywillmott

I'm trying to send json to a credit card processing gateway.  Please read carefully before you answer.  The gateway does NOT accept messages containing escape characters.  Yes I know with 100% certainty that this is the case. I spent 4 hours on the phone with the person who wrote the gateway.  We tried almost everything.

 

This is the variable I've created.   Set Valiable $json  JSONFormatElements ("{\"GWToken\":\"10852b2b2f57480696e5a4e918b26cc1\",\"transaction_data\": {\"amount\":\"1.00\",\"baddress\":\"29727 Niguel Rd\",\"bcountry\":\"US\",\"bstate\":\"CA\",\"bzip\":\"92677\",\"cardfullname\":\"John Smith\",\"cemail\":\"hank@stratusdevelopment.com\",\"cfirstname\":\"John\",\"clastname\":\"Smith\",\"cphone\":\"9494783686\",\"creditcard\":\"5544044490909090\",\"currency\":\"USD\",\"cvv\":\"123\",\"cwebaddress\":\"www.web.com\",\"ipaddress\":\"127.0.0.1\",\"mid\":\"90655454\",\"month\":\"04\",\"orderid\":\"101\",\"year\":\"19\"}}")

 

I've put the string  in 3 Json validators, so i know it is OK.   Here is the header option

 

"-X POST " &

"--header \"Content-Type:application/json\" " &

"--header \"Accept: application/json\” " &

"-d@$json"

 

This is the message I receive back.   {"status":"error","message":"Credentials not provided in header or body (GWToken).  Contact your customer representative.","code":"GW500"}

 

According to the person who wrote this, the system does NOT accept json with the "\" escape character.

 

Is there any way to send the string WITHOUT the \ where the quotes are?  Any other ideas?

Outcomes