I'm trying to refund transactions via Omnipay and it looks like Omnipay supports refunds. However the documentation isn't clear and I've some confusion about how to go about this.
Omnipay Example code for refund:
$transaction = $gateway->refund(array(
'amount' => '10.00',
'currency' => 'AUD',
));
$transaction->setTransactionReference($sale_id);
$response = $transaction->send();
if ($response->isSuccessful()) {
echo "Refund transaction was successful!\n";
$data = $response->getData();
echo "Gateway refund response data == " . print_r($data, true) . "\n";
}
What's the $sale_id here? My Payments table has transaction id saved as:
'PAYMENTINFO_0_TRANSACTIONID' => $data['PAYMENTINFO_0_TRANSACTIONID'],
Which looks like: 01H36802XU637613S
(PayPal) & ch_1IYpA7BJRxbFR9rFrGmPKs85
(Stripe). Are these the $sale_id
?