Skip to content

Instantly share code, notes, and snippets.

@xcommerce-gists
xcommerce-gists / CreateAccount
Last active December 25, 2015 12:21
How to Create a PayPal Account Using Adaptive Accounts.curl
HTTP Headers
------------
-H "X-PAYPAL-SECURITY-USERID: <Caller-UID>" # UserID from the Caller account
-H "X-PAYPAL-SECURITY-PASSWORD: <Caller-Pswd>" # Password from the Caller account
-H "X-PAYPAL-SECURITY-SIGNATURE: <Caller-Sig>" # Signature from the Caller account
-H "X-PAYPAL-REQUEST-DATA-FORMAT: JSON"
-H "X-PAYPAL-RESPONSE-DATA-FORMAT: JSON"
-H "X-PAYPAL-SANDBOX-EMAIL-ADDRESS: <Caller-Sandbox-edress>"
-H "X-PAYPAL-DEVICE-IPADDRESS: 192.0.2.0"
-H "X-PAYPAL-APPLICATION-ID: APP-80W284485P519543T" # Standard Sandbox App ID
@xcommerce-gists
xcommerce-gists / CreateRecurringPaymentsProfile
Created August 28, 2012 20:59
How to Create a Recurring Payments Profile with Express Checkout.curl
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=CreateRecurringPaymentsProfile
&VERSION=86
@xcommerce-gists
xcommerce-gists / Pay
Created August 28, 2012 21:08
How to Make a Basic Chained Payment Using Adaptive Payments.curl
HTTP Headers
------------
-H "X-PAYPAL-SECURITY-USERID: insert_developer_user_name_here"
-H "X-PAYPAL-SECURITY-PASSWORD: insert_developer_password_here"
-H "X-PAYPAL-SECURITY-SIGNATURE: insert_developer_signature_here"
-H "X-PAYPAL-REQUEST-DATA-FORMAT: NV"
-H "X-PAYPAL-RESPONSE-DATA-FORMAT: NV"
-H "X-PAYPAL-APPLICATION-ID: APP-80W284485P519543T" #Standard Sandbox App ID
Endpoint
@xcommerce-gists
xcommerce-gists / ExecutePayment
Created August 28, 2012 21:13
How to Make a Delayed Chained Payment Using Adaptive Payments.curl
HTTP Headers
------------
-H "X-PAYPAL-SECURITY-USERID: insert_developer_user_name"
-H "X-PAYPAL-SECURITY-PASSWORD: insert_developer_password"
-H "X-PAYPAL-SECURITY-SIGNATURE: insert_developer_signature"
-H "X-PAYPAL-REQUEST-DATA-FORMAT: NV"
-H "X-PAYPAL-RESPONSE-DATA-FORMAT: NV"
-H "X-PAYPAL-APPLICATION-ID: APP-80W284485P519543T" #Standard Sandbox App ID
Endpoint
@xcommerce-gists
xcommerce-gists / Pay
Created August 28, 2012 21:21
How to Set Up a Payment Preapproval Using Adaptive Payments.curl
HTTP Headers
------------
-H "X-PAYPAL-SECURITY-USERID: insert_developer_user_name_here"
-H "X-PAYPAL-SECURITY-PASSWORD: insert_developer_password_here"
-H "X-PAYPAL-SECURITY-SIGNATURE: insert_developer_signature_here"
-H "X-PAYPAL-REQUEST-DATA-FORMAT: NV"
-H "X-PAYPAL-RESPONSE-DATA-FORMAT: NV"
-H "X-PAYPAL-APPLICATION-ID: APP-80W284485P519543T" #Standard Sandbox App ID
Endpoint
@xcommerce-gists
xcommerce-gists / CreateRecurringPaymentsProfile
Created August 28, 2012 21:25
How to Set Up a Recurring Payments Profile Using Direct Payment.curl
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=CreateRecurringPaymentsProfile
&PROFILESTARTDATE=2012-05-11T00:00:00Z #Billing date start, in UTC/GMT format
@xcommerce-gists
xcommerce-gists / CreateBillingAgreement
Created August 28, 2012 21:28
How to Set Up a Reference Transaction Using Express Checkout.curl
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
@xcommerce-gists
xcommerce-gists / DoExpressCheckoutPayment
Created August 29, 2012 19:37
How to Use Express Checkout for One-Time Payments.curl
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=DoExpressCheckoutPayment
&VERSION=86
@xcommerce-gists
xcommerce-gists / auth.php
Created September 5, 2012 15:23
PayPalAccessOpenIDConnect.PHP
/**
* Get Access Token
*
* After the user is forwarded back to the application callback (defined in
* the application at devportal.x.com) and the code parameter is available on
* the query string, exchange the code parameter for an access token.
*
*/
public function get_access_token(){
$code = $_GET['code'];
@xcommerce-gists
xcommerce-gists / DoExpressCheckoutPayment.php
Created September 6, 2012 20:36
How to Use Express Checkout for One-Time Payments.php
require_once('services/PayPalApi/PayPalAPIInterfaceServiceService.php');
/* setup payment details */
orderTotal = new BasicAmountType( '-your-currency-code-', '-your-amount-');
$PaymentDetails= new PaymentDetailsType();
$PaymentDetails->OrderTotal = $orderTotal;
/* create DoExpressCheckout request details */
$DoECRequestDetails = new DoExpressCheckoutPaymentRequestDetailsType();
$DoECRequestDetails->PayerID = '-payer-id-from-get-EC-call';