$recurring = new PaypalRecurringPayments($gateway);
$recurring->obtainBillingAgreement("Test subscription", "email@example.com", 'USD', $resultData);
It will return billing details (most important are token and payerId)
$billingAgreementId = $recurring->doInitialPayment($details->token, $details->payerId, $amount);
$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: www.x.com/thread/38753 To enable reference transactions on live site you need to contact PayPal Business Services Group