post https://api.cartgateway.com/payment/refund
Do a Refund Payment Request
Using the PHP SDK
You can also use the PHP SDK to trigger a request to Refund the amount from a Charged or Captured Payment.
require '../vendor/autoload.php';
try {
$client = new CartGateway\CartGateway([
'account_id' => 123,
'access_token' => 'access-token',
]);
$model = new CartGateway\Models\RefundPayment([
'amount' => 500, // in cents
'payment_id' => '',
]);
$response = $client->refundPayment($model);
} catch (CartGateway\Exceptions\ApiException $e) {
echo $e->message;
exit;
}
// refund was a success
var_dump($response);