Jump to content

Simple Direct Payment Integration with the PayPal API

0
  sarahkim's Photo
Posted Mar 16 2011 08:25 AM

This excerpt from PayPal APIs: Up and Running walks you through the steps that are necessary to implement a direct payment using the PayPal API.
To implement a Direct Payment transaction, you need to invoke the DoDirectPayment API and provide information to identify the buyer’s credit or debit card and the amount of the payment. Setting up the transaction is accomplished through the following steps:

  • Specify the amount of the transaction, including the currency if it is not in U.S. dollars. You should specify the total amount of the transaction if it is known; otherwise, specify the subtotal.

    AMT=amount
    
    CURRENCYCODE=currencyID


  • Specify the payment action. It is best practice to explicitly specify the payment action as one of the following values:

    PAYMENTACTION=Sale
    
    PAYMENTACTION=Authorization


  • Specify the IP address of the buyer’s computer:

    IPADDRESS=xxx.xxx.xxx.xxx


  • Specify information about the card being used. You must specify the type of card as well as the account number:

    CREDITCARDTYPE=Visa
    
    ACCT=1234567891011123


    The type of credit/debit card being used, the card issuer, and the Payment Receiving Preferences setting on your PayPal Profile might require that you set the following fields as well:

    EXPDATE=012010
    
    CVV2=123


  • Specify information about the card holder. You must provide the first and last name of the card holder, as well as the billing address associated with the card:

    FIRSTNAME=John
    
    LASTNAME=Doe
    
    STREET=1313 Mockingbird Lane
    
    CITY=Any town
    
    STATE=Any state
    
    ZIP=11111
    
    COUNTRYCODE=US


Cover of PayPal APIs: Up and Running
Learn more about this topic from PayPal APIs: Up and Running. 

Does your web application provide users with a convenient way to complete transactions? This book introduces you to PayPal’s APIs with instruction and resources for integrating this popular payment solution in different application environments, including mobile. By the end of this book, you'll have a clear understanding of what PayPal is and how you can get the most out of its powerful features for your particular payment situation.

Learn More Read Now on Safari


Tags:
1 Subscribe


0 Replies