Skip to content

Commit 087fa4b

Browse files
author
Okubanjo Oluwafunsho
committed
Added support for fetching a page details
You can fetch the details of a page using it slug or id
1 parent af5ce3d commit 087fa4b

File tree

1 file changed

+14
-1
lines changed

1 file changed

+14
-1
lines changed

src/Paystack.php

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -503,14 +503,27 @@ public function createPage(){
503503
* Fetches all the pages the merchant has
504504
* @return array
505505
*/
506-
public function fetchPages(){
506+
public function getAllPages(){
507507

508508
$this->setRequestOptions();
509509

510510
return $this->setGetResponse('/page', [])->getResponse();
511511

512512
}
513513

514+
/**
515+
* Fetch details about a certain page using its id or slug
516+
* @param $page_id
517+
* @return array
518+
*/
519+
public function fetchPage($page_id){
520+
521+
$this->setRequestOptions();
522+
523+
return $this->setGetResponse('/page/'.$page_id, [])->getResponse();
524+
525+
}
526+
514527
}
515528

516529

0 commit comments

Comments
 (0)