cancel
Showing results for 
Search instead for 
Did you mean: 

Who Me Too'd this topic

Authorize.net Accept.js Hosted - Invalid Setting Value. hostedPaymentReturnOptionsurl must begin wit

I also posted this on stackoverflow, but haven't gotten any action. https://stackoverflow.com/questions/74733569/authorize-net-accept-js-hosted-invalid-setting-value-ho... 

I just started getting this error today from my authorize.net API implementation and it is preventing customers from making to the payment page.

I'm using the authorize.net API SDK.

My return option URLs are formatted as such:

$success_url = "https://" . $_SERVER['HTTP_HOST'] . "/payment/cc_authorizenet_accept_hosted.php?r=$soidhash";
$cancel_url = "https://" . $_SERVER['HTTP_HOST'] . "/payment/cc_authorizenet_accept_hosted.php?r=$coidhash";

Then put into an array of options:

 $payment_options = array(
        'hostedPaymentSecurityOptions'          =>  "{\"captcha\": false}",
        'hostedPaymentStyleOptions'             =>  "{\"bgColor\": \"#C00\"}",
        'hostedPaymentShippingAddressOptions'   =>  "{\"show\": false, \"required\": true}",
        'hostedPaymentBillingAddressOptions'    =>  "{\"show\": false, \"required\": true}",
        'hostedPaymentButtonOptions'            =>  "{\"text\": \"Submit Secure Payment\"}",
        'hostedPaymentOrderOptions'             =>  "{\"show\": true, \"merchantName\": \"Lee Precision, Inc.\"}",
        'hostedPaymentPaymentOptions'           =>  "{\"cardCodeRequired\": true, \"showCreditCard\": true,\"showBankAccount\": false}",
        'hostedPaymentReturnOptions'            =>  "{\"showReceipt\": true,\"url\": \"{$success_url}\", \"urlText\": \"Get Receipt\", \"cancelUrl\": \"{$cancel_url}\", \"cancelUrlText\": \"Cancel/Continue Shopping\"}"
    );

Then options added using API SDK:

   foreach ($payment_options as $k => $v) {
        $aSetting = new AnetAPI\SettingType();
        $aSetting->setSettingName($k);
        $aSetting->setSettingValue($v);
        $request->addToHostedPaymentSettings($aSetting);
    }

This implementation has been working for about two years, and I have not changed any of the code since then, so I'm not sure if their API is having an issue? Status page says everything is working.

Is there a way on authorize.net to review API requests to see what they are receiving from my server?

danfbach1
Member
Who Me Too'd this topic