From 483bc31a9cb277c25946a80fd08e7eb0e1dcdbaa Mon Sep 17 00:00:00 2001 From: Raza Mehdi Date: Thu, 6 Apr 2017 20:09:53 +0500 Subject: [PATCH] Update README --- README.md | 20 ++++++-------------- 1 file changed, 6 insertions(+), 14 deletions(-) diff --git a/README.md b/README.md index 1201714c..74b82834 100644 --- a/README.md +++ b/README.md @@ -376,7 +376,7 @@ Suppose you have set IPN URL to **http://example.com/ipn/notify/** in PayPal. To ## Create Subscriptions -* To create recurring payment subscriptions on paypal, first pass data to `SetExpressCheckout` API call in following format: +* For example, you want to create a recurring subscriptions on paypal, first pass data to `SetExpressCheckout` API call in following format: ```php // Always update the code below accordingly to your own requirements. @@ -409,20 +409,12 @@ $data['total'] = $total; * Finally do the following for [`CreateRecurringPaymentsProfile`](#usage-ec-createrecurringprofile) ```php -// Always update the code below accordingly to your own requirements. -$startdate = Carbon::now()->addMonth()->toAtomString(); - -$data = [ - 'PROFILESTARTDATE' => $startdate, - 'DESC' => "Monthly Subscription #1", - 'BILLINGPERIOD' => 'Month', - 'BILLINGFREQUENCY' => 1, - 'AMT' => 9.99, - 'INITAMT' => 9.99, - 'CURRENCYCODE' => 'USD' -]; +$amount = 9.99; +$description = "Monthly Subscription #1"; +$response = $provider->createMonthlySubscription($token, $amount, $description); -$response = $provider->createRecurringPaymentsProfile($data, $token); +// To create recurring yearly subscription on PayPal +$response = $provider->createYearlySubscription($token, $amount, $description); ```