1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
namespace Yabacon\Paystack\Routes; |
4
|
|
|
|
5
|
|
|
use Yabacon\Paystack\Contracts\RouteInterface; |
6
|
|
|
|
7
|
|
|
class Subaccount implements RouteInterface |
8
|
|
|
{ |
9
|
|
|
|
10
|
3 |
|
public static function root() |
11
|
|
|
{ |
12
|
3 |
|
return '/subaccount'; |
13
|
|
|
} |
14
|
|
|
|
15
|
2 |
|
public static function create() |
16
|
|
|
{ |
17
|
|
|
return [ |
18
|
2 |
|
RouteInterface::METHOD_KEY => RouteInterface::POST_METHOD, |
19
|
2 |
|
RouteInterface::ENDPOINT_KEY => Subaccount::root(), |
20
|
2 |
|
RouteInterface::PARAMS_KEY => [ |
21
|
2 |
|
'business_name', 'settlement_bank', |
22
|
2 |
|
'account_number', 'percentage_charge', |
23
|
2 |
|
'primary_contact_email', 'primary_contact_name', |
24
|
2 |
|
'primary_contact_phone', |
25
|
2 |
|
'metadata', 'settlement_schedule', |
26
|
2 |
|
], |
27
|
2 |
|
]; |
28
|
|
|
} |
29
|
|
|
|
30
|
2 |
|
public static function fetch() |
31
|
|
|
{ |
32
|
|
|
return [ |
33
|
2 |
|
RouteInterface::METHOD_KEY => RouteInterface::GET_METHOD, |
34
|
2 |
|
RouteInterface::ENDPOINT_KEY => Subaccount::root() . '/{id}', |
35
|
2 |
|
RouteInterface::ARGS_KEY => ['id'], |
36
|
2 |
|
]; |
37
|
|
|
} |
38
|
|
|
|
39
|
2 |
|
public static function getList() |
40
|
|
|
{ |
41
|
|
|
return [ |
42
|
2 |
|
RouteInterface::METHOD_KEY => RouteInterface::GET_METHOD, |
43
|
2 |
|
RouteInterface::ENDPOINT_KEY => Subaccount::root(), |
44
|
2 |
|
]; |
45
|
|
|
} |
46
|
|
|
|
47
|
2 |
|
public static function update() |
48
|
|
|
{ |
49
|
|
|
return [ |
50
|
2 |
|
RouteInterface::METHOD_KEY => RouteInterface::PUT_METHOD, |
51
|
2 |
|
RouteInterface::ENDPOINT_KEY => Subaccount::root() . '/{id}', |
52
|
2 |
|
RouteInterface::PARAMS_KEY => [ |
53
|
2 |
|
'business_name', 'settlement_bank', |
54
|
2 |
|
'account_number', 'percentage_charge', |
55
|
2 |
|
'primary_contact_email', 'primary_contact_name', |
56
|
2 |
|
'primary_contact_phone', |
57
|
2 |
|
'metadata', 'settlement_schedule', |
58
|
2 |
|
], |
59
|
2 |
|
RouteInterface::ARGS_KEY => ['id'], |
60
|
2 |
|
]; |
61
|
|
|
} |
62
|
|
|
} |
63
|
|
|
|