Skip to content

Commit

Permalink
feat: add get refund method (#30)
Browse files Browse the repository at this point in the history
  • Loading branch information
phillipgr4vy authored Aug 1, 2024
1 parent 8201ca3 commit 95ec15a
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
10 changes: 7 additions & 3 deletions lib/Gr4vyConfig.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;
}
Expand Down
2 changes: 1 addition & 1 deletion test/Api/TokenApiTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down

0 comments on commit 95ec15a

Please sign in to comment.