From f85203ef3b7eb34112b6ad6fcd3096675637fc46 Mon Sep 17 00:00:00 2001 From: Kael Moreno Date: Wed, 5 Mar 2025 12:22:05 +0800 Subject: [PATCH 1/2] Add delete card function in CardClient --- src/Clients/Vault/CardClient.php | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/Clients/Vault/CardClient.php b/src/Clients/Vault/CardClient.php index b554063..74adf61 100644 --- a/src/Clients/Vault/CardClient.php +++ b/src/Clients/Vault/CardClient.php @@ -65,4 +65,17 @@ public function put(string $customerId, string $cardToken, bool $isDefault) ['json' => compact('isDefault')] ); } + + /** + * @param string $customerId + * @param string $cardToken + * @return ResponseInterface + * @throws ClientException + */ + public function delete(string $customerId, string $cardToken) + { + return $this->payMayaClient + ->getClientWithSecretKey() + ->delete("/payments/v1/customers/{$customerId}/cards/{$cardToken}"); + } } From cbc9f88cdb53c9494fc6a8ea0486fe0f50caf022 Mon Sep 17 00:00:00 2001 From: Kael Moreno Date: Wed, 5 Mar 2025 12:29:03 +0800 Subject: [PATCH 2/2] Update PayMayaClientTest.php --- tests/PayMayaClientTest.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/PayMayaClientTest.php b/tests/PayMayaClientTest.php index 82e4951..7266a94 100644 --- a/tests/PayMayaClientTest.php +++ b/tests/PayMayaClientTest.php @@ -32,7 +32,7 @@ public function testCreateClient($environment, $baseUri) public static function environmentProvider() { return [ - 'production' => ['production', 'https://pg.paymaya.com'], + 'production' => ['production', 'https://pg.maya.ph'], 'sandbox' => ['sandbox', 'https://pg-sandbox.paymaya.com'], ]; }