1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-11-10 13:12:50 +01:00

fixes for eway

This commit is contained in:
David Bomba 2021-08-12 21:02:12 +10:00
parent f7727da192
commit 68c9ee33af
4 changed files with 12 additions and 7 deletions

View File

@ -138,7 +138,7 @@ class CreditCard
// ],
// 'TransactionType' => \Eway\Rapid\Enum\TransactionType::PURCHASE,
'Method' => \Eway\Rapid\Enum\PaymentMethod::CREATE_TOKEN_CUSTOMER,
'SecuredCardData' => $request->input('SecuredCardData'),
'SecuredCardData' => $request->input('securefieldcode'),
];
$response = $this->eway_driver->init()->eway->createCustomer(\Eway\Rapid\Enum\ApiMethod::DIRECT, $transaction);
@ -178,7 +178,8 @@ class CreditCard
}
public function processPaymentResponse($request)
public function paymentResponse($request)
{
}

View File

@ -6,10 +6,10 @@ ctrans('texts.credit_card')])
@section('gateway_content')
<form action="{{ route('client.payment_methods.store', ['method' => App\Models\GatewayType::CREDIT_CARD]) }}"
method="post" id="payment_form">
method="post" id="server-response">
@csrf
<input type="hidden" id="securefieldcode" name="SecuredCardData" value="" />
<input type="hidden" id="securefieldcode" name="securefieldcode" value="" />
<input type="hidden" name="company_gateway_id" value="{{ $gateway->company_gateway->id }}">
<input type="hidden" name="payment_method_id" value="1">
@ -36,7 +36,7 @@ ctrans('texts.credit_card')])
<!-- Your JS includes go here -->
<script src="https://secure.ewaypayments.com/scripts/eWAY.min.js" data-init="false"></script>
@include('portal.ninja2020.gateways.eway.includes.credt_card')
@include('portal.ninja2020.gateways.eway.includes.credit_card')
<script type="text/javascript">

View File

@ -93,17 +93,20 @@ function securePanelCallback(event) {
if (!event.fieldValid) {
alert(getError(event.errors));
} else {
var s = document.getElementById("securefieldcode");
var s = document.querySelector("input[name=securefieldcode]");
s.value = event.secureFieldCode
console.log(s.value);
}
}
function doneCallback() {
var form = document.getElementById("payment_form");
console.log("done call bak");
var form = document.getElementById("server-response");
form.submit();
}
function saveAndSubmit() {
console.log("save and sub");
eWAY.saveAllFields(doneCallback, 2000);
return false;
}

View File

@ -12,6 +12,7 @@
<input type="hidden" name="company_gateway_id" value="{{ $gateway->getCompanyGatewayId() }}">
<input type="hidden" name="payment_method_id" value="1">
<input type="hidden" name="token" id="token" value="">
<input type="hidden" name="securefieldcode" value="">
</form>
<div class="alert alert-failure mb-4" hidden id="errors"></div>