Stats

174 Contributors: 1
2016-05-03
Licensed under: CC-BY-SA

Not affiliated with Stack Overflow
Rip Tutorial: info@zzzprojects.com

Download eBook

Creating Subscriptions / Recurring Payments

Download paypal eBook

Parameters

ParameterDetails
billingAgreementAttributesConfiguration object to create the billing agreement
billingPlanBilling plan ID from the query string
billingPlanAttribsConfiguration object to create the billing plan
billingPlanUpdateAttributesConfiguration object for changing a billing plan to an active state
clientIdYour application client ID (OAuth keys)
httpReference to the http package to set up our simple server
isoDateISO date for setting the subscription start date
linksHATEOAS link object for extracting the redirect URL to PayPal
paramsQuery string parameters
paypalReference to the PayPal SDK
secretYour application secret (OAuth keys)
tokenThe billing agreement approval token provided after PayPal redirect to execute the billing agreement

Remarks

These examples go through the process of creating a subscription / recurring payment system using PayPal.

The process for creating a subscription is to:

  1. Create a billing plan. This is a reusable model that outlines the details of the subscription.
  2. Activate the billing plan.
  3. When you want to create a subscription for a user, you create a billing agreement using the ID of the billing plan that they should be subscribed to.
  4. Once created, you redirect the user to PayPal to confirm the subscription. Once confirmed, the user is redirected back to the merchant's website.
  5. Lastly, you execute the billing agreement to begin the subscription.

Related Examples