mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-06-17 19:04:36 -04:00
REfunds for wepay
This commit is contained in:
parent
4173cb6903
commit
a58db2100c
@ -160,11 +160,6 @@ class WePayPaymentDriver extends BaseDriver
|
|||||||
return $this->payment_method->paymentResponse($request); //this is your custom implementation from here
|
return $this->payment_method->paymentResponse($request); //this is your custom implementation from here
|
||||||
}
|
}
|
||||||
|
|
||||||
public function refund(Payment $payment, $amount, $return_client_response = false)
|
|
||||||
{
|
|
||||||
return $this->payment_method->yourRefundImplementationHere(); //this is your custom implementation from here
|
|
||||||
}
|
|
||||||
|
|
||||||
public function tokenBilling(ClientGatewayToken $cgt, PaymentHash $payment_hash)
|
public function tokenBilling(ClientGatewayToken $cgt, PaymentHash $payment_hash)
|
||||||
{
|
{
|
||||||
return $this->payment_method->yourTokenBillingImplmentation(); //this is your custom implementation from here
|
return $this->payment_method->yourTokenBillingImplmentation(); //this is your custom implementation from here
|
||||||
@ -264,6 +259,27 @@ class WePayPaymentDriver extends BaseDriver
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function refund(Payment $payment, $amount, $return_client_response = false)
|
||||||
|
{
|
||||||
|
|
||||||
|
$this->init();
|
||||||
|
|
||||||
|
$response = $this->wepay->request('checkout/refund', array(
|
||||||
|
'checkout_id' => $payment->transaction_reference,
|
||||||
|
'refund_reason' => 'Refund',
|
||||||
|
'amount' => $amount
|
||||||
|
));
|
||||||
|
|
||||||
|
|
||||||
|
return [
|
||||||
|
'transaction_reference' => $response->checkout_id,
|
||||||
|
'transaction_response' => json_encode($response),
|
||||||
|
'success' => $response->state == 'refunded' ? true : false,
|
||||||
|
'description' => 'refund',
|
||||||
|
'code' => 0,
|
||||||
|
];
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
public function detach(ClientGatewayToken $token)
|
public function detach(ClientGatewayToken $token)
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user