Skip to content

Commit 064ad10

Browse files
author
Okubanjo Oluwafunsho
committed
Support for creating subscription
You can now create subscription now, yaay!
1 parent b38f8cb commit 064ad10

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

src/Paystack.php

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -416,6 +416,23 @@ public function exportTransactions(){
416416

417417
}
418418

419+
/**
420+
* Create a subscription to a plan from a customer.
421+
* @return array
422+
*/
423+
public function createSubscription(){
424+
425+
$data = [
426+
"customer" => request()->customer, //Customer email or code
427+
"plan" => request()->plan,
428+
"authorization" => request()->authorization_code
429+
];
430+
431+
$this->setRequestOptions();
432+
433+
return $this->setGetResponse('/subscription', $data)->getResponse();
434+
}
435+
419436
}
420437

421438

0 commit comments

Comments
 (0)