@@ -258,6 +258,13 @@ public function createFuturePayment(string $customerId, ?string $paymentMethod =
258258 return $ result ;
259259 }
260260
261+ public function getFuturePayment (string $ id ): array
262+ {
263+ $ path = '/setup_intents/ ' .$ id ;
264+
265+ return $ this ->execute (self ::METHOD_GET , $ path );
266+ }
267+
261268 public function listFuturePayments (?string $ customerId = null , ?string $ pyamentMethodId = null ): array
262269 {
263270 $ path = '/setup_intents ' ;
@@ -271,7 +278,7 @@ public function listFuturePayments(?string $customerId = null, ?string $pyamentM
271278 }
272279 $ result = $ this ->execute (self ::METHOD_GET , $ path , $ requestBody );
273280
274- return $ result ;
281+ return $ result[ ' data ' ] ;
275282 }
276283
277284 public function updateFuturePayment (string $ id , ?string $ customerId = null , ?string $ paymentMethod = null , array $ paymentMethodOptions = [], ?string $ paymentMethodConfiguration = null ): array
@@ -294,6 +301,13 @@ public function updateFuturePayment(string $id, ?string $customerId = null, ?str
294301 return $ this ->execute (self ::METHOD_POST , $ path , $ requestBody );
295302 }
296303
304+ public function getMandate (string $ id ): array
305+ {
306+ $ path = '/mandates/ ' .$ id ;
307+
308+ return $ this ->execute (self ::METHOD_GET , $ path );
309+ }
310+
297311 private function execute (string $ method , string $ path , array $ requestBody = [], array $ headers = []): array
298312 {
299313 $ headers = array_merge (['content-type ' => 'application/x-www-form-urlencoded ' , 'Authorization ' => 'Bearer ' .$ this ->secretKey ], $ headers );
0 commit comments