cancel
Showing results for 
Search instead for 
Did you mean: 

Ampersand in return or cancel URLs for GetHostedPaymentPageRequest

We have a need to get two data items back as part of the responses to our redirects to an Accept hosted payment page:

 

1) we need our local reference ID to be on the response, and I've read here that putting it in the URL is the way to do so

2) we also need to use the same URL for both return and cancel, so the thought was to include the action type as a GET parameter

 

E.g., the Return URL might be:

 

https://oursite.com/ProcessPayment?a=return&id=123456

 

And the Cancel URL might be:

 

https://oursite.com/ProcessPayment?a=cancel&id=123456

 

However, when we try sending this through the AuthorizeNet API, the XMLTextWriter in use therein translates the ampersand character to & instead.  Which might be fine from the standpoint of valid XML, but it appears that the Authorize.net server cannot convert this back to an ampersand, because even though we get back a success state and a token from GetHostedPaymentPageRequest, when we actually attempt to display the Accept Hosted page using the resulting token, the page is completely messed up (containing only a single line of text and two unlabeled buttons).

 

Can you please do some or all of the following:

 

1) suggest a code change or different approach that would allow us to get both of these data items back after a payment redirect, but without the problematic ampersand?  (Note that simply using different URLs is an option we would resist pursuing, as we have other systems that are locked into using the same, single URL, and we don't want to start maintaining parallel codebases, especially since that part of our code is supposed to remain agnostic regarding the provider.)

2) suggest a code change to your client API that would allow both data items to be part of the same URL in a way that your server can handle?

3) look into whether something on the Auth.net server side might be broken with respect to handling ampersands in return URLs?

dsandberg
Contributor
0 REPLIES 0