1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
namespace Yabacon\Paystack\Routes; |
4
|
|
|
|
5
|
|
|
use Yabacon\Paystack\Contracts\RouteInterface; |
6
|
|
|
|
7
|
|
|
/** |
8
|
|
|
* Plan |
9
|
|
|
* Insert description here |
10
|
|
|
* |
11
|
|
|
* @category |
12
|
|
|
* @package |
13
|
|
|
* @author |
14
|
|
|
* @copyright |
15
|
|
|
* @license |
16
|
|
|
* @version |
17
|
|
|
* @link |
18
|
|
|
* @see |
19
|
|
|
* @since |
20
|
|
|
*/ |
21
|
|
|
class Plan implements RouteInterface |
22
|
|
|
{ |
23
|
|
|
|
24
|
|
|
/** |
25
|
|
|
Root |
26
|
|
|
*/ |
27
|
|
|
public static function root() |
28
|
|
|
{ |
29
|
|
|
return '/plan'; |
30
|
|
|
} |
31
|
|
|
/* |
32
|
|
|
Create plan |
33
|
|
|
*/ |
34
|
|
|
|
35
|
|
|
/** |
36
|
|
|
* create |
37
|
|
|
* Insert description here |
38
|
|
|
* |
39
|
|
|
* @return |
40
|
|
|
* |
41
|
|
|
* @access |
42
|
|
|
* @static |
43
|
|
|
* @see |
44
|
|
|
* @since |
45
|
|
|
*/ |
46
|
|
|
public static function create() |
47
|
|
|
{ |
48
|
|
|
return [RouteInterface::METHOD_KEY => RouteInterface::POST_METHOD, |
49
|
|
|
RouteInterface::ENDPOINT_KEY => Plan::root(), |
50
|
|
|
RouteInterface::PARAMS_KEY => [ |
51
|
|
|
'name', |
52
|
|
|
'description', |
53
|
|
|
'amount', |
54
|
|
|
'interval', |
55
|
|
|
'send_invoices', |
56
|
|
|
'send_sms', |
57
|
|
|
'hosted_page', |
58
|
|
|
'hosted_page_url', |
59
|
|
|
'hosted_page_summary', |
60
|
|
|
'currency' ] |
61
|
|
|
]; |
62
|
|
|
} |
63
|
|
|
/* |
64
|
|
|
Get plan |
65
|
|
|
*/ |
66
|
|
|
|
67
|
|
|
/** |
68
|
|
|
* fetch |
69
|
|
|
* Insert description here |
70
|
|
|
* |
71
|
|
|
* @return |
72
|
|
|
* |
73
|
|
|
* @access |
74
|
|
|
* @static |
75
|
|
|
* @see |
76
|
|
|
* @since |
77
|
|
|
*/ |
78
|
|
|
public static function fetch() |
79
|
|
|
{ |
80
|
|
|
return [RouteInterface::METHOD_KEY => RouteInterface::GET_METHOD, |
81
|
|
|
RouteInterface::ENDPOINT_KEY => Plan::root() . '/{id}', |
82
|
|
|
RouteInterface::ARGS_KEY => ['id' ] ]; |
83
|
|
|
} |
84
|
|
|
|
85
|
|
|
/* |
86
|
|
|
List plan |
87
|
|
|
*/ |
88
|
|
|
|
89
|
|
|
/** |
90
|
|
|
* getList |
91
|
|
|
* Insert description here |
92
|
|
|
* |
93
|
|
|
* @return |
94
|
|
|
* |
95
|
|
|
* @access |
96
|
|
|
* @static |
97
|
|
|
* @see |
98
|
|
|
* @since |
99
|
|
|
*/ |
100
|
|
|
public static function getList() |
101
|
|
|
{ |
102
|
|
|
return [RouteInterface::METHOD_KEY => RouteInterface::GET_METHOD, |
103
|
|
|
RouteInterface::ENDPOINT_KEY => Plan::root() ]; |
104
|
|
|
} |
105
|
|
|
/* |
106
|
|
|
Update plan |
107
|
|
|
*/ |
108
|
|
|
|
109
|
|
|
/** |
110
|
|
|
* update |
111
|
|
|
* Insert description here |
112
|
|
|
* |
113
|
|
|
* @return |
114
|
|
|
* |
115
|
|
|
* @access |
116
|
|
|
* @static |
117
|
|
|
* @see |
118
|
|
|
* @since |
119
|
|
|
*/ |
120
|
|
|
public static function update() |
121
|
|
|
{ |
122
|
|
|
return [RouteInterface::METHOD_KEY => RouteInterface::PUT_METHOD, |
123
|
|
|
RouteInterface::ENDPOINT_KEY => Plan::root() . '/{id}', |
124
|
|
|
RouteInterface::PARAMS_KEY => [ |
125
|
|
|
'name', |
126
|
|
|
'description', |
127
|
|
|
'amount', |
128
|
|
|
'interval', |
129
|
|
|
'send_invoices', |
130
|
|
|
'send_sms', |
131
|
|
|
'hosted_page', |
132
|
|
|
'hosted_page_url', |
133
|
|
|
'hosted_page_summary', |
134
|
|
|
'currency' ], |
135
|
|
|
RouteInterface::ARGS_KEY => ['id' ] ]; |
136
|
|
|
} |
137
|
|
|
} |
138
|
|
|
|