From 95ec15ab34ef12d341daa0c659becd09850dc32e Mon Sep 17 00:00:00 2001 From: phillipgr4vy <92320120+phillipgr4vy@users.noreply.github.com> Date: Thu, 1 Aug 2024 16:52:46 -0400 Subject: [PATCH] feat: add get refund method (#30) --- lib/Gr4vyConfig.php | 10 +++++++--- test/Api/TokenApiTest.php | 2 +- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/lib/Gr4vyConfig.php b/lib/Gr4vyConfig.php index 69a4592..7bbbbe5 100644 --- a/lib/Gr4vyConfig.php +++ b/lib/Gr4vyConfig.php @@ -411,6 +411,10 @@ public function listTransactions($params = array()) { $response = $this->get("/transactions", $params); return $response; } + public function getRefund($refund_id) { + $response = $this->get("/refunds/" . $refund_id); + return $response; + } public function refundTransaction($transaction_id, $refund_request) { $response = $this->post("/transactions/" . $transaction_id . "/refunds", $refund_request); return $response; @@ -423,15 +427,15 @@ public function newCheckoutSession($request = array()) { $response = $this->post("/checkout/sessions", $request); return $response; } - public function updateCheckoutSession($request = array()) { + public function updateCheckoutSession($checkout_session_id, $request = array()) { $response = $this->put("/checkout/sessions/" . $checkout_session_id, $request); return $response; } - public function updateCheckoutSessionFields($request = array()) { + public function updateCheckoutSessionFields($checkout_session_id, $request = array()) { $response = $this->put("/checkout/sessions/" . $checkout_session_id . "/fields", $request); return $response; } - public function deleteCheckoutSession() { + public function deleteCheckoutSession($checkout_session_id) { $response = $this->delete("/checkout/sessions/" . $checkout_session_id); return $response; } diff --git a/test/Api/TokenApiTest.php b/test/Api/TokenApiTest.php index 0d347ba..0f861dc 100644 --- a/test/Api/TokenApiTest.php +++ b/test/Api/TokenApiTest.php @@ -96,7 +96,7 @@ public function testAddBuyerAndEmbed() try { $config = new Gr4vyConfig(self::$gr4vyId, self::$privateKeyLocation); - $buyer_request = array("external_identifier"=>"412231123","display_name"=>"Tester T."); + $buyer_request = array("display_name"=>"Tester T."); $result = $config->addBuyer($buyer_request); $this->assertArrayHasKey("id", $result);