From b688a432ab460fa7dfa8e5c211cdec3581c9e2fe Mon Sep 17 00:00:00 2001 From: David Bomba Date: Fri, 12 Aug 2022 10:24:51 +1000 Subject: [PATCH] Make square postal code optional --- app/PaymentDrivers/Square/CreditCard.php | 1 - app/PaymentDrivers/SquarePaymentDriver.php | 1 - resources/js/clients/payments/square-credit-card.js | 3 --- .../portal/ninja2020/gateways/square/credit_card/pay.blade.php | 1 - 4 files changed, 6 deletions(-) diff --git a/app/PaymentDrivers/Square/CreditCard.php b/app/PaymentDrivers/Square/CreditCard.php index 242076fd01..84fd4bea00 100644 --- a/app/PaymentDrivers/Square/CreditCard.php +++ b/app/PaymentDrivers/Square/CreditCard.php @@ -68,7 +68,6 @@ class CreditCard implements MethodInterface $data['amount'] = $this->square_driver->payment_hash->data->amount_with_fee; $data['currencyCode'] = $this->square_driver->client->getCurrencyCode(); $data['square_contact'] = $this->buildClientObject(); - $data['postal_code_required'] = in_array($data['currencyCode'], ['USD', 'GBP', 'CAD']) || $this->square_driver->company_gateway->getConfigField('testMode'); return render('gateways.square.credit_card.pay', $data); } diff --git a/app/PaymentDrivers/SquarePaymentDriver.php b/app/PaymentDrivers/SquarePaymentDriver.php index d8c70cd037..44acfbfc64 100644 --- a/app/PaymentDrivers/SquarePaymentDriver.php +++ b/app/PaymentDrivers/SquarePaymentDriver.php @@ -195,7 +195,6 @@ class SquarePaymentDriver extends BaseDriver { $fields = []; - if ($this->company_gateway->require_client_name) { $fields[] = ['name' => 'client_name', 'label' => ctrans('texts.client_name'), 'type' => 'text', 'validation' => 'required']; } diff --git a/resources/js/clients/payments/square-credit-card.js b/resources/js/clients/payments/square-credit-card.js index 8bf9c2bf2e..cceaacc5a7 100644 --- a/resources/js/clients/payments/square-credit-card.js +++ b/resources/js/clients/payments/square-credit-card.js @@ -61,7 +61,6 @@ class SquareCreditCard { currencyCode: document.querySelector('meta[name=currencyCode]') .content, intent: 'CHARGE', - postalCode: document.querySelector('meta[name=postal_code_required]').content }; const verificationResults = await this.payments.verifyBuyer( @@ -115,8 +114,6 @@ class SquareCreditCard { currencyCode: document.querySelector('meta[name=currencyCode]') .content, intent: 'CHARGE', - postalCode: document.querySelector('meta[name=postal_code_required]').content - }; const verificationResults = await this.payments.verifyBuyer( diff --git a/resources/views/portal/ninja2020/gateways/square/credit_card/pay.blade.php b/resources/views/portal/ninja2020/gateways/square/credit_card/pay.blade.php index 68cc3c1cb3..79b2627db1 100644 --- a/resources/views/portal/ninja2020/gateways/square/credit_card/pay.blade.php +++ b/resources/views/portal/ninja2020/gateways/square/credit_card/pay.blade.php @@ -7,7 +7,6 @@ - @endsection