mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-07-07 17:54:30 -04:00
Clean up for eWay
This commit is contained in:
parent
4faa58ec8c
commit
4ec4b54327
@ -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)]);
|
||||
|
Loading…
x
Reference in New Issue
Block a user