We use authorize.net Java SDK, latest version 2.0.1. Using JDK 11 (not 8) on Windows 10.
We get a failed (with errors), Order Summary page
if the return URL that has more than one query parameters (delimited by &)
If we specifiy just 1 query parameter in the return URL, the hosted page seem to work with no problem (we get the Order summary screen, can enter cc number and click continue).
The errors in the Hosted page can be seen in the attached image
The errors are:
SyntaxError: "" string literal contains an unescaped line break
ERROR ReferenceError: "g_errorPanelMessage is not defined"
ERROR TypeError: "this.paymentProfileList" is undefined
The debugger screenshot attached to this messsage, showing all the parameters that are passed (and the issue pointed by yellow error) into API -- is also attached (auth-net-issue1b.png) picture. It contains all the parameters and their order.
we searched community forums, but no helpful discussion were found.
We receive no errors from the API call (the token it generates seems to be valid).
did not get any suggestions sofar.
Would very much appreciate if somebody could help (I contacted also developer support at Authorize.net, but they said all that they can do is reset passwords for sandbox, they do not help developers).
Does anybody on the forum use authorize.net Java SDK (version 2.0.1) ?
And with that does anybody use Payment Hosted page with a return URL with 2 or more query parameters? (I need query parameters in return URL to be able to re-create the state of my application after user finishes paymetnt).
To help others following up with a workaround.
Even though Authorize.net documentation states
With any of the form integration methods, you can embed information specific to the customer into the continue URL or the cancel URL. The merchant server's code can embed a tracking code into the URL that can identify the specific customer and order details when the customer returns. URL-encode any name-value pairs embedded in the URL to ensure correct processing in the form request.
This does not work (at least when using AuthorizeNet Java SDK)
Following workaround had to be made to our code:
a) use only 1 URL Query parameter in hostedPaymentReturnOptions return url
b) Base64 encode the value of the query parameter (URL-encoding did not work for us)
I suspect, not using Query parameters and just adding base64 encoded path-end would also work
(eg https://mywebsite/return/az/accepted/<base64 encoded blob of your data>)
We are using: