Refunds & Cancelations
You can only refund and/or cancel payments made via the BreathePay Payments API
//PHP
public function cancel() {
$data = [
'merchantID' => YOUR_MERCHANT_ID,
'action' => 'CANCEL',
'xref' => TRANSACTION_XREF //stored from the charge function
];
$data['signature'] = $this->createBreathepaySignature($data, YOUR_MERCHANT_SECRET);
return $this->sendRequest($data);
}//PHP
public function fullOrPartialRefund() {
$data = [
'merchantID' => YOUR_MERCHANT_ID,
'action' => 'REFUND_SALE',
'amount' => AMOUNT_TO_REFUND, //In pence, £1 = 100 (maximum is amount of transaction)
'xref' => TRANSACTION_XREF //stored from the charge function
];
$data['signature'] = $this->createBreathepaySignature($data, YOUR_MERCHANT_SECRET);
return $this->sendRequest($data);
}Last updated