Charging a Credit Card Using DoDirectPaymentUse DoDirectPayment to charge a credit card or to authorize a credit card for later capture. Always include the following parameters with DoDirectPayment:
l
l
l
l On success, the DoDirectPayment response returns the Address Verification System (AVS) code, a PayPal transaction ID, and the amount charged.
Table 2.1 [requiredSecurityParameters]&METHOD=DoDirectPayment&CREDITCARDTYPE=VISA
&ACCT=4683075410516684&EXPDATE=012007&CVV2=808&AMT=212.95
&FIRSTNAME=Designer&LASTNAME=Fotos&IPADDRESS=255.55.167.002
&STREET=1234+Easy+Street&CITY=San+Jose&STATE=CA&COUNTRY=United+States
&ZIP=95110&COUNTRYCODE=US&PAYMENTACTION=Sale
To authorize a credit card for later capture, include the PAYMENTACTION=Authorization field.
[requiredSecurityParameters]&METHOD=DoDirectPayment&CREDITCARDTYPE=VISA
&ACCT=4683075410516684&EXPDATE=012007&CVV2=808&AMT=305.92
&FIRSTNAME=Designer&LASTNAME=Fotos&IPADDRESS=255.55.167.002
&STREET=1234+Easy+Street&CITY=San+Jose&STATE=CA&COUNTRY=United+States
&ZIP=95110&COUNTRYCODE=US&PAYMENTACTION=Authorization
To capture the payment, use DoCapture. For details, see “Capturing, Authorizing, Voiding, and Reauthorizing”.
Table 2.5 [requiredSecurityParameters]&METHOD=DoDirectPayment&CREDITCARDTYPE=VISA
&ACCT=4683075410516684&EXPDATE=012007&CVV2=808&AMT=212.95
&FIRSTNAME=Designer&LASTNAME=Fotos&IPADDRESS=255.55.167.002
&STREET=1234+Easy+Street&CITY=San+Jose&STATE=CA&COUNTRY=United+States
&ZIP=95110&COUNTRYCODE=US&PAYMENTACTION=Sale
&SHIPTONAME=Louise+P.+Flowerchild&SHIPTOSTREET=1234+Easy+Street
&SHIPTOSTREET2=Apt+22+bis&SHIPTOCITY=New+Orleans&SHIPTOSTATE=LA
&SHIPTOCOUNTRYCODE=US&SHIPTOPHONENUM=504-555-1212&SHIPTOZIP=70114
If you want the PayPal user to see subtotals of item cost, shipping charges, handling charges, and sales tax, include the following parameters:
l
l
Note: Be sure that the summed values of ITEMAMT, SHIPPINGAMT, HANDLINGAMT, and TAXAMT equal the value of AMT. You cannot include a zero amount for any of these fields, and you must set all of them.
Table 2.7 [requiredSecurityParameters]&METHOD=DoDirectPayment&CREDITCARDTYPE=VISA
&ACCT=4683075410516684&EXPDATE=012007&CVV2=808&AMT=127.87
&FIRSTNAME=Designer&LASTNAME=Fotos&IPADDRESS=255.55.167.002
&STREET=1234+Easy+Street&CITY=San+Jose&STATE=CA&COUNTRY=United+States
&ZIP=95110&COUNTRYCODE=US&PAYMENTACTION=Sale
&ITEMAMT=115.00&SHIPPINGAMT=7.02&HANDLINGAMT=1.00&TAXAMT=4.85
If you want the PayPal user to see details about the items purchased with the credit card, include these parameters:
l L_NAMEn: item name or description
l L_NUMBERn: line item number
l L_QTYn: item quantity
l L_TAXAMTn: sales tax for the item
l L_AMTn: cost of itemYou can detail as many items as you want. Beginning with 0, append an index number to the field name and increment that index number by one for each item.
Table 2.9 [requiredSecurityParameters]&METHOD=DoDirectPayment&CREDITCARDTYPE=VISA
&ACCT=4683075410516684&EXPDATE=012007&CVV2=808&AMT=127.87
&FIRSTNAME=Designer&LASTNAME=Fotos&IPADDRESS=255.55.167.002
&STREET=1234+Easy+Street&CITY=San+Jose&STATE=CA&COUNTRY=United+States
&ZIP=95110&COUNTRYCODE=US&PAYMENTACTION=Sale&L_DESC0=Cat+Nibbles
&L_NUMBER0=SKU+98099&L_QTY0=2&L_TAXAMT0=0.85&L_AMT0=8.00
L_DESC1=+Flea+Collar&L_NUMBER1=2&L_QTY1=1&L_TAXAMT1=1.10&
L_AMT1=17.00&ITEMAMT=37.00&TAXAMT=1.95
If you specify L_AMTn, you must specify the ITEMAMT parameter. The values for L_AMTn and L_QTYn should add up to the ITEMAMT.If you specify L_TAXAMTn, you must specify the TAXAMT parameter. The values for L_TAXAMTn and L_QTYn should add up to TAXAMT.
Note: If the line item details do not add up to ITEMAMT or TAXAMT, the line item details are discarded, and the transaction is processed using the values of ITEMAMT or TAXAMT. The ACK value in the response is set to SuccessWithWarning.