Skip to content


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
PHP PayPal Recurring Payments with Billing Agreement (could be used with cron jobs)
branch: master

This branch is even with romaonthego:master

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.


PayPal recurring payments (with flexible amount) integration.

1. Create object instance:

$recurring = new PaypalRecurringPayments($gateway);

2. Obtain billing agreement from PayPal, user will be redirected there

$recurring->obtainBillingAgreement("Test subscription", "", 'USD', $resultData);

3. Read PayPal's response


It will return billing details (most important are token and payerId)

4. Make an initial payment (could be $1.00), it will return billing agreement ID

$billingAgreementId = $recurring->doInitialPayment($details->token, $details->payerId, $amount);

5. Now you can perform transparent transactions using the Billing Agreement ID

$recurring->doSubscriptionPayment($billingAgreementId, $amount, $resultData);

For more information see index.php file.

NOTE: You need to have reference transactions enabled To enable it on sandbox account, you need to ask it here: To enable reference transactions on live site you need to contact PayPal Business Services Group

Something went wrong with that request. Please try again.