mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-07-09 03:14:30 -04:00
Refunds
This commit is contained in:
parent
e3a6f223d0
commit
92037546da
@ -122,8 +122,22 @@ class BraintreePaymentDriver extends BaseDriver
|
|||||||
|
|
||||||
try {
|
try {
|
||||||
$response = $this->gateway->transaction()->refund($payment->transaction_reference, $amount);
|
$response = $this->gateway->transaction()->refund($payment->transaction_reference, $amount);
|
||||||
|
|
||||||
|
return [
|
||||||
|
'transaction_reference' => $response->id,
|
||||||
|
'transaction_response' => json_encode($response),
|
||||||
|
'success' => (bool) $response->success,
|
||||||
|
'description' => $response->status,
|
||||||
|
'code' => 0,
|
||||||
|
];
|
||||||
} catch (\Exception $e) {
|
} catch (\Exception $e) {
|
||||||
// ..
|
return [
|
||||||
|
'transaction_reference' => null,
|
||||||
|
'transaction_response' => json_encode($e->getMessage()),
|
||||||
|
'success' => false,
|
||||||
|
'description' => $e->getMessage(),
|
||||||
|
'code' => $e->getCode(),
|
||||||
|
];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user