Skip to content

Commit 8251ef3

Browse files
committed
add method to get all subscriptions made
1 parent 6219066 commit 8251ef3

File tree

1 file changed

+13
-2
lines changed

1 file changed

+13
-2
lines changed

src/Paystack.php

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ public function makePaymentRequest()
127127
*
128128
* ]
129129
*/
130-
'metadata' => request()->metadata
130+
'metadata' => request()->metadata
131131
];
132132

133133
// Remove the fields which were not sent (value would be null)
@@ -319,7 +319,6 @@ public function createPlan()
319319
$this->setRequestOptions();
320320

321321
$this->setHttpResponse("/plan", 'POST', $data);
322-
323322
}
324323

325324
/**
@@ -434,6 +433,18 @@ public function createSubscription()
434433
$this->setHttpResponse('/subscription', 'POST', $data);
435434
}
436435

436+
/**
437+
* Get all the subscriptions made on Paystack.
438+
*
439+
* @return array
440+
*/
441+
public function getAllSubscriptions()
442+
{
443+
$this->setRequestOptions();
444+
445+
return $this->setHttpResponse("/subscription", 'GET', [])->getData();
446+
}
447+
437448
/**
438449
* Enable a subscription using the subscription code and token
439450
* @return array

0 commit comments

Comments
 (0)