Skip to content

Payment Plan

Abraham Olaobaju edited this page Aug 23, 2023 · 3 revisions

Overview

This section describes how you can create and manage your respective payment plans.

Create a Payment Plan.

This section describes how to create a payment plan with Flutterwave.

use Flutterwave\Payload;
use Flutterwave\Service\PaymentPlan;

$payload = new Payload();
$payload->set("amount", "2000");
$payload->set("name", "Hulu Extra");
$payload->set("interval", "monthly");
$payload->set("duration", "1");

$service = new PaymentPlan();
$request = $service->create($payload);
print_r($request);

Get a Payment Plan.

This section describes how to fetch all payment plans on your account.

use Flutterwave\Service\PaymentPlan;

$id = "3806";
$service = new PaymentPlan();
$request = $service->get($id);
print_r($request);

Get Payment Plans.

This section describes how to fetch all payment plans on your account.

use Flutterwave\Service\PaymentPlan;

$service = new PaymentPlan();
$request = $service->list();
print_r($request);

Update a Payment Plan.

This help the you update an existing payment plan.

use Flutterwave\Service\PaymentPlan;

$payload = new Payload();
$payload->set("amount","600");
$payload->set("status", "active");

$service = new PaymentPlan();
$request = $service->update($id, $payload);
print_r($request);

Cancel a Plan.

This help the to cancel an existing payment plan.

$id = "3807";

$service = new PaymentPlan();
$request = $service->cancel($id);
print_r($request);
Clone this wiki locally