handle payments and gateway fee integration

This commit is contained in:
David Bomba 2020-09-11 09:01:25 +10:00
parent c55f660f7f
commit 0b56e8d4cb
2 changed files with 12 additions and 0 deletions

View File

@ -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);
}

View File

@ -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);
}
}