@@ -20,9 +20,9 @@ |
||
20 | 20 | * @param string $type |
21 | 21 | * @return string |
22 | 22 | */ |
23 | - private static function getPool( $type = 'alnum') |
|
23 | + private static function getPool($type = 'alnum') |
|
24 | 24 | { |
25 | - switch ( $type ) { |
|
25 | + switch ($type) { |
|
26 | 26 | case 'alnum': |
27 | 27 | $pool = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'; |
28 | 28 | break; |
@@ -86,7 +86,7 @@ discard block |
||
86 | 86 | */ |
87 | 87 | private function setRequestOptions() |
88 | 88 | { |
89 | - $authBearer = 'Bearer '. $this->secretKey; |
|
89 | + $authBearer = 'Bearer '.$this->secretKey; |
|
90 | 90 | |
91 | 91 | $this->client = new Client(['base_uri' => $this->baseUrl, |
92 | 92 | 'headers' => [ |
@@ -120,7 +120,7 @@ discard block |
||
120 | 120 | "email" => request()->email |
121 | 121 | ]; |
122 | 122 | |
123 | - $this->response = $this->client->post($this->baseUrl . $relativeUrl, [ |
|
123 | + $this->response = $this->client->post($this->baseUrl.$relativeUrl, [ |
|
124 | 124 | 'body' => json_encode($data) |
125 | 125 | ]); |
126 | 126 | |
@@ -129,21 +129,21 @@ discard block |
||
129 | 129 | |
130 | 130 | private function setGetResponse($relativeUrl, $body = []) |
131 | 131 | { |
132 | - $this->response = $this->client->get($this->baseUrl . $relativeUrl, $body); |
|
132 | + $this->response = $this->client->get($this->baseUrl.$relativeUrl, $body); |
|
133 | 133 | |
134 | 134 | return $this; |
135 | 135 | } |
136 | 136 | |
137 | 137 | private function setPostResponse($relativeUrl, $body = []) |
138 | 138 | { |
139 | - $this->response = $this->client->post($this->baseUrl . $relativeUrl, $body); |
|
139 | + $this->response = $this->client->post($this->baseUrl.$relativeUrl, $body); |
|
140 | 140 | |
141 | 141 | return $this; |
142 | 142 | } |
143 | 143 | |
144 | 144 | private function setPutResponse($relativeUrl, $body = []) |
145 | 145 | { |
146 | - $this->response = $this->client->put($this->baseUrl . $relativeUrl, $body); |
|
146 | + $this->response = $this->client->put($this->baseUrl.$relativeUrl, $body); |
|
147 | 147 | |
148 | 148 | return $this; |
149 | 149 | } |
@@ -171,7 +171,7 @@ discard block |
||
171 | 171 | |
172 | 172 | $relativeUrl = "/transaction/verify/{$transactionRef}"; |
173 | 173 | |
174 | - $this->response = $this->client->get($this->baseUrl . $relativeUrl, []); |
|
174 | + $this->response = $this->client->get($this->baseUrl.$relativeUrl, []); |
|
175 | 175 | } |
176 | 176 | |
177 | 177 | /** |
@@ -295,7 +295,7 @@ discard block |
||
295 | 295 | /** |
296 | 296 | * Create a plan |
297 | 297 | */ |
298 | - public function createPlan(){ |
|
298 | + public function createPlan() { |
|
299 | 299 | |
300 | 300 | $data = [ |
301 | 301 | "name" => request()->name, |
@@ -318,11 +318,11 @@ discard block |
||
318 | 318 | * @param $plan_code |
319 | 319 | * @return array |
320 | 320 | */ |
321 | - public function fetchPlan($plan_code){ |
|
321 | + public function fetchPlan($plan_code) { |
|
322 | 322 | |
323 | 323 | $this->setRequestOptions(); |
324 | 324 | |
325 | - return $this->setGetResponse('/plan/' . $plan_code, [])->getResponse(); |
|
325 | + return $this->setGetResponse('/plan/'.$plan_code, [])->getResponse(); |
|
326 | 326 | |
327 | 327 | } |
328 | 328 | |
@@ -331,7 +331,7 @@ discard block |
||
331 | 331 | * @param $plan_code |
332 | 332 | * @return array |
333 | 333 | */ |
334 | - public function updatePlan($plan_code){ |
|
334 | + public function updatePlan($plan_code) { |
|
335 | 335 | |
336 | 336 | $data = [ |
337 | 337 | "name" => request()->name, |
@@ -345,7 +345,7 @@ discard block |
||
345 | 345 | |
346 | 346 | $this->setRequestOptions(); |
347 | 347 | |
348 | - return $this->setPutResponse('/plan/' . $plan_code, $data)->getResponse(); |
|
348 | + return $this->setPutResponse('/plan/'.$plan_code, $data)->getResponse(); |
|
349 | 349 | |
350 | 350 | } |
351 | 351 | |
@@ -353,7 +353,7 @@ discard block |
||
353 | 353 | * Create a customer |
354 | 354 | * @return array |
355 | 355 | */ |
356 | - public function createCustomer(){ |
|
356 | + public function createCustomer() { |
|
357 | 357 | |
358 | 358 | $data = [ |
359 | 359 | "email" => request()->email, |
@@ -375,11 +375,11 @@ discard block |
||
375 | 375 | * @param $customer_id |
376 | 376 | * @return array |
377 | 377 | */ |
378 | - public function fetchCustomer($customer_id){ |
|
378 | + public function fetchCustomer($customer_id) { |
|
379 | 379 | |
380 | 380 | $this->setRequestOptions(); |
381 | 381 | |
382 | - return $this->setGetResponse('/customer/'. $customer_id, [])->getResponse(); |
|
382 | + return $this->setGetResponse('/customer/'.$customer_id, [])->getResponse(); |
|
383 | 383 | |
384 | 384 | } |
385 | 385 | |
@@ -388,7 +388,7 @@ discard block |
||
388 | 388 | * @param $customer_id |
389 | 389 | * @return array |
390 | 390 | */ |
391 | - public function updateCustomer($customer_id){ |
|
391 | + public function updateCustomer($customer_id) { |
|
392 | 392 | |
393 | 393 | $data = [ |
394 | 394 | "email" => request()->email, |
@@ -401,7 +401,7 @@ discard block |
||
401 | 401 | |
402 | 402 | $this->setRequestOptions(); |
403 | 403 | |
404 | - return $this->setPutResponse('/customer/'. $customer_id, $data)->getResponse(); |
|
404 | + return $this->setPutResponse('/customer/'.$customer_id, $data)->getResponse(); |
|
405 | 405 | |
406 | 406 | } |
407 | 407 | |
@@ -409,7 +409,7 @@ discard block |
||
409 | 409 | * Export tranactions in .CSV |
410 | 410 | * @return array |
411 | 411 | */ |
412 | - public function exportTransactions(){ |
|
412 | + public function exportTransactions() { |
|
413 | 413 | |
414 | 414 | $data = [ |
415 | 415 | "from" => request()->from, |
@@ -427,7 +427,7 @@ discard block |
||
427 | 427 | * Create a subscription to a plan from a customer. |
428 | 428 | * @return array |
429 | 429 | */ |
430 | - public function createSubscription(){ |
|
430 | + public function createSubscription() { |
|
431 | 431 | |
432 | 432 | $data = [ |
433 | 433 | "customer" => request()->customer, //Customer email or code |
@@ -444,7 +444,7 @@ discard block |
||
444 | 444 | * Enable a subscription using the subscription code and token |
445 | 445 | * @return array |
446 | 446 | */ |
447 | - public function enableSubscription(){ |
|
447 | + public function enableSubscription() { |
|
448 | 448 | |
449 | 449 | $data = [ |
450 | 450 | "code" => request()->code, |
@@ -461,7 +461,7 @@ discard block |
||
461 | 461 | * Disable a subscription using the subscription code and token |
462 | 462 | * @return array |
463 | 463 | */ |
464 | - public function disableSubscription(){ |
|
464 | + public function disableSubscription() { |
|
465 | 465 | |
466 | 466 | $data = [ |
467 | 467 | "code" => request()->code, |
@@ -479,7 +479,7 @@ discard block |
||
479 | 479 | * @param $subscription_id |
480 | 480 | * @return array |
481 | 481 | */ |
482 | - public function fetchSubscription($subscription_id){ |
|
482 | + public function fetchSubscription($subscription_id) { |
|
483 | 483 | |
484 | 484 | $this->setRequestOptions(); |
485 | 485 | |
@@ -491,7 +491,7 @@ discard block |
||
491 | 491 | * Create pages you can share with users using the returned slug |
492 | 492 | * @return array |
493 | 493 | */ |
494 | - public function createPage(){ |
|
494 | + public function createPage() { |
|
495 | 495 | |
496 | 496 | $data = [ |
497 | 497 | "name" => request()->name, |
@@ -509,7 +509,7 @@ discard block |
||
509 | 509 | * Fetches all the pages the merchant has |
510 | 510 | * @return array |
511 | 511 | */ |
512 | - public function getAllPages(){ |
|
512 | + public function getAllPages() { |
|
513 | 513 | |
514 | 514 | $this->setRequestOptions(); |
515 | 515 | |
@@ -522,7 +522,7 @@ discard block |
||
522 | 522 | * @param $page_id |
523 | 523 | * @return array |
524 | 524 | */ |
525 | - public function fetchPage($page_id){ |
|
525 | + public function fetchPage($page_id) { |
|
526 | 526 | |
527 | 527 | $this->setRequestOptions(); |
528 | 528 | |
@@ -535,7 +535,7 @@ discard block |
||
535 | 535 | * @param $page_id |
536 | 536 | * @return array |
537 | 537 | */ |
538 | - public function updatePage($page_id){ |
|
538 | + public function updatePage($page_id) { |
|
539 | 539 | |
540 | 540 | $data = [ |
541 | 541 | "name" => request()->name, |