cancel
Showing results forย 
Search instead forย 
Did you mean:ย 

Unable to set return options using hostedPaymentReturnOptions setting

I have been trying to set the url for the Continue button on the Receipt page using the following code:

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""}"

The other settings I have are hostedPaymentOrderOptions, hostedPaymentButtonOptions and hostedPaymentCustomerOptions and these do not cause any problems.  If I include hostedPaymentReturnOptions, I get the error "Missing or invalid token".

 

 

I was guessing this is some typo in my string but I can't find it.  Any suggestions?

 

Thank you.

 

 

 

 

 

jmorgret
Contributor
3 REPLIES 3

I dont see the setting values correct. Please use the following code, it should workout.

Let us know if you see any other issues.

 

-Bhavana

 

            settingType[] settings = new settingType[3];

            settings[0] = new settingType();
            settings[0].settingName = settingNameEnum.hostedPaymentButtonOptions.ToString();
            settings[0].settingValue = "{\"text\": \"Pay\"}";
            
            settings[1] = new settingType();
            settings[1].settingName = settingNameEnum.hostedPaymentOrderOptions.ToString();
            settings[1].settingValue = "{\"show\": false}";


			settings[2] = new settingType();
			settings[2].settingName = settingNameEnum.hostedPaymentReturnOptions.ToString();
			settings[2].settingValue = "{\"showReceipt\": true, \"url\": \"https://mysite.com/receipt\", \"urlText\": \"Continue\", \"cancelUrl\": \"https://mysite.com/cancel\", \"cancelUrlText\": \"Cancel\"}";

			var transactionRequest = new transactionRequestType
            {
                transactionType = transactionTypeEnum.authCaptureTransaction.ToString(),    // authorize capture only
                amount = amount
            };

 

 

bhav
Authorize.Net Expert Authorize.Net Expert
Authorize.Net Expert

Here is the code I currently have:

 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

Anyone have any suggestions?