This commit is contained in:
Benjamin Beganović 2024-08-09 01:07:35 +02:00
parent e7f41c1dba
commit 339a92fa6f
3 changed files with 22 additions and 3 deletions

View File

@ -17,10 +17,11 @@ use App\Jobs\Util\SystemLogger;
use App\Models\GatewayType;
use App\Models\PaymentType;
use App\Models\SystemLog;
use App\PaymentDrivers\Common\LivewireMethodInterface;
use App\PaymentDrivers\EwayPaymentDriver;
use App\Utils\Traits\MakesHash;
class CreditCard
class CreditCard implements LivewireMethodInterface
{
use MakesHash;
@ -102,11 +103,18 @@ class CreditCard
return $token;
}
public function paymentView($data)
public function paymentData(array $data): array
{
$data['gateway'] = $this->eway_driver;
$data['public_api_key'] = $this->eway_driver->company_gateway->getConfigField('publicApiKey');
return $data;
}
public function paymentView($data)
{
$data = $this->paymentData($data);
return render('gateways.eway.pay', $data);
}
@ -276,4 +284,8 @@ class CreditCard
return $payment;
}
public function livewirePaymentView(array $data): string
{
return 'gateways.eway.pay_livewire';
}
}

View File

@ -8,6 +8,8 @@
* @license https://www.elastic.co/licensing/elastic-license
*/
import { wait, instant } from '../wait';
class EwayRapid {
constructor() {
this.cardStyles =
@ -510,4 +512,8 @@ class EwayRapid {
}
}
function boot() {
new EwayRapid().handle();
}
instant() ? boot() : wait('#eway-credit-card-payment').then(() => boot());

View File

@ -7,6 +7,7 @@ ctrans('texts.credit_card')])
<meta name="translation-expiry_date" content="{{ ctrans('texts.date') }}">
<meta name="translation-card_number" content="{{ ctrans('texts.card_number') }}">
<meta name="translation-cvv" content="{{ ctrans('texts.cvv') }}">
<meta name="instant-payment" content="yes" />
@endsection
@section('gateway_content')