From 7a128ecb1011cc9c3d635de228c33ed9c93b32db Mon Sep 17 00:00:00 2001 From: David Bomba Date: Mon, 29 Apr 2024 10:01:49 +1000 Subject: [PATCH] working on 3ds SCA --- app/PaymentDrivers/PayPalRestPaymentDriver.php | 4 ++-- .../portal/ninja2020/gateways/paypal/ppcp/card.blade.php | 7 +++++++ 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/app/PaymentDrivers/PayPalRestPaymentDriver.php b/app/PaymentDrivers/PayPalRestPaymentDriver.php index 8799162493dc..6583e99489e8 100644 --- a/app/PaymentDrivers/PayPalRestPaymentDriver.php +++ b/app/PaymentDrivers/PayPalRestPaymentDriver.php @@ -444,8 +444,8 @@ return render('gateways.paypal.pay', $data); "card" => [ "attributes" => [ "verification" => [ - // "method" => "SCA_WHEN_REQUIRED", //SCA_ALWAYS - "method" => "SCA_ALWAYS", //SCA_ALWAYS + "method" => "SCA_WHEN_REQUIRED", //SCA_ALWAYS + // "method" => "SCA_ALWAYS", //SCA_ALWAYS ], "vault" => [ "store_in_vault" => "ON_SUCCESS", //must listen to this webhook - VAULT.PAYMENT-TOKEN.CREATED webhook. diff --git a/resources/views/portal/ninja2020/gateways/paypal/ppcp/card.blade.php b/resources/views/portal/ninja2020/gateways/paypal/ppcp/card.blade.php index f303968082c1..a950e690d0c8 100644 --- a/resources/views/portal/ninja2020/gateways/paypal/ppcp/card.blade.php +++ b/resources/views/portal/ninja2020/gateways/paypal/ppcp/card.blade.php @@ -104,6 +104,13 @@ //doesn't really do anything as failure is linked in SUBMIT. We only hit here after a successful return //and where SCA is optional? + if(liabilityShift == 'NO') { + + document.getElementById('errors').textContent = `Sorry, your transaction could not be processed, Please try a different payment method.`; + document.getElementById('errors').hidden = false; + return; + } + } var errorDetail = Array.isArray(data.details) && data.details[0];