cancel
Showing results for 
Search instead for 
Did you mean: 

Hosted Form decline error code and message.

I have implemented the hosted form using the Iframe Communicator (ifcommunicator.html and C#).

 

How do I capture the response when a credit card is decline?

 

I don't have problems getting the response when a credit card was authorize, but now I need to save the error code and message submitted by authorize.net when a credit card is not charged.

 

Thank you in advance for your time reading this and offering suggestions.

8 REPLIES 8

Has anyone found a solution for this.  I need a response to mark my orders as "payment failed," but I do not get a declined response?

jcrittenden
Member

For the IFrame, If sendReceipt is set to False, you will be able to get the response code in transactResponse object.

Please check the below link for the same - under Held Transactions Section.

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

 

-Bhavana

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

I find that the sendReceipt flag is mentioned 2 times in the documentation for hosted payment form but I cannot find where this flag can be set? I did now find it option for an setting for the request. please help me where I can find this flag!

pixdev
Member

Hi @pixdev

 

Please have a look at our Accept sample app for it . 

 

https://github.com/AuthorizeNet/accept-sample-app

 

https://github.com/AuthorizeNet/accept-sample-app/blob/master/getHostedPaymentForm.php

 

 





Send feedback at developer_feedback@authorize.net

Thanks for Reply. Could not find the sendReceipt flag in the whole repo. But I found a showReceipt Flag. Could it be that the documentation is somehow inconsistent and the mentioned sendReceipt should be the showReceipt Flag?

pixdev
Member

Yes, you are right, showReceipt Flag is what you need.

 

Since you are using iFrame, you can set "showReceipt" to false.

At the same time, pass your iframe communicator url in hostedPaymentIFrameCommunicationUrl setting, as follows 

 

<setting>
    <settingName>hostedPaymentIFrameCommunicatorUrl</settingName>
    <settingValue>{"url": "your iframe communicator url"}</settingValue>
</setting>

 

Then, you should be able to get a json response like the following one:

{  
   "accountType":"XXXX",
   "accountNumber":"XXXX",
   "transId":"XXXX",
   "responseCode":"XX",
   "authorization":"XXXX",

    ....
   "totalAmount":"XXXX",
   "dateTime":"XXXX"

    ....
}

 

 

Thanks,

Angie

 

angie
Authorize.Net Developer Authorize.Net Developer
Authorize.Net Developer

I am not able to capture error responses. Only successfull transactions.Any help?

Hi,
Im not able to captured error respones from iframe.
if transactions is successful i get a response otherwise if there is a error it will not return anything.
Help please!