cancel
Showing results for 
Search instead for 
Did you mean: 

error in hostedPaymentReturn URL with equal sign

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?

tabsoft
Member
1 ACCEPTED SOLUTION

Accepted Solutions

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.

View solution in original post

8 REPLIES 8

Hi @tabsoft,

 

Are you URL encoding the URL? (i.e., replacing the "=" with "%3D"?)

Aaron
All Star
I tried that, and I got an error for the % sign as well.

Tom

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?

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...

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?

 

 

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...

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.

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...