Skip to content

Commit

Permalink
Update README
Browse files Browse the repository at this point in the history
  • Loading branch information
srmklive committed Apr 6, 2017
1 parent 54dc12c commit 483bc31
Showing 1 changed file with 6 additions and 14 deletions.
20 changes: 6 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -376,7 +376,7 @@ Suppose you have set IPN URL to **http://example.com/ipn/notify/** in PayPal. To
<a name="create-subscriptions"></a>
## 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.
Expand Down Expand Up @@ -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);
```
<a name="support"></a>
Expand Down

0 comments on commit 483bc31

Please sign in to comment.