mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-06-01 00:24:36 -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'];
|
$response = $data['response'];
|
||||||
|
|
||||||
if ($response != null && $response->getMessages()->getResultCode() == 'Ok') {
|
if ($response != null && $response->getMessages()->getResultCode() == 'Ok') {
|
||||||
|
|
||||||
|
$this->authorize->confirmGatewayFee($request);
|
||||||
|
|
||||||
return $this->processSuccessfulResponse($data, $request);
|
return $this->processSuccessfulResponse($data, $request);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -182,17 +182,26 @@ class CheckoutComPaymentDriver extends BaseDriver
|
|||||||
$state['payment_response'] = $response;
|
$state['payment_response'] = $response;
|
||||||
|
|
||||||
if ($response->status === 'Authorized') {
|
if ($response->status === 'Authorized') {
|
||||||
|
$this->confirmGatewayFee($request);
|
||||||
|
|
||||||
return $this->processSuccessfulPayment($state);
|
return $this->processSuccessfulPayment($state);
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($response->status === 'Pending') {
|
if ($response->status === 'Pending') {
|
||||||
|
$this->confirmGatewayFee($request);
|
||||||
|
|
||||||
return $this->processPendingPayment($state);
|
return $this->processPendingPayment($state);
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($response->status === 'Declined') {
|
if ($response->status === 'Declined') {
|
||||||
|
$this->unWindGatewayFees($request->payment_hash);
|
||||||
|
|
||||||
return $this->processUnsuccessfulPayment($state);
|
return $this->processUnsuccessfulPayment($state);
|
||||||
}
|
}
|
||||||
} catch (CheckoutHttpException $e) {
|
} catch (CheckoutHttpException $e) {
|
||||||
|
|
||||||
|
$this->unWindGatewayFees($request->payment_hash);
|
||||||
|
|
||||||
return $this->processInternallyFailedPayment($e, $state);
|
return $this->processInternallyFailedPayment($e, $state);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user