| Total Complexity | 4 |
| Total Lines | 56 |
| Duplicated Lines | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 5 | class Plan extends Endpoint |
||
| 6 | { |
||
| 7 | protected const ENDPOINT = '/plan'; |
||
| 8 | |||
| 9 | /** |
||
| 10 | * Create a plan on your integration. |
||
| 11 | * |
||
| 12 | * @param array<string, mixed> $payload |
||
| 13 | * |
||
| 14 | * @link https://paystack.com/docs/api/#plan-create |
||
| 15 | */ |
||
| 16 | public function create(array $payload): self |
||
| 21 | } |
||
| 22 | |||
| 23 | /** |
||
| 24 | * List plans available on your integration. |
||
| 25 | * |
||
| 26 | * @param array<string, mixed> $query |
||
| 27 | * |
||
| 28 | * @link https://paystack.com/docs/api/#plan-list |
||
| 29 | */ |
||
| 30 | public function list(array $query = []): self |
||
| 31 | { |
||
| 32 | $this->get($this->url(self::ENDPOINT), $query); |
||
| 33 | |||
| 34 | return $this; |
||
| 35 | } |
||
| 36 | |||
| 37 | /** |
||
| 38 | * Get details of a plan on your integration. |
||
| 39 | * |
||
| 40 | * @link https://paystack.com/docs/api/#plan-fetch |
||
| 41 | */ |
||
| 42 | public function fetch(string $plan_id): self |
||
| 47 | } |
||
| 48 | |||
| 49 | /** |
||
| 50 | * Update a plan details on your integration. |
||
| 51 | * |
||
| 52 | * @param array<string, mixed> $payload |
||
| 53 | * |
||
| 54 | * @link https://paystack.com/docs/api/#plan-update |
||
| 55 | */ |
||
| 56 | public function update(string $plan_id, array $payload = []): self |
||
| 63 |