I am trying to migrate to your new API. The problem I have is my script requires a parameter to know which area it is used in. (i.e. http://mydomain.com/mystore.cgi?area=onlinestore1) The problem is every time I try to use that for my return or cancelURL, I get errors that /=/ is not allowed. Only the base URL is valid. I know I can use a Iframe or webhook for communication purposes, but I wanted to make this a simple add-in to my current (working) process. I'll rewrite the whole thing later. Any suggestions?
Solved! Go to Solution.
03-25-2017 04:28 PM
Thanks,
I recreated it on my end, and realized you're not url encoding the whole URL. Change to the hex value for the "&" sign as well, and it should work just fine.
03-27-2017 10:17 AM
03-26-2017 10:45 PM
03-26-2017 11:10 PM
Can you post an example of the request you're making? Can you also post an example of the exact error message you're receiving?
03-26-2017 11:20 PM
Here is my redacted request (partial)
<hostedPaymentSettings> <setting> <settingName>hostedPaymentButtonOptions</settingName> <settingValue>{"text": "Pay"}</settingValue> </setting> <setting> <settingName>hostedPaymentReturnOptions</settingName> <settingValue>{"url":"https://xxxxx.com/mystore.cgi?uid%3DYFf2vQAA1490328330&config%3Dconfig1.txt","urlText":"Continue","cancelUrl":"<<CancelURL>>","cancelUrlText":"Cancel"}</settingValue> </setting>
and the error:
{ 'xmlns' => 'AnetApi/xml/v1/schema/AnetApiSchema.xsd', 'messages' => { 'resultCode' => 'Error', 'message' => { 'text' => '\'%\' is an unexpected token. The expected token is \';\'. Line 54, position 128.', 'code' => 'E00003' } }, 'xmlns:xsi' => 'http://www.w3.org/2001/XMLSchema-instance', 'xmlns:xsd' => 'http://www.w3.org/2001/XMLSchema' };
And it works if I leave off everything after '.cgi'.
Tom...
03-27-2017 08:54 AM
Any more details you can give me? Are you doing this through one of our SDKs? If so, which one? And, if so, could you post the code that creates the request?
03-27-2017 09:46 AM
I am posting to: "https://apitest.authorize.net/xml/v1/request.api";
I am using the AcceptHosted API and I am attempting to get a Token.
Tom...
03-27-2017 09:52 AM
Thanks,
I recreated it on my end, and realized you're not url encoding the whole URL. Change to the hex value for the "&" sign as well, and it should work just fine.
03-27-2017 10:17 AM
Thank you. You are correct. Fixed that and it seems to work now. I had no idea it would be an encoding error. Unfortunately, all the sample code does not show anything but simple URLs for the return URLs.
Tom...
03-27-2017 10:58 AM