Integration Guide

Table Of Contents
PayPal Payments Pro Integration Guide April 2012 35
Getting Started With Direct Payment
Testing Direct Payment Using NVP and cURL
4
The following steps show how you can test the DoDirectPayment API operation:
1. Execute the DoDirectPayment API operation to complete the transaction.
The following example uses cURL to communicate with PayPal:
curl --insecure ^
https://api-3t.sandbox.paypal.com/nvp ^
-d "VERSION=56.0^
&SIGNATURE=api_signature^
&USER=api_username^
&PWD=api_password^
&METHOD=DoDirectPayment^
&PAYMENTACTION=Sale^
&IPADDRESS=192.168.0.1^
&AMT=8.88^
&CREDITCARDTYPE=Visa^
&ACCT=4683075410516684^
&EXPDATE=042011^
&CVV2=123^
&FIRSTNAME=John^
&LASTNAME=Smith^
&STREET=1 Main St.^
&CITY=San Jose^
&STATE=CA^
&ZIP=95131^
&COUNTRYCODE=US"
2. Test that the response to the DoDirectPayment API operation was successful.
The ACK field must contain Success or SuccessWithWarning; however, other fields in
the response can help you decide whether to ultimately accept or refund the payment:
TIMESTAMP=...
&CORRELATIONID=...
&ACK=Success
&VERSION=56%2e0
&BUILD=1195961
&AMT=8%2e88
&CURRENCYCODE=USD
&AVSCODE=X
&CVV2MATCH=M
&TRANSACTIONID=...
NOTE: Values of status fields are simulated because an actual card transaction does not occur.
3. Log into your PayPal test account from the Sandbox.
On the My Account Overview page, you should see the results of your transaction if the
transaction was successful: