@@ -134,6 +134,20 @@ private function setGetResponse($relativeUrl, $body = [])
134
134
return $ this ;
135
135
}
136
136
137
+ private function setPostResponse ($ relativeUrl , $ body = [])
138
+ {
139
+ $ this ->response = $ this ->client ->post ($ this ->baseUrl . $ relativeUrl , $ body );
140
+
141
+ return $ this ;
142
+ }
143
+
144
+ private function setPutResponse ($ relativeUrl , $ body = [])
145
+ {
146
+ $ this ->response = $ this ->client ->put ($ this ->baseUrl . $ relativeUrl , $ body );
147
+
148
+ return $ this ;
149
+ }
150
+
137
151
/**
138
152
* Get the authorization url from the callback response
139
153
* @return Unicodeveloper\Paystack\Paystack
@@ -295,7 +309,7 @@ public function createPlan(){
295
309
296
310
$ this ->setRequestOptions ();
297
311
298
- $ this ->response = $ this ->setGetResponse ("/plan " , $ data );
312
+ $ this ->response = $ this ->setPostResponse ("/plan " , $ data );
299
313
300
314
}
301
315
@@ -331,7 +345,7 @@ public function updatePlan($plan_code){
331
345
332
346
$ this ->setRequestOptions ();
333
347
334
- return $ this ->setGetResponse ('/plan/ ' . $ plan_code , $ data )->getResponse ();
348
+ return $ this ->setPutResponse ('/plan/ ' . $ plan_code , $ data )->getResponse ();
335
349
336
350
}
337
351
@@ -352,7 +366,7 @@ public function createCustomer(){
352
366
353
367
$ this ->setRequestOptions ();
354
368
355
- $ this ->response = $ this ->setGetResponse ('/customer ' , $ data );
369
+ $ this ->response = $ this ->setPostResponse ('/customer ' , $ data );
356
370
357
371
}
358
372
@@ -387,7 +401,7 @@ public function updateCustomer($customer_id){
387
401
388
402
$ this ->setRequestOptions ();
389
403
390
- return $ this ->setGetResponse ('/customer/ ' . $ customer_id , $ data )->getResponse ();
404
+ return $ this ->setPutResponse ('/customer/ ' . $ customer_id , $ data )->getResponse ();
391
405
392
406
}
393
407
@@ -423,7 +437,7 @@ public function createSubscription(){
423
437
424
438
$ this ->setRequestOptions ();
425
439
426
- $ this ->response = $ this ->setGetResponse ('/subscription ' , $ data );
440
+ $ this ->response = $ this ->setPostResponse ('/subscription ' , $ data );
427
441
}
428
442
429
443
/**
@@ -439,7 +453,7 @@ public function enableSubscription(){
439
453
440
454
$ this ->setRequestOptions ();
441
455
442
- return $ this ->setGetResponse ('/subscription/enable ' , $ data )->getResponse ();
456
+ return $ this ->setPostResponse ('/subscription/enable ' , $ data )->getResponse ();
443
457
444
458
}
445
459
@@ -456,7 +470,7 @@ public function disableSubscription(){
456
470
457
471
$ this ->setRequestOptions ();
458
472
459
- return $ this ->setGetResponse ('/subscription/disable ' , $ data )->getResponse ();
473
+ return $ this ->setPostResponse ('/subscription/disable ' , $ data )->getResponse ();
460
474
461
475
}
462
476
@@ -487,7 +501,7 @@ public function createPage(){
487
501
488
502
$ this ->setRequestOptions ();
489
503
490
- $ this ->response = $ this ->setGetResponse ('/page ' , $ data );
504
+ $ this ->response = $ this ->setPostResponse ('/page ' , $ data );
491
505
492
506
}
493
507
0 commit comments