close ad
WARNING: Do Not Install the DREAMWEAVER CC 2017 or 2018 Update »
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

How to display Authorize.net failure response on checkout_failure page

Thread began 11/09/2010 5:40 pm by SaladoGuy | Last modified 11/11/2010 4:48 pm by SaladoGuy | 2595 views | 14 replies

SaladoGuyBeta Tester

How to display Authorize.net failure response on checkout_failure page

Hello,

The checkout wizard that generates all the checkout pages makes two final pages (along with all the others) checkout_success.php and checkout_failure.php.

Initially the checkout_failure page just says:

"Transaction Not Completed
We're sorry
Your transaction could not be completed. "

I want to add more detail and have it show the reason the card was declined, if possible.

By searching in the forms I found this thread: showthread.php?t=649&highlight=authorize.net+response

That gives me an idea but I still am not quite sure how to implement this...

In DreamWeaver I see that if I have the checkout_failure page up, there's not really anything in the Bindings panel that I can use, but if I open confirm.php, Bindings contains
something called "Local Checkout Response (Authorize.net)".

What I tried doing is posting all of those as hidden fields in the form, and then echoing the post on the checkout_failure page - but that's not working.

The form code on the confirm.php page looks like this:

<input name="rcode" type="hidden" id="rcode" value="<?php echo(AuthNet_Result("Response Code")) ?>" />
<input name="rsubcode" type="hidden" id="rsubcode" value="<?php echo(AuthNet_Result("Response Subcode")) ?>" />
<input name="rreasoncode" type="hidden" id="rreasoncode" value="<?php echo(AuthNet_Result("Response Reason Code")) ?>" />
<input name="rreasontext" type="hidden" id="rreasontext" value="<?php echo(AuthNet_Result("Response Reason Text")) ?>" />


(that's all just above the buttons for the checkout form)

and the post echo on the checkout_failure page looks like this:

<?php echo $_POST["rcode"]; ?>&nbsp;<?php echo $_POST["rsubcode"]; ?>&nbsp;<?php echo $_POST["rreasoncode"]; ?>&nbsp;<?php echo $_POST["rreasontext"]; ?>

Nothing is actually displayed, so either I'm not handling the echo right, or I'm it's not really getting into the hidden field (which seems more likely ... since the response data can't exist until after the form is posted ... but then how are you suppose to capture the data?).

(BTW ... we do NOT have the AVS service enabled at Authorize.net - but we should still be able to see and print out the reasons the card was declined, right? Or does the x_relay_response only work with AVS?)

I echoed all the session variables on the failure page and i see this (along with the rest):

["WAAuthNet"]=> string(455) "2::1::2::This transaction has been declined.::::U::3281283316::c984cdf88677653a2aea::

What is the proper way to do this? Should I forget the hidden fields and the _POST echo, and parse & echo out of the session variable array instead?

Also I don't quite understand: should x_test_request be set to TRUE or FALSE while I'm doing this - or does it not matter?

BTW I did change x_relay_response to "TRUE" in confirm.php.

Build websites with a little help from your friends

Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.

Build websites from already-built web applications

These out-of-the-box solutions provide you proven, tested applications that can be up and running now.  Build a store, a gallery, or a web-based email solution.

Want your website pre-built and hosted?

Close Windowclose

Rate your experience or provide feedback on this page

Account or customer service questions?
Please user our contact form.

Need technical support?
Please visit support to ask a question

Content

rating

Layout

rating

Ease of use

rating

security code refresh image

We do not respond to comments submitted from this page directly, but we do read and analyze any feedback and will use it to help make your experience better in the future.

Close Windowclose

We were unable to retrieve the attached file

Close Windowclose

Attach and remove files

add attachmentAdd attachment
Close Windowclose

Enter the URL you would like to link to in your post

Close Windowclose

This is how you use right click RTF editing

Enable right click RTF editing option allows you to add html markup into your tutorial such as images, bulleted lists, files and more...

-- click to close --

Uploading file...