1 | <?php |
||
10 | class Paystack |
||
11 | { |
||
12 | |||
13 | public $secret_key; |
||
14 | private $routes; |
||
15 | public $use_guzzle = false; |
||
16 | |||
17 | /** |
||
18 | * Creates a new Paystack object |
||
19 | * @param string $secret_key - Secret key for your account with Paystack |
||
20 | */ |
||
21 | public function __construct($secret_key) |
||
32 | |||
33 | /** |
||
34 | * Router uses Guzzle for calls if GuzzleHttp is found |
||
35 | */ |
||
36 | public function useGuzzle() |
||
40 | |||
41 | /** |
||
42 | * definedRoutes |
||
43 | * gets routes defined in the YabaCon\Paystack\Routes namespace |
||
44 | * since we are using PSR-4. It is safe to assume that all php |
||
45 | * files in the folder are names of the classes. |
||
46 | * |
||
47 | * @return the list of defined Routes |
||
48 | * |
||
49 | * @access private |
||
50 | * @see YabaCon\Paystack\Routes\Router |
||
51 | * @since 1.0 |
||
52 | */ |
||
53 | private function definedRoutes() |
||
64 | /** |
||
65 | * __call |
||
66 | * Magic Method for getOne on routes |
||
67 | * |
||
68 | * @param $method - a string whose title case is a class in the |
||
69 | * YabaCon\Paystack\Routes namespace implementing |
||
70 | * YabaCon\Paystack\Contracts\RouteInterface |
||
71 | * @param $args - arguments sent to the magic method |
||
72 | * |
||
73 | * @return the result of calling /{route}/get on the api |
||
74 | * |
||
75 | * @access public |
||
76 | * @see YabaCon\Paystack\Routes\Router |
||
77 | * @since 1.0 |
||
78 | */ |
||
79 | public function __call($method, $args) |
||
101 | |||
102 | /** |
||
103 | * Call this function to register the custom auto loader for Paystack. * Required only if not using composer. */ |
||
104 | public static function registerAutoloader() |
||
126 | |||
127 | /** |
||
128 | * __get |
||
129 | * Insert description here |
||
130 | * |
||
131 | * @param $name |
||
132 | * |
||
133 | * @return |
||
134 | * |
||
135 | * @access |
||
136 | * @static |
||
137 | * @see |
||
138 | * @since |
||
139 | */ |
||
140 | public function __get($name) |
||
146 | } |
||
147 |