AuthorizeNet / sample-code-php

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

Charging a Card gets Authorized but Not Captured #86

Closed globatum closed 7 years ago

globatum commented 7 years ago

On your API page, you describe that authorization and capture is possible.

http://developer.authorize.net/api/reference/#payment-transactions-charge-a-credit-card

Use this method to authorize and capture a credit card payment.

However, using our live credentials... we notice that we need to manually capture on the authorize.net backend.

This is from your support team

"You'll want to let your web or software provider know that the transactions aren't always being automatically captured. It's up to them to ensure that the transaction request that's sent to us includes a request to capture. We can't automatically capture without that request."

What is the point of this code if it doesn't automatically "authorize and capture" a user's credit card when they purchase? https://github.com/AuthorizeNet/sample-code-php/blob/master/PaymentTransactions/charge-credit-card.php

What more do we need to do beyond what is in the above link?

adavidw commented 7 years ago

Hi,

This comes down to the transaction type. If you're setting the transaction type as "authCaptureTransaction", it will authorize and capture in one step. If you're sending it as "authOnlyTransaction", it will only be authorized, and you'll have to capture either in the interface or a separate API request.

The relevant part of our sample code looks like this: // Create a TransactionRequestType object $transactionRequestType = new AnetAPI\TransactionRequestType(); $transactionRequestType->setTransactionType( "authCaptureTransaction");