I have not been able to get a helpful response for this question. Any help is greatly appreciated.
I have been trying to set the url for the Continue button on the Receipt page using the following code:
Dim settings As settingType() = New settingType(3) {} settings(0) = New settingType settings(0).settingName = settingNameEnum.hostedPaymentCustomerOptions.ToString settings(0).settingValue = "{""showEmail"":true,""requiredEmail"":true}" settings(1) = New settingType() settings(1).settingName = settingNameEnum.hostedPaymentButtonOptions.ToString() settings(1).settingValue = "{""text"": ""Pay Now""}" settings(2) = New settingType() settings(2).settingName = settingNameEnum.hostedPaymentOrderOptions.ToString() settings(2).settingValue = "{""show"": true, ""merchantName"":""My Company, Inc.""}" settings(3) = New settingType settings(3).settingName = settingNameEnum.hostedPaymentReturnOptions.ToString settings(3).settingValue = "{""showReceipt"": true, ""url"": ""http://mysite.com/training-center/training-locations"", ""urlText"": ""Continue"", ""cancelURL"": ""http://mysite.com/training-center/training-schedule"", ""cancelUrlText"": ""Cancel""}"
When the customer pays, they are taken to an Authorize.net generated receipt page that displays my company name as set in the hostedPaymentOrderOptions setting. It also displays a button that says "Continue". How do I set the url for that button? It was my understanding that I should use the hostedPaymentReturnOptions setting and set the url value to the url I would like the user to be directed to from the auto-generated receipt page.
Is that the case? If not where can you set the url for this button? If it is the case, then is there something wrong with my syntax that I am not seeing or something else I need to do because every time I insert this code, instead of being taken to the payment page, I get the error "Missing or invalid token".
Thank you,
Jennifer
Solved! Go to Solution.
02-23-2018 08:57 AM
One thing that is obvious is that your
cancelUrl
is defined as
cancelURL
Adhere to the case sensitivity of the schema.
02-27-2018 01:08 AM - edited 02-27-2018 01:10 AM
Hi Jennifer,
The missing or invalid token error is due to the token not being passed properly to your form input.
Can you inspect the form element and verify or copy the token value?
For the SandBox, we have a token tester, that you can paste the token in to validate : https://nexwebsites.com/authorizenet/token-tester.html
If you are using the SandBox, which you should be at this stage, and the token is coming back as invalid using the form above, then you should check your API login credentials, and regenerate a new Transaction Key, if necessary.
02-26-2018 04:57 AM - edited 02-26-2018 04:58 AM
Thank you for your response. I should have been more detailed in my question.
The code only breaks if I add the setting for hostedPaymentReturnOptions so for instance, if I comment it out like this, it works.
Dim settings As settingType() = New settingType(3) {} settings(0) = New settingType settings(0).settingName = settingNameEnum.hostedPaymentCustomerOptions.ToString settings(0).settingValue = "{""showEmail"":true,""requiredEmail"":true}" settings(1) = New settingType() settings(1).settingName = settingNameEnum.hostedPaymentButtonOptions.ToString() settings(1).settingValue = "{""text"": ""Pay Now""}" settings(2) = New settingType() settings(2).settingName = settingNameEnum.hostedPaymentOrderOptions.ToString() settings(2).settingValue = "{""show"": true, ""merchantName"":""My Company, Inc.""}" ' settings(3) = New settingType ' settings(3).settingName = 'settingNameEnum.hostedPaymentReturnOptions.ToString ' settings(3).settingValue = "{""showReceipt"": true, ""url"": ""http://mysite.com/training-center/training-locations"", ""urlText"": ""Continue"", ""cancelURL"": ""http://mysite.com/training-center/training-schedule"", ""cancelUrlText"": ""Cancel""}"
But if I uncomment it it fails. No changes to the Transaction Key or login credentials.
Thank you.
02-26-2018 10:09 PM
One thing that is obvious is that your
cancelUrl
is defined as
cancelURL
Adhere to the case sensitivity of the schema.
02-27-2018 01:08 AM - edited 02-27-2018 01:10 AM
Thank you so much! I knew it had to be something simple and obvious. I just didn't see it.
Working great now.
-Jennifer
02-27-2018 10:38 AM