How to Make a Basic Chained Payment Using Adaptive Payments

Making a basic chained payment using Adaptive Payments requires:

  1. Setting up the payment.
  2. Redirecting the customer to PayPal for authorization.
  3. Optionally, retrieving information about the payment.

In a chained payment, a payment is made to a primary receiver. The primary receiver keeps some of the payment and pays the rest to one or more secondary receivers. For additional information about the subjects covered below, see the following:

Note Please see Going Live with Your Application regarding the review process for applications that include chained payments or other advanced functionality.

Step 1: Set Up the Payment

When a customer is ready to check out, use the Pay call to set up the chained payment. The input fields include the email address of a single primary receiver and the email addresses of one or more secondary receivers. Also specify the payment amounts.

The Pay response contains a pay key for use in subsequent steps. For parameter descriptions, see the Pay API Operation.

The following HTTP POST request includes cURL syntax.

Step 2: Redirect the Customer to PayPal for Authorization

Redirect the customer to Paypal by using the URL-decoded pay key from Step 1, with the PayPal authorization URL, as follows:

https://www.sandbox.paypal.com/cgi-bin/webscr?cmd=_ap-payment&paykey=InsertPayKeyHere

If the customer doesn't provide authorization, the customer is redirected to the cancel URL that you specified in the Pay call, so you can provide a way to re-initiate checkout.

If the customer authorizes the payment, the customer is redirected to the return URL that you specified in the Pay call.

Step 3: Retrieve Information about the Payment (Optional)

If you want to retrieve data about the payment, specify the pay key (from Step 1) in a PaymentDetails call. The PaymentDetails call enables you to obtain transaction IDs and other information about the payment. For more information, see PaymentDetails API Operation.

The following HTTP POST request includes cURL syntax.