Clean up for eWay

This commit is contained in:
David Bomba 2022-03-25 14:55:39 +11:00
parent 4faa58ec8c
commit 4ec4b54327

View File

@ -160,7 +160,6 @@ class CreditCard
'TotalAmount' => $this->convertAmountForEway(),
'CurrencyCode' => $this->eway_driver->client->currency()->code,
'InvoiceNumber' => $invoice_numbers,
'InvoiceReference' => $description,
],
'TransactionType' => \Eway\Rapid\Enum\TransactionType::PURCHASE,
'SecuredCardData' => $request->input('securefieldcode'),
@ -168,19 +167,17 @@ class CreditCard
$response = $this->eway_driver->init()->eway->createTransaction(\Eway\Rapid\Enum\ApiMethod::DIRECT, $transaction);
$this->logResponse($response);
$response_status = ErrorCode::getStatus($response->ResponseMessage);
if(!$response_status['success']){
$this->logResponse($response, false);
$this->eway_driver->sendFailureMail($response_status['message']);
throw new PaymentFailed($response_status['message'], 400);
}
$this->logResponse($response, true);
$payment = $this->storePayment($response);
return redirect()->route('client.payments.show', ['payment' => $this->encodePrimaryKey($payment->id)]);