Subscription Billing
In this chapter we show how to create subscription plan and use it in future to charge a customer.
Create a plan
<?php
// prepare.php
use Payum\Stripe\Request\Api\CreatePlan;
$plan = new \ArrayObject([
"amount" => 2000,
"interval" => "month",
"currency" => "usd",
"id" => "gold",
"product" => [
"name" => "Amazing Gold Plan"
]
]);
/** @var \Payum\Core\Payum $payum */
$payum->getGateway('gatewayName')->execute(new CreatePlan($plan));or with existing product, for example Stripe API - Create a Plan
Subscribing a customer to a plan
This is a usual charge as we showed it in get-it-started with only these additions:
Links
Supporting Payum
Payum is an MIT-licensed open source project with its ongoing development made possible entirely by the support of community and our customers. If you'd like to join them, please consider:
Last updated