AuthorizeNet / sample-code-php

This repository contains working code samples which demonstrate php integration with the Authorize.Net API
MIT License
176 stars 197 forks source link

Unable to pass parameter in AuthorizeNet Sample Code for PHP #60

Closed techauth closed 7 years ago

techauth commented 7 years ago

I am using following code for making transaction with my sandbox account which is working fine. But I am unable to pass following parameters :-

1) Customer Name 2) Customer Phone number 3) Customer Email address 4) Order Id 5) Order Description

Code URL : https://github.com/AuthorizeNet/sample-code-php/blob/master/PaymentTransactions/authorize-credit-card.php

ashtru commented 7 years ago

If you see the api reference for Charge a credit card, the xml request fields include:-

techauth commented 7 years ago

Hi,

Thanks for the response as mentioned I am using following code for "Auth and Capture" mode

https://github.com/AuthorizeNet/sample-code-php/blob/master/PaymentTransactions/authorize-credit-card.php

But for some strange reason I am still unable to make a successful transaction. The problem is when a customer fill their form and press submit button it shows "Transaction successful". But when I go to "Reports" to capture specific transaction in my authorizenet account. It declines all the transactions showing one of the reasons below:

1) Declined (Authorization with the card issuer was successful but the transaction was declined due to an address or ZIP code mismatch with the address on file with the card issuing bank based on the settings in the Merchant Interface.)

2) Declined (Card declined by issuer - Contact card issuer to determine reason.)

My question is if the above exception can happen then why it shows "Transaction Successful" message in my application? Or Is there any other code to implement Authorzinet for Auth and Capture mode with PHP application ?

ashtru commented 7 years ago
  1. Sorry for the confusion, but for a successful transaction, the response code returned must be 1. Refer the responseCode field in Response tab for authorize a credit card api. image
  2. You need to review your settings in MINT (Merchant Interface), and check which fraud filters have been applied, and adjust them accordingly. It seems to be one of the address based filters. Refer the documentation.

Here is another discussion, describing the actions that can be chosen, when one of the filters is triggered.

ashtru commented 7 years ago

Please reply if you were able to fix this issue. Meanwhile, this will issues be closed. Feel free to reopen in case of further queries.