Use the issueRefund method to issue a total refund for an order processed by 2Checkout.
The payment for the refundable order needs to be collected.
You cannot issue a refund for an amount higher than the total order amount.
require ('PATH_TO_AUTH'); // authentication call $orderReference = "72711777"; $amount = 26.00; $items = ""; // empty for total refunds $comment = "We hope you are satisfied with the refund process."; $reason = "Duplicate purchase"; $jsonRpcRequest = new stdClass(); $jsonRpcRequest->jsonrpc = '2.0'; $jsonRpcRequest->method = 'issueRefund'; $jsonRpcRequest->params = array($sessionID, $orderReference, $amount, $items, $comment, $reason); $jsonRpcRequest->id = $i++; var_dump (callRPC((Object)$jsonRpcRequest, $host, true));
TRUE is the refund was processed successfully