cancel
Showing results for 
Search instead for 
Did you mean: 

Hosted Payment page Cancel button not working

I have set the code for the cancel button but nothing happens when it is clicked. Any suggestions why?  I thought this was the code to set it:

settings(3) = New settingType
        settings(3).settingName = settingNameEnum.hostedPaymentReturnOptions.ToString
        settings(3).settingValue = "{""url"": ""http://mysite/training-center/training-locations"", ""urlText"": ""Continue"", ""cancelUrl"": ""http://mysite/training-center/training-schedule"", ""cancelUrlText"": ""Cancel""}"
        

It works for the "Continue" button which appears on the receipt page but the "Cancel" button that is shown on the payment page ("Pay" and "Cancel" buttons are shown) does nothing.

 

 

Thanks.

jmorgret
Contributor
2 REPLIES 2

Any suggestions?

jmorgret
Contributor

After looking the code it seems SettingValue got messed up, Please check your request when goes on network, if it follow below structure:-

 

JSON:-

"hostedPaymentSettings": {
      "setting": [{
        "settingName": "hostedPaymentReturnOptions",
        "settingValue": "{\"showReceipt\": true, \"url\": \"https://mysite.com/receipt\", \"urlText\": \"Continue\", \"cancelUrl\": \"https://mysite.com/cancel\", \"cancelUrlText\": \"Cancel\"}"
      },  {
        "settingName": "hostedPaymentPaymentOptions",
        "settingValue": "{\"cardCodeRequired\": false, \"showCreditCard\": true, \"showBankAccount\": true}"
      }]
    }

 

XML:-

<hostedPaymentSettings>

    <setting>

        <settingName>hostedPaymentReturnOptions</settingName>

        <settingValue>{"showReceipt": true, "url":"https://mysite.com/receipt","urlText":"Continue","cancelUrl":"https://mysite.com/cancel","cancelUrlText":"CancelText"}</settingValue>

    </setting>

 

    <setting>

 

        <settingName>hostedPaymentPaymentOptions</settingName>

        <settingValue>{"cardCodeRequired": true, "showCreditCard": true, "showBankAccount": true}</settingValue>

    </setting>

</hostedPaymentSettings>

 

Please refer here:-

https://developer.authorize.net/api/reference/features/accept_hosted.html

 

I hope it will help.

 

Thanks,

Shoagraw
Authorize.Net Developer Authorize.Net Developer
Authorize.Net Developer