mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-05-24 02:14:21 -04:00
handle payments and gateway fee integration
This commit is contained in:
parent
c55f660f7f
commit
0b56e8d4cb
@ -136,6 +136,9 @@ class AuthorizeCreditCard
|
||||
$response = $data['response'];
|
||||
|
||||
if ($response != null && $response->getMessages()->getResultCode() == 'Ok') {
|
||||
|
||||
$this->authorize->confirmGatewayFee($request);
|
||||
|
||||
return $this->processSuccessfulResponse($data, $request);
|
||||
}
|
||||
|
||||
|
@ -182,17 +182,26 @@ class CheckoutComPaymentDriver extends BaseDriver
|
||||
$state['payment_response'] = $response;
|
||||
|
||||
if ($response->status === 'Authorized') {
|
||||
$this->confirmGatewayFee($request);
|
||||
|
||||
return $this->processSuccessfulPayment($state);
|
||||
}
|
||||
|
||||
if ($response->status === 'Pending') {
|
||||
$this->confirmGatewayFee($request);
|
||||
|
||||
return $this->processPendingPayment($state);
|
||||
}
|
||||
|
||||
if ($response->status === 'Declined') {
|
||||
$this->unWindGatewayFees($request->payment_hash);
|
||||
|
||||
return $this->processUnsuccessfulPayment($state);
|
||||
}
|
||||
} catch (CheckoutHttpException $e) {
|
||||
|
||||
$this->unWindGatewayFees($request->payment_hash);
|
||||
|
||||
return $this->processInternallyFailedPayment($e, $state);
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user