Prev | Current Page 747 | Next

Emilian Balanescu and Cristian Darie

"Beginning PHP and MySQL E-Commerce: From Novice to Professional, Second Edition"

In our examples, we??™ll use the pipe (|) character. The return values come in
a predetermined order, and their significance is given by their position in the returned string.
?– Note The complete documentation for the Authorize.net API can be found in the Advanced Integration Method
(AIM) Implementation Guide: Card-Not-Present Transactionsat http://www.authorize.net/support/
AIM_guide.pdf. Even more documents are available in the document library at http://www.authorize.net/
resources/documentlibrary/.
The default transaction type is AUTH_CAPTURE, where we request and deduct the funds from
the credit card using a single request. For TShirtShop, we??™ll use two other transaction types:
AUTH_ONLY, which checks if the necessary funds are available (this happens in the PsCheckFunds
pipeline stage), and PRIOR_AUTH_CAPTURE, which deducts the amount of money that was previously
checked using AUTH_ONLY (this happens in the PsTakePayment pipeline stage).
To perform an AUTH_ONLY transaction, we??™ll first create an array that contains the necessary
transaction data:
// Auth
$transaction =
array ('x_invoice_num' => '99999', // Invoice number
'x_amount' => '45.99', // Amount
'x_card_num' => '4007000000027', // Credit card number
'x_exp_date' => '1209', // Expiration date
'x_method' => 'CC', // Payment method
'x_type' => 'AUTH_ONLY'); // Transaction type
CHAPTER 20 ?–  PROCESSING CREDIT CARD TRANSACTIONS 642
For PRIOR_AUTH_CAPTURE transactions, we don??™t need to specify all this information again;
we only need to pass the transaction ID that was returned in response to the AUTH_ONLY request.


Pages:
735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759
Leona Lewis Koraliki nowoczesne meble hale pomoce dydaktyczne