Hi,
I am integrating with SIM, but am not quite sure how to handle this situation:
1. User goes through my checkout and is handed off via SIM to an authorize.net payment page
2. User enters an invalid credit card / security combination
3. Authorize.net is presenting a card failure type screen, and user is never able to retry/fix their entry
Is there a better way to handle this? I'm currently using the relay URL upon completion to send a user back to my site so I can give them a receipt page and capture the response (transaction ID, etc).
What best practices should I use?
Thanks!
12-27-2011 06:52 PM
If you're using SIM with relay response, it should display the payment form again on failure:
Relay Response does not redirect the end user back to your server, but relays your specified Relay URL to the end user through our receipt page instead of displaying our default receipt page. If you would like to redirect the end user back to your server, please provide a link on your Relay URL for this purpose.
If a transaction encounters an error or is part of a partial authorization, and you are using Relay Response, the Authorize.Net payment form reappears, offering an option to try again or enter another form of payment to complete the order. If you are using your own payment form, such as with the Direct Post Method, you should set x_relay_always to true to prevent the standard Authorize.Net payment form from redisplaying instead of your own customized payment form. For more information on how to integrate your website using the Direct Post Method, see http://developer.authorize.net/guides/DPM/ .
This is the relay response page from the DPM guide. DPM is layered on top of SIM, so most of the page will probably be the same:
<?php require_once 'anet_php_sdk/AuthorizeNet.php'; // The SDK $redirect_url = "http://YOUR_DOMAIN.com/receipt_page.php"; // Where the user will end up. $api_login_id = 'YOUR_API_LOGIN_ID'; $md5_setting = ""; // Your MD5 Setting $response = new AuthorizeNetSIM($api_login_id, $md5_setting); if ($response->isAuthorizeNet()) { if ($response->approved) { // Do your processing here. $redirect_url .= '?response_code=1&transaction_id=' . $response->transaction_id; } else { $redirect_url .= '?response_code='.$response->response_ code . '&response_reason_text=' . $response->response_reason_text; } // Send the Javascript back to AuthorizeNet, which will redirect user back to your site. echo AuthorizeNetDPM::getRelayResponseSnippet($redirect_ url); } else { echo "Error. Check your MD5 Setting."; } ?>
12-27-2011 08:32 PM