Reply
Member
Posts: 1
Registered: ‎10-08-2017

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.

Member
Posts: 1
Registered: ‎01-11-2018

Re: Hosted Form decline error code and message.

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?

Highlighted
Authorize.Net Expert
Posts: 84
Registered: ‎11-16-2017

Re: Hosted Form decline error code and message.

[ Edited ]

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

Member
Posts: 2
Registered: ‎03-21-2018

Re: Hosted Form decline error code and message.

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!

Posts: 196
Kudos: 31
Solutions: 17
Registered: ‎03-13-2017

Re: Hosted Form decline error code and message.

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

 

 

Follow me at

https://twitter.com/anuragg29

https://www.linkedin.com/in/anuragg



Send feedback at developer_feedback@authorize.net
Member
Posts: 2
Registered: ‎03-21-2018

Re: Hosted Form decline error code and message.

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?

Authorize.Net Contributor
Posts: 12
Registered: ‎03-01-2018

Re: Hosted Form decline error code and message.

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