Skip to content

Latest commit

 

History

History
23 lines (20 loc) · 621 Bytes

SUBSCRIPTION.md

File metadata and controls

23 lines (20 loc) · 621 Bytes

Subscriptions

To create a charge as a subscription, you need add to charge creation the following code:

$subscription = new Subscription();
$subscription->repeats(2)
             ->interval(1);

$response = $apiGN->createCharge()
                  ...
                  ->subscription($subscription)
                  ->run()
                  ->response();

To cancel a subscription:

$response = $apiGN->cancelSubscription()
                  ->subscriptionId($subscriptionId)
                  ->isCustomer(true) // This is optional
                  ->run()
                  ->response();