- 
      
 - 
        
Save alekpopovic/a17d7cc2091f5bc87b26f12458bcca4b to your computer and use it in GitHub Desktop.  
    How to Set Up a Reference Transaction Using Express Checkout.curl
  
        
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | Request | |
| ------- | |
| Endpoint URL: https://api-3t.sandbox.paypal.com/nvp | |
| HTTP method: POST | |
| POST data: | |
| USER=insert_merchant_user_name_here | |
| &PWD=insert_merchant_password_here | |
| &SIGNATURE=insert_merchant_signature_value_here | |
| &METHOD=CreateBillingAgreement | |
| &VERSION=86 | |
| &TOKEN=insert_token_value_here | |
| Response | |
| -------- | |
| BILLINGAGREEMENTID=B%2d7FB31251F28061234 | |
| &ACK=Success | |
| ... | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | Request | |
| ------- | |
| Endpoint URL: https://api-3t.sandbox.paypal.com/nvp | |
| HTTP method: POST | |
| POST data: | |
| USER=insert_merchant_user_name_here | |
| &PWD=insert_merchant_password_here | |
| &SIGNATURE=insert_merchant_signature_value_here | |
| &METHOD=DoReferenceTransaction | |
| &VERSION=86 | |
| &AMT=50 #The amount the buyer will pay in a payment period | |
| &CURRENCYCODE=USD #The currency, e.g. US dollars | |
| &PAYMENTACTION=SALE #The type of payment | |
| &REFERENCEID=B-7FB31251F28061234 #Billing agreement ID received in the DoExpressCheckoutPayment call | |
| Response | |
| -------- | |
| BILLINGAGREEMENTID=B%2d7FB31251F28061234 | |
| &ACK=Success | |
| &TRANSACTIONID=98A13946GS4491234 | |
| &TRANSACTIONTYPE=merchtpmt | |
| &PAYMENTTYPE=instant | |
| &AMT=50%2e00 | |
| &PAYMENTSTATUS=Completed | |
| ... | |
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | Request | |
| ------- | |
| Endpoint URL: https://api-3t.sandbox.paypal.com/nvp | |
| HTTP method: POST | |
| POST data: | |
| USER=insert_merchant_user_name_here | |
| &PWD=insert_merchant_password_here | |
| &SIGNATURE=insert_merchant_signature_value_here | |
| &METHOD=SetExpressCheckout | |
| &VERSION=86 | |
| &PAYMENTREQUEST_0_PAYMENTACTION=AUTHORIZATION #Payment authorization | |
| &PAYMENTREQUEST_0_AMT=0 #The amount authorized | |
| &PAYMENTREQUEST_0_CURRENCYCODE=USD #The currency, e.g. US dollars | |
| &L_BILLINGTYPE0=MerchantInitiatedBilling #The type of billing agreement | |
| &L_BILLINGAGREEMENTDESCRIPTION0=ClubUsage #The description of the billing agreement | |
| &cancelUrl=http://www.yourdomain.com/cancel.html #For use if the consumer decides not to proceed with payment | |
| &returnUrl=http://www.yourdomain.com/success.html #For use if the consumer proceeds with payment | |
| Response | |
| -------- | |
| TOKEN=EC%2d2B984685J43051234 | |
| &ACK=Success | |
| ... | 
  
    Sign up for free
    to join this conversation on GitHub.
    Already have an account?
    Sign in to comment