diff --git a/app/PaymentDrivers/BaseDriver.php b/app/PaymentDrivers/BaseDriver.php index 680d6ddfda12..a77ef25aa196 100644 --- a/app/PaymentDrivers/BaseDriver.php +++ b/app/PaymentDrivers/BaseDriver.php @@ -639,7 +639,7 @@ class BaseDriver extends AbstractPaymentDriver $message = [ 'server_response' => $response, - 'data' => $this->payment_hash->data, + 'data' => $this->payment_hash?->data, ]; SystemLogger::dispatch( diff --git a/app/PaymentDrivers/CheckoutCom/CreditCard.php b/app/PaymentDrivers/CheckoutCom/CreditCard.php index c19acab18e6d..f6b5249e8d6c 100644 --- a/app/PaymentDrivers/CheckoutCom/CreditCard.php +++ b/app/PaymentDrivers/CheckoutCom/CreditCard.php @@ -153,6 +153,11 @@ class CreditCard implements MethodInterface return render('gateways.checkout.credit_card.pay', $data); } + public function livewirePaymentView(array $data): string + { + return 'gateways.checkout.credit_card.pay_livewire'; + } + public function paymentResponse(PaymentResponseRequest $request) { $state = [ diff --git a/app/PaymentDrivers/PaytracePaymentDriver.php b/app/PaymentDrivers/PaytracePaymentDriver.php index bb0348d0a5dd..e573136041c0 100644 --- a/app/PaymentDrivers/PaytracePaymentDriver.php +++ b/app/PaymentDrivers/PaytracePaymentDriver.php @@ -254,7 +254,20 @@ class PaytracePaymentDriver extends BaseDriver public function getClientRequiredFields(): array { - $fields = parent::getClientRequiredFields(); + + $fields = []; + + if ($this->company_gateway->require_client_name) { + $fields[] = ['name' => 'client_name', 'label' => ctrans('texts.client_name'), 'type' => 'text', 'validation' => 'required']; + } + + $fields[] = ['name' => 'contact_first_name', 'label' => ctrans('texts.first_name'), 'type' => 'text', 'validation' => 'required']; + $fields[] = ['name' => 'contact_last_name', 'label' => ctrans('texts.last_name'), 'type' => 'text', 'validation' => 'required']; + $fields[] = ['name' => 'contact_email', 'label' => ctrans('texts.email'), 'type' => 'text', 'validation' => 'required,email:rfc']; + + if ($this->company_gateway->require_client_phone) { + $fields[] = ['name' => 'client_phone', 'label' => ctrans('texts.client_phone'), 'type' => 'tel', 'validation' => 'required']; + } $fields[] = ['name' => 'client_address_line_1', 'label' => ctrans('texts.address1'), 'type' => 'text', 'validation' => 'required']; $fields[] = ['name' => 'client_city', 'label' => ctrans('texts.city'), 'type' => 'text', 'validation' => 'required']; @@ -262,6 +275,35 @@ class PaytracePaymentDriver extends BaseDriver $fields[] = ['name' => 'client_state', 'label' => ctrans('texts.state'), 'type' => 'text', 'validation' => 'required']; $fields[] = ['name' => 'client_country_id', 'label' => ctrans('texts.country'), 'type' => 'text', 'validation' => 'required']; + + if ($this->company_gateway->require_shipping_address) { + $fields[] = ['name' => 'client_shipping_address_line_1', 'label' => ctrans('texts.shipping_address1'), 'type' => 'text', 'validation' => 'required']; + $fields[] = ['name' => 'client_shipping_city', 'label' => ctrans('texts.shipping_city'), 'type' => 'text', 'validation' => 'required']; + $fields[] = ['name' => 'client_shipping_state', 'label' => ctrans('texts.shipping_state'), 'type' => 'text', 'validation' => 'required']; + $fields[] = ['name' => 'client_shipping_postal_code', 'label' => ctrans('texts.shipping_postal_code'), 'type' => 'text', 'validation' => 'required']; + $fields[] = ['name' => 'client_shipping_country_id', 'label' => ctrans('texts.shipping_country'), 'type' => 'text', 'validation' => 'required']; + } + + if ($this->company_gateway->require_custom_value1) { + $fields[] = ['name' => 'client_custom_value1', 'label' => $this->helpers->makeCustomField($this->client->company->custom_fields, 'client1'), 'type' => 'text', 'validation' => 'required']; + } + + if ($this->company_gateway->require_custom_value2) { + $fields[] = ['name' => 'client_custom_value2', 'label' => $this->helpers->makeCustomField($this->client->company->custom_fields, 'client2'), 'type' => 'text', 'validation' => 'required']; + } + + + if ($this->company_gateway->require_custom_value3) { + $fields[] = ['name' => 'client_custom_value3', 'label' => $this->helpers->makeCustomField($this->client->company->custom_fields, 'client3'), 'type' => 'text', 'validation' => 'required']; + } + + if ($this->company_gateway->require_custom_value4) { + $fields[] = ['name' => 'client_custom_value4', 'label' => $this->helpers->makeCustomField($this->client->company->custom_fields, 'client4'), 'type' => 'text', 'validation' => 'required']; + } + + + + return $fields; } diff --git a/app/PaymentDrivers/Stripe/ACSS.php b/app/PaymentDrivers/Stripe/ACSS.php index 7ef4fa2dde2b..189378a81c26 100644 --- a/app/PaymentDrivers/Stripe/ACSS.php +++ b/app/PaymentDrivers/Stripe/ACSS.php @@ -161,15 +161,7 @@ class ACSS return $intent; } - /** - * Payment view for ACSS - * - * Determines if any payment tokens are available and if not, generates a mandate - * - * @param array $data - - */ - public function paymentView(array $data) + public function paymentData(array $data): array { if(count($data['tokens']) == 0) { diff --git a/app/PaymentDrivers/Stripe/Alipay.php b/app/PaymentDrivers/Stripe/Alipay.php index 96c0930d0752..df03760f6efc 100644 --- a/app/PaymentDrivers/Stripe/Alipay.php +++ b/app/PaymentDrivers/Stripe/Alipay.php @@ -19,9 +19,10 @@ use App\Models\GatewayType; use App\Models\Payment; use App\Models\PaymentType; use App\Models\SystemLog; +use App\PaymentDrivers\Common\LivewireMethodInterface; use App\PaymentDrivers\StripePaymentDriver; -class Alipay +class Alipay implements LivewireMethodInterface { /** @var StripePaymentDriver */ public $stripe; @@ -33,25 +34,7 @@ class Alipay public function paymentView(array $data) { - $intent = \Stripe\PaymentIntent::create([ - 'amount' => $this->stripe->convertToStripeAmount($data['total']['amount_with_fee'], $this->stripe->client->currency()->precision, $this->stripe->client->currency()), - 'currency' => $this->stripe->client->currency()->code, - 'payment_method_types' => ['alipay'], - 'customer' => $this->stripe->findOrCreateCustomer(), - 'description' => $this->stripe->getDescription(false), - 'metadata' => [ - 'payment_hash' => $this->stripe->payment_hash->hash, - 'gateway_type_id' => GatewayType::ALIPAY, - ], - ], $this->stripe->stripe_connect_auth); - - - $data['gateway'] = $this->stripe; - $data['return_url'] = $this->buildReturnUrl(); - $data['ci_intent'] = $intent->client_secret; - - $this->stripe->payment_hash->data = array_merge((array) $this->stripe->payment_hash->data, ['stripe_amount' => $this->stripe->convertToStripeAmount($data['total']['amount_with_fee'], $this->stripe->client->currency()->precision, $this->stripe->client->currency())]); - $this->stripe->payment_hash->save(); + $data = $this->paymentData($data); return render('gateways.stripe.alipay.pay', $data); } @@ -146,4 +129,40 @@ class Alipay throw new PaymentFailed('Failed to process the payment.', 500); } + + /** + * @inheritDoc + */ + public function livewirePaymentView(array $data): string + { + return 'gateways.stripe.alipay.pay_livewire'; + } + + /** + * @inheritDoc + */ + public function paymentData(array $data): array + { + $intent = \Stripe\PaymentIntent::create([ + 'amount' => $this->stripe->convertToStripeAmount($data['total']['amount_with_fee'], $this->stripe->client->currency()->precision, $this->stripe->client->currency()), + 'currency' => $this->stripe->client->currency()->code, + 'payment_method_types' => ['alipay'], + 'customer' => $this->stripe->findOrCreateCustomer(), + 'description' => $this->stripe->getDescription(false), + 'metadata' => [ + 'payment_hash' => $this->stripe->payment_hash->hash, + 'gateway_type_id' => GatewayType::ALIPAY, + ], + ], $this->stripe->stripe_connect_auth); + + + $data['gateway'] = $this->stripe; + $data['return_url'] = $this->buildReturnUrl(); + $data['ci_intent'] = $intent->client_secret; + + $this->stripe->payment_hash->data = array_merge((array) $this->stripe->payment_hash->data, ['stripe_amount' => $this->stripe->convertToStripeAmount($data['total']['amount_with_fee'], $this->stripe->client->currency()->precision, $this->stripe->client->currency())]); + $this->stripe->payment_hash->save(); + + return $data; + } } diff --git a/app/PaymentDrivers/Stripe/GIROPAY.php b/app/PaymentDrivers/Stripe/GIROPAY.php index cd8828bfb4ea..44e0912b131f 100644 --- a/app/PaymentDrivers/Stripe/GIROPAY.php +++ b/app/PaymentDrivers/Stripe/GIROPAY.php @@ -142,4 +142,40 @@ class GIROPAY throw new PaymentFailed('Failed to process the payment.', 500); } + + public function paymentData(array $data): array + { + $this->stripe->init(); + + $data['gateway'] = $this->stripe; + $data['return_url'] = $this->buildReturnUrl(); + $data['stripe_amount'] = $this->stripe->convertToStripeAmount($data['total']['amount_with_fee'], $this->stripe->client->currency()->precision, $this->stripe->client->currency()); + $data['client'] = $this->stripe->client; + $data['customer'] = $this->stripe->findOrCreateCustomer()->id; + $data['country'] = $this->stripe->client->country->iso_3166_2; + + $intent = \Stripe\PaymentIntent::create([ + 'amount' => $data['stripe_amount'], + 'currency' => 'eur', + 'payment_method_types' => ['giropay'], + 'customer' => $this->stripe->findOrCreateCustomer(), + 'description' => $this->stripe->getDescription(false), + 'metadata' => [ + 'payment_hash' => $this->stripe->payment_hash->hash, + 'gateway_type_id' => GatewayType::GIROPAY, + ], + ], array_merge($this->stripe->stripe_connect_auth, ['idempotency_key' => uniqid("st", true)])); + + $data['pi_client_secret'] = $intent->client_secret; + + $this->stripe->payment_hash->data = array_merge((array) $this->stripe->payment_hash->data, ['stripe_amount' => $data['stripe_amount']]); + $this->stripe->payment_hash->save(); + + return $data; + } + + public function livewirePaymentView(array $data): string + { + return 'gateways.stripe.giropay.pay_livewire'; + } } diff --git a/package-lock.json b/package-lock.json index 3c1cb2273643..656605e540c6 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,11 +1,10 @@ { - "name": "invoiceninja", + "name": "@invoiceninja/invoiceninja", "lockfileVersion": 2, "requires": true, "packages": { "": { "dependencies": { - "@invoiceninja/simple-card": "^0.0.2", "axios": "^0.25", "card-js": "^1.0.13", "card-validator": "^8.1.1", @@ -2026,15 +2025,6 @@ "purgecss": "^3.1.3" } }, - "node_modules/@invoiceninja/simple-card": { - "version": "0.0.2", - "resolved": "https://registry.npmjs.org/@invoiceninja/simple-card/-/simple-card-0.0.2.tgz", - "integrity": "sha512-xDZvfrumnE7Qkp5e4N8EFfEIOcQfMJXSI+o/xeVlTb1WvibulSBgWkIg7J0zZW0eIDvGKCpEv3k+NBpASlaJUw==", - "dependencies": { - "@maskito/core": "^3.0.0", - "@maskito/kit": "^3.0.0" - } - }, "node_modules/@isaacs/cliui": { "version": "8.0.2", "resolved": "https://registry.npmjs.org/@isaacs/cliui/-/cliui-8.0.2.tgz", @@ -2200,19 +2190,6 @@ "resolved": "https://registry.npmjs.org/@leichtgewicht/ip-codec/-/ip-codec-2.0.4.tgz", "integrity": "sha512-Hcv+nVC0kZnQ3tD9GVu5xSMR4VVYOteQIr/hwFPVEvPdlXqgGEuRjiheChHgdM+JyqdgNcmzZOX/tnl0JOiI7A==" }, - "node_modules/@maskito/core": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/@maskito/core/-/core-3.0.0.tgz", - "integrity": "sha512-g7zeYPMlpMczrq4Huf+Bpdm3Emy/GO0NUXXnQnUiCjlAoKQl+86cLyP5Hbf4HGcNl/J9SoEGEA4uoW6uUc/yLw==" - }, - "node_modules/@maskito/kit": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/@maskito/kit/-/kit-3.0.0.tgz", - "integrity": "sha512-aXRlDBjeNox/+D7hbXtnM9INGml1QUIXhrnScrCsbqgg7550mt/ivh4PrxL7oazq/BH7HhvS4olJCF5TPEti1g==", - "peerDependencies": { - "@maskito/core": "^3.0.0" - } - }, "node_modules/@nodelib/fs.scandir": { "version": "2.1.5", "resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz", @@ -12735,15 +12712,6 @@ "purgecss": "^3.1.3" } }, - "@invoiceninja/simple-card": { - "version": "0.0.2", - "resolved": "https://registry.npmjs.org/@invoiceninja/simple-card/-/simple-card-0.0.2.tgz", - "integrity": "sha512-xDZvfrumnE7Qkp5e4N8EFfEIOcQfMJXSI+o/xeVlTb1WvibulSBgWkIg7J0zZW0eIDvGKCpEv3k+NBpASlaJUw==", - "requires": { - "@maskito/core": "^3.0.0", - "@maskito/kit": "^3.0.0" - } - }, "@isaacs/cliui": { "version": "8.0.2", "resolved": "https://registry.npmjs.org/@isaacs/cliui/-/cliui-8.0.2.tgz", @@ -12868,17 +12836,6 @@ "resolved": "https://registry.npmjs.org/@leichtgewicht/ip-codec/-/ip-codec-2.0.4.tgz", "integrity": "sha512-Hcv+nVC0kZnQ3tD9GVu5xSMR4VVYOteQIr/hwFPVEvPdlXqgGEuRjiheChHgdM+JyqdgNcmzZOX/tnl0JOiI7A==" }, - "@maskito/core": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/@maskito/core/-/core-3.0.0.tgz", - "integrity": "sha512-g7zeYPMlpMczrq4Huf+Bpdm3Emy/GO0NUXXnQnUiCjlAoKQl+86cLyP5Hbf4HGcNl/J9SoEGEA4uoW6uUc/yLw==" - }, - "@maskito/kit": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/@maskito/kit/-/kit-3.0.0.tgz", - "integrity": "sha512-aXRlDBjeNox/+D7hbXtnM9INGml1QUIXhrnScrCsbqgg7550mt/ivh4PrxL7oazq/BH7HhvS4olJCF5TPEti1g==", - "requires": {} - }, "@nodelib/fs.scandir": { "version": "2.1.5", "resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz", diff --git a/package.json b/package.json index 43bb262ed960..a0edb0de1d2e 100644 --- a/package.json +++ b/package.json @@ -23,7 +23,6 @@ "vue-template-compiler": "^2.6.14" }, "dependencies": { - "@invoiceninja/simple-card": "^0.0.2", "axios": "^0.25", "card-js": "^1.0.13", "card-validator": "^8.1.1", diff --git a/public/build/assets/authorize-authorize-card-39be6d93.js b/public/build/assets/authorize-authorize-card-39be6d93.js new file mode 100644 index 000000000000..f8fddd49dd12 --- /dev/null +++ b/public/build/assets/authorize-authorize-card-39be6d93.js @@ -0,0 +1,9 @@ +/** + * Invoice Ninja (https://invoiceninja.com) + * + * @link https://github.com/invoiceninja/invoiceninja source repository + * + * @copyright Copyright (c) 2021. Invoice Ninja LLC (https://invoiceninja.com) + * + * @license https://www.elastic.co/licensing/elastic-license + */class o{constructor(e,t){this.publicKey=e,this.loginId=t,this.cardHolderName=document.getElementById("cardholder_name"),this.cardButton=document.getElementById("card_button"),this.sc=createSimpleCard({fields:{card:{number:"#number",date:"#date",cvv:"#cvv"}}}),this.sc.mount()}handleAuthorization(){var r,n,s,c;if(this.cvvRequired=="1"&&document.getElementById("cvv").value.length<3){const d=document.getElementById("errors");d&&(d.innerText="CVV is required",d.style.display="block"),document.getElementById("pay-now").disabled=!1,document.querySelector("#pay-now > svg").classList.add("hidden"),document.querySelector("#pay-now > span").classList.remove("hidden");return}var e={};e.clientKey=this.publicKey,e.apiLoginID=this.loginId;var t={};t.cardNumber=(r=this.sc.value("number"))==null?void 0:r.replace(/[^\d]/g,""),t.month=(n=this.sc.value("month"))==null?void 0:n.replace(/[^\d]/g,""),t.year=`20${(s=this.sc.value("year"))==null?void 0:s.replace(/[^\d]/g,"")}`,t.cardCode=(c=this.sc.value("cvv"))==null?void 0:c.replace(/[^\d]/g,"");var a={};return a.authData=e,a.cardData=t,document.getElementById("card_button").disabled=!0,document.querySelector("#card_button > svg").classList.remove("hidden"),document.querySelector("#card_button > span").classList.add("hidden"),Accept.dispatchData(a,this.responseHandler),!1}responseHandler(e){if(e.messages.resultCode==="Error"){var t=0;const a=document.getElementById("errors");a&&(a.innerText=`${e.messages.message[t].code}: ${e.messages.message[t].text}`,a.style.display="block"),document.getElementById("card_button").disabled=!1,document.querySelector("#card_button > svg").classList.add("hidden"),document.querySelector("#card_button > span").classList.remove("hidden")}else e.messages.resultCode==="Ok"&&(document.getElementById("dataDescriptor").value=e.opaqueData.dataDescriptor,document.getElementById("dataValue").value=e.opaqueData.dataValue,document.getElementById("server_response").submit());return!1}handle(){return this.cardButton.addEventListener("click",()=>{this.cardButton.disabled=!this.cardButton.disabled,this.handleAuthorization()}),this}}const u=document.querySelector('meta[name="authorize-public-key"]').content,l=document.querySelector('meta[name="authorize-login-id"]').content;document.querySelector('meta[name="authnet-require-cvv"]').content;new o(u,l).handle(); diff --git a/public/build/assets/authorize-authorize-card-7da1185c.js b/public/build/assets/authorize-authorize-card-7da1185c.js deleted file mode 100644 index 677563d9b364..000000000000 --- a/public/build/assets/authorize-authorize-card-7da1185c.js +++ /dev/null @@ -1,9 +0,0 @@ -/** - * Invoice Ninja (https://invoiceninja.com) - * - * @link https://github.com/invoiceninja/invoiceninja source repository - * - * @copyright Copyright (c) 2021. Invoice Ninja LLC (https://invoiceninja.com) - * - * @license https://www.elastic.co/licensing/elastic-license - */class n{constructor(e,t){this.publicKey=e,this.loginId=t,this.cardHolderName=document.getElementById("cardholder_name"),this.cardButton=document.getElementById("card_button")}handleAuthorization(){if(s=="1"&&document.getElementById("cvv").value.length<3){var e=$("#errors");e.show().html("

CVV is required

"),document.getElementById("card_button").disabled=!1,document.querySelector("#card_button > svg").classList.add("hidden"),document.querySelector("#card_button > span").classList.remove("hidden");return}var t=$("#my-card"),a={};a.clientKey=this.publicKey,a.apiLoginID=this.loginId;var d={};d.cardNumber=t.CardJs("cardNumber").replace(/[^\d]/g,""),d.month=t.CardJs("expiryMonth").replace(/[^\d]/g,""),d.year=t.CardJs("expiryYear").replace(/[^\d]/g,""),d.cardCode=document.getElementById("cvv").value.replace(/[^\d]/g,"");var r={};return r.authData=a,r.cardData=d,document.getElementById("card_button").disabled=!0,document.querySelector("#card_button > svg").classList.remove("hidden"),document.querySelector("#card_button > span").classList.add("hidden"),Accept.dispatchData(r,this.responseHandler),!1}responseHandler(e){if(e.messages.resultCode==="Error"){var t=0,a=$("#errors");a.show().html("

"+e.messages.message[t].code+": "+e.messages.message[t].text+"

"),document.getElementById("card_button").disabled=!1,document.querySelector("#card_button > svg").classList.add("hidden"),document.querySelector("#card_button > span").classList.remove("hidden")}else e.messages.resultCode==="Ok"&&(document.getElementById("dataDescriptor").value=e.opaqueData.dataDescriptor,document.getElementById("dataValue").value=e.opaqueData.dataValue,document.getElementById("server_response").submit());return!1}handle(){return this.cardButton.addEventListener("click",()=>{this.cardButton.disabled=!this.cardButton.disabled,this.handleAuthorization()}),this}}const c=document.querySelector('meta[name="authorize-public-key"]').content,o=document.querySelector('meta[name="authorize-login-id"]').content,s=document.querySelector('meta[name="authnet-require-cvv"]').content;new n(c,o).handle(); diff --git a/public/build/assets/authorize-credit-card-payment-222655bd.js b/public/build/assets/authorize-credit-card-payment-222655bd.js new file mode 100644 index 000000000000..77e6ff82fcac --- /dev/null +++ b/public/build/assets/authorize-credit-card-payment-222655bd.js @@ -0,0 +1,9 @@ +var m=Object.defineProperty;var y=(n,e,t)=>e in n?m(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t;var o=(n,e,t)=>(y(n,typeof e!="symbol"?e+"":e,t),t);import{i as h,w as g}from"./wait-8f4ae121.js";/** + * Invoice Ninja (https://invoiceninja.com) + * + * @link https://github.com/invoiceninja/invoiceninja source repository + * + * @copyright Copyright (c) 2021. Invoice Ninja LLC (https://invoiceninja.com) + * + * @license https://www.elastic.co/licensing/elastic-license + */class p{constructor(e,t){o(this,"handleAuthorization",()=>{var c,l,s,i;if(this.cvvRequired=="1"&&document.getElementById("cvv").value.length<3){const r=document.getElementById("errors");r&&(r.innerText="CVV is required",r.style.display="block"),document.getElementById("pay-now").disabled=!1,document.querySelector("#pay-now > svg").classList.add("hidden"),document.querySelector("#pay-now > span").classList.remove("hidden");return}var e={};e.clientKey=this.publicKey,e.apiLoginID=this.loginId;var t={};t.cardNumber=(c=this.sc.value("number"))==null?void 0:c.replace(/[^\d]/g,""),t.month=(l=this.sc.value("month"))==null?void 0:l.replace(/[^\d]/g,""),t.year=`20${(s=this.sc.value("year"))==null?void 0:s.replace(/[^\d]/g,"")}`,t.cardCode=(i=this.sc.value("cvv"))==null?void 0:i.replace(/[^\d]/g,"");var a={};return a.authData=e,a.cardData=t,document.getElementById("pay-now")&&(document.getElementById("pay-now").disabled=!0,document.querySelector("#pay-now > svg").classList.remove("hidden"),document.querySelector("#pay-now > span").classList.add("hidden")),Accept.dispatchData(a,this.responseHandler),!1});o(this,"responseHandler",e=>{if(e.messages.resultCode==="Error"){var t=0;const a=document.getElementById("errors");a&&(a.innerText=`${e.messages.message[t].code}: ${e.messages.message[t].text}`,a.style.display="block"),document.getElementById("pay-now").disabled=!1,document.querySelector("#pay-now > svg").classList.add("hidden"),document.querySelector("#pay-now > span").classList.remove("hidden")}else if(e.messages.resultCode==="Ok"){document.getElementById("dataDescriptor").value=e.opaqueData.dataDescriptor,document.getElementById("dataValue").value=e.opaqueData.dataValue;let a=document.querySelector("input[name=token-billing-checkbox]:checked");a&&(document.getElementById("store_card").value=a.value),document.getElementById("server_response").submit()}return!1});o(this,"handle",()=>{Array.from(document.getElementsByClassName("toggle-payment-with-token")).forEach(a=>a.addEventListener("click",d=>{document.getElementById("save-card--container").style.display="none",document.getElementById("authorize--credit-card-container").style.display="none",document.getElementById("token").value=d.target.dataset.token}));let e=document.getElementById("toggle-payment-with-credit-card");e&&e.addEventListener("click",()=>{document.getElementById("save-card--container").style.display="grid",document.getElementById("authorize--credit-card-container").style.display="flex",document.getElementById("token").value=null});let t=document.getElementById("pay-now");return t&&t.addEventListener("click",a=>{let d=document.getElementById("token");d.value?this.handlePayNowAction(d.value):this.handleAuthorization()}),this});this.publicKey=e,this.loginId=t,this.cardHolderName=document.getElementById("cardholder_name"),this.sc=createSimpleCard({fields:{card:{number:"#number",date:"#date",cvv:"#cvv"}}}),this.sc.mount(),this.cvvRequired=document.querySelector('meta[name="authnet-require-cvv"]').content}handlePayNowAction(e){document.getElementById("pay-now").disabled=!0,document.querySelector("#pay-now > svg").classList.remove("hidden"),document.querySelector("#pay-now > span").classList.add("hidden"),document.getElementById("token").value=e,document.getElementById("server_response").submit()}}function u(){const n=document.querySelector('meta[name="authorize-public-key"]').content,e=document.querySelector('meta[name="authorize-login-id"]').content;new p(n,e).handle()}h()?u():g("#authorize-net-credit-card-payment").then(()=>u()); diff --git a/public/build/assets/authorize-stripe-acss-f6bd46c1.js b/public/build/assets/authorize-stripe-acss-f6bd46c1.js new file mode 100644 index 000000000000..34c2126d897c --- /dev/null +++ b/public/build/assets/authorize-stripe-acss-f6bd46c1.js @@ -0,0 +1,9 @@ +import{w as y}from"./wait-8f4ae121.js";/** + * Invoice Ninja (https://invoiceninja.com). + * + * @link https://github.com/invoiceninja/invoiceninja source repository + * + * @copyright Copyright (c) 2024. Invoice Ninja LLC (https://invoiceninja.com) + * + * @license https://www.elastic.co/licensing/elastic-license + */y("#stripe-acss-authorize").then(()=>f());function f(){var i,l,o;let n;const a=(i=document.querySelector('meta[name="stripe-account-id"]'))==null?void 0:i.content,r=(l=document.querySelector('meta[name="stripe-publishable-key"]'))==null?void 0:l.content;a&&a.length>0?n=Stripe(r,{stripeAccount:a}):n=Stripe(r);const c=document.getElementById("acss-name"),s=document.getElementById("acss-email-address"),t=document.getElementById("authorize-acss"),d=(o=document.querySelector('meta[name="stripe-pi-client-secret"]'))==null?void 0:o.content,e=document.getElementById("errors");t.addEventListener("click",async u=>{u.preventDefault(),e.hidden=!0,t.disabled=!0;const m=/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9-]+(?:\.[a-zA-Z0-9-]+)*$/;if(s.value.length<3||!s.value.match(m)){e.textContent="Please enter a valid email address.",e.hidden=!1,t.disabled=!1;return}if(c.value.length<3){e.textContent="Please enter a name for the account holder.",e.hidden=!1,t.disabled=!1;return}const{setupIntent:p,error:h}=await n.confirmAcssDebitSetup(d,{payment_method:{billing_details:{name:c.value,email:s.value}}});document.getElementById("gateway_response").value=JSON.stringify(p??h),document.getElementById("server_response").submit()})} diff --git a/public/build/assets/braintree-credit-card-60bd8878.js b/public/build/assets/braintree-credit-card-60bd8878.js new file mode 100644 index 000000000000..d2c7d7f9820e --- /dev/null +++ b/public/build/assets/braintree-credit-card-60bd8878.js @@ -0,0 +1,9 @@ +import{i as l,w as s}from"./wait-8f4ae121.js";/** + * Invoice Ninja (https://invoiceninja.com). + * + * @link https://github.com/invoiceninja/invoiceninja source repository + * + * @copyright Copyright (c) 2021. Invoice Ninja LLC (https://invoiceninja.com) + * + * @license https://www.elastic.co/licensing/elastic-license + */class c{initBraintreeDataCollector(){window.braintree.client.create({authorization:document.querySelector("meta[name=client-token]").content},function(t,r){window.braintree.dataCollector.create({client:r,paypal:!0},function(n,e){n||(document.querySelector("input[name=client-data]").value=e.deviceData)})})}mountBraintreePaymentWidget(){window.braintree.dropin.create({authorization:document.querySelector("meta[name=client-token]").content,container:"#dropin-container",threeDSecure:document.querySelector("input[name=threeds_enable]").value.toLowerCase()==="true"},this.handleCallback)}handleCallback(t,r){if(t){console.error(t);return}let n=document.getElementById("pay-now"),e=JSON.parse(document.querySelector("input[name=threeds]").value);n.addEventListener("click",()=>{r.requestPaymentMethod({threeDSecure:{challengeRequested:!0,amount:e.amount,email:e.email,billingAddress:{givenName:e.billingAddress.givenName,surname:e.billingAddress.surname,phoneNumber:e.billingAddress.phoneNumber,streetAddress:e.billingAddress.streetAddress,extendedAddress:e.billingAddress.extendedAddress,locality:e.billingAddress.locality,region:e.billingAddress.region,postalCode:e.billingAddress.postalCode,countryCodeAlpha2:e.billingAddress.countryCodeAlpha2}}},function(i,a){if(i){console.log(i),dropin.clearSelectedPaymentMethod(),alert("There was a problem verifying this card, please contact your merchant");return}if(document.querySelector("input[name=threeds_enable]").value==="true"&&!a.liabilityShifted){console.log("Liability did not shift",a),alert("There was a problem verifying this card, please contact your merchant");return}n.disabled=!0,n.querySelector("svg").classList.remove("hidden"),n.querySelector("span").classList.add("hidden"),document.querySelector("input[name=gateway_response]").value=JSON.stringify(a);let d=document.querySelector('input[name="token-billing-checkbox"]:checked');d&&(document.querySelector('input[name="store_card"]').value=d.value),document.getElementById("server-response").submit()})})}handle(){this.initBraintreeDataCollector(),this.mountBraintreePaymentWidget(),Array.from(document.getElementsByClassName("toggle-payment-with-token")).forEach(r=>r.addEventListener("click",n=>{document.getElementById("dropin-container").classList.add("hidden"),document.getElementById("save-card--container").style.display="none",document.querySelector("input[name=token]").value=n.target.dataset.token,document.getElementById("pay-now-with-token").classList.remove("hidden"),document.getElementById("pay-now").classList.add("hidden")})),document.getElementById("toggle-payment-with-credit-card").addEventListener("click",r=>{document.getElementById("dropin-container").classList.remove("hidden"),document.getElementById("save-card--container").style.display="grid",document.querySelector("input[name=token]").value="",document.getElementById("pay-now-with-token").classList.add("hidden"),document.getElementById("pay-now").classList.remove("hidden")});let t=document.getElementById("pay-now-with-token");t.addEventListener("click",r=>{t.disabled=!0,t.querySelector("svg").classList.remove("hidden"),t.querySelector("span").classList.add("hidden"),document.getElementById("server-response").submit()})}}function o(){new c().handle()}l()?o():s("#braintree-credit-card-payment","meta[name=client-token]").then(()=>o()); diff --git a/public/build/assets/braintree-paypal-45391805.js b/public/build/assets/braintree-paypal-45391805.js index 662aab2a1bc2..9858dd7045d5 100644 --- a/public/build/assets/braintree-paypal-45391805.js +++ b/public/build/assets/braintree-paypal-45391805.js @@ -1,4 +1,8 @@ +<<<<<<<< HEAD:public/build/assets/braintree-paypal-45391805.js /** +======== +import{i as s,w as u}from"./wait-8f4ae121.js";/** +>>>>>>>> new_payment_flow:public/build/assets/braintree-paypal-f78ad64b.js * Invoice Ninja (https://invoiceninja.com). * * @link https://github.com/invoiceninja/invoiceninja source repository @@ -6,4 +10,8 @@ * @copyright Copyright (c) 2021. Invoice Ninja LLC (https://invoiceninja.com) * * @license https://www.elastic.co/licensing/elastic-license +<<<<<<<< HEAD:public/build/assets/braintree-paypal-45391805.js */class a{initBraintreeDataCollector(){window.braintree.client.create({authorization:document.querySelector("meta[name=client-token]").content},function(e,t){window.braintree.dataCollector.create({client:t,paypal:!0},function(n,o){n||(document.querySelector("input[name=client-data]").value=o.deviceData)})})}static getPaymentDetails(){return{flow:"vault"}}static handleErrorMessage(e){let t=document.getElementById("errors");t.innerText=e,t.hidden=!1}handlePaymentWithToken(){Array.from(document.getElementsByClassName("toggle-payment-with-token")).forEach(t=>t.addEventListener("click",n=>{document.getElementById("paypal-button").classList.add("hidden"),document.getElementById("save-card--container").style.display="none",document.querySelector("input[name=token]").value=n.target.dataset.token,document.getElementById("pay-now-with-token").classList.remove("hidden"),document.getElementById("pay-now").classList.add("hidden")}));let e=document.getElementById("pay-now-with-token");e.addEventListener("click",t=>{e.disabled=!0,e.querySelector("svg").classList.remove("hidden"),e.querySelector("span").classList.add("hidden"),document.getElementById("server-response").submit()})}handle(){this.initBraintreeDataCollector(),this.handlePaymentWithToken(),braintree.client.create({authorization:document.querySelector("meta[name=client-token]").content}).then(function(e){return braintree.paypalCheckout.create({client:e})}).then(function(e){return e.loadPayPalSDK({vault:!0}).then(function(t){return paypal.Buttons({fundingSource:paypal.FUNDING.PAYPAL,createBillingAgreement:function(){return t.createPayment(a.getPaymentDetails())},onApprove:function(n,o){return t.tokenizePayment(n).then(function(i){let r=document.querySelector('input[name="token-billing-checkbox"]:checked');r&&(document.querySelector('input[name="store_card"]').value=r.value),document.querySelector("input[name=gateway_response]").value=JSON.stringify(i),document.getElementById("server-response").submit()})},onCancel:function(n){},onError:function(n){console.log(n.message),a.handleErrorMessage(n.message)}}).render("#paypal-button")})}).catch(function(e){console.log(e.message),a.handleErrorMessage(e.message)})}}new a().handle(); +======== + */class a{initBraintreeDataCollector(){window.braintree.client.create({authorization:document.querySelector("meta[name=client-token]").content},function(e,t){window.braintree.dataCollector.create({client:t,paypal:!0},function(n,o){n||(document.querySelector("input[name=client-data]").value=o.deviceData)})})}static getPaymentDetails(){return{flow:"vault"}}static handleErrorMessage(e){let t=document.getElementById("errors");t.innerText=e,t.hidden=!1}handlePaymentWithToken(){Array.from(document.getElementsByClassName("toggle-payment-with-token")).forEach(t=>t.addEventListener("click",n=>{document.getElementById("paypal-button").classList.add("hidden"),document.getElementById("save-card--container").style.display="none",document.querySelector("input[name=token]").value=n.target.dataset.token,document.getElementById("pay-now-with-token").classList.remove("hidden"),document.getElementById("pay-now").classList.add("hidden")}));let e=document.getElementById("pay-now-with-token");e.addEventListener("click",t=>{e.disabled=!0,e.querySelector("svg").classList.remove("hidden"),e.querySelector("span").classList.add("hidden"),document.getElementById("server-response").submit()})}handle(){this.initBraintreeDataCollector(),this.handlePaymentWithToken(),braintree.client.create({authorization:document.querySelector("meta[name=client-token]").content}).then(function(e){return braintree.paypalCheckout.create({client:e})}).then(function(e){return e.loadPayPalSDK({vault:!0}).then(function(t){return paypal.Buttons({fundingSource:paypal.FUNDING.PAYPAL,createBillingAgreement:function(){return t.createPayment(a.getPaymentDetails())},onApprove:function(n,o){return t.tokenizePayment(n).then(function(d){var i,c;(i=document.querySelector("#paypal-button"))==null||i.classList.add("hidden"),(c=document.querySelector("#paypal-spinner"))==null||c.classList.remove("hidden");let r=document.querySelector('input[name="token-billing-checkbox"]:checked');r&&(document.querySelector('input[name="store_card"]').value=r.value),document.querySelector("input[name=gateway_response]").value=JSON.stringify(d),document.getElementById("server-response").submit()})},onCancel:function(n){},onError:function(n){console.log(n.message),a.handleErrorMessage(n.message)}}).render("#paypal-button")})}).catch(function(e){console.log(e.message),a.handleErrorMessage(e.message)})}}function l(){new a().handle()}s()?l():u("#braintree-paypal-payment").then(()=>l()); +>>>>>>>> new_payment_flow:public/build/assets/braintree-paypal-f78ad64b.js diff --git a/public/build/assets/braintree-paypal-f78ad64b.js b/public/build/assets/braintree-paypal-f78ad64b.js new file mode 100644 index 000000000000..9858dd7045d5 --- /dev/null +++ b/public/build/assets/braintree-paypal-f78ad64b.js @@ -0,0 +1,17 @@ +<<<<<<<< HEAD:public/build/assets/braintree-paypal-45391805.js +/** +======== +import{i as s,w as u}from"./wait-8f4ae121.js";/** +>>>>>>>> new_payment_flow:public/build/assets/braintree-paypal-f78ad64b.js + * Invoice Ninja (https://invoiceninja.com). + * + * @link https://github.com/invoiceninja/invoiceninja source repository + * + * @copyright Copyright (c) 2021. Invoice Ninja LLC (https://invoiceninja.com) + * + * @license https://www.elastic.co/licensing/elastic-license +<<<<<<<< HEAD:public/build/assets/braintree-paypal-45391805.js + */class a{initBraintreeDataCollector(){window.braintree.client.create({authorization:document.querySelector("meta[name=client-token]").content},function(e,t){window.braintree.dataCollector.create({client:t,paypal:!0},function(n,o){n||(document.querySelector("input[name=client-data]").value=o.deviceData)})})}static getPaymentDetails(){return{flow:"vault"}}static handleErrorMessage(e){let t=document.getElementById("errors");t.innerText=e,t.hidden=!1}handlePaymentWithToken(){Array.from(document.getElementsByClassName("toggle-payment-with-token")).forEach(t=>t.addEventListener("click",n=>{document.getElementById("paypal-button").classList.add("hidden"),document.getElementById("save-card--container").style.display="none",document.querySelector("input[name=token]").value=n.target.dataset.token,document.getElementById("pay-now-with-token").classList.remove("hidden"),document.getElementById("pay-now").classList.add("hidden")}));let e=document.getElementById("pay-now-with-token");e.addEventListener("click",t=>{e.disabled=!0,e.querySelector("svg").classList.remove("hidden"),e.querySelector("span").classList.add("hidden"),document.getElementById("server-response").submit()})}handle(){this.initBraintreeDataCollector(),this.handlePaymentWithToken(),braintree.client.create({authorization:document.querySelector("meta[name=client-token]").content}).then(function(e){return braintree.paypalCheckout.create({client:e})}).then(function(e){return e.loadPayPalSDK({vault:!0}).then(function(t){return paypal.Buttons({fundingSource:paypal.FUNDING.PAYPAL,createBillingAgreement:function(){return t.createPayment(a.getPaymentDetails())},onApprove:function(n,o){return t.tokenizePayment(n).then(function(i){let r=document.querySelector('input[name="token-billing-checkbox"]:checked');r&&(document.querySelector('input[name="store_card"]').value=r.value),document.querySelector("input[name=gateway_response]").value=JSON.stringify(i),document.getElementById("server-response").submit()})},onCancel:function(n){},onError:function(n){console.log(n.message),a.handleErrorMessage(n.message)}}).render("#paypal-button")})}).catch(function(e){console.log(e.message),a.handleErrorMessage(e.message)})}}new a().handle(); +======== + */class a{initBraintreeDataCollector(){window.braintree.client.create({authorization:document.querySelector("meta[name=client-token]").content},function(e,t){window.braintree.dataCollector.create({client:t,paypal:!0},function(n,o){n||(document.querySelector("input[name=client-data]").value=o.deviceData)})})}static getPaymentDetails(){return{flow:"vault"}}static handleErrorMessage(e){let t=document.getElementById("errors");t.innerText=e,t.hidden=!1}handlePaymentWithToken(){Array.from(document.getElementsByClassName("toggle-payment-with-token")).forEach(t=>t.addEventListener("click",n=>{document.getElementById("paypal-button").classList.add("hidden"),document.getElementById("save-card--container").style.display="none",document.querySelector("input[name=token]").value=n.target.dataset.token,document.getElementById("pay-now-with-token").classList.remove("hidden"),document.getElementById("pay-now").classList.add("hidden")}));let e=document.getElementById("pay-now-with-token");e.addEventListener("click",t=>{e.disabled=!0,e.querySelector("svg").classList.remove("hidden"),e.querySelector("span").classList.add("hidden"),document.getElementById("server-response").submit()})}handle(){this.initBraintreeDataCollector(),this.handlePaymentWithToken(),braintree.client.create({authorization:document.querySelector("meta[name=client-token]").content}).then(function(e){return braintree.paypalCheckout.create({client:e})}).then(function(e){return e.loadPayPalSDK({vault:!0}).then(function(t){return paypal.Buttons({fundingSource:paypal.FUNDING.PAYPAL,createBillingAgreement:function(){return t.createPayment(a.getPaymentDetails())},onApprove:function(n,o){return t.tokenizePayment(n).then(function(d){var i,c;(i=document.querySelector("#paypal-button"))==null||i.classList.add("hidden"),(c=document.querySelector("#paypal-spinner"))==null||c.classList.remove("hidden");let r=document.querySelector('input[name="token-billing-checkbox"]:checked');r&&(document.querySelector('input[name="store_card"]').value=r.value),document.querySelector("input[name=gateway_response]").value=JSON.stringify(d),document.getElementById("server-response").submit()})},onCancel:function(n){},onError:function(n){console.log(n.message),a.handleErrorMessage(n.message)}}).render("#paypal-button")})}).catch(function(e){console.log(e.message),a.handleErrorMessage(e.message)})}}function l(){new a().handle()}s()?l():u("#braintree-paypal-payment").then(()=>l()); +>>>>>>>> new_payment_flow:public/build/assets/braintree-paypal-f78ad64b.js diff --git a/public/build/assets/checkout-credit-card-2cca8b36.js b/public/build/assets/checkout-credit-card-2cca8b36.js new file mode 100644 index 000000000000..cc32bdcba638 --- /dev/null +++ b/public/build/assets/checkout-credit-card-2cca8b36.js @@ -0,0 +1,9 @@ +import{i as s,w as i}from"./wait-8f4ae121.js";/** + * Invoice Ninja (https://invoiceninja.com) + * + * @link https://github.com/invoiceninja/invoiceninja source repository + * + * @copyright Copyright (c) 2021. Invoice Ninja LLC (https://invoiceninja.com) + * + * @license https://www.elastic.co/licensing/elastic-license + */class a{constructor(){this.tokens=[]}handlePaymentUsingToken(t){document.getElementById("checkout--container").classList.add("hidden"),document.getElementById("pay-now-with-token--container").classList.remove("hidden"),document.getElementById("save-card--container").style.display="none",document.querySelector("input[name=token]").value=t.target.dataset.token}handlePaymentUsingCreditCard(t){document.getElementById("checkout--container").classList.remove("hidden"),document.getElementById("pay-now-with-token--container").classList.add("hidden"),document.getElementById("save-card--container").style.display="grid",document.querySelector("input[name=token]").value="";const e=document.getElementById("pay-button"),d=document.querySelector('meta[name="public-key"]').content??"",o=document.getElementById("payment-form");Frames.init(d),Frames.addEventHandler(Frames.Events.CARD_VALIDATION_CHANGED,function(n){e.disabled=!Frames.isCardValid()}),Frames.addEventHandler(Frames.Events.CARD_TOKENIZATION_FAILED,function(n){e.disabled=!1}),Frames.addEventHandler(Frames.Events.CARD_TOKENIZED,function(n){e.disabled=!0,document.querySelector('input[name="gateway_response"]').value=JSON.stringify(n),document.querySelector('input[name="store_card"]').value=document.querySelector("input[name=token-billing-checkbox]:checked").value,document.getElementById("server-response").submit()}),o.addEventListener("submit",function(n){n.preventDefault(),e.disabled=!0,Frames.submitCard()})}completePaymentUsingToken(t){let e=document.getElementById("pay-now-with-token");e.disabled=!0,e.querySelector("svg").classList.remove("hidden"),e.querySelector("span").classList.add("hidden"),document.getElementById("server-response").submit()}handle(){this.handlePaymentUsingCreditCard(),Array.from(document.getElementsByClassName("toggle-payment-with-token")).forEach(t=>t.addEventListener("click",this.handlePaymentUsingToken)),document.getElementById("toggle-payment-with-credit-card").addEventListener("click",this.handlePaymentUsingCreditCard),document.getElementById("pay-now-with-token").addEventListener("click",this.completePaymentUsingToken)}}function r(){new a().handle()}s()?r():i("#checkout-credit-card-payment").then(()=>new a().handle()); diff --git a/public/build/assets/eway-credit-card-150298fa.js b/public/build/assets/eway-credit-card-150298fa.js new file mode 100644 index 000000000000..bb4dcc2cd7e6 --- /dev/null +++ b/public/build/assets/eway-credit-card-150298fa.js @@ -0,0 +1,17 @@ +<<<<<<<< HEAD:public/build/assets/eway-credit-card-62ce5f3b.js +/** +======== +import{i as d,w as n}from"./wait-8f4ae121.js";/** +>>>>>>>> new_payment_flow:public/build/assets/eway-credit-card-150298fa.js + * Invoice Ninja (https://invoiceninja.com). + * + * @link https://github.com/invoiceninja/invoiceninja source repository + * + * @copyright Copyright (c) 2021. Invoice Ninja LLC (https://invoiceninja.com) + * + * @license https://www.elastic.co/licensing/elastic-license +<<<<<<<< HEAD:public/build/assets/eway-credit-card-62ce5f3b.js + */class i{constructor(){this.cardStyles="padding: 2px; border: 1px solid #AAA; border-radius: 3px; height: 34px; width: 100%;",this.errorCodes=new Map,this.errorCodes.set("V6000","Validation error"),this.errorCodes.set("V6001","Invalid CustomerIP"),this.errorCodes.set("V6002","Invalid DeviceID"),this.errorCodes.set("V6003","Invalid Request PartnerID"),this.errorCodes.set("V6004","Invalid Request Method"),this.errorCodes.set("V6010","Invalid TransactionType, account not certified for eCome only MOTO or Recurring available"),this.errorCodes.set("V6011","Invalid Payment TotalAmount"),this.errorCodes.set("V6012","Invalid Payment InvoiceDescription"),this.errorCodes.set("V6013","Invalid Payment InvoiceNumber"),this.errorCodes.set("V6014","Invalid Payment InvoiceReference"),this.errorCodes.set("V6015","Invalid Payment CurrencyCode"),this.errorCodes.set("V6016","Payment Required"),this.errorCodes.set("V6017","Payment CurrencyCode Required"),this.errorCodes.set("V6018","Unknown Payment CurrencyCode"),this.errorCodes.set("V6019","Cardholder identity authentication required"),this.errorCodes.set("V6020","Cardholder Input Required"),this.errorCodes.set("V6021","EWAY_CARDHOLDERNAME Required"),this.errorCodes.set("V6022","EWAY_CARDNUMBER Required"),this.errorCodes.set("V6023","EWAY_CARDCVN Required"),this.errorCodes.set("V6024","Cardholder Identity Authentication One Time Password Not Active Yet"),this.errorCodes.set("V6025","PIN Required"),this.errorCodes.set("V6033","Invalid Expiry Date"),this.errorCodes.set("V6034","Invalid Issue Number"),this.errorCodes.set("V6035","Invalid Valid From Date"),this.errorCodes.set("V6039","Invalid Network Token Status"),this.errorCodes.set("V6040","Invalid TokenCustomerID"),this.errorCodes.set("V6041","Customer Required"),this.errorCodes.set("V6042","Customer FirstName Required"),this.errorCodes.set("V6043","Customer LastName Required"),this.errorCodes.set("V6044","Customer CountryCode Required"),this.errorCodes.set("V6045","Customer Title Required"),this.errorCodes.set("V6046","TokenCustomerID Required"),this.errorCodes.set("V6047","RedirectURL Required"),this.errorCodes.set("V6048","CheckoutURL Required when CheckoutPayment specified"),this.errorCodes.set("V6049","nvalid Checkout URL"),this.errorCodes.set("V6051","Invalid Customer FirstName"),this.errorCodes.set("V6052","Invalid Customer LastName"),this.errorCodes.set("V6053","Invalid Customer CountryCode"),this.errorCodes.set("V6058","Invalid Customer Title"),this.errorCodes.set("V6059","Invalid RedirectURL"),this.errorCodes.set("V6060","Invalid TokenCustomerID"),this.errorCodes.set("V6061","Invalid Customer Reference"),this.errorCodes.set("V6062","Invalid Customer CompanyName"),this.errorCodes.set("V6063","Invalid Customer JobDescription"),this.errorCodes.set("V6064","Invalid Customer Street1"),this.errorCodes.set("V6065","Invalid Customer Street2"),this.errorCodes.set("V6066","Invalid Customer City"),this.errorCodes.set("V6067","Invalid Customer State"),this.errorCodes.set("V6068","Invalid Customer PostalCode"),this.errorCodes.set("V6069","Invalid Customer Email"),this.errorCodes.set("V6070","Invalid Customer Phone"),this.errorCodes.set("V6071","Invalid Customer Mobile"),this.errorCodes.set("V6072","Invalid Customer Comments"),this.errorCodes.set("V6073","Invalid Customer Fax"),this.errorCodes.set("V6074","Invalid Customer URL"),this.errorCodes.set("V6075","Invalid ShippingAddress FirstName"),this.errorCodes.set("V6076","Invalid ShippingAddress LastName"),this.errorCodes.set("V6077","Invalid ShippingAddress Street1"),this.errorCodes.set("V6078","Invalid ShippingAddress Street2"),this.errorCodes.set("V6079","Invalid ShippingAddress City"),this.errorCodes.set("V6080","Invalid ShippingAddress State"),this.errorCodes.set("V6081","Invalid ShippingAddress PostalCode"),this.errorCodes.set("V6082","Invalid ShippingAddress Email"),this.errorCodes.set("V6083","Invalid ShippingAddress Phone"),this.errorCodes.set("V6084","Invalid ShippingAddress Country"),this.errorCodes.set("V6085","Invalid ShippingAddress ShippingMethod"),this.errorCodes.set("V6086","Invalid ShippingAddress Fax"),this.errorCodes.set("V6091","Unknown Customer CountryCode"),this.errorCodes.set("V6092","Unknown ShippingAddress CountryCode"),this.errorCodes.set("V6093","Insufficient Address Information"),this.errorCodes.set("V6100","Invalid EWAY_CARDNAME"),this.errorCodes.set("V6101","Invalid EWAY_CARDEXPIRYMONTH"),this.errorCodes.set("V6102","Invalid EWAY_CARDEXPIRYYEAR"),this.errorCodes.set("V6103","Invalid EWAY_CARDSTARTMONTH"),this.errorCodes.set("V6104","Invalid EWAY_CARDSTARTYEAR"),this.errorCodes.set("V6105","Invalid EWAY_CARDISSUENUMBER"),this.errorCodes.set("V6106","Invalid EWAY_CARDCVN"),this.errorCodes.set("V6107","Invalid EWAY_ACCESSCODE"),this.errorCodes.set("V6108","Invalid CustomerHostAddress"),this.errorCodes.set("V6109","Invalid UserAgent"),this.errorCodes.set("V6110","Invalid EWAY_CARDNUMBER"),this.errorCodes.set("V6111","Unauthorised API Access, Account Not PCI Certified"),this.errorCodes.set("V6112","Redundant card details other than expiry year and month"),this.errorCodes.set("V6113","Invalid transaction for refund"),this.errorCodes.set("V6114","Gateway validation error"),this.errorCodes.set("V6115","Invalid DirectRefundRequest, Transaction ID"),this.errorCodes.set("V6116","Invalid card data on original TransactionID"),this.errorCodes.set("V6117","Invalid CreateAccessCodeSharedRequest, FooterText"),this.errorCodes.set("V6118","Invalid CreateAccessCodeSharedRequest, HeaderText"),this.errorCodes.set("V6119","Invalid CreateAccessCodeSharedRequest, Language"),this.errorCodes.set("V6120","Invalid CreateAccessCodeSharedRequest, LogoUrl"),this.errorCodes.set("V6121","Invalid TransactionSearch, Filter Match Type"),this.errorCodes.set("V6122","Invalid TransactionSearch, Non numeric Transaction ID"),this.errorCodes.set("V6123","Invalid TransactionSearch,no TransactionID or AccessCode specified"),this.errorCodes.set("V6124","Invalid Line Items. The line items have been provided however the totals do not match the TotalAmount field"),this.errorCodes.set("V6125","Selected Payment Type not enabled"),this.errorCodes.set("V6126","Invalid encrypted card number, decryption failed"),this.errorCodes.set("V6127","Invalid encrypted cvn, decryption failed"),this.errorCodes.set("V6128","Invalid Method for Payment Type"),this.errorCodes.set("V6129","Transaction has not been authorised for Capture/Cancellation"),this.errorCodes.set("V6130","Generic customer information error"),this.errorCodes.set("V6131","Generic shipping information error"),this.errorCodes.set("V6132","Transaction has already been completed or voided, operation not permitted"),this.errorCodes.set("V6133","Checkout not available for Payment Type"),this.errorCodes.set("V6134","Invalid Auth Transaction ID for Capture/Void"),this.errorCodes.set("V6135","PayPal Error Processing Refund"),this.errorCodes.set("V6136","Original transaction does not exist or state is incorrect"),this.errorCodes.set("V6140","Merchant account is suspended"),this.errorCodes.set("V6141","Invalid PayPal account details or API signature"),this.errorCodes.set("V6142","Authorise not available for Bank/Branch"),this.errorCodes.set("V6143","Invalid Public Key"),this.errorCodes.set("V6144","Method not available with Public API Key Authentication"),this.errorCodes.set("V6145","Credit Card not allow if Token Customer ID is provided with Public API Key Authentication"),this.errorCodes.set("V6146","Client Side Encryption Key Missing or Invalid"),this.errorCodes.set("V6147","Unable to Create One Time Code for Secure Field"),this.errorCodes.set("V6148","Secure Field has Expired"),this.errorCodes.set("V6149","Invalid Secure Field One Time Code"),this.errorCodes.set("V6150","Invalid Refund Amount"),this.errorCodes.set("V6151","Refund amount greater than original transaction"),this.errorCodes.set("V6152","Original transaction already refunded for total amount"),this.errorCodes.set("V6153","Card type not support by merchant"),this.errorCodes.set("V6154","Insufficent Funds Available For Refund"),this.errorCodes.set("V6155","Missing one or more fields in request"),this.errorCodes.set("V6160","Encryption Method Not Supported"),this.errorCodes.set("V6161","Encryption failed, missing or invalid key"),this.errorCodes.set("V6165","Invalid Click-to-Pay (Visa Checkout) data or decryption failed"),this.errorCodes.set("V6170","Invalid TransactionSearch, Invoice Number is not unique"),this.errorCodes.set("V6171","Invalid TransactionSearch, Invoice Number not found"),this.errorCodes.set("V6220","Three domain secure XID invalid"),this.errorCodes.set("V6221","Three domain secure ECI invalid"),this.errorCodes.set("V6222","Three domain secure AVV invalid"),this.errorCodes.set("V6223","Three domain secure XID is required"),this.errorCodes.set("V6224","Three Domain Secure ECI is required"),this.errorCodes.set("V6225","Three Domain Secure AVV is required"),this.errorCodes.set("V6226","Three Domain Secure AuthStatus is required"),this.errorCodes.set("V6227","Three Domain Secure AuthStatus invalid"),this.errorCodes.set("V6228","Three domain secure Version is required"),this.errorCodes.set("V6230","Three domain secure Directory Server Txn ID invalid"),this.errorCodes.set("V6231","Three domain secure Directory Server Txn ID is required"),this.errorCodes.set("V6232","Three domain secure Version is invalid"),this.errorCodes.set("V6501","Invalid Amex InstallementPlan"),this.errorCodes.set("V6502","Invalid Number Of Installements for Amex. Valid values are from 0 to 99 inclusive"),this.errorCodes.set("V6503","Merchant Amex ID required"),this.errorCodes.set("V6504","Invalid Merchant Amex ID"),this.errorCodes.set("V6505","Merchant Terminal ID required"),this.errorCodes.set("V6506","Merchant category code required"),this.errorCodes.set("V6507","Invalid merchant category code"),this.errorCodes.set("V6508","Amex 3D ECI required"),this.errorCodes.set("V6509","Invalid Amex 3D ECI"),this.errorCodes.set("V6510","Invalid Amex 3D verification value"),this.errorCodes.set("V6511","Invalid merchant location data"),this.errorCodes.set("V6512","Invalid merchant street address"),this.errorCodes.set("V6513","Invalid merchant city"),this.errorCodes.set("V6514","Invalid merchant country"),this.errorCodes.set("V6515","Invalid merchant phone"),this.errorCodes.set("V6516","Invalid merchant postcode"),this.errorCodes.set("V6517","Amex connection error"),this.errorCodes.set("V6518","Amex EC Card Details API returned invalid data"),this.errorCodes.set("V6520","Invalid or missing Amex Point Of Sale Data"),this.errorCodes.set("V6521","Invalid or missing Amex transaction date time"),this.errorCodes.set("V6522","Invalid or missing Amex Original transaction date time"),this.errorCodes.set("V6530","Credit Card Number in non Credit Card Field")}get groupFieldConfig(){var e,t,r,s,o;return{publicApiKey:(e=document.querySelector("meta[name=public-api-key]"))==null?void 0:e.content,fieldDivId:"eway-secure-panel",fieldType:"group",styles:"",layout:{fonts:["Lobster"],rows:[{styles:"",cells:[{colSpan:12,styles:"margin-top: 15px;",label:{fieldColSpan:4,text:(t=document.querySelector("meta[name=translation-card-name]"))==null?void 0:t.content,styles:""},field:{fieldColSpan:8,fieldType:"name",styles:this.cardStyles,divStyles:"padding-left: 10px;"}},{colSpan:12,styles:"margin-top: 15px;",label:{fieldColSpan:4,text:(r=document.querySelector("meta[name=translation-expiry_date]"))==null?void 0:r.content,styles:""},field:{fieldColSpan:8,fieldType:"expirytext",styles:this.cardStyles,divStyles:"padding-left: 10px;"}}]},{styles:"",cells:[{colSpan:12,styles:"margin-top: 15px;",label:{fieldColSpan:4,text:(s=document.querySelector("meta[name=translation-card_number]"))==null?void 0:s.content,styles:""},field:{fieldColSpan:8,fieldType:"card",styles:this.cardStyles}},{colSpan:12,styles:"margin-top: 15px;",label:{fieldColSpan:4,text:(o=document.querySelector("meta[name=translation-cvv]"))==null?void 0:o.content,styles:""},field:{fieldColSpan:8,fieldType:"cvn",styles:this.cardStyles}}]}]}}}securePanelCallback(e){if(document.getElementById("errors").hidden=!0,e.errors)return this.handleErrors(e.errors);document.getElementById("authorize-card")&&(document.getElementById("authorize-card").disabled=!1),document.getElementById("pay-now")&&(document.getElementById("pay-now").disabled=!1),document.querySelector("input[name=securefieldcode]").value=e.secureFieldCode}handleErrors(e){let t=e.split(" "),r="";t.forEach(s=>{r=r.concat(this.errorCodes.get(s)+"
")}),document.getElementById("errors").innerHTML=r,document.getElementById("errors").hidden=!1}completeAuthorization(e){e.target.parentElement.disabled=!0,document.getElementById("server-response").submit()}completePaymentUsingToken(e){e.target.parentElement.disabled=!0,document.getElementById("server-response").submit()}completePaymentWithoutToken(e){e.target.parentElement.disabled=!0;let t=document.querySelector('input[name="token-billing-checkbox"]:checked');t&&(document.querySelector('input[name="store_card"]').value=t.value),document.getElementById("server-response").submit()}initialize(){this.eWAY=eWAY.setupSecureField(this.groupFieldConfig,e=>this.securePanelCallback(e))}handle(){var e,t;this.initialize(),(e=document.getElementById("authorize-card"))==null||e.addEventListener("click",r=>this.completeAuthorization(r)),Array.from(document.getElementsByClassName("toggle-payment-with-token")??[]).forEach(r=>r.addEventListener("click",s=>{document.getElementById("eway-secure-panel").classList.add("hidden"),document.getElementById("save-card--container").style.display="none",document.querySelector("input[name=token]").value=s.target.dataset.token,document.getElementById("pay-now").disabled=!1})),document.getElementById("toggle-payment-with-credit-card")&&document.getElementById("toggle-payment-with-credit-card").addEventListener("click",r=>{document.getElementById("eway-secure-panel").classList.remove("hidden"),document.getElementById("save-card--container").style.display="grid",document.querySelector("input[name=token]").value="",document.getElementById("pay-now").disabled=!0}),(t=document.getElementById("pay-now"))==null||t.addEventListener("click",r=>document.querySelector("input[name=token]").value?this.completePaymentUsingToken(r):this.completePaymentWithoutToken(r))}}new i().handle(); +======== + */class a{constructor(){this.cardStyles="padding: 2px; border: 1px solid #AAA; border-radius: 3px; height: 34px; width: 100%;",this.errorCodes=new Map,this.errorCodes.set("V6000","Validation error"),this.errorCodes.set("V6001","Invalid CustomerIP"),this.errorCodes.set("V6002","Invalid DeviceID"),this.errorCodes.set("V6003","Invalid Request PartnerID"),this.errorCodes.set("V6004","Invalid Request Method"),this.errorCodes.set("V6010","Invalid TransactionType, account not certified for eCome only MOTO or Recurring available"),this.errorCodes.set("V6011","Invalid Payment TotalAmount"),this.errorCodes.set("V6012","Invalid Payment InvoiceDescription"),this.errorCodes.set("V6013","Invalid Payment InvoiceNumber"),this.errorCodes.set("V6014","Invalid Payment InvoiceReference"),this.errorCodes.set("V6015","Invalid Payment CurrencyCode"),this.errorCodes.set("V6016","Payment Required"),this.errorCodes.set("V6017","Payment CurrencyCode Required"),this.errorCodes.set("V6018","Unknown Payment CurrencyCode"),this.errorCodes.set("V6019","Cardholder identity authentication required"),this.errorCodes.set("V6020","Cardholder Input Required"),this.errorCodes.set("V6021","EWAY_CARDHOLDERNAME Required"),this.errorCodes.set("V6022","EWAY_CARDNUMBER Required"),this.errorCodes.set("V6023","EWAY_CARDCVN Required"),this.errorCodes.set("V6024","Cardholder Identity Authentication One Time Password Not Active Yet"),this.errorCodes.set("V6025","PIN Required"),this.errorCodes.set("V6033","Invalid Expiry Date"),this.errorCodes.set("V6034","Invalid Issue Number"),this.errorCodes.set("V6035","Invalid Valid From Date"),this.errorCodes.set("V6039","Invalid Network Token Status"),this.errorCodes.set("V6040","Invalid TokenCustomerID"),this.errorCodes.set("V6041","Customer Required"),this.errorCodes.set("V6042","Customer FirstName Required"),this.errorCodes.set("V6043","Customer LastName Required"),this.errorCodes.set("V6044","Customer CountryCode Required"),this.errorCodes.set("V6045","Customer Title Required"),this.errorCodes.set("V6046","TokenCustomerID Required"),this.errorCodes.set("V6047","RedirectURL Required"),this.errorCodes.set("V6048","CheckoutURL Required when CheckoutPayment specified"),this.errorCodes.set("V6049","nvalid Checkout URL"),this.errorCodes.set("V6051","Invalid Customer FirstName"),this.errorCodes.set("V6052","Invalid Customer LastName"),this.errorCodes.set("V6053","Invalid Customer CountryCode"),this.errorCodes.set("V6058","Invalid Customer Title"),this.errorCodes.set("V6059","Invalid RedirectURL"),this.errorCodes.set("V6060","Invalid TokenCustomerID"),this.errorCodes.set("V6061","Invalid Customer Reference"),this.errorCodes.set("V6062","Invalid Customer CompanyName"),this.errorCodes.set("V6063","Invalid Customer JobDescription"),this.errorCodes.set("V6064","Invalid Customer Street1"),this.errorCodes.set("V6065","Invalid Customer Street2"),this.errorCodes.set("V6066","Invalid Customer City"),this.errorCodes.set("V6067","Invalid Customer State"),this.errorCodes.set("V6068","Invalid Customer PostalCode"),this.errorCodes.set("V6069","Invalid Customer Email"),this.errorCodes.set("V6070","Invalid Customer Phone"),this.errorCodes.set("V6071","Invalid Customer Mobile"),this.errorCodes.set("V6072","Invalid Customer Comments"),this.errorCodes.set("V6073","Invalid Customer Fax"),this.errorCodes.set("V6074","Invalid Customer URL"),this.errorCodes.set("V6075","Invalid ShippingAddress FirstName"),this.errorCodes.set("V6076","Invalid ShippingAddress LastName"),this.errorCodes.set("V6077","Invalid ShippingAddress Street1"),this.errorCodes.set("V6078","Invalid ShippingAddress Street2"),this.errorCodes.set("V6079","Invalid ShippingAddress City"),this.errorCodes.set("V6080","Invalid ShippingAddress State"),this.errorCodes.set("V6081","Invalid ShippingAddress PostalCode"),this.errorCodes.set("V6082","Invalid ShippingAddress Email"),this.errorCodes.set("V6083","Invalid ShippingAddress Phone"),this.errorCodes.set("V6084","Invalid ShippingAddress Country"),this.errorCodes.set("V6085","Invalid ShippingAddress ShippingMethod"),this.errorCodes.set("V6086","Invalid ShippingAddress Fax"),this.errorCodes.set("V6091","Unknown Customer CountryCode"),this.errorCodes.set("V6092","Unknown ShippingAddress CountryCode"),this.errorCodes.set("V6093","Insufficient Address Information"),this.errorCodes.set("V6100","Invalid EWAY_CARDNAME"),this.errorCodes.set("V6101","Invalid EWAY_CARDEXPIRYMONTH"),this.errorCodes.set("V6102","Invalid EWAY_CARDEXPIRYYEAR"),this.errorCodes.set("V6103","Invalid EWAY_CARDSTARTMONTH"),this.errorCodes.set("V6104","Invalid EWAY_CARDSTARTYEAR"),this.errorCodes.set("V6105","Invalid EWAY_CARDISSUENUMBER"),this.errorCodes.set("V6106","Invalid EWAY_CARDCVN"),this.errorCodes.set("V6107","Invalid EWAY_ACCESSCODE"),this.errorCodes.set("V6108","Invalid CustomerHostAddress"),this.errorCodes.set("V6109","Invalid UserAgent"),this.errorCodes.set("V6110","Invalid EWAY_CARDNUMBER"),this.errorCodes.set("V6111","Unauthorised API Access, Account Not PCI Certified"),this.errorCodes.set("V6112","Redundant card details other than expiry year and month"),this.errorCodes.set("V6113","Invalid transaction for refund"),this.errorCodes.set("V6114","Gateway validation error"),this.errorCodes.set("V6115","Invalid DirectRefundRequest, Transaction ID"),this.errorCodes.set("V6116","Invalid card data on original TransactionID"),this.errorCodes.set("V6117","Invalid CreateAccessCodeSharedRequest, FooterText"),this.errorCodes.set("V6118","Invalid CreateAccessCodeSharedRequest, HeaderText"),this.errorCodes.set("V6119","Invalid CreateAccessCodeSharedRequest, Language"),this.errorCodes.set("V6120","Invalid CreateAccessCodeSharedRequest, LogoUrl"),this.errorCodes.set("V6121","Invalid TransactionSearch, Filter Match Type"),this.errorCodes.set("V6122","Invalid TransactionSearch, Non numeric Transaction ID"),this.errorCodes.set("V6123","Invalid TransactionSearch,no TransactionID or AccessCode specified"),this.errorCodes.set("V6124","Invalid Line Items. The line items have been provided however the totals do not match the TotalAmount field"),this.errorCodes.set("V6125","Selected Payment Type not enabled"),this.errorCodes.set("V6126","Invalid encrypted card number, decryption failed"),this.errorCodes.set("V6127","Invalid encrypted cvn, decryption failed"),this.errorCodes.set("V6128","Invalid Method for Payment Type"),this.errorCodes.set("V6129","Transaction has not been authorised for Capture/Cancellation"),this.errorCodes.set("V6130","Generic customer information error"),this.errorCodes.set("V6131","Generic shipping information error"),this.errorCodes.set("V6132","Transaction has already been completed or voided, operation not permitted"),this.errorCodes.set("V6133","Checkout not available for Payment Type"),this.errorCodes.set("V6134","Invalid Auth Transaction ID for Capture/Void"),this.errorCodes.set("V6135","PayPal Error Processing Refund"),this.errorCodes.set("V6136","Original transaction does not exist or state is incorrect"),this.errorCodes.set("V6140","Merchant account is suspended"),this.errorCodes.set("V6141","Invalid PayPal account details or API signature"),this.errorCodes.set("V6142","Authorise not available for Bank/Branch"),this.errorCodes.set("V6143","Invalid Public Key"),this.errorCodes.set("V6144","Method not available with Public API Key Authentication"),this.errorCodes.set("V6145","Credit Card not allow if Token Customer ID is provided with Public API Key Authentication"),this.errorCodes.set("V6146","Client Side Encryption Key Missing or Invalid"),this.errorCodes.set("V6147","Unable to Create One Time Code for Secure Field"),this.errorCodes.set("V6148","Secure Field has Expired"),this.errorCodes.set("V6149","Invalid Secure Field One Time Code"),this.errorCodes.set("V6150","Invalid Refund Amount"),this.errorCodes.set("V6151","Refund amount greater than original transaction"),this.errorCodes.set("V6152","Original transaction already refunded for total amount"),this.errorCodes.set("V6153","Card type not support by merchant"),this.errorCodes.set("V6154","Insufficent Funds Available For Refund"),this.errorCodes.set("V6155","Missing one or more fields in request"),this.errorCodes.set("V6160","Encryption Method Not Supported"),this.errorCodes.set("V6161","Encryption failed, missing or invalid key"),this.errorCodes.set("V6165","Invalid Click-to-Pay (Visa Checkout) data or decryption failed"),this.errorCodes.set("V6170","Invalid TransactionSearch, Invoice Number is not unique"),this.errorCodes.set("V6171","Invalid TransactionSearch, Invoice Number not found"),this.errorCodes.set("V6220","Three domain secure XID invalid"),this.errorCodes.set("V6221","Three domain secure ECI invalid"),this.errorCodes.set("V6222","Three domain secure AVV invalid"),this.errorCodes.set("V6223","Three domain secure XID is required"),this.errorCodes.set("V6224","Three Domain Secure ECI is required"),this.errorCodes.set("V6225","Three Domain Secure AVV is required"),this.errorCodes.set("V6226","Three Domain Secure AuthStatus is required"),this.errorCodes.set("V6227","Three Domain Secure AuthStatus invalid"),this.errorCodes.set("V6228","Three domain secure Version is required"),this.errorCodes.set("V6230","Three domain secure Directory Server Txn ID invalid"),this.errorCodes.set("V6231","Three domain secure Directory Server Txn ID is required"),this.errorCodes.set("V6232","Three domain secure Version is invalid"),this.errorCodes.set("V6501","Invalid Amex InstallementPlan"),this.errorCodes.set("V6502","Invalid Number Of Installements for Amex. Valid values are from 0 to 99 inclusive"),this.errorCodes.set("V6503","Merchant Amex ID required"),this.errorCodes.set("V6504","Invalid Merchant Amex ID"),this.errorCodes.set("V6505","Merchant Terminal ID required"),this.errorCodes.set("V6506","Merchant category code required"),this.errorCodes.set("V6507","Invalid merchant category code"),this.errorCodes.set("V6508","Amex 3D ECI required"),this.errorCodes.set("V6509","Invalid Amex 3D ECI"),this.errorCodes.set("V6510","Invalid Amex 3D verification value"),this.errorCodes.set("V6511","Invalid merchant location data"),this.errorCodes.set("V6512","Invalid merchant street address"),this.errorCodes.set("V6513","Invalid merchant city"),this.errorCodes.set("V6514","Invalid merchant country"),this.errorCodes.set("V6515","Invalid merchant phone"),this.errorCodes.set("V6516","Invalid merchant postcode"),this.errorCodes.set("V6517","Amex connection error"),this.errorCodes.set("V6518","Amex EC Card Details API returned invalid data"),this.errorCodes.set("V6520","Invalid or missing Amex Point Of Sale Data"),this.errorCodes.set("V6521","Invalid or missing Amex transaction date time"),this.errorCodes.set("V6522","Invalid or missing Amex Original transaction date time"),this.errorCodes.set("V6530","Credit Card Number in non Credit Card Field")}get groupFieldConfig(){var e,r,s,t,o;return{publicApiKey:(e=document.querySelector("meta[name=public-api-key]"))==null?void 0:e.content,fieldDivId:"eway-secure-panel",fieldType:"group",styles:"",layout:{fonts:["Lobster"],rows:[{styles:"",cells:[{colSpan:12,styles:"margin-top: 15px;",label:{fieldColSpan:4,text:(r=document.querySelector("meta[name=translation-card-name]"))==null?void 0:r.content,styles:""},field:{fieldColSpan:8,fieldType:"name",styles:this.cardStyles,divStyles:"padding-left: 10px;"}},{colSpan:12,styles:"margin-top: 15px;",label:{fieldColSpan:4,text:(s=document.querySelector("meta[name=translation-expiry_date]"))==null?void 0:s.content,styles:""},field:{fieldColSpan:8,fieldType:"expirytext",styles:this.cardStyles,divStyles:"padding-left: 10px;"}}]},{styles:"",cells:[{colSpan:12,styles:"margin-top: 15px;",label:{fieldColSpan:4,text:(t=document.querySelector("meta[name=translation-card_number]"))==null?void 0:t.content,styles:""},field:{fieldColSpan:8,fieldType:"card",styles:this.cardStyles}},{colSpan:12,styles:"margin-top: 15px;",label:{fieldColSpan:4,text:(o=document.querySelector("meta[name=translation-cvv]"))==null?void 0:o.content,styles:""},field:{fieldColSpan:8,fieldType:"cvn",styles:this.cardStyles}}]}]}}}securePanelCallback(e){if(document.getElementById("errors").hidden=!0,e.errors)return this.handleErrors(e.errors);document.getElementById("authorize-card")&&(document.getElementById("authorize-card").disabled=!1),document.getElementById("pay-now")&&(document.getElementById("pay-now").disabled=!1),document.querySelector("input[name=securefieldcode]").value=e.secureFieldCode}handleErrors(e){let r=e.split(" "),s="";r.forEach(t=>{s=s.concat(this.errorCodes.get(t)+"
")}),document.getElementById("errors").innerHTML=s,document.getElementById("errors").hidden=!1}completeAuthorization(e){e.target.parentElement.disabled=!0;const r=document.getElementById("authorize-card");r.querySelector("svg").classList.remove("hidden"),r.querySelector("span").classList.add("hidden"),document.getElementById("server-response").submit()}completePaymentUsingToken(e){e.target.parentElement.disabled=!0,document.getElementById("server-response").submit()}completePaymentWithoutToken(e){e.target.parentElement.disabled=!0;let r=document.querySelector('input[name="token-billing-checkbox"]:checked');r&&(document.querySelector('input[name="store_card"]').value=r.value),document.getElementById("server-response").submit()}initialize(){this.eWAY=eWAY.setupSecureField(this.groupFieldConfig,e=>this.securePanelCallback(e))}handle(){var r,s;this.initialize(),(r=document.getElementById("authorize-card"))==null||r.addEventListener("click",t=>this.completeAuthorization(t)),Array.from(document.getElementsByClassName("toggle-payment-with-token")??[]).forEach(t=>t.addEventListener("click",o=>{document.getElementById("eway-secure-panel").classList.add("hidden"),document.getElementById("save-card--container").style.display="none",document.querySelector("input[name=token]").value=o.target.dataset.token,document.getElementById("pay-now").disabled=!1})),document.getElementById("toggle-payment-with-credit-card")&&document.getElementById("toggle-payment-with-credit-card").addEventListener("click",t=>{document.getElementById("eway-secure-panel").classList.remove("hidden"),document.getElementById("save-card--container").style.display="grid",document.querySelector("input[name=token]").value="",document.getElementById("pay-now").disabled=!0});const e=document.getElementById("pay-now");(s=document.getElementById("pay-now"))==null||s.addEventListener("click",t=>{let o=document.querySelector("input[name=token]");return e.querySelector("svg").classList.remove("hidden"),e.querySelector("span").classList.add("hidden"),o.value?this.completePaymentUsingToken(t):this.completePaymentWithoutToken(t)})}}function i(){new a().handle()}d()?i():n("#eway-credit-card-payment").then(()=>i()); +>>>>>>>> new_payment_flow:public/build/assets/eway-credit-card-150298fa.js diff --git a/public/build/assets/eway-credit-card-62ce5f3b.js b/public/build/assets/eway-credit-card-62ce5f3b.js index 3c3ceed101ae..bb4dcc2cd7e6 100644 --- a/public/build/assets/eway-credit-card-62ce5f3b.js +++ b/public/build/assets/eway-credit-card-62ce5f3b.js @@ -1,4 +1,8 @@ +<<<<<<<< HEAD:public/build/assets/eway-credit-card-62ce5f3b.js /** +======== +import{i as d,w as n}from"./wait-8f4ae121.js";/** +>>>>>>>> new_payment_flow:public/build/assets/eway-credit-card-150298fa.js * Invoice Ninja (https://invoiceninja.com). * * @link https://github.com/invoiceninja/invoiceninja source repository @@ -6,4 +10,8 @@ * @copyright Copyright (c) 2021. Invoice Ninja LLC (https://invoiceninja.com) * * @license https://www.elastic.co/licensing/elastic-license +<<<<<<<< HEAD:public/build/assets/eway-credit-card-62ce5f3b.js */class i{constructor(){this.cardStyles="padding: 2px; border: 1px solid #AAA; border-radius: 3px; height: 34px; width: 100%;",this.errorCodes=new Map,this.errorCodes.set("V6000","Validation error"),this.errorCodes.set("V6001","Invalid CustomerIP"),this.errorCodes.set("V6002","Invalid DeviceID"),this.errorCodes.set("V6003","Invalid Request PartnerID"),this.errorCodes.set("V6004","Invalid Request Method"),this.errorCodes.set("V6010","Invalid TransactionType, account not certified for eCome only MOTO or Recurring available"),this.errorCodes.set("V6011","Invalid Payment TotalAmount"),this.errorCodes.set("V6012","Invalid Payment InvoiceDescription"),this.errorCodes.set("V6013","Invalid Payment InvoiceNumber"),this.errorCodes.set("V6014","Invalid Payment InvoiceReference"),this.errorCodes.set("V6015","Invalid Payment CurrencyCode"),this.errorCodes.set("V6016","Payment Required"),this.errorCodes.set("V6017","Payment CurrencyCode Required"),this.errorCodes.set("V6018","Unknown Payment CurrencyCode"),this.errorCodes.set("V6019","Cardholder identity authentication required"),this.errorCodes.set("V6020","Cardholder Input Required"),this.errorCodes.set("V6021","EWAY_CARDHOLDERNAME Required"),this.errorCodes.set("V6022","EWAY_CARDNUMBER Required"),this.errorCodes.set("V6023","EWAY_CARDCVN Required"),this.errorCodes.set("V6024","Cardholder Identity Authentication One Time Password Not Active Yet"),this.errorCodes.set("V6025","PIN Required"),this.errorCodes.set("V6033","Invalid Expiry Date"),this.errorCodes.set("V6034","Invalid Issue Number"),this.errorCodes.set("V6035","Invalid Valid From Date"),this.errorCodes.set("V6039","Invalid Network Token Status"),this.errorCodes.set("V6040","Invalid TokenCustomerID"),this.errorCodes.set("V6041","Customer Required"),this.errorCodes.set("V6042","Customer FirstName Required"),this.errorCodes.set("V6043","Customer LastName Required"),this.errorCodes.set("V6044","Customer CountryCode Required"),this.errorCodes.set("V6045","Customer Title Required"),this.errorCodes.set("V6046","TokenCustomerID Required"),this.errorCodes.set("V6047","RedirectURL Required"),this.errorCodes.set("V6048","CheckoutURL Required when CheckoutPayment specified"),this.errorCodes.set("V6049","nvalid Checkout URL"),this.errorCodes.set("V6051","Invalid Customer FirstName"),this.errorCodes.set("V6052","Invalid Customer LastName"),this.errorCodes.set("V6053","Invalid Customer CountryCode"),this.errorCodes.set("V6058","Invalid Customer Title"),this.errorCodes.set("V6059","Invalid RedirectURL"),this.errorCodes.set("V6060","Invalid TokenCustomerID"),this.errorCodes.set("V6061","Invalid Customer Reference"),this.errorCodes.set("V6062","Invalid Customer CompanyName"),this.errorCodes.set("V6063","Invalid Customer JobDescription"),this.errorCodes.set("V6064","Invalid Customer Street1"),this.errorCodes.set("V6065","Invalid Customer Street2"),this.errorCodes.set("V6066","Invalid Customer City"),this.errorCodes.set("V6067","Invalid Customer State"),this.errorCodes.set("V6068","Invalid Customer PostalCode"),this.errorCodes.set("V6069","Invalid Customer Email"),this.errorCodes.set("V6070","Invalid Customer Phone"),this.errorCodes.set("V6071","Invalid Customer Mobile"),this.errorCodes.set("V6072","Invalid Customer Comments"),this.errorCodes.set("V6073","Invalid Customer Fax"),this.errorCodes.set("V6074","Invalid Customer URL"),this.errorCodes.set("V6075","Invalid ShippingAddress FirstName"),this.errorCodes.set("V6076","Invalid ShippingAddress LastName"),this.errorCodes.set("V6077","Invalid ShippingAddress Street1"),this.errorCodes.set("V6078","Invalid ShippingAddress Street2"),this.errorCodes.set("V6079","Invalid ShippingAddress City"),this.errorCodes.set("V6080","Invalid ShippingAddress State"),this.errorCodes.set("V6081","Invalid ShippingAddress PostalCode"),this.errorCodes.set("V6082","Invalid ShippingAddress Email"),this.errorCodes.set("V6083","Invalid ShippingAddress Phone"),this.errorCodes.set("V6084","Invalid ShippingAddress Country"),this.errorCodes.set("V6085","Invalid ShippingAddress ShippingMethod"),this.errorCodes.set("V6086","Invalid ShippingAddress Fax"),this.errorCodes.set("V6091","Unknown Customer CountryCode"),this.errorCodes.set("V6092","Unknown ShippingAddress CountryCode"),this.errorCodes.set("V6093","Insufficient Address Information"),this.errorCodes.set("V6100","Invalid EWAY_CARDNAME"),this.errorCodes.set("V6101","Invalid EWAY_CARDEXPIRYMONTH"),this.errorCodes.set("V6102","Invalid EWAY_CARDEXPIRYYEAR"),this.errorCodes.set("V6103","Invalid EWAY_CARDSTARTMONTH"),this.errorCodes.set("V6104","Invalid EWAY_CARDSTARTYEAR"),this.errorCodes.set("V6105","Invalid EWAY_CARDISSUENUMBER"),this.errorCodes.set("V6106","Invalid EWAY_CARDCVN"),this.errorCodes.set("V6107","Invalid EWAY_ACCESSCODE"),this.errorCodes.set("V6108","Invalid CustomerHostAddress"),this.errorCodes.set("V6109","Invalid UserAgent"),this.errorCodes.set("V6110","Invalid EWAY_CARDNUMBER"),this.errorCodes.set("V6111","Unauthorised API Access, Account Not PCI Certified"),this.errorCodes.set("V6112","Redundant card details other than expiry year and month"),this.errorCodes.set("V6113","Invalid transaction for refund"),this.errorCodes.set("V6114","Gateway validation error"),this.errorCodes.set("V6115","Invalid DirectRefundRequest, Transaction ID"),this.errorCodes.set("V6116","Invalid card data on original TransactionID"),this.errorCodes.set("V6117","Invalid CreateAccessCodeSharedRequest, FooterText"),this.errorCodes.set("V6118","Invalid CreateAccessCodeSharedRequest, HeaderText"),this.errorCodes.set("V6119","Invalid CreateAccessCodeSharedRequest, Language"),this.errorCodes.set("V6120","Invalid CreateAccessCodeSharedRequest, LogoUrl"),this.errorCodes.set("V6121","Invalid TransactionSearch, Filter Match Type"),this.errorCodes.set("V6122","Invalid TransactionSearch, Non numeric Transaction ID"),this.errorCodes.set("V6123","Invalid TransactionSearch,no TransactionID or AccessCode specified"),this.errorCodes.set("V6124","Invalid Line Items. The line items have been provided however the totals do not match the TotalAmount field"),this.errorCodes.set("V6125","Selected Payment Type not enabled"),this.errorCodes.set("V6126","Invalid encrypted card number, decryption failed"),this.errorCodes.set("V6127","Invalid encrypted cvn, decryption failed"),this.errorCodes.set("V6128","Invalid Method for Payment Type"),this.errorCodes.set("V6129","Transaction has not been authorised for Capture/Cancellation"),this.errorCodes.set("V6130","Generic customer information error"),this.errorCodes.set("V6131","Generic shipping information error"),this.errorCodes.set("V6132","Transaction has already been completed or voided, operation not permitted"),this.errorCodes.set("V6133","Checkout not available for Payment Type"),this.errorCodes.set("V6134","Invalid Auth Transaction ID for Capture/Void"),this.errorCodes.set("V6135","PayPal Error Processing Refund"),this.errorCodes.set("V6136","Original transaction does not exist or state is incorrect"),this.errorCodes.set("V6140","Merchant account is suspended"),this.errorCodes.set("V6141","Invalid PayPal account details or API signature"),this.errorCodes.set("V6142","Authorise not available for Bank/Branch"),this.errorCodes.set("V6143","Invalid Public Key"),this.errorCodes.set("V6144","Method not available with Public API Key Authentication"),this.errorCodes.set("V6145","Credit Card not allow if Token Customer ID is provided with Public API Key Authentication"),this.errorCodes.set("V6146","Client Side Encryption Key Missing or Invalid"),this.errorCodes.set("V6147","Unable to Create One Time Code for Secure Field"),this.errorCodes.set("V6148","Secure Field has Expired"),this.errorCodes.set("V6149","Invalid Secure Field One Time Code"),this.errorCodes.set("V6150","Invalid Refund Amount"),this.errorCodes.set("V6151","Refund amount greater than original transaction"),this.errorCodes.set("V6152","Original transaction already refunded for total amount"),this.errorCodes.set("V6153","Card type not support by merchant"),this.errorCodes.set("V6154","Insufficent Funds Available For Refund"),this.errorCodes.set("V6155","Missing one or more fields in request"),this.errorCodes.set("V6160","Encryption Method Not Supported"),this.errorCodes.set("V6161","Encryption failed, missing or invalid key"),this.errorCodes.set("V6165","Invalid Click-to-Pay (Visa Checkout) data or decryption failed"),this.errorCodes.set("V6170","Invalid TransactionSearch, Invoice Number is not unique"),this.errorCodes.set("V6171","Invalid TransactionSearch, Invoice Number not found"),this.errorCodes.set("V6220","Three domain secure XID invalid"),this.errorCodes.set("V6221","Three domain secure ECI invalid"),this.errorCodes.set("V6222","Three domain secure AVV invalid"),this.errorCodes.set("V6223","Three domain secure XID is required"),this.errorCodes.set("V6224","Three Domain Secure ECI is required"),this.errorCodes.set("V6225","Three Domain Secure AVV is required"),this.errorCodes.set("V6226","Three Domain Secure AuthStatus is required"),this.errorCodes.set("V6227","Three Domain Secure AuthStatus invalid"),this.errorCodes.set("V6228","Three domain secure Version is required"),this.errorCodes.set("V6230","Three domain secure Directory Server Txn ID invalid"),this.errorCodes.set("V6231","Three domain secure Directory Server Txn ID is required"),this.errorCodes.set("V6232","Three domain secure Version is invalid"),this.errorCodes.set("V6501","Invalid Amex InstallementPlan"),this.errorCodes.set("V6502","Invalid Number Of Installements for Amex. Valid values are from 0 to 99 inclusive"),this.errorCodes.set("V6503","Merchant Amex ID required"),this.errorCodes.set("V6504","Invalid Merchant Amex ID"),this.errorCodes.set("V6505","Merchant Terminal ID required"),this.errorCodes.set("V6506","Merchant category code required"),this.errorCodes.set("V6507","Invalid merchant category code"),this.errorCodes.set("V6508","Amex 3D ECI required"),this.errorCodes.set("V6509","Invalid Amex 3D ECI"),this.errorCodes.set("V6510","Invalid Amex 3D verification value"),this.errorCodes.set("V6511","Invalid merchant location data"),this.errorCodes.set("V6512","Invalid merchant street address"),this.errorCodes.set("V6513","Invalid merchant city"),this.errorCodes.set("V6514","Invalid merchant country"),this.errorCodes.set("V6515","Invalid merchant phone"),this.errorCodes.set("V6516","Invalid merchant postcode"),this.errorCodes.set("V6517","Amex connection error"),this.errorCodes.set("V6518","Amex EC Card Details API returned invalid data"),this.errorCodes.set("V6520","Invalid or missing Amex Point Of Sale Data"),this.errorCodes.set("V6521","Invalid or missing Amex transaction date time"),this.errorCodes.set("V6522","Invalid or missing Amex Original transaction date time"),this.errorCodes.set("V6530","Credit Card Number in non Credit Card Field")}get groupFieldConfig(){var e,t,r,s,o;return{publicApiKey:(e=document.querySelector("meta[name=public-api-key]"))==null?void 0:e.content,fieldDivId:"eway-secure-panel",fieldType:"group",styles:"",layout:{fonts:["Lobster"],rows:[{styles:"",cells:[{colSpan:12,styles:"margin-top: 15px;",label:{fieldColSpan:4,text:(t=document.querySelector("meta[name=translation-card-name]"))==null?void 0:t.content,styles:""},field:{fieldColSpan:8,fieldType:"name",styles:this.cardStyles,divStyles:"padding-left: 10px;"}},{colSpan:12,styles:"margin-top: 15px;",label:{fieldColSpan:4,text:(r=document.querySelector("meta[name=translation-expiry_date]"))==null?void 0:r.content,styles:""},field:{fieldColSpan:8,fieldType:"expirytext",styles:this.cardStyles,divStyles:"padding-left: 10px;"}}]},{styles:"",cells:[{colSpan:12,styles:"margin-top: 15px;",label:{fieldColSpan:4,text:(s=document.querySelector("meta[name=translation-card_number]"))==null?void 0:s.content,styles:""},field:{fieldColSpan:8,fieldType:"card",styles:this.cardStyles}},{colSpan:12,styles:"margin-top: 15px;",label:{fieldColSpan:4,text:(o=document.querySelector("meta[name=translation-cvv]"))==null?void 0:o.content,styles:""},field:{fieldColSpan:8,fieldType:"cvn",styles:this.cardStyles}}]}]}}}securePanelCallback(e){if(document.getElementById("errors").hidden=!0,e.errors)return this.handleErrors(e.errors);document.getElementById("authorize-card")&&(document.getElementById("authorize-card").disabled=!1),document.getElementById("pay-now")&&(document.getElementById("pay-now").disabled=!1),document.querySelector("input[name=securefieldcode]").value=e.secureFieldCode}handleErrors(e){let t=e.split(" "),r="";t.forEach(s=>{r=r.concat(this.errorCodes.get(s)+"
")}),document.getElementById("errors").innerHTML=r,document.getElementById("errors").hidden=!1}completeAuthorization(e){e.target.parentElement.disabled=!0,document.getElementById("server-response").submit()}completePaymentUsingToken(e){e.target.parentElement.disabled=!0,document.getElementById("server-response").submit()}completePaymentWithoutToken(e){e.target.parentElement.disabled=!0;let t=document.querySelector('input[name="token-billing-checkbox"]:checked');t&&(document.querySelector('input[name="store_card"]').value=t.value),document.getElementById("server-response").submit()}initialize(){this.eWAY=eWAY.setupSecureField(this.groupFieldConfig,e=>this.securePanelCallback(e))}handle(){var e,t;this.initialize(),(e=document.getElementById("authorize-card"))==null||e.addEventListener("click",r=>this.completeAuthorization(r)),Array.from(document.getElementsByClassName("toggle-payment-with-token")??[]).forEach(r=>r.addEventListener("click",s=>{document.getElementById("eway-secure-panel").classList.add("hidden"),document.getElementById("save-card--container").style.display="none",document.querySelector("input[name=token]").value=s.target.dataset.token,document.getElementById("pay-now").disabled=!1})),document.getElementById("toggle-payment-with-credit-card")&&document.getElementById("toggle-payment-with-credit-card").addEventListener("click",r=>{document.getElementById("eway-secure-panel").classList.remove("hidden"),document.getElementById("save-card--container").style.display="grid",document.querySelector("input[name=token]").value="",document.getElementById("pay-now").disabled=!0}),(t=document.getElementById("pay-now"))==null||t.addEventListener("click",r=>document.querySelector("input[name=token]").value?this.completePaymentUsingToken(r):this.completePaymentWithoutToken(r))}}new i().handle(); +======== + */class a{constructor(){this.cardStyles="padding: 2px; border: 1px solid #AAA; border-radius: 3px; height: 34px; width: 100%;",this.errorCodes=new Map,this.errorCodes.set("V6000","Validation error"),this.errorCodes.set("V6001","Invalid CustomerIP"),this.errorCodes.set("V6002","Invalid DeviceID"),this.errorCodes.set("V6003","Invalid Request PartnerID"),this.errorCodes.set("V6004","Invalid Request Method"),this.errorCodes.set("V6010","Invalid TransactionType, account not certified for eCome only MOTO or Recurring available"),this.errorCodes.set("V6011","Invalid Payment TotalAmount"),this.errorCodes.set("V6012","Invalid Payment InvoiceDescription"),this.errorCodes.set("V6013","Invalid Payment InvoiceNumber"),this.errorCodes.set("V6014","Invalid Payment InvoiceReference"),this.errorCodes.set("V6015","Invalid Payment CurrencyCode"),this.errorCodes.set("V6016","Payment Required"),this.errorCodes.set("V6017","Payment CurrencyCode Required"),this.errorCodes.set("V6018","Unknown Payment CurrencyCode"),this.errorCodes.set("V6019","Cardholder identity authentication required"),this.errorCodes.set("V6020","Cardholder Input Required"),this.errorCodes.set("V6021","EWAY_CARDHOLDERNAME Required"),this.errorCodes.set("V6022","EWAY_CARDNUMBER Required"),this.errorCodes.set("V6023","EWAY_CARDCVN Required"),this.errorCodes.set("V6024","Cardholder Identity Authentication One Time Password Not Active Yet"),this.errorCodes.set("V6025","PIN Required"),this.errorCodes.set("V6033","Invalid Expiry Date"),this.errorCodes.set("V6034","Invalid Issue Number"),this.errorCodes.set("V6035","Invalid Valid From Date"),this.errorCodes.set("V6039","Invalid Network Token Status"),this.errorCodes.set("V6040","Invalid TokenCustomerID"),this.errorCodes.set("V6041","Customer Required"),this.errorCodes.set("V6042","Customer FirstName Required"),this.errorCodes.set("V6043","Customer LastName Required"),this.errorCodes.set("V6044","Customer CountryCode Required"),this.errorCodes.set("V6045","Customer Title Required"),this.errorCodes.set("V6046","TokenCustomerID Required"),this.errorCodes.set("V6047","RedirectURL Required"),this.errorCodes.set("V6048","CheckoutURL Required when CheckoutPayment specified"),this.errorCodes.set("V6049","nvalid Checkout URL"),this.errorCodes.set("V6051","Invalid Customer FirstName"),this.errorCodes.set("V6052","Invalid Customer LastName"),this.errorCodes.set("V6053","Invalid Customer CountryCode"),this.errorCodes.set("V6058","Invalid Customer Title"),this.errorCodes.set("V6059","Invalid RedirectURL"),this.errorCodes.set("V6060","Invalid TokenCustomerID"),this.errorCodes.set("V6061","Invalid Customer Reference"),this.errorCodes.set("V6062","Invalid Customer CompanyName"),this.errorCodes.set("V6063","Invalid Customer JobDescription"),this.errorCodes.set("V6064","Invalid Customer Street1"),this.errorCodes.set("V6065","Invalid Customer Street2"),this.errorCodes.set("V6066","Invalid Customer City"),this.errorCodes.set("V6067","Invalid Customer State"),this.errorCodes.set("V6068","Invalid Customer PostalCode"),this.errorCodes.set("V6069","Invalid Customer Email"),this.errorCodes.set("V6070","Invalid Customer Phone"),this.errorCodes.set("V6071","Invalid Customer Mobile"),this.errorCodes.set("V6072","Invalid Customer Comments"),this.errorCodes.set("V6073","Invalid Customer Fax"),this.errorCodes.set("V6074","Invalid Customer URL"),this.errorCodes.set("V6075","Invalid ShippingAddress FirstName"),this.errorCodes.set("V6076","Invalid ShippingAddress LastName"),this.errorCodes.set("V6077","Invalid ShippingAddress Street1"),this.errorCodes.set("V6078","Invalid ShippingAddress Street2"),this.errorCodes.set("V6079","Invalid ShippingAddress City"),this.errorCodes.set("V6080","Invalid ShippingAddress State"),this.errorCodes.set("V6081","Invalid ShippingAddress PostalCode"),this.errorCodes.set("V6082","Invalid ShippingAddress Email"),this.errorCodes.set("V6083","Invalid ShippingAddress Phone"),this.errorCodes.set("V6084","Invalid ShippingAddress Country"),this.errorCodes.set("V6085","Invalid ShippingAddress ShippingMethod"),this.errorCodes.set("V6086","Invalid ShippingAddress Fax"),this.errorCodes.set("V6091","Unknown Customer CountryCode"),this.errorCodes.set("V6092","Unknown ShippingAddress CountryCode"),this.errorCodes.set("V6093","Insufficient Address Information"),this.errorCodes.set("V6100","Invalid EWAY_CARDNAME"),this.errorCodes.set("V6101","Invalid EWAY_CARDEXPIRYMONTH"),this.errorCodes.set("V6102","Invalid EWAY_CARDEXPIRYYEAR"),this.errorCodes.set("V6103","Invalid EWAY_CARDSTARTMONTH"),this.errorCodes.set("V6104","Invalid EWAY_CARDSTARTYEAR"),this.errorCodes.set("V6105","Invalid EWAY_CARDISSUENUMBER"),this.errorCodes.set("V6106","Invalid EWAY_CARDCVN"),this.errorCodes.set("V6107","Invalid EWAY_ACCESSCODE"),this.errorCodes.set("V6108","Invalid CustomerHostAddress"),this.errorCodes.set("V6109","Invalid UserAgent"),this.errorCodes.set("V6110","Invalid EWAY_CARDNUMBER"),this.errorCodes.set("V6111","Unauthorised API Access, Account Not PCI Certified"),this.errorCodes.set("V6112","Redundant card details other than expiry year and month"),this.errorCodes.set("V6113","Invalid transaction for refund"),this.errorCodes.set("V6114","Gateway validation error"),this.errorCodes.set("V6115","Invalid DirectRefundRequest, Transaction ID"),this.errorCodes.set("V6116","Invalid card data on original TransactionID"),this.errorCodes.set("V6117","Invalid CreateAccessCodeSharedRequest, FooterText"),this.errorCodes.set("V6118","Invalid CreateAccessCodeSharedRequest, HeaderText"),this.errorCodes.set("V6119","Invalid CreateAccessCodeSharedRequest, Language"),this.errorCodes.set("V6120","Invalid CreateAccessCodeSharedRequest, LogoUrl"),this.errorCodes.set("V6121","Invalid TransactionSearch, Filter Match Type"),this.errorCodes.set("V6122","Invalid TransactionSearch, Non numeric Transaction ID"),this.errorCodes.set("V6123","Invalid TransactionSearch,no TransactionID or AccessCode specified"),this.errorCodes.set("V6124","Invalid Line Items. The line items have been provided however the totals do not match the TotalAmount field"),this.errorCodes.set("V6125","Selected Payment Type not enabled"),this.errorCodes.set("V6126","Invalid encrypted card number, decryption failed"),this.errorCodes.set("V6127","Invalid encrypted cvn, decryption failed"),this.errorCodes.set("V6128","Invalid Method for Payment Type"),this.errorCodes.set("V6129","Transaction has not been authorised for Capture/Cancellation"),this.errorCodes.set("V6130","Generic customer information error"),this.errorCodes.set("V6131","Generic shipping information error"),this.errorCodes.set("V6132","Transaction has already been completed or voided, operation not permitted"),this.errorCodes.set("V6133","Checkout not available for Payment Type"),this.errorCodes.set("V6134","Invalid Auth Transaction ID for Capture/Void"),this.errorCodes.set("V6135","PayPal Error Processing Refund"),this.errorCodes.set("V6136","Original transaction does not exist or state is incorrect"),this.errorCodes.set("V6140","Merchant account is suspended"),this.errorCodes.set("V6141","Invalid PayPal account details or API signature"),this.errorCodes.set("V6142","Authorise not available for Bank/Branch"),this.errorCodes.set("V6143","Invalid Public Key"),this.errorCodes.set("V6144","Method not available with Public API Key Authentication"),this.errorCodes.set("V6145","Credit Card not allow if Token Customer ID is provided with Public API Key Authentication"),this.errorCodes.set("V6146","Client Side Encryption Key Missing or Invalid"),this.errorCodes.set("V6147","Unable to Create One Time Code for Secure Field"),this.errorCodes.set("V6148","Secure Field has Expired"),this.errorCodes.set("V6149","Invalid Secure Field One Time Code"),this.errorCodes.set("V6150","Invalid Refund Amount"),this.errorCodes.set("V6151","Refund amount greater than original transaction"),this.errorCodes.set("V6152","Original transaction already refunded for total amount"),this.errorCodes.set("V6153","Card type not support by merchant"),this.errorCodes.set("V6154","Insufficent Funds Available For Refund"),this.errorCodes.set("V6155","Missing one or more fields in request"),this.errorCodes.set("V6160","Encryption Method Not Supported"),this.errorCodes.set("V6161","Encryption failed, missing or invalid key"),this.errorCodes.set("V6165","Invalid Click-to-Pay (Visa Checkout) data or decryption failed"),this.errorCodes.set("V6170","Invalid TransactionSearch, Invoice Number is not unique"),this.errorCodes.set("V6171","Invalid TransactionSearch, Invoice Number not found"),this.errorCodes.set("V6220","Three domain secure XID invalid"),this.errorCodes.set("V6221","Three domain secure ECI invalid"),this.errorCodes.set("V6222","Three domain secure AVV invalid"),this.errorCodes.set("V6223","Three domain secure XID is required"),this.errorCodes.set("V6224","Three Domain Secure ECI is required"),this.errorCodes.set("V6225","Three Domain Secure AVV is required"),this.errorCodes.set("V6226","Three Domain Secure AuthStatus is required"),this.errorCodes.set("V6227","Three Domain Secure AuthStatus invalid"),this.errorCodes.set("V6228","Three domain secure Version is required"),this.errorCodes.set("V6230","Three domain secure Directory Server Txn ID invalid"),this.errorCodes.set("V6231","Three domain secure Directory Server Txn ID is required"),this.errorCodes.set("V6232","Three domain secure Version is invalid"),this.errorCodes.set("V6501","Invalid Amex InstallementPlan"),this.errorCodes.set("V6502","Invalid Number Of Installements for Amex. Valid values are from 0 to 99 inclusive"),this.errorCodes.set("V6503","Merchant Amex ID required"),this.errorCodes.set("V6504","Invalid Merchant Amex ID"),this.errorCodes.set("V6505","Merchant Terminal ID required"),this.errorCodes.set("V6506","Merchant category code required"),this.errorCodes.set("V6507","Invalid merchant category code"),this.errorCodes.set("V6508","Amex 3D ECI required"),this.errorCodes.set("V6509","Invalid Amex 3D ECI"),this.errorCodes.set("V6510","Invalid Amex 3D verification value"),this.errorCodes.set("V6511","Invalid merchant location data"),this.errorCodes.set("V6512","Invalid merchant street address"),this.errorCodes.set("V6513","Invalid merchant city"),this.errorCodes.set("V6514","Invalid merchant country"),this.errorCodes.set("V6515","Invalid merchant phone"),this.errorCodes.set("V6516","Invalid merchant postcode"),this.errorCodes.set("V6517","Amex connection error"),this.errorCodes.set("V6518","Amex EC Card Details API returned invalid data"),this.errorCodes.set("V6520","Invalid or missing Amex Point Of Sale Data"),this.errorCodes.set("V6521","Invalid or missing Amex transaction date time"),this.errorCodes.set("V6522","Invalid or missing Amex Original transaction date time"),this.errorCodes.set("V6530","Credit Card Number in non Credit Card Field")}get groupFieldConfig(){var e,r,s,t,o;return{publicApiKey:(e=document.querySelector("meta[name=public-api-key]"))==null?void 0:e.content,fieldDivId:"eway-secure-panel",fieldType:"group",styles:"",layout:{fonts:["Lobster"],rows:[{styles:"",cells:[{colSpan:12,styles:"margin-top: 15px;",label:{fieldColSpan:4,text:(r=document.querySelector("meta[name=translation-card-name]"))==null?void 0:r.content,styles:""},field:{fieldColSpan:8,fieldType:"name",styles:this.cardStyles,divStyles:"padding-left: 10px;"}},{colSpan:12,styles:"margin-top: 15px;",label:{fieldColSpan:4,text:(s=document.querySelector("meta[name=translation-expiry_date]"))==null?void 0:s.content,styles:""},field:{fieldColSpan:8,fieldType:"expirytext",styles:this.cardStyles,divStyles:"padding-left: 10px;"}}]},{styles:"",cells:[{colSpan:12,styles:"margin-top: 15px;",label:{fieldColSpan:4,text:(t=document.querySelector("meta[name=translation-card_number]"))==null?void 0:t.content,styles:""},field:{fieldColSpan:8,fieldType:"card",styles:this.cardStyles}},{colSpan:12,styles:"margin-top: 15px;",label:{fieldColSpan:4,text:(o=document.querySelector("meta[name=translation-cvv]"))==null?void 0:o.content,styles:""},field:{fieldColSpan:8,fieldType:"cvn",styles:this.cardStyles}}]}]}}}securePanelCallback(e){if(document.getElementById("errors").hidden=!0,e.errors)return this.handleErrors(e.errors);document.getElementById("authorize-card")&&(document.getElementById("authorize-card").disabled=!1),document.getElementById("pay-now")&&(document.getElementById("pay-now").disabled=!1),document.querySelector("input[name=securefieldcode]").value=e.secureFieldCode}handleErrors(e){let r=e.split(" "),s="";r.forEach(t=>{s=s.concat(this.errorCodes.get(t)+"
")}),document.getElementById("errors").innerHTML=s,document.getElementById("errors").hidden=!1}completeAuthorization(e){e.target.parentElement.disabled=!0;const r=document.getElementById("authorize-card");r.querySelector("svg").classList.remove("hidden"),r.querySelector("span").classList.add("hidden"),document.getElementById("server-response").submit()}completePaymentUsingToken(e){e.target.parentElement.disabled=!0,document.getElementById("server-response").submit()}completePaymentWithoutToken(e){e.target.parentElement.disabled=!0;let r=document.querySelector('input[name="token-billing-checkbox"]:checked');r&&(document.querySelector('input[name="store_card"]').value=r.value),document.getElementById("server-response").submit()}initialize(){this.eWAY=eWAY.setupSecureField(this.groupFieldConfig,e=>this.securePanelCallback(e))}handle(){var r,s;this.initialize(),(r=document.getElementById("authorize-card"))==null||r.addEventListener("click",t=>this.completeAuthorization(t)),Array.from(document.getElementsByClassName("toggle-payment-with-token")??[]).forEach(t=>t.addEventListener("click",o=>{document.getElementById("eway-secure-panel").classList.add("hidden"),document.getElementById("save-card--container").style.display="none",document.querySelector("input[name=token]").value=o.target.dataset.token,document.getElementById("pay-now").disabled=!1})),document.getElementById("toggle-payment-with-credit-card")&&document.getElementById("toggle-payment-with-credit-card").addEventListener("click",t=>{document.getElementById("eway-secure-panel").classList.remove("hidden"),document.getElementById("save-card--container").style.display="grid",document.querySelector("input[name=token]").value="",document.getElementById("pay-now").disabled=!0});const e=document.getElementById("pay-now");(s=document.getElementById("pay-now"))==null||s.addEventListener("click",t=>{let o=document.querySelector("input[name=token]");return e.querySelector("svg").classList.remove("hidden"),e.querySelector("span").classList.add("hidden"),o.value?this.completePaymentUsingToken(t):this.completePaymentWithoutToken(t)})}}function i(){new a().handle()}d()?i():n("#eway-credit-card-payment").then(()=>i()); +>>>>>>>> new_payment_flow:public/build/assets/eway-credit-card-150298fa.js diff --git a/public/build/assets/forte-ach-payment-2f7fa236.js b/public/build/assets/forte-ach-payment-2f7fa236.js index faf0f66ed4a8..177b83dd819f 100644 --- a/public/build/assets/forte-ach-payment-2f7fa236.js +++ b/public/build/assets/forte-ach-payment-2f7fa236.js @@ -1,4 +1,8 @@ +<<<<<<<< HEAD:public/build/assets/forte-ach-payment-2f7fa236.js var a=Object.defineProperty;var s=(t,e,n)=>e in t?a(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n;var o=(t,e,n)=>(s(t,typeof e!="symbol"?e+"":e,n),n);/** +======== +var s=Object.defineProperty;var d=(n,e,t)=>e in n?s(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t;var o=(n,e,t)=>(d(n,typeof e!="symbol"?e+"":e,t),t);import{i,w as u}from"./wait-8f4ae121.js";/** +>>>>>>>> new_payment_flow:public/build/assets/forte-ach-payment-546428ee.js * Invoice Ninja (https://invoiceninja.com) * * @link https://github.com/invoiceninja/invoiceninja source repository diff --git a/public/build/assets/forte-ach-payment-546428ee.js b/public/build/assets/forte-ach-payment-546428ee.js new file mode 100644 index 000000000000..177b83dd819f --- /dev/null +++ b/public/build/assets/forte-ach-payment-546428ee.js @@ -0,0 +1,13 @@ +<<<<<<<< HEAD:public/build/assets/forte-ach-payment-2f7fa236.js +var a=Object.defineProperty;var s=(t,e,n)=>e in t?a(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n;var o=(t,e,n)=>(s(t,typeof e!="symbol"?e+"":e,n),n);/** +======== +var s=Object.defineProperty;var d=(n,e,t)=>e in n?s(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t;var o=(n,e,t)=>(d(n,typeof e!="symbol"?e+"":e,t),t);import{i,w as u}from"./wait-8f4ae121.js";/** +>>>>>>>> new_payment_flow:public/build/assets/forte-ach-payment-546428ee.js + * Invoice Ninja (https://invoiceninja.com) + * + * @link https://github.com/invoiceninja/invoiceninja source repository + * + * @copyright Copyright (c) 2021. Invoice Ninja LLC (https://invoiceninja.com) + * + * @license https://opensource.org/licenses/AAL + */class d{constructor(e){o(this,"handleAuthorization",()=>{var e=document.getElementById("account-number").value,n=document.getElementById("routing-number").value,r={api_login_id:this.apiLoginId,account_number:e,routing_number:n,account_type:"checking"};return document.getElementById("pay-now")&&(document.getElementById("pay-now").disabled=!0,document.querySelector("#pay-now > svg").classList.remove("hidden"),document.querySelector("#pay-now > span").classList.add("hidden")),forte.createToken(r).success(this.successResponseHandler).error(this.failedResponseHandler),!1});o(this,"successResponseHandler",e=>(document.getElementById("payment_token").value=e.onetime_token,document.getElementById("server_response").submit(),!1));o(this,"failedResponseHandler",e=>{var n='
";return document.getElementById("forte_errors").innerHTML=n,document.getElementById("pay-now").disabled=!1,document.querySelector("#pay-now > svg").classList.add("hidden"),document.querySelector("#pay-now > span").classList.remove("hidden"),!1});o(this,"handle",()=>{let e=document.getElementById("pay-now");return e&&e.addEventListener("click",n=>{this.handleAuthorization()}),this});this.apiLoginId=e}}const u=document.querySelector('meta[name="forte-api-login-id"]').content;new d(u).handle(); diff --git a/public/build/assets/forte-credit-card-payment-ea7d8632.js b/public/build/assets/forte-credit-card-payment-ea7d8632.js new file mode 100644 index 000000000000..8ea0882de32d --- /dev/null +++ b/public/build/assets/forte-credit-card-payment-ea7d8632.js @@ -0,0 +1,9 @@ +var c=Object.defineProperty;var l=(n,e,t)=>e in n?c(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t;var a=(n,e,t)=>(l(n,typeof e!="symbol"?e+"":e,t),t);import{i as u,w as m}from"./wait-8f4ae121.js";/** + * Invoice Ninja (https://invoiceninja.com) + * + * @link https://github.com/invoiceninja/invoiceninja source repository + * + * @copyright Copyright (c) 2021. Invoice Ninja LLC (https://invoiceninja.com) + * + * @license https://opensource.org/licenses/AAL + */class p{constructor(e){a(this,"handleAuthorization",()=>{var r,d,o,s;const e={api_login_id:this.apiLoginId,card_number:(r=this.sc.value("number"))==null?void 0:r.replace(/[^\d]/g,""),expire_year:`20${(d=this.sc.value("year"))==null?void 0:d.replace(/[^\d]/g,"")}`,expire_month:(o=this.sc.value("month"))==null?void 0:o.replace(/[^\d]/g,""),cvv:(s=this.sc.value("cvv"))==null?void 0:s.replace(/[^\d]/g,"")};return document.getElementById("pay-now")&&(document.getElementById("pay-now").disabled=!0,document.querySelector("#pay-now > svg").classList.remove("hidden"),document.querySelector("#pay-now > span").classList.add("hidden")),forte.createToken(e).success(this.successResponseHandler).error(this.failedResponseHandler),!1});a(this,"successResponseHandler",e=>(document.getElementById("payment_token").value=e.onetime_token,document.getElementById("card_brand").value=e.card_type,document.getElementById("server_response").submit(),!1));a(this,"failedResponseHandler",e=>{var t='
";return document.getElementById("forte_errors").innerHTML=t,document.getElementById("pay-now").disabled=!1,document.querySelector("#pay-now > svg").classList.add("hidden"),document.querySelector("#pay-now > span").classList.remove("hidden"),!1});a(this,"handle",()=>{let e=document.getElementById("pay-now");return e&&e.addEventListener("click",t=>{this.handleAuthorization()}),this});this.apiLoginId=e,this.cardHolderName=document.getElementById("cardholder_name"),this.sc=createSimpleCard({fields:{card:{number:"#number",date:"#date",cvv:"#cvv"}}}),this.sc.mount()}}function i(){const n=document.querySelector('meta[name="forte-api-login-id"]').content;new p(n).handle()}u()?i():m("#forte-credit-card-payment").then(()=>i()); diff --git a/public/build/assets/mollie-credit-card-d81afbd4.js b/public/build/assets/mollie-credit-card-d81afbd4.js new file mode 100644 index 000000000000..976ecc648d21 --- /dev/null +++ b/public/build/assets/mollie-credit-card-d81afbd4.js @@ -0,0 +1,13 @@ +<<<<<<<< HEAD:public/build/assets/mollie-credit-card-db5c26c6.js +/** +======== +import{i as d,w as l}from"./wait-8f4ae121.js";/** +>>>>>>>> new_payment_flow:public/build/assets/mollie-credit-card-d81afbd4.js + * Invoice Ninja (https://invoiceninja.com). + * + * @link https://github.com/invoiceninja/invoiceninja source repository + * + * @copyright Copyright (c) 2021. Invoice Ninja LLC (https://invoiceninja.com) + * + * @license https://www.elastic.co/licensing/elastic-license + */class a{constructor(){var e,t;this.mollie=Mollie((e=document.querySelector("meta[name=mollie-profileId]"))==null?void 0:e.content,{testmode:(t=document.querySelector("meta[name=mollie-testmode]"))==null?void 0:t.content,locale:"en_US"})}createCardHolderInput(){let e=this.mollie.createComponent("cardHolder");e.mount("#card-holder");let t=document.getElementById("card-holder-error");return e.addEventListener("change",function(n){n.error&&n.touched?t.textContent=n.error:t.textContent=""}),this}createCardNumberInput(){let e=this.mollie.createComponent("cardNumber");e.mount("#card-number");let t=document.getElementById("card-number-error");return e.addEventListener("change",function(n){n.error&&n.touched?t.textContent=n.error:t.textContent=""}),this}createExpiryDateInput(){let e=this.mollie.createComponent("expiryDate");e.mount("#expiry-date");let t=document.getElementById("expiry-date-error");return e.addEventListener("change",function(n){n.error&&n.touched?t.textContent=n.error:t.textContent=""}),this}createCvvInput(){let e=this.mollie.createComponent("verificationCode");e.mount("#cvv");let t=document.getElementById("cvv-error");return e.addEventListener("change",function(n){n.error&&n.touched?t.textContent=n.error:t.textContent=""}),this}handlePayNowButton(){if(document.getElementById("pay-now").disabled=!0,document.querySelector("input[name=token]").value!=="")return document.querySelector("input[name=gateway_response]").value="",document.getElementById("server-response").submit();this.mollie.createToken().then(function(e){let t=e.token,n=e.error;if(n){document.getElementById("pay-now").disabled=!1;let o=document.getElementById("errors");o.innerText=n.message,o.hidden=!1;return}let r=document.querySelector('input[name="token-billing-checkbox"]:checked');r&&(document.querySelector('input[name="store_card"]').value=r.value),document.querySelector("input[name=gateway_response]").value=t,document.querySelector("input[name=token]").value="",document.getElementById("server-response").submit()})}handle(){this.createCardHolderInput().createCardNumberInput().createExpiryDateInput().createCvvInput(),Array.from(document.getElementsByClassName("toggle-payment-with-token")).forEach(e=>e.addEventListener("click",t=>{document.getElementById("mollie--payment-container").classList.add("hidden"),document.getElementById("save-card--container").style.display="none",document.querySelector("input[name=token]").value=t.target.dataset.token})),document.getElementById("toggle-payment-with-credit-card").addEventListener("click",e=>{document.getElementById("mollie--payment-container").classList.remove("hidden"),document.getElementById("save-card--container").style.display="grid",document.querySelector("input[name=token]").value=""}),document.getElementById("pay-now").addEventListener("click",()=>this.handlePayNowButton())}}new a().handle(); diff --git a/public/build/assets/mollie-credit-card-db5c26c6.js b/public/build/assets/mollie-credit-card-db5c26c6.js index c822f500bafa..976ecc648d21 100644 --- a/public/build/assets/mollie-credit-card-db5c26c6.js +++ b/public/build/assets/mollie-credit-card-db5c26c6.js @@ -1,4 +1,8 @@ +<<<<<<<< HEAD:public/build/assets/mollie-credit-card-db5c26c6.js /** +======== +import{i as d,w as l}from"./wait-8f4ae121.js";/** +>>>>>>>> new_payment_flow:public/build/assets/mollie-credit-card-d81afbd4.js * Invoice Ninja (https://invoiceninja.com). * * @link https://github.com/invoiceninja/invoiceninja source repository diff --git a/public/build/assets/paytrace-credit-card-d29797c1.js b/public/build/assets/paytrace-credit-card-d29797c1.js new file mode 100644 index 000000000000..7052cba6938d --- /dev/null +++ b/public/build/assets/paytrace-credit-card-d29797c1.js @@ -0,0 +1,9 @@ +import{i as o,w as i}from"./wait-8f4ae121.js";/** + * Invoice Ninja (https://invoiceninja.com). + * + * @link https://github.com/invoiceninja/invoiceninja source repository + * + * @copyright Copyright (c) 2021. Invoice Ninja LLC (https://invoiceninja.com) + * + * @license https://www.elastic.co/licensing/elastic-license + */class l{constructor(){var t;this.clientKey=(t=document.querySelector("meta[name=paytrace-client-key]"))==null?void 0:t.content}get creditCardStyles(){return{font_color:"#000",border_color:"#a1b1c9",border_style:"dotted",font_size:"13pt",input_border_radius:"3px",input_border_width:"1px",input_font:"Times New Roman, arial, fantasy",input_font_weight:"400",input_margin:"5px 0px 5px 0px",input_padding:"0px 5px 0px 5px",label_color:"#a0aec0",label_size:"16px",label_width:"150px",label_font:"Times New Roman, sans-serif, serif",label_font_weight:"light",label_margin:"5px 0px 0px 0px",label_padding:"0px 5px 0px 5px",background_color:"white",height:"30px",width:"370px",padding_bottom:"0px"}}get codeStyles(){return{font_color:"#000",border_color:"#a1b1c9",border_style:"dotted",font_size:"13pt",input_border_radius:"2px",input_border_width:"1px",input_font:"serif, cursive, fantasy",input_font_weight:"700",input_margin:"5px 0px 5px 20px",input_padding:"0px 5px 0px 5px",label_color:"#a0aec0",label_size:"16px",label_width:"150px",label_font:"sans-serif, arial, serif",label_font_weight:"bold",label_margin:"5px 0px 0px 20px",label_padding:"2px 5px 2px 5px",background_color:"white",height:"30px",width:"150px",padding_bottom:"2px"}}get expStyles(){return{font_color:"#000",border_color:"#a1b1c9",border_style:"dashed",font_size:"12pt",input_border_radius:"0px",input_border_width:"2px",input_font:"arial, cursive, fantasy",input_font_weight:"400",input_margin:"5px 0px 5px 0px",input_padding:"0px 5px 0px 5px",label_color:"#a0aec0",label_size:"16px",label_width:"150px",label_font:"arial, fantasy, serif",label_font_weight:"normal",label_margin:"5px 0px 0px 0px",label_padding:"2px 5px 2px 5px",background_color:"white",height:"30px",width:"85px",padding_bottom:"2px",type:"dropdown"}}updatePayTraceLabels(){window.PTPayment.getControl("securityCode").label.text(document.querySelector("meta[name=ctrans-cvv]").content),window.PTPayment.getControl("creditCard").label.text(document.querySelector("meta[name=ctrans-card_number]").content),window.PTPayment.getControl("expiration").label.text(document.querySelector("meta[name=ctrans-expires]").content)}setupPayTrace(){return window.PTPayment.setup({styles:{code:this.codeStyles,cc:this.creditCardStyles,exp:this.expStyles},authorization:{clientKey:this.clientKey}})}handlePaymentWithCreditCard(t){const e=document.getElementById("pay-now");e.querySelector("svg").classList.remove("hidden"),e.querySelector("span").classList.add("hidden"),t.target.parentElement.disabled=!0,document.getElementById("errors").hidden=!0,window.PTPayment.validate(a=>{if(a.length>=1){let n=document.getElementById("errors");return n.textContent=a[0].description,n.hidden=!1,e.querySelector("svg").classList.add("hidden"),e.querySelector("span").classList.remove("hidden"),t.target.parentElement.disabled=!1}this.ptInstance.process().then(n=>{document.getElementById("HPF_Token").value=n.message.hpf_token,document.getElementById("enc_key").value=n.message.enc_key;let r=document.querySelector('input[name="token-billing-checkbox"]:checked');r&&(document.querySelector('input[name="store_card"]').value=r.value),document.getElementById("server_response").submit()}).catch(n=>{document.getElementById("errors").textContent=JSON.stringify(n),document.getElementById("errors").hidden=!1,e.querySelector("svg").classList.add("hidden"),e.querySelector("span").classList.remove("hidden"),console.log(n)})})}handlePaymentWithToken(t){t.target.parentElement.disabled=!0;const e=document.getElementById("pay-now");e.querySelector("svg").classList.remove("hidden"),e.querySelector("span").classList.add("hidden"),document.getElementById("server_response").submit()}handle(){var t;Array.from(document.getElementsByClassName("toggle-payment-with-token")).forEach(e=>e.addEventListener("click",a=>{document.getElementById("paytrace--credit-card-container").classList.add("hidden"),document.getElementById("save-card--container").style.display="none",document.querySelector("input[name=token]").value=a.target.dataset.token})),(t=document.getElementById("toggle-payment-with-credit-card"))==null||t.addEventListener("click",e=>{document.getElementById("paytrace--credit-card-container").classList.remove("hidden"),document.getElementById("save-card--container").style.display="grid",document.querySelector("input[name=token]").value="",this.setupPayTrace().then(a=>{this.ptInstance=a,this.updatePayTraceLabels()})}),document.getElementById("pay-now").addEventListener("click",e=>document.querySelector("input[name=token]").value===""?this.handlePaymentWithCreditCard(e):this.handlePaymentWithToken(e)),Array.from(document.getElementsByClassName("toggle-payment-with-token")).length===0&&!o()&&document.getElementById("toggle-payment-with-credit-card").click()}}function d(){new l().handle()}o()?d():i("#paytrace-credit-card-payment").then(()=>d()); diff --git a/public/build/assets/razorpay-aio-f8e8c7f0.js b/public/build/assets/razorpay-aio-f8e8c7f0.js new file mode 100644 index 000000000000..9031d5887707 --- /dev/null +++ b/public/build/assets/razorpay-aio-f8e8c7f0.js @@ -0,0 +1,9 @@ +import{i,w as d}from"./wait-8f4ae121.js";/** + * Invoice Ninja (https://invoiceninja.com). + * + * @link https://github.com/invoiceninja/invoiceninja source repository + * + * @copyright Copyright (c) 2021. Invoice Ninja LLC (https://invoiceninja.com) + * + * @license https://www.elastic.co/licensing/elastic-license + */function o(){var a;let e=JSON.parse((a=document.querySelector("meta[name=razorpay-options]"))==null?void 0:a.content);e.handler=function(n){document.getElementById("razorpay_payment_id").value=n.razorpay_payment_id,document.getElementById("razorpay_signature").value=n.razorpay_signature,document.getElementById("server-response").submit()},e.modal={ondismiss:function(){t.disabled=!1}};let r=new Razorpay(e),t=document.getElementById("pay-now");t.onclick=function(n){t.disabled=!0,r.open()}}i()?o():d("#razorpay-hosted-payment").then(()=>o()); diff --git a/public/build/assets/square-credit-card-2fc5c3fa.js b/public/build/assets/square-credit-card-2fc5c3fa.js new file mode 100644 index 000000000000..3a391af71533 --- /dev/null +++ b/public/build/assets/square-credit-card-2fc5c3fa.js @@ -0,0 +1,13 @@ +<<<<<<<< HEAD:public/build/assets/square-credit-card-a20464a3.js +/** +======== +import{i,w as d}from"./wait-8f4ae121.js";/** +>>>>>>>> new_payment_flow:public/build/assets/square-credit-card-2fc5c3fa.js + * Invoice Ninja (https://invoiceninja.com). + * + * @link https://github.com/invoiceninja/invoiceninja source repository + * + * @copyright Copyright (c) 2021. Invoice Ninja LLC (https://invoiceninja.com) + * + * @license https://www.elastic.co/licensing/elastic-license + */class c{constructor(){this.appId=document.querySelector("meta[name=square-appId]").content,this.locationId=document.querySelector("meta[name=square-locationId]").content,this.isLoaded=!1}async init(){this.payments=Square.payments(this.appId,this.locationId),this.card=await this.payments.card(),await this.card.attach("#card-container"),this.isLoaded=!0;let e=document.querySelector(".sq-card-iframe-container");e&&e.setAttribute("style","150px !important"),document.querySelector(".toggle-payment-with-token")&&document.getElementById("card-container").classList.add("hidden")}async completePaymentWithoutToken(e){document.getElementById("errors").hidden=!0,e.target.parentElement.disabled=!0;let t=await this.card.tokenize(),o;try{const n={amount:document.querySelector("meta[name=amount]").content,billingContact:JSON.parse(document.querySelector("meta[name=square_contact]").content),currencyCode:document.querySelector("meta[name=currencyCode]").content,intent:"CHARGE"};o=(await this.payments.verifyBuyer(t.token,n)).token}catch{e.target.parentElement.disabled=!0}if(document.querySelector('input[name="verificationToken"]').value=o,t.status==="OK"){document.getElementById("sourceId").value=t.token;let n=document.querySelector('input[name="token-billing-checkbox"]:checked');return n&&(document.querySelector('input[name="store_card"]').value=n.value),document.getElementById("server_response").submit()}document.getElementById("errors").textContent=t.errors[0].message,document.getElementById("errors").hidden=!1,e.target.parentElement.disabled=!1}async completePaymentUsingToken(e){return e.target.parentElement.disabled=!0,document.getElementById("server_response").submit()}async verifyBuyer(e){const t={amount:document.querySelector("meta[name=amount]").content,billingContact:document.querySelector("meta[name=square_contact]").content,currencyCode:document.querySelector("meta[name=currencyCode]").content,intent:"CHARGE"};return(await this.payments.verifyBuyer(e,t)).token}async handle(){document.getElementById("payment-list").classList.add("hidden"),await this.init().then(()=>{var e,t,o,n;(e=document.getElementById("authorize-card"))==null||e.addEventListener("click",a=>this.completePaymentWithoutToken(a)),(t=document.getElementById("pay-now"))==null||t.addEventListener("click",a=>document.querySelector("input[name=token]").value?this.completePaymentUsingToken(a):this.completePaymentWithoutToken(a)),Array.from(document.getElementsByClassName("toggle-payment-with-token")).forEach(a=>a.addEventListener("click",async r=>{document.getElementById("card-container").classList.add("hidden"),document.getElementById("save-card--container").style.display="none",document.querySelector("input[name=token]").value=r.target.dataset.token})),(o=document.getElementById("toggle-payment-with-credit-card"))==null||o.addEventListener("click",async a=>{document.getElementById("card-container").classList.remove("hidden"),document.getElementById("save-card--container").style.display="grid",document.querySelector("input[name=token]").value=""}),document.getElementById("loader").classList.add("hidden"),document.getElementById("payment-list").classList.remove("hidden"),(n=document.getElementById("toggle-payment-with-credit-card"))==null||n.click()})}}new c().handle(); diff --git a/public/build/assets/square-credit-card-a20464a3.js b/public/build/assets/square-credit-card-a20464a3.js index 11597eeaf5a8..3a391af71533 100644 --- a/public/build/assets/square-credit-card-a20464a3.js +++ b/public/build/assets/square-credit-card-a20464a3.js @@ -1,4 +1,8 @@ +<<<<<<<< HEAD:public/build/assets/square-credit-card-a20464a3.js /** +======== +import{i,w as d}from"./wait-8f4ae121.js";/** +>>>>>>>> new_payment_flow:public/build/assets/square-credit-card-2fc5c3fa.js * Invoice Ninja (https://invoiceninja.com). * * @link https://github.com/invoiceninja/invoiceninja source repository diff --git a/public/build/assets/stripe-ach-pay-22d14901.js b/public/build/assets/stripe-ach-pay-22d14901.js new file mode 100644 index 000000000000..afc3ee0a621e --- /dev/null +++ b/public/build/assets/stripe-ach-pay-22d14901.js @@ -0,0 +1,9 @@ +import{w as g}from"./wait-8f4ae121.js";/** + * Invoice Ninja (https://invoiceninja.com). + * + * @link https://github.com/invoiceninja/invoiceninja source repository + * + * @copyright Copyright (c) 2024. Invoice Ninja LLC (https://invoiceninja.com) + * + * @license https://www.elastic.co/licensing/elastic-license + */g("#stripe-ach-payment").then(()=>f());function f(){let d=document.getElementById("pay-now");d&&(Array.from(document.getElementsByClassName("toggle-payment-with-token")).forEach(e=>e.addEventListener("click",n=>{document.querySelector("input[name=source]").value=n.target.dataset.token})),d.addEventListener("click",function(){let e=document.getElementById("pay-now");e.disabled=!0,e.querySelector("svg").classList.remove("hidden"),e.querySelector("span").classList.add("hidden"),document.getElementById("server-response").submit()})),document.getElementById("new-bank").addEventListener("click",e=>{var m,y;if(!document.getElementById("accept-terms").checked){errors.textContent="You must accept the mandate terms prior to making payment.",errors.hidden=!1;return}errors.hidden=!0;let n,t=document.querySelector('meta[name="stripe-publishable-key"]').content,o=(m=document.querySelector('meta[name="stripe-account-id"]'))==null?void 0:m.content;o?n=Stripe(t,{stripeAccount:o}):n=Stripe(t);let s=document.getElementById("new-bank");s.disabled=!0,s.querySelector("svg").classList.remove("hidden"),s.querySelector("span").classList.add("hidden"),e.preventDefault();const c=document.getElementById("account-holder-name-field"),r=document.getElementById("email-field"),u=(y=document.querySelector('meta[name="client_secret"]'))==null?void 0:y.content;n.collectBankAccountForPayment({clientSecret:u,params:{payment_method_type:"us_bank_account",payment_method_data:{billing_details:{name:c.value,email:r.value}}},expand:["payment_method"]}).then(({paymentIntent:i,error:l})=>{if(l)console.error(l.message),errors.textContent=l.message,errors.hidden=!1,a();else if(i.status==="requires_payment_method"){errors.textContent="We were unable to process the payment with this account, please try another one.",errors.hidden=!1,a();return}else if(i.status==="requires_confirmation"){let h=document.getElementById("bank_account_response");h.value=JSON.stringify(i),p(n,u)}a()})});function p(e,n){e.confirmUsBankAccountPayment(n).then(({paymentIntent:t,error:o})=>{var s,c;if(console.log(t),o)console.error(o.message);else if(t.status==="requires_payment_method")errors.textContent="We were unable to process the payment with this account, please try another one.",errors.hidden=!1,a();else if(t.status==="processing"){let r=document.getElementById("gateway_response");r.value=JSON.stringify(t),document.getElementById("server-response").submit()}else if(((s=t.next_action)==null?void 0:s.type)==="verify_with_microdeposits"||((c=t.next_action)==null?void 0:c.type)==="requires_source_action"){errors.textContent="You will receive an email with details on how to verify your bank account and process payment.",errors.hidden=!1,document.getElementById("new-bank").style.visibility="hidden";let r=document.getElementById("gateway_response");r.value=JSON.stringify(t),document.getElementById("server-response").submit()}})}function a(){let e=document.getElementById("new-bank");e.disabled=!1,e.querySelector("svg").classList.add("hidden"),e.querySelector("span").classList.remove("hidden")}} diff --git a/public/build/assets/stripe-acss-1184fda8.js b/public/build/assets/stripe-acss-1184fda8.js new file mode 100644 index 000000000000..986c2dc895ad --- /dev/null +++ b/public/build/assets/stripe-acss-1184fda8.js @@ -0,0 +1,13 @@ +<<<<<<<< HEAD:public/build/assets/stripe-acss-946fe54a.js +var c=Object.defineProperty;var i=(n,e,t)=>e in n?c(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t;var r=(n,e,t)=>(i(n,typeof e!="symbol"?e+"":e,t),t);/** +======== +var d=Object.defineProperty;var c=(o,e,t)=>e in o?d(o,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):o[e]=t;var a=(o,e,t)=>(c(o,typeof e!="symbol"?e+"":e,t),t);import{i,w as l}from"./wait-8f4ae121.js";/** +>>>>>>>> new_payment_flow:public/build/assets/stripe-acss-1184fda8.js + * Invoice Ninja (https://invoiceninja.com) + * + * @link https://github.com/invoiceninja/invoiceninja source repository + * + * @copyright Copyright (c) 2021. Invoice Ninja LLC (https://invoiceninja.com) + * + * @license https://www.elastic.co/licensing/elastic-license + */class l{constructor(e,t){r(this,"setupStripe",()=>(this.stripeConnect?this.stripe=Stripe(this.key,{stripeAccount:this.stripeConnect}):this.stripe=Stripe(this.key),this));r(this,"handle",()=>{Array.from(document.getElementsByClassName("toggle-payment-with-token")).forEach(e=>e.addEventListener("click",t=>{document.querySelector("input[name=token]").value=t.target.dataset.token,console.log(t.target.dataset.token)})),document.getElementById("toggle-payment-with-new-account")&&document.getElementById("toggle-payment-with-new-account").addEventListener("click",e=>{document.getElementById("save-card--container").style.display="grid",document.querySelector("input[name=token]").value=""}),document.getElementById("pay-now-with-token")?document.getElementById("pay-now-with-token").addEventListener("click",e=>{document.querySelector("input[name=token]").value,document.getElementById("pay-now-with-token").disabled=!0,document.querySelector("#pay-now-with-token > svg").classList.remove("hidden"),document.querySelector("#pay-now-with-token > span").classList.add("hidden"),document.getElementById("server-response").submit()}):document.getElementById("pay-now").addEventListener("click",e=>{let t=document.querySelector('input[name="token-billing-checkbox"]:checked');t&&(document.querySelector('input[name="store_card"]').value=t.value);let o=document.getElementById("errors");if(o.textContent="",o.hidden=!0,document.getElementById("acss-name").value===""){document.getElementById("acss-name").focus(),o.textContent=document.querySelector("meta[name=translation-name-required]").content,o.hidden=!1;return}if(document.getElementById("acss-email-address").value===""){document.getElementById("acss-email-address").focus(),o.textContent=document.querySelector("meta[name=translation-email-required]").content,o.hidden=!1;return}document.getElementById("pay-now").disabled=!0,document.querySelector("#pay-now > svg").classList.remove("hidden"),document.querySelector("#pay-now > span").classList.add("hidden"),this.stripe.confirmAcssDebitPayment(document.querySelector("meta[name=pi-client-secret").content,{payment_method:{billing_details:{name:document.getElementById("acss-name").value,email:document.getElementById("acss-email-address").value}}}).then(s=>s.error?this.handleFailure(s.error.message):this.handleSuccess(s))})});this.key=e,this.errors=document.getElementById("errors"),this.stripeConnect=t}handleSuccess(e){document.querySelector('input[name="gateway_response"]').value=JSON.stringify(e.paymentIntent),document.getElementById("server-response").submit()}handleFailure(e){let t=document.getElementById("errors");t.textContent="",t.textContent=e,t.hidden=!1,document.getElementById("pay-now").disabled=!1,document.querySelector("#pay-now > svg").classList.add("hidden"),document.querySelector("#pay-now > span").classList.remove("hidden")}}var a;const m=((a=document.querySelector('meta[name="stripe-publishable-key"]'))==null?void 0:a.content)??"";var d;const u=((d=document.querySelector('meta[name="stripe-account-id"]'))==null?void 0:d.content)??"";new l(m,u).setupStripe().handle(); diff --git a/public/build/assets/stripe-acss-946fe54a.js b/public/build/assets/stripe-acss-946fe54a.js index 8b12e28c4d42..986c2dc895ad 100644 --- a/public/build/assets/stripe-acss-946fe54a.js +++ b/public/build/assets/stripe-acss-946fe54a.js @@ -1,4 +1,8 @@ +<<<<<<<< HEAD:public/build/assets/stripe-acss-946fe54a.js var c=Object.defineProperty;var i=(n,e,t)=>e in n?c(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t;var r=(n,e,t)=>(i(n,typeof e!="symbol"?e+"":e,t),t);/** +======== +var d=Object.defineProperty;var c=(o,e,t)=>e in o?d(o,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):o[e]=t;var a=(o,e,t)=>(c(o,typeof e!="symbol"?e+"":e,t),t);import{i,w as l}from"./wait-8f4ae121.js";/** +>>>>>>>> new_payment_flow:public/build/assets/stripe-acss-1184fda8.js * Invoice Ninja (https://invoiceninja.com) * * @link https://github.com/invoiceninja/invoiceninja source repository diff --git a/public/build/assets/stripe-alipay-00a4a19f.js b/public/build/assets/stripe-alipay-00a4a19f.js index 1aa7a164b732..20e883f94734 100644 --- a/public/build/assets/stripe-alipay-00a4a19f.js +++ b/public/build/assets/stripe-alipay-00a4a19f.js @@ -1,4 +1,8 @@ +<<<<<<<< HEAD:public/build/assets/stripe-alipay-00a4a19f.js var i=Object.defineProperty;var c=(n,e,t)=>e in n?i(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t;var r=(n,e,t)=>(c(n,typeof e!="symbol"?e+"":e,t),t);/** +======== +var i=Object.defineProperty;var c=(n,e,t)=>e in n?i(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t;var r=(n,e,t)=>(c(n,typeof e!="symbol"?e+"":e,t),t);import{i as a,w as d}from"./wait-8f4ae121.js";/** +>>>>>>>> new_payment_flow:public/build/assets/stripe-alipay-1457b63d.js * Invoice Ninja (https://invoiceninja.com) * * @link https://github.com/invoiceninja/invoiceninja source repository diff --git a/public/build/assets/stripe-alipay-1457b63d.js b/public/build/assets/stripe-alipay-1457b63d.js new file mode 100644 index 000000000000..20e883f94734 --- /dev/null +++ b/public/build/assets/stripe-alipay-1457b63d.js @@ -0,0 +1,13 @@ +<<<<<<<< HEAD:public/build/assets/stripe-alipay-00a4a19f.js +var i=Object.defineProperty;var c=(n,e,t)=>e in n?i(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t;var r=(n,e,t)=>(c(n,typeof e!="symbol"?e+"":e,t),t);/** +======== +var i=Object.defineProperty;var c=(n,e,t)=>e in n?i(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t;var r=(n,e,t)=>(c(n,typeof e!="symbol"?e+"":e,t),t);import{i as a,w as d}from"./wait-8f4ae121.js";/** +>>>>>>>> new_payment_flow:public/build/assets/stripe-alipay-1457b63d.js + * Invoice Ninja (https://invoiceninja.com) + * + * @link https://github.com/invoiceninja/invoiceninja source repository + * + * @copyright Copyright (c) 2021. Invoice Ninja LLC (https://invoiceninja.com) + * + * @license https://www.elastic.co/licensing/elastic-license + */class a{constructor(e,t){r(this,"setupStripe",()=>(this.stripeConnect?this.stripe=Stripe(this.key,{stripeAccount:this.stripeConnect}):this.stripe=Stripe(this.key),this));this.key=e,this.stripeConnect=t,this.errors=document.getElementById("errors")}async handle(){document.getElementById("pay-now").addEventListener("click",async e=>{document.getElementById("pay-now").disabled=!0,document.querySelector("#pay-now > svg").classList.add("hidden"),document.querySelector("#pay-now > span").classList.remove("hidden");const{error:t}=await this.stripe.confirmAlipayPayment(document.querySelector("meta[name=ci_intent]").content,{return_url:`${document.querySelector("meta[name=return_url]").content}`});document.getElementById("pay-now").disabled=!1,document.querySelector("#pay-now > svg").classList.remove("hidden"),document.querySelector("#pay-now > span").classList.add("hidden"),t&&(this.errors.textContent="",this.errors.textContent=result.error.message,this.errors.hidden=!1)})}}var s;const d=((s=document.querySelector('meta[name="stripe-publishable-key"]'))==null?void 0:s.content)??"";var o;const l=((o=document.querySelector('meta[name="stripe-account-id"]'))==null?void 0:o.content)??"";new a(d,l).setupStripe().handle(); diff --git a/public/build/assets/stripe-bacs-425cb13e.js b/public/build/assets/stripe-bacs-425cb13e.js new file mode 100644 index 000000000000..38799a268fa6 --- /dev/null +++ b/public/build/assets/stripe-bacs-425cb13e.js @@ -0,0 +1,9 @@ +var c=Object.defineProperty;var d=(n,e,t)=>e in n?c(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t;var o=(n,e,t)=>(d(n,typeof e!="symbol"?e+"":e,t),t);import{i as u,w as l}from"./wait-8f4ae121.js";/** + * Invoice Ninja (https://invoiceninja.com) + * + * @link https://github.com/invoiceninja/invoiceninja source repository + * + * @copyright Copyright (c) 2021. Invoice Ninja LLC (https://invoiceninja.com) + * + * @license https://www.elastic.co/licensing/elastic-license + */class h{constructor(e,t,s){o(this,"setupStripe",()=>(this.stripeConnect?this.stripe=Stripe(this.key,{stripeAccount:this.stripeConnect}):this.stripe=Stripe(this.key),this));o(this,"payment_data");o(this,"handle",()=>{this.onlyAuthorization?document.getElementById("authorize-bacs").addEventListener("click",e=>{document.getElementById("authorize-bacs").disabled=!0,document.querySelector("#authorize-bacs > svg").classList.remove("hidden"),document.querySelector("#authorize-bacs > span").classList.add("hidden"),location.href=document.querySelector("meta[name=stripe-redirect-url]").content}):(this.payNowButton=document.getElementById("pay-now"),document.getElementById("pay-now").addEventListener("click",e=>{this.payNowButton.disabled=!0,this.payNowButton.querySelector("svg").classList.remove("hidden"),this.payNowButton.querySelector("span").classList.add("hidden"),document.getElementById("server-response").submit()}),this.payment_data=Array.from(document.getElementsByClassName("toggle-payment-with-token")),this.payment_data.length>0?this.payment_data.forEach(e=>e.addEventListener("click",t=>{document.querySelector("input[name=token]").value=t.target.dataset.token})):(this.errors.textContent=document.querySelector("meta[name=translation-payment-method-required]").content,this.errors.hidden=!1,this.payNowButton.disabled=!0,this.payNowButton.querySelector("span").classList.remove("hidden"),this.payNowButton.querySelector("svg").classList.add("hidden")))});this.key=e,this.errors=document.getElementById("errors"),this.stripeConnect=t,this.onlyAuthorization=s}}function a(){var s,i,r;const n=((s=document.querySelector('meta[name="stripe-publishable-key"]'))==null?void 0:s.content)??"",e=((i=document.querySelector('meta[name="stripe-account-id"]'))==null?void 0:i.content)??"",t=((r=document.querySelector('meta[name="only-authorization"]'))==null?void 0:r.content)??"";new h(n,e,t).setupStripe().handle()}u()?a():l("#stripe-bacs-payment").then(()=>a()); diff --git a/public/build/assets/stripe-bancontact-4a0d7a40.js b/public/build/assets/stripe-bancontact-4a0d7a40.js new file mode 100644 index 000000000000..bb49bc04a6b9 --- /dev/null +++ b/public/build/assets/stripe-bancontact-4a0d7a40.js @@ -0,0 +1,9 @@ +var s=Object.defineProperty;var a=(n,t,e)=>t in n?s(n,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):n[t]=e;var r=(n,t,e)=>(a(n,typeof t!="symbol"?t+"":t,e),e);import{i,w as m}from"./wait-8f4ae121.js";/** + * Invoice Ninja (https://invoiceninja.com) + * + * @link https://github.com/invoiceninja/invoiceninja source repository + * + * @copyright Copyright (c) 2021. Invoice Ninja LLC (https://invoiceninja.com) + * + * @license https://www.elastic.co/licensing/elastic-license + */class l{constructor(t,e){r(this,"setupStripe",()=>(this.stripeConnect?this.stripe=Stripe(this.key,{stripeAccount:this.stripeConnect}):this.stripe=Stripe(this.key),this));r(this,"handle",()=>{document.getElementById("pay-now").addEventListener("click",t=>{let e=document.getElementById("errors");if(!document.getElementById("bancontact-name").value){e.textContent=document.querySelector("meta[name=translation-name-required]").content,e.hidden=!1,console.log("name");return}document.getElementById("pay-now").disabled=!0,document.querySelector("#pay-now > svg").classList.remove("hidden"),document.querySelector("#pay-now > span").classList.add("hidden"),this.stripe.confirmBancontactPayment(document.querySelector("meta[name=pi-client-secret").content,{payment_method:{billing_details:{name:document.getElementById("bancontact-name").value}},return_url:document.querySelector('meta[name="return-url"]').content})})});this.key=t,this.errors=document.getElementById("errors"),this.stripeConnect=e}}function c(){var e,o;const n=((e=document.querySelector('meta[name="stripe-publishable-key"]'))==null?void 0:e.content)??"",t=((o=document.querySelector('meta[name="stripe-account-id"]'))==null?void 0:o.content)??"";new l(n,t).setupStripe().handle()}i()?c():m("#stripe-bancontact-payment").then(()=>c()); diff --git a/public/build/assets/stripe-bank-transfer-4ab58b35.js b/public/build/assets/stripe-bank-transfer-4ab58b35.js new file mode 100644 index 000000000000..c723f15b55f7 --- /dev/null +++ b/public/build/assets/stripe-bank-transfer-4ab58b35.js @@ -0,0 +1,9 @@ +import{i as p,w as y}from"./wait-8f4ae121.js";/** + * Invoice Ninja (https://invoiceninja.com). + * + * @link https://github.com/invoiceninja/invoiceninja source repository + * + * @copyright Copyright (c) 2024. Invoice Ninja LLC (https://invoiceninja.com) + * + * @license https://www.elastic.co/licensing/elastic-license + */p()?c():y("#stripe-bank-transfer-payment").then(()=>c());function c(){var r,o,s;const m=(r=document.querySelector('meta[name="stripe-client-secret"]'))==null?void 0:r.content,i=(o=document.querySelector('meta[name="stripe-return-url"]'))==null?void 0:o.content,d={clientSecret:m,appearance:{theme:"stripe",variables:{colorPrimary:"#0570de",colorBackground:"#ffffff",colorText:"#30313d",colorDanger:"#df1b41",fontFamily:"Ideal Sans, system-ui, sans-serif",spacingUnit:"2px",borderRadius:"4px"}}},e=Stripe(document.querySelector('meta[name="stripe-publishable-key"]').getAttribute("content")),t=((s=document.querySelector('meta[name="stripe-account-id"]'))==null?void 0:s.content)??"";t&&(e.stripeAccount=t);const n=e.elements(d);n.create("payment").mount("#payment-element"),document.getElementById("payment-form").addEventListener("submit",async l=>{l.preventDefault(),document.getElementById("pay-now").disabled=!0,document.querySelector("#pay-now > svg").classList.add("hidden"),document.querySelector("#pay-now > span").classList.remove("hidden");const{error:a}=await e.confirmPayment({elements:n,confirmParams:{return_url:i}});if(a){document.getElementById("pay-now").disabled=!1,document.querySelector("svg").classList.remove("hidden"),document.querySelector("span").classList.add("hidden");const u=document.querySelector("#errors");u.textContent=a.message}})} diff --git a/public/build/assets/stripe-becs-483b1b23.js b/public/build/assets/stripe-becs-483b1b23.js new file mode 100644 index 000000000000..a8eaaa8624e0 --- /dev/null +++ b/public/build/assets/stripe-becs-483b1b23.js @@ -0,0 +1,13 @@ +<<<<<<<< HEAD:public/build/assets/stripe-becs-4d1494ed.js +var r=Object.defineProperty;var d=(n,t,e)=>t in n?r(n,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):n[t]=e;var o=(n,t,e)=>(d(n,typeof t!="symbol"?t+"":t,e),e);/** +======== +var c=Object.defineProperty;var r=(n,t,e)=>t in n?c(n,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):n[t]=e;var o=(n,t,e)=>(r(n,typeof t!="symbol"?t+"":t,e),e);import{i,w as d}from"./wait-8f4ae121.js";/** +>>>>>>>> new_payment_flow:public/build/assets/stripe-becs-483b1b23.js + * Invoice Ninja (https://invoiceninja.com) + * + * @link https://github.com/invoiceninja/invoiceninja source repository + * + * @copyright Copyright (c) 2021. Invoice Ninja LLC (https://invoiceninja.com) + * + * @license https://www.elastic.co/licensing/elastic-license + */class i{constructor(t,e){o(this,"setupStripe",()=>{this.stripeConnect?this.stripe=Stripe(this.key,{stripeAccount:this.stripeConnect}):this.stripe=Stripe(this.key);const t=this.stripe.elements(),s={style:{base:{color:"#32325d",fontSize:"16px","::placeholder":{color:"#aab7c4"},":-webkit-autofill":{color:"#32325d"}},invalid:{color:"#fa755a",iconColor:"#fa755a",":-webkit-autofill":{color:"#fa755a"}}},disabled:!1,hideIcon:!1,iconStyle:"default"};return this.auBankAccount=t.create("auBankAccount",s),this.auBankAccount.mount("#becs-iban"),this});o(this,"handle",()=>{document.getElementById("pay-now").addEventListener("click",t=>{let e=document.getElementById("errors");if(document.getElementById("becs-name").value===""){document.getElementById("becs-name").focus(),e.textContent=document.querySelector("meta[name=translation-name-required]").content,e.hidden=!1;return}if(document.getElementById("becs-email-address").value===""){document.getElementById("becs-email-address").focus(),e.textContent=document.querySelector("meta[name=translation-email-required]").content,e.hidden=!1;return}if(!document.getElementById("becs-mandate-acceptance").checked){document.getElementById("becs-mandate-acceptance").focus(),e.textContent=document.querySelector("meta[name=translation-terms-required]").content,e.hidden=!1,console.log("Terms");return}document.getElementById("pay-now").disabled=!0,document.querySelector("#pay-now > svg").classList.remove("hidden"),document.querySelector("#pay-now > span").classList.add("hidden"),this.stripe.confirmAuBecsDebitPayment(document.querySelector("meta[name=pi-client-secret").content,{payment_method:{au_becs_debit:this.auBankAccount,billing_details:{name:document.getElementById("becs-name").value,email:document.getElementById("becs-email-address").value}}}).then(s=>s.error?this.handleFailure(s.error.message):this.handleSuccess(s))})});this.key=t,this.errors=document.getElementById("errors"),this.stripeConnect=e}handleSuccess(t){document.querySelector('input[name="gateway_response"]').value=JSON.stringify(t.paymentIntent),document.getElementById("server-response").submit()}handleFailure(t){let e=document.getElementById("errors");e.textContent="",e.textContent=t,e.hidden=!1,document.getElementById("pay-now").disabled=!1,document.querySelector("#pay-now > svg").classList.add("hidden"),document.querySelector("#pay-now > span").classList.remove("hidden")}}var a;const l=((a=document.querySelector('meta[name="stripe-publishable-key"]'))==null?void 0:a.content)??"";var c;const m=((c=document.querySelector('meta[name="stripe-account-id"]'))==null?void 0:c.content)??"";new i(l,m).setupStripe().handle(); diff --git a/public/build/assets/stripe-becs-4d1494ed.js b/public/build/assets/stripe-becs-4d1494ed.js index 9dede5b9728a..a8eaaa8624e0 100644 --- a/public/build/assets/stripe-becs-4d1494ed.js +++ b/public/build/assets/stripe-becs-4d1494ed.js @@ -1,4 +1,8 @@ +<<<<<<<< HEAD:public/build/assets/stripe-becs-4d1494ed.js var r=Object.defineProperty;var d=(n,t,e)=>t in n?r(n,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):n[t]=e;var o=(n,t,e)=>(d(n,typeof t!="symbol"?t+"":t,e),e);/** +======== +var c=Object.defineProperty;var r=(n,t,e)=>t in n?c(n,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):n[t]=e;var o=(n,t,e)=>(r(n,typeof t!="symbol"?t+"":t,e),e);import{i,w as d}from"./wait-8f4ae121.js";/** +>>>>>>>> new_payment_flow:public/build/assets/stripe-becs-483b1b23.js * Invoice Ninja (https://invoiceninja.com) * * @link https://github.com/invoiceninja/invoiceninja source repository diff --git a/public/build/assets/stripe-browserpay-ac78fb26.js b/public/build/assets/stripe-browserpay-ac78fb26.js index 5433bd793132..136627231249 100644 --- a/public/build/assets/stripe-browserpay-ac78fb26.js +++ b/public/build/assets/stripe-browserpay-ac78fb26.js @@ -1,4 +1,8 @@ +<<<<<<<< HEAD:public/build/assets/stripe-browserpay-ac78fb26.js /** +======== +import{i as o,w as i}from"./wait-8f4ae121.js";/** +>>>>>>>> new_payment_flow:public/build/assets/stripe-browserpay-c23582f0.js * Invoice Ninja (https://invoiceninja.com). * * @link https://github.com/invoiceninja/invoiceninja source repository diff --git a/public/build/assets/stripe-browserpay-c23582f0.js b/public/build/assets/stripe-browserpay-c23582f0.js new file mode 100644 index 000000000000..136627231249 --- /dev/null +++ b/public/build/assets/stripe-browserpay-c23582f0.js @@ -0,0 +1,13 @@ +<<<<<<<< HEAD:public/build/assets/stripe-browserpay-ac78fb26.js +/** +======== +import{i as o,w as i}from"./wait-8f4ae121.js";/** +>>>>>>>> new_payment_flow:public/build/assets/stripe-browserpay-c23582f0.js + * Invoice Ninja (https://invoiceninja.com). + * + * @link https://github.com/invoiceninja/invoiceninja source repository + * + * @copyright Copyright (c) 2021. Invoice Ninja LLC (https://invoiceninja.com) + * + * @license https://www.elastic.co/licensing/elastic-license + */class a{constructor(){var e;this.clientSecret=(e=document.querySelector("meta[name=stripe-pi-client-secret]"))==null?void 0:e.content}init(){var t,n;let e={};return document.querySelector("meta[name=stripe-account-id]")&&(e.apiVersion="2020-08-27",e.stripeAccount=(t=document.querySelector("meta[name=stripe-account-id]"))==null?void 0:t.content),this.stripe=Stripe((n=document.querySelector("meta[name=stripe-publishable-key]"))==null?void 0:n.content,e),this.elements=this.stripe.elements(),this}createPaymentRequest(){return this.paymentRequest=this.stripe.paymentRequest(JSON.parse(document.querySelector("meta[name=payment-request-data").content)),this}createPaymentRequestButton(){this.paymentRequestButton=this.elements.create("paymentRequestButton",{paymentRequest:this.paymentRequest})}handlePaymentRequestEvents(e,t){document.querySelector("#errors").hidden=!0,this.paymentRequest.on("paymentmethod",function(n){e.confirmCardPayment(t,{payment_method:n.paymentMethod.id},{handleActions:!1}).then(function(r){r.error?(document.querySelector("#errors").innerText=r.error.message,document.querySelector("#errors").hidden=!1,n.complete("fail")):(n.complete("success"),r.paymentIntent.status==="requires_action"?e.confirmCardPayment(t).then(function(s){s.error?(n.complete("fail"),document.querySelector("#errors").innerText=s.error.message,document.querySelector("#errors").hidden=!1):(document.querySelector('input[name="gateway_response"]').value=JSON.stringify(s.paymentIntent),document.getElementById("server-response").submit())}):(document.querySelector('input[name="gateway_response"]').value=JSON.stringify(r.paymentIntent),document.getElementById("server-response").submit()))})})}handle(){this.init().createPaymentRequest().createPaymentRequestButton(),this.paymentRequest.canMakePayment().then(e=>{var t;if(e)return this.paymentRequestButton.mount("#payment-request-button");document.querySelector("#errors").innerHTML=JSON.parse((t=document.querySelector("meta[name=no-available-methods]"))==null?void 0:t.content),document.querySelector("#errors").hidden=!1}),this.handlePaymentRequestEvents(this.stripe,this.clientSecret)}}new a().handle(); diff --git a/public/build/assets/stripe-credit-card-5487be17.js b/public/build/assets/stripe-credit-card-5487be17.js new file mode 100644 index 000000000000..af5154da8d4d --- /dev/null +++ b/public/build/assets/stripe-credit-card-5487be17.js @@ -0,0 +1,13 @@ +<<<<<<<< HEAD:public/build/assets/stripe-credit-card-75322a3b.js +/** +======== +import{i as c,w as u}from"./wait-8f4ae121.js";/** +>>>>>>>> new_payment_flow:public/build/assets/stripe-credit-card-5487be17.js + * Invoice Ninja (https://invoiceninja.com) + * + * @link https://github.com/invoiceninja/invoiceninja source repository + * + * @copyright Copyright (c) 2021. Invoice Ninja LLC (https://invoiceninja.com) + * + * @license https://www.elastic.co/licensing/elastic-license + */class l{constructor(e,t,n,d){this.key=e,this.secret=t,this.onlyAuthorization=n,this.stripeConnect=d}setupStripe(){return this.stripeConnect?this.stripe=Stripe(this.key,{stripeAccount:this.stripeConnect}):this.stripe=Stripe(this.key),this.elements=this.stripe.elements(),this}createElement(){var e;return this.cardElement=this.elements.create("card",{hidePostalCode:((e=document.querySelector("meta[name=stripe-require-postal-code]"))==null?void 0:e.content)==="0",value:{postalCode:document.querySelector("meta[name=client-postal-code]").content},hideIcon:!1}),this}mountCardElement(){return this.cardElement.mount("#card-element"),this}completePaymentUsingToken(){let e=document.querySelector("input[name=token]").value,t=document.getElementById("pay-now");this.payNowButton=t,this.payNowButton.disabled=!0,this.payNowButton.querySelector("svg").classList.remove("hidden"),this.payNowButton.querySelector("span").classList.add("hidden"),this.stripe.handleCardPayment(this.secret,{payment_method:e}).then(n=>n.error?this.handleFailure(n.error.message):this.handleSuccess(n))}completePaymentWithoutToken(){let e=document.getElementById("pay-now");this.payNowButton=e,this.payNowButton.disabled=!0,this.payNowButton.querySelector("svg").classList.remove("hidden"),this.payNowButton.querySelector("span").classList.add("hidden");let t=document.getElementById("cardholder-name");this.stripe.handleCardPayment(this.secret,this.cardElement,{payment_method_data:{billing_details:{name:t.value}}}).then(n=>n.error?this.handleFailure(n.error.message):this.handleSuccess(n))}handleSuccess(e){document.querySelector('input[name="gateway_response"]').value=JSON.stringify(e.paymentIntent);let t=document.querySelector('input[name="token-billing-checkbox"]:checked');t&&(document.querySelector('input[name="store_card"]').value=t.value),document.getElementById("server-response").submit()}handleFailure(e){let t=document.getElementById("errors");t.textContent="",t.textContent=e,t.hidden=!1,this.payNowButton.disabled=!1,this.payNowButton.querySelector("svg").classList.add("hidden"),this.payNowButton.querySelector("span").classList.remove("hidden")}handleAuthorization(){let e=document.getElementById("cardholder-name"),t=document.getElementById("authorize-card");this.payNowButton=t,this.payNowButton.disabled=!0,this.payNowButton.querySelector("svg").classList.remove("hidden"),this.payNowButton.querySelector("span").classList.add("hidden"),this.stripe.handleCardSetup(this.secret,this.cardElement,{payment_method_data:{billing_details:{name:e.value}}}).then(n=>n.error?this.handleFailure(n.error.message):this.handleSuccessfulAuthorization(n))}handleSuccessfulAuthorization(e){document.getElementById("gateway_response").value=JSON.stringify(e.setupIntent),document.getElementById("server_response").submit()}handle(){this.setupStripe(),this.onlyAuthorization?(this.createElement().mountCardElement(),document.getElementById("authorize-card").addEventListener("click",()=>this.handleAuthorization())):(Array.from(document.getElementsByClassName("toggle-payment-with-token")).forEach(e=>e.addEventListener("click",t=>{document.getElementById("stripe--payment-container").classList.add("hidden"),document.getElementById("save-card--container").style.display="none",document.querySelector("input[name=token]").value=t.target.dataset.token})),document.getElementById("toggle-payment-with-credit-card").addEventListener("click",e=>{document.getElementById("stripe--payment-container").classList.remove("hidden"),document.getElementById("save-card--container").style.display="grid",document.querySelector("input[name=token]").value=""}),this.createElement().mountCardElement(),document.getElementById("pay-now").addEventListener("click",()=>{try{return document.querySelector("input[name=token]").value?this.completePaymentUsingToken():this.completePaymentWithoutToken()}catch(e){console.log(e.message)}}))}}var o;const c=((o=document.querySelector('meta[name="stripe-publishable-key"]'))==null?void 0:o.content)??"";var r;const u=((r=document.querySelector('meta[name="stripe-secret"]'))==null?void 0:r.content)??"";var a;const m=((a=document.querySelector('meta[name="only-authorization"]'))==null?void 0:a.content)??"";var s;const h=((s=document.querySelector('meta[name="stripe-account-id"]'))==null?void 0:s.content)??"";let i=new l(c,u,m,h);i.handle();document.addEventListener("livewire:init",()=>{Livewire.on("passed-required-fields-check",()=>i.handle())}); diff --git a/public/build/assets/stripe-credit-card-75322a3b.js b/public/build/assets/stripe-credit-card-75322a3b.js index c0ed12095051..af5154da8d4d 100644 --- a/public/build/assets/stripe-credit-card-75322a3b.js +++ b/public/build/assets/stripe-credit-card-75322a3b.js @@ -1,4 +1,8 @@ +<<<<<<<< HEAD:public/build/assets/stripe-credit-card-75322a3b.js /** +======== +import{i as c,w as u}from"./wait-8f4ae121.js";/** +>>>>>>>> new_payment_flow:public/build/assets/stripe-credit-card-5487be17.js * Invoice Ninja (https://invoiceninja.com) * * @link https://github.com/invoiceninja/invoiceninja source repository diff --git a/public/build/assets/stripe-eps-0c461508.js b/public/build/assets/stripe-eps-0c461508.js new file mode 100644 index 000000000000..e6670bf79fac --- /dev/null +++ b/public/build/assets/stripe-eps-0c461508.js @@ -0,0 +1,9 @@ +var i=Object.defineProperty;var a=(n,t,e)=>t in n?i(n,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):n[t]=e;var s=(n,t,e)=>(a(n,typeof t!="symbol"?t+"":t,e),e);import{i as c,w as l}from"./wait-8f4ae121.js";/** + * Invoice Ninja (https://invoiceninja.com) + * + * @link https://github.com/invoiceninja/invoiceninja source repository + * + * @copyright Copyright (c) 2021. Invoice Ninja LLC (https://invoiceninja.com) + * + * @license https://www.elastic.co/licensing/elastic-license + */class m{constructor(t,e){s(this,"setupStripe",()=>{this.stripeConnect?this.stripe=Stripe(this.key,{stripeAccount:this.stripeConnect}):this.stripe=Stripe(this.key);let t=this.stripe.elements();var e={style:{base:{padding:"10px 12px",color:"#32325d",fontSize:"16px","::placeholder":{color:"#aab7c4"}}}};return this.eps=t.create("epsBank",e),this.eps.mount("#eps-bank-element"),this});s(this,"handle",()=>{document.getElementById("pay-now").addEventListener("click",t=>{let e=document.getElementById("errors");if(!document.getElementById("eps-name").value){e.textContent=document.querySelector("meta[name=translation-name-required]").content,e.hidden=!1;return}document.getElementById("pay-now").disabled=!0,document.querySelector("#pay-now > svg").classList.remove("hidden"),document.querySelector("#pay-now > span").classList.add("hidden"),this.stripe.confirmEpsPayment(document.querySelector("meta[name=pi-client-secret").content,{payment_method:{eps:this.eps,billing_details:{name:document.getElementById("eps-name").value}},return_url:document.querySelector('meta[name="return-url"]').content})})});this.key=t,this.errors=document.getElementById("errors"),this.stripeConnect=e}}function o(){var e,r;const n=((e=document.querySelector('meta[name="stripe-publishable-key"]'))==null?void 0:e.content)??"",t=((r=document.querySelector('meta[name="stripe-account-id"]'))==null?void 0:r.content)??"";new m(n,t).setupStripe().handle()}c()?o():l("#stripe-eps-payment").then(()=>o()); diff --git a/public/build/assets/stripe-fpx-240a05e2.js b/public/build/assets/stripe-fpx-240a05e2.js index 5cf0503f394c..2b9e8258998f 100644 --- a/public/build/assets/stripe-fpx-240a05e2.js +++ b/public/build/assets/stripe-fpx-240a05e2.js @@ -1,4 +1,8 @@ +<<<<<<<< HEAD:public/build/assets/stripe-fpx-240a05e2.js var i=Object.defineProperty;var c=(n,t,e)=>t in n?i(n,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):n[t]=e;var s=(n,t,e)=>(c(n,typeof t!="symbol"?t+"":t,e),e);/** +======== +var i=Object.defineProperty;var a=(n,t,e)=>t in n?i(n,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):n[t]=e;var s=(n,t,e)=>(a(n,typeof t!="symbol"?t+"":t,e),e);import{i as c,w as d}from"./wait-8f4ae121.js";/** +>>>>>>>> new_payment_flow:public/build/assets/stripe-fpx-c82fd7dc.js * Invoice Ninja (https://invoiceninja.com) * * @link https://github.com/invoiceninja/invoiceninja source repository diff --git a/public/build/assets/stripe-fpx-c82fd7dc.js b/public/build/assets/stripe-fpx-c82fd7dc.js new file mode 100644 index 000000000000..2b9e8258998f --- /dev/null +++ b/public/build/assets/stripe-fpx-c82fd7dc.js @@ -0,0 +1,13 @@ +<<<<<<<< HEAD:public/build/assets/stripe-fpx-240a05e2.js +var i=Object.defineProperty;var c=(n,t,e)=>t in n?i(n,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):n[t]=e;var s=(n,t,e)=>(c(n,typeof t!="symbol"?t+"":t,e),e);/** +======== +var i=Object.defineProperty;var a=(n,t,e)=>t in n?i(n,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):n[t]=e;var s=(n,t,e)=>(a(n,typeof t!="symbol"?t+"":t,e),e);import{i as c,w as d}from"./wait-8f4ae121.js";/** +>>>>>>>> new_payment_flow:public/build/assets/stripe-fpx-c82fd7dc.js + * Invoice Ninja (https://invoiceninja.com) + * + * @link https://github.com/invoiceninja/invoiceninja source repository + * + * @copyright Copyright (c) 2021. Invoice Ninja LLC (https://invoiceninja.com) + * + * @license https://www.elastic.co/licensing/elastic-license + */class d{constructor(t,e){s(this,"setupStripe",()=>{this.stripeConnect?this.stripe=Stripe(this.key,{stripeAccount:this.stripeConnect}):this.stripe=Stripe(this.key);let t=this.stripe.elements(),e={base:{padding:"10px 12px",color:"#32325d",fontSize:"16px"}};return this.fpx=t.create("fpxBank",{style:e,accountHolderType:"individual"}),this.fpx.mount("#fpx-bank-element"),this});s(this,"handle",()=>{document.getElementById("pay-now").addEventListener("click",t=>{document.getElementById("pay-now").disabled=!0,document.querySelector("#pay-now > svg").classList.remove("hidden"),document.querySelector("#pay-now > span").classList.add("hidden"),this.stripe.confirmFpxPayment(document.querySelector("meta[name=pi-client-secret").content,{payment_method:{fpx:this.fpx},return_url:document.querySelector('meta[name="return-url"]').content}).then(e=>{e.error&&this.handleFailure(e.error.message)})})});this.key=t,this.errors=document.getElementById("errors"),this.stripeConnect=e}handleFailure(t){let e=document.getElementById("errors");e.textContent="",e.textContent=t,e.hidden=!1,document.getElementById("pay-now").disabled=!1,document.querySelector("#pay-now > svg").classList.add("hidden"),document.querySelector("#pay-now > span").classList.remove("hidden")}}var r;const a=((r=document.querySelector('meta[name="stripe-publishable-key"]'))==null?void 0:r.content)??"";var o;const l=((o=document.querySelector('meta[name="stripe-account-id"]'))==null?void 0:o.content)??"";new d(a,l).setupStripe().handle(); diff --git a/public/build/assets/stripe-giropay-aedb4a64.js b/public/build/assets/stripe-giropay-aedb4a64.js new file mode 100644 index 000000000000..e9eb2a9a92b4 --- /dev/null +++ b/public/build/assets/stripe-giropay-aedb4a64.js @@ -0,0 +1,9 @@ +var i=Object.defineProperty;var c=(n,t,e)=>t in n?i(n,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):n[t]=e;var r=(n,t,e)=>(c(n,typeof t!="symbol"?t+"":t,e),e);import{i as a,w as m}from"./wait-8f4ae121.js";/** + * Invoice Ninja (https://invoiceninja.com) + * + * @link https://github.com/invoiceninja/invoiceninja source repository + * + * @copyright Copyright (c) 2021. Invoice Ninja LLC (https://invoiceninja.com) + * + * @license https://www.elastic.co/licensing/elastic-license + */class d{constructor(t,e){r(this,"setupStripe",()=>(this.stripeConnect?this.stripe=Stripe(this.key,{stripeAccount:this.stripeConnect}):this.stripe=Stripe(this.key),this));r(this,"handle",()=>{document.getElementById("pay-now").addEventListener("click",t=>{let e=document.getElementById("errors");if(!document.getElementById("giropay-mandate-acceptance").checked){e.textContent=document.querySelector("meta[name=translation-terms-required]").content,e.hidden=!1,console.log("Terms");return}document.getElementById("pay-now").disabled=!0,document.querySelector("#pay-now > svg").classList.remove("hidden"),document.querySelector("#pay-now > span").classList.add("hidden"),this.stripe.confirmGiropayPayment(document.querySelector("meta[name=pi-client-secret").content,{payment_method:{billing_details:{name:document.getElementById("giropay-name").value}},return_url:document.querySelector('meta[name="return-url"]').content})})});this.key=t,this.errors=document.getElementById("errors"),this.stripeConnect=e}}function s(){var e,o;const n=((e=document.querySelector('meta[name="stripe-publishable-key"]'))==null?void 0:e.content)??"",t=((o=document.querySelector('meta[name="stripe-account-id"]'))==null?void 0:o.content)??"";new d(n,t).setupStripe().handle()}a()?s():m("#stripe-giropay-payment").then(()=>s()); diff --git a/public/build/assets/stripe-ideal-95836518.js b/public/build/assets/stripe-ideal-95836518.js new file mode 100644 index 000000000000..cd679e943098 --- /dev/null +++ b/public/build/assets/stripe-ideal-95836518.js @@ -0,0 +1,9 @@ +var s=Object.defineProperty;var a=(n,t,e)=>t in n?s(n,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):n[t]=e;var r=(n,t,e)=>(a(n,typeof t!="symbol"?t+"":t,e),e);import{i as l,w as c}from"./wait-8f4ae121.js";/** + * Invoice Ninja (https://invoiceninja.com) + * + * @link https://github.com/invoiceninja/invoiceninja source repository + * + * @copyright Copyright (c) 2021. Invoice Ninja LLC (https://invoiceninja.com) + * + * @license https://www.elastic.co/licensing/elastic-license + */class d{constructor(t,e){r(this,"setupStripe",()=>{this.stripeConnect?this.stripe=Stripe(this.key,{stripeAccount:this.stripeConnect}):this.stripe=Stripe(this.key);let t=this.stripe.elements();var e={style:{base:{padding:"10px 12px",color:"#32325d",fontSize:"16px","::placeholder":{color:"#aab7c4"}}}};return this.ideal=t.create("idealBank",e),this.ideal.mount("#ideal-bank-element"),this});r(this,"handle",()=>{document.getElementById("pay-now").addEventListener("click",t=>{let e=document.getElementById("errors");if(!document.getElementById("ideal-name").value){e.textContent=document.querySelector("meta[name=translation-name-required]").content,e.hidden=!1,console.log("name");return}document.getElementById("pay-now").disabled=!0,document.querySelector("#pay-now > svg").classList.remove("hidden"),document.querySelector("#pay-now > span").classList.add("hidden"),this.stripe.confirmIdealPayment(document.querySelector("meta[name=pi-client-secret").content,{payment_method:{ideal:this.ideal,billing_details:{name:document.getElementById("ideal-name").value}},return_url:document.querySelector('meta[name="return-url"]').content})})});this.key=t,this.errors=document.getElementById("errors"),this.stripeConnect=e}}function o(){var e,i;const n=((e=document.querySelector('meta[name="stripe-publishable-key"]'))==null?void 0:e.content)??"",t=((i=document.querySelector('meta[name="stripe-account-id"]'))==null?void 0:i.content)??"";new d(n,t).setupStripe().handle()}l()?o():c("#stripe-ideal-payment").then(()=>o()); diff --git a/public/build/assets/stripe-klarna-93dcc6f1.js b/public/build/assets/stripe-klarna-93dcc6f1.js new file mode 100644 index 000000000000..1334b37fea2d --- /dev/null +++ b/public/build/assets/stripe-klarna-93dcc6f1.js @@ -0,0 +1,13 @@ +<<<<<<<< HEAD:public/build/assets/stripe-klarna-e45c946d.js +var m=Object.defineProperty;var d=(n,e,t)=>e in n?m(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t;var r=(n,e,t)=>(d(n,typeof e!="symbol"?e+"":e,t),t);/** +======== +var c=Object.defineProperty;var m=(n,e,t)=>e in n?c(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t;var o=(n,e,t)=>(m(n,typeof e!="symbol"?e+"":e,t),t);import{i as d,w as i}from"./wait-8f4ae121.js";/** +>>>>>>>> new_payment_flow:public/build/assets/stripe-klarna-93dcc6f1.js + * Invoice Ninja (https://invoiceninja.com) + * + * @link https://github.com/invoiceninja/invoiceninja source repository + * + * @copyright Copyright (c) 2021. Invoice Ninja LLC (https://invoiceninja.com) + * + * @license https://www.elastic.co/licensing/elastic-license + */class l{constructor(e,t){r(this,"setupStripe",()=>(this.stripeConnect?this.stripe=Stripe(this.key,{stripeAccount:this.stripeConnect}):this.stripe=Stripe(this.key),this));r(this,"handleError",e=>{document.getElementById("pay-now").disabled=!1,document.querySelector("#pay-now > svg").classList.add("hidden"),document.querySelector("#pay-now > span").classList.remove("hidden"),this.errors.textContent="",this.errors.textContent=e,this.errors.hidden=!1});r(this,"handle",()=>{document.getElementById("pay-now").addEventListener("click",e=>{let t=document.getElementById("errors"),o=document.getElementById("klarna-name").value;/^[A-Za-z\s]*$/.test(o)?(document.getElementById("pay-now").disabled=!0,document.querySelector("#pay-now > svg").classList.remove("hidden"),document.querySelector("#pay-now > span").classList.add("hidden"),this.stripe.confirmKlarnaPayment(document.querySelector("meta[name=pi-client-secret").content,{payment_method:{billing_details:{name:o,email:document.querySelector("meta[name=email]").content,address:{line1:document.querySelector("meta[name=address-1]").content,line2:document.querySelector("meta[name=address-2]").content,city:document.querySelector("meta[name=city]").content,postal_code:document.querySelector("meta[name=postal_code]").content,state:document.querySelector("meta[name=state]").content,country:document.querySelector("meta[name=country]").content}}},return_url:document.querySelector('meta[name="return-url"]').content}).then(a=>{if(a.hasOwnProperty("error"))return this.handleError(a.error.message)})):(document.getElementById("klarna-name-correction").hidden=!1,document.getElementById("klarna-name").textContent=o.replace(/^[A-Za-z\s]*$/,""),document.getElementById("klarna-name").focus(),t.textContent=document.querySelector("meta[name=translation-name-without-special-characters]").content,t.hidden=!1)})});this.key=e,this.errors=document.getElementById("errors"),this.stripeConnect=t}}var c;const i=((c=document.querySelector('meta[name="stripe-publishable-key"]'))==null?void 0:c.content)??"";var s;const u=((s=document.querySelector('meta[name="stripe-account-id"]'))==null?void 0:s.content)??"";new l(i,u).setupStripe().handle(); diff --git a/public/build/assets/stripe-klarna-e45c946d.js b/public/build/assets/stripe-klarna-e45c946d.js index 9fda752c30f3..1334b37fea2d 100644 --- a/public/build/assets/stripe-klarna-e45c946d.js +++ b/public/build/assets/stripe-klarna-e45c946d.js @@ -1,4 +1,8 @@ +<<<<<<<< HEAD:public/build/assets/stripe-klarna-e45c946d.js var m=Object.defineProperty;var d=(n,e,t)=>e in n?m(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t;var r=(n,e,t)=>(d(n,typeof e!="symbol"?e+"":e,t),t);/** +======== +var c=Object.defineProperty;var m=(n,e,t)=>e in n?c(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t;var o=(n,e,t)=>(m(n,typeof e!="symbol"?e+"":e,t),t);import{i as d,w as i}from"./wait-8f4ae121.js";/** +>>>>>>>> new_payment_flow:public/build/assets/stripe-klarna-93dcc6f1.js * Invoice Ninja (https://invoiceninja.com) * * @link https://github.com/invoiceninja/invoiceninja source repository diff --git a/public/build/assets/stripe-przelewy24-5db060c5.js b/public/build/assets/stripe-przelewy24-5db060c5.js new file mode 100644 index 000000000000..f948ac217919 --- /dev/null +++ b/public/build/assets/stripe-przelewy24-5db060c5.js @@ -0,0 +1,13 @@ +<<<<<<<< HEAD:public/build/assets/stripe-przelewy24-f9154acf.js +var d=Object.defineProperty;var s=(n,t,e)=>t in n?d(n,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):n[t]=e;var o=(n,t,e)=>(s(n,typeof t!="symbol"?t+"":t,e),e);/** +======== +var c=Object.defineProperty;var s=(n,t,e)=>t in n?c(n,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):n[t]=e;var o=(n,t,e)=>(s(n,typeof t!="symbol"?t+"":t,e),e);import{i as d,w as m}from"./wait-8f4ae121.js";/** +>>>>>>>> new_payment_flow:public/build/assets/stripe-przelewy24-5db060c5.js + * Invoice Ninja (https://invoiceninja.com) + * + * @link https://github.com/invoiceninja/invoiceninja source repository + * + * @copyright Copyright (c) 2021. Invoice Ninja LLC (https://invoiceninja.com) + * + * @license https://www.elastic.co/licensing/elastic-license + */class m{constructor(t,e){o(this,"setupStripe",()=>{this.stripeConnect?this.stripe=Stripe(this.key,{stripeAccount:this.stripeConnect}):this.stripe=Stripe(this.key);let t=this.stripe.elements();var e={style:{base:{padding:"10px 12px",color:"#32325d",fontSize:"16px","::placeholder":{color:"#aab7c4"}}}};return this.p24bank=t.create("p24Bank",e),this.p24bank.mount("#p24-bank-element"),this});o(this,"handle",()=>{document.getElementById("pay-now").addEventListener("click",t=>{let e=document.getElementById("errors");if(document.getElementById("p24-name").value===""){document.getElementById("p24-name").focus(),e.textContent=document.querySelector("meta[name=translation-name-required]").content,e.hidden=!1;return}if(document.getElementById("p24-email-address").value===""){document.getElementById("p24-email-address").focus(),e.textContent=document.querySelector("meta[name=translation-email-required]").content,e.hidden=!1;return}if(!document.getElementById("p24-mandate-acceptance").checked){document.getElementById("p24-mandate-acceptance").focus(),e.textContent=document.querySelector("meta[name=translation-terms-required]").content,e.hidden=!1;return}document.getElementById("pay-now").disabled=!0,document.querySelector("#pay-now > svg").classList.remove("hidden"),document.querySelector("#pay-now > span").classList.add("hidden"),this.stripe.confirmP24Payment(document.querySelector("meta[name=pi-client-secret").content,{payment_method:{p24:this.p24bank,billing_details:{name:document.getElementById("p24-name").value,email:document.getElementById("p24-email-address").value}},payment_method_options:{p24:{tos_shown_and_accepted:document.getElementById("p24-mandate-acceptance").checked}},return_url:document.querySelector('meta[name="return-url"]').content}).then(function(a){a.error?(e.textContent=a.error.message,e.hidden=!1,document.getElementById("pay-now").disabled=!1,document.querySelector("#pay-now > svg").classList.add("hidden"),document.querySelector("#pay-now > span").classList.remove("hidden")):a.paymentIntent.status==="succeeded"&&(window.location=document.querySelector('meta[name="return-url"]').content)})})});this.key=t,this.errors=document.getElementById("errors"),this.stripeConnect=e}}var r;const i=((r=document.querySelector('meta[name="stripe-publishable-key"]'))==null?void 0:r.content)??"";var c;const l=((c=document.querySelector('meta[name="stripe-account-id"]'))==null?void 0:c.content)??"";new m(i,l).setupStripe().handle(); diff --git a/public/build/assets/stripe-przelewy24-f9154acf.js b/public/build/assets/stripe-przelewy24-f9154acf.js index 88a19bfa445d..f948ac217919 100644 --- a/public/build/assets/stripe-przelewy24-f9154acf.js +++ b/public/build/assets/stripe-przelewy24-f9154acf.js @@ -1,4 +1,8 @@ +<<<<<<<< HEAD:public/build/assets/stripe-przelewy24-f9154acf.js var d=Object.defineProperty;var s=(n,t,e)=>t in n?d(n,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):n[t]=e;var o=(n,t,e)=>(s(n,typeof t!="symbol"?t+"":t,e),e);/** +======== +var c=Object.defineProperty;var s=(n,t,e)=>t in n?c(n,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):n[t]=e;var o=(n,t,e)=>(s(n,typeof t!="symbol"?t+"":t,e),e);import{i as d,w as m}from"./wait-8f4ae121.js";/** +>>>>>>>> new_payment_flow:public/build/assets/stripe-przelewy24-5db060c5.js * Invoice Ninja (https://invoiceninja.com) * * @link https://github.com/invoiceninja/invoiceninja source repository diff --git a/public/build/assets/stripe-sepa-6dd487fc.js b/public/build/assets/stripe-sepa-6dd487fc.js index 525db0c1e7b5..cbc596298f2d 100644 --- a/public/build/assets/stripe-sepa-6dd487fc.js +++ b/public/build/assets/stripe-sepa-6dd487fc.js @@ -1,4 +1,8 @@ +<<<<<<<< HEAD:public/build/assets/stripe-sepa-6dd487fc.js var s=Object.defineProperty;var l=(a,e,t)=>e in a?s(a,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):a[e]=t;var o=(a,e,t)=>(l(a,typeof e!="symbol"?e+"":e,t),t);/** +======== +var s=Object.defineProperty;var c=(a,e,t)=>e in a?s(a,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):a[e]=t;var o=(a,e,t)=>(c(a,typeof e!="symbol"?e+"":e,t),t);import{i,w as l}from"./wait-8f4ae121.js";/** +>>>>>>>> new_payment_flow:public/build/assets/stripe-sepa-9ab85221.js * Invoice Ninja (https://invoiceninja.com) * * @link https://github.com/invoiceninja/invoiceninja source repository diff --git a/public/build/assets/stripe-sepa-9ab85221.js b/public/build/assets/stripe-sepa-9ab85221.js new file mode 100644 index 000000000000..cbc596298f2d --- /dev/null +++ b/public/build/assets/stripe-sepa-9ab85221.js @@ -0,0 +1,13 @@ +<<<<<<<< HEAD:public/build/assets/stripe-sepa-6dd487fc.js +var s=Object.defineProperty;var l=(a,e,t)=>e in a?s(a,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):a[e]=t;var o=(a,e,t)=>(l(a,typeof e!="symbol"?e+"":e,t),t);/** +======== +var s=Object.defineProperty;var c=(a,e,t)=>e in a?s(a,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):a[e]=t;var o=(a,e,t)=>(c(a,typeof e!="symbol"?e+"":e,t),t);import{i,w as l}from"./wait-8f4ae121.js";/** +>>>>>>>> new_payment_flow:public/build/assets/stripe-sepa-9ab85221.js + * Invoice Ninja (https://invoiceninja.com) + * + * @link https://github.com/invoiceninja/invoiceninja source repository + * + * @copyright Copyright (c) 2021. Invoice Ninja LLC (https://invoiceninja.com) + * + * @license https://www.elastic.co/licensing/elastic-license + */class i{constructor(e,t){o(this,"setupStripe",()=>{this.stripeConnect?this.stripe=Stripe(this.key,{stripeAccount:this.stripeConnect}):this.stripe=Stripe(this.key);const e=this.stripe.elements();var t={base:{color:"#32325d",fontFamily:'-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif',fontSmoothing:"antialiased",fontSize:"16px","::placeholder":{color:"#aab7c4"},":-webkit-autofill":{color:"#32325d"}},invalid:{color:"#fa755a",iconColor:"#fa755a",":-webkit-autofill":{color:"#fa755a"}}},n={style:t,supportedCountries:["SEPA"],placeholderCountry:document.querySelector('meta[name="country"]').content};return this.iban=e.create("iban",n),this.iban.mount("#sepa-iban"),document.getElementById("sepa-name").value=document.querySelector("meta[name=client_name]").content,document.getElementById("sepa-email-address").value=document.querySelector("meta[name=client_email]").content,this});o(this,"handle",()=>{let e=document.getElementById("errors");Array.from(document.getElementsByClassName("toggle-payment-with-token")).forEach(t=>t.addEventListener("click",n=>{document.getElementById("stripe--payment-container").classList.add("hidden"),document.getElementById("save-card--container").style.display="none",document.querySelector("input[name=token]").value=n.target.dataset.token})),document.getElementById("toggle-payment-with-new-bank-account").addEventListener("click",t=>{document.getElementById("stripe--payment-container").classList.remove("hidden"),document.getElementById("save-card--container").style.display="grid",document.querySelector("input[name=token]").value=""}),document.getElementById("pay-now").addEventListener("click",t=>{if(document.querySelector("input[name=token]").value.length!==0)document.getElementById("pay-now").disabled=!0,document.querySelector("#pay-now > svg").classList.remove("hidden"),document.querySelector("#pay-now > span").classList.add("hidden"),this.stripe.confirmSepaDebitPayment(document.querySelector("meta[name=pi-client-secret").content,{payment_method:document.querySelector("input[name=token]").value}).then(n=>n.error?this.handleFailure(n.error.message):this.handleSuccess(n));else{if(document.getElementById("sepa-name").value===""){document.getElementById("sepa-name").focus(),e.textContent=document.querySelector("meta[name=translation-name-required]").content,e.hidden=!1;return}if(document.getElementById("sepa-email-address").value===""){document.getElementById("sepa-email-address").focus(),e.textContent=document.querySelector("meta[name=translation-email-required]").content,e.hidden=!1;return}if(!document.getElementById("sepa-mandate-acceptance").checked){e.textContent=document.querySelector("meta[name=translation-terms-required]").content,e.hidden=!1;return}document.getElementById("pay-now").disabled=!0,document.querySelector("#pay-now > svg").classList.remove("hidden"),document.querySelector("#pay-now > span").classList.add("hidden"),this.stripe.confirmSepaDebitPayment(document.querySelector("meta[name=pi-client-secret").content,{payment_method:{sepa_debit:this.iban,billing_details:{name:document.getElementById("sepa-name").value,email:document.getElementById("sepa-email-address").value}}}).then(n=>n.error?this.handleFailure(n.error.message):this.handleSuccess(n))}})});this.key=e,this.errors=document.getElementById("errors"),this.stripeConnect=t}handleSuccess(e){document.querySelector('input[name="gateway_response"]').value=JSON.stringify(e.paymentIntent);let t=document.querySelector('input[name="token-billing-checkbox"]:checked');t&&(document.querySelector('input[name="store_card"]').value=t.value),document.querySelector("input[name=token]").value.length>2&&(document.querySelector('input[name="store_card"]').value=!1),document.getElementById("server-response").submit()}handleFailure(e){let t=document.getElementById("errors");t.textContent="",t.textContent=e,t.hidden=!1,document.getElementById("pay-now").disabled=!1,document.querySelector("#pay-now > svg").classList.add("hidden"),document.querySelector("#pay-now > span").classList.remove("hidden")}handleSuccess(e){document.querySelector('input[name="gateway_response"]').value=JSON.stringify(e.paymentIntent);let t=document.querySelector('input[name="token-billing-checkbox"]:checked');t&&(document.querySelector('input[name="store_card"]').value=t.value),document.getElementById("server-response").submit()}}var r;const d=((r=document.querySelector('meta[name="stripe-publishable-key"]'))==null?void 0:r.content)??"";var c;const m=((c=document.querySelector('meta[name="stripe-account-id"]'))==null?void 0:c.content)??"";new i(d,m).setupStripe().handle(); diff --git a/public/build/assets/stripe-sofort-18aeca06.js b/public/build/assets/stripe-sofort-18aeca06.js index bb1601d347f4..ac738942b238 100644 --- a/public/build/assets/stripe-sofort-18aeca06.js +++ b/public/build/assets/stripe-sofort-18aeca06.js @@ -1,4 +1,8 @@ +<<<<<<<< HEAD:public/build/assets/stripe-sofort-18aeca06.js var c=Object.defineProperty;var i=(n,e,t)=>e in n?c(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t;var r=(n,e,t)=>(i(n,typeof e!="symbol"?e+"":e,t),t);/** +======== +var c=Object.defineProperty;var i=(n,e,t)=>e in n?c(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t;var r=(n,e,t)=>(i(n,typeof e!="symbol"?e+"":e,t),t);import{i as a,w as u}from"./wait-8f4ae121.js";/** +>>>>>>>> new_payment_flow:public/build/assets/stripe-sofort-fbef42bb.js * Invoice Ninja (https://invoiceninja.com) * * @link https://github.com/invoiceninja/invoiceninja source repository diff --git a/public/build/assets/stripe-sofort-fbef42bb.js b/public/build/assets/stripe-sofort-fbef42bb.js new file mode 100644 index 000000000000..ac738942b238 --- /dev/null +++ b/public/build/assets/stripe-sofort-fbef42bb.js @@ -0,0 +1,13 @@ +<<<<<<<< HEAD:public/build/assets/stripe-sofort-18aeca06.js +var c=Object.defineProperty;var i=(n,e,t)=>e in n?c(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t;var r=(n,e,t)=>(i(n,typeof e!="symbol"?e+"":e,t),t);/** +======== +var c=Object.defineProperty;var i=(n,e,t)=>e in n?c(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t;var r=(n,e,t)=>(i(n,typeof e!="symbol"?e+"":e,t),t);import{i as a,w as u}from"./wait-8f4ae121.js";/** +>>>>>>>> new_payment_flow:public/build/assets/stripe-sofort-fbef42bb.js + * Invoice Ninja (https://invoiceninja.com) + * + * @link https://github.com/invoiceninja/invoiceninja source repository + * + * @copyright Copyright (c) 2021. Invoice Ninja LLC (https://invoiceninja.com) + * + * @license https://www.elastic.co/licensing/elastic-license + */class u{constructor(e,t){r(this,"setupStripe",()=>(this.stripeConnect?this.stripe=Stripe(this.key,{stripeAccount:this.stripeConnect}):this.stripe=Stripe(this.key),this));r(this,"handle",()=>{document.getElementById("pay-now").addEventListener("click",e=>{document.getElementById("pay-now").disabled=!0,document.querySelector("#pay-now > svg").classList.remove("hidden"),document.querySelector("#pay-now > span").classList.add("hidden"),this.stripe.confirmSofortPayment(document.querySelector("meta[name=pi-client-secret").content,{payment_method:{sofort:{country:document.querySelector('meta[name="country"]').content}},return_url:document.querySelector('meta[name="return-url"]').content})})});this.key=e,this.errors=document.getElementById("errors"),this.stripeConnect=t}}var o;const a=((o=document.querySelector('meta[name="stripe-publishable-key"]'))==null?void 0:o.content)??"";var s;const m=((s=document.querySelector('meta[name="stripe-account-id"]'))==null?void 0:s.content)??"";new u(a,m).setupStripe().handle(); diff --git a/public/build/assets/wait-8f4ae121.js b/public/build/assets/wait-8f4ae121.js new file mode 100644 index 000000000000..ec3d03b10652 --- /dev/null +++ b/public/build/assets/wait-8f4ae121.js @@ -0,0 +1,9 @@ +/** + * Invoice Ninja (https://invoiceninja.com). + * + * @link https://github.com/invoiceninja/invoiceninja source repository + * + * @copyright Copyright (c) 2024. Invoice Ninja LLC (https://invoiceninja.com) + * + * @license https://www.elastic.co/licensing/elastic-license + */function i(...e){return new Promise(n=>{if(!e.length){n([]);return}const r=e.map(t=>document.querySelector(t)).filter(Boolean);if(r.length===e.length){n(r);return}const o=new MutationObserver(()=>{const t=e.map(u=>document.querySelector(u)).filter(Boolean);t.length===e.length&&(o.disconnect(),n(t))});o.observe(document.body,{childList:!0,subtree:!0})})}function a(){const e=document.querySelector('meta[name="instant-payment"]');return!!(e&&e instanceof HTMLMetaElement&&e.content==="yes")}export{a as i,i as w}; diff --git a/public/build/manifest.json b/public/build/manifest.json index f1747c8d7f50..4a0cad921374 100644 --- a/public/build/manifest.json +++ b/public/build/manifest.json @@ -8,6 +8,9 @@ "__commonjsHelpers-725317a4.js" ] }, + "_wait-8f4ae121.js": { + "file": "assets/wait-8f4ae121.js" + }, "resources/js/app.js": { "file": "assets/app-e0713224.js", "imports": [ @@ -36,7 +39,7 @@ "src": "resources/js/clients/linkify-urls.js" }, "resources/js/clients/payment_methods/authorize-authorize-card.js": { - "file": "assets/authorize-authorize-card-7da1185c.js", + "file": "assets/authorize-authorize-card-39be6d93.js", "isEntry": true, "src": "resources/js/clients/payment_methods/authorize-authorize-card.js" }, @@ -45,6 +48,17 @@ "isEntry": true, "src": "resources/js/clients/payment_methods/authorize-checkout-card.js" }, +<<<<<<< HEAD +======= + "resources/js/clients/payment_methods/authorize-stripe-acss.js": { + "file": "assets/authorize-stripe-acss-f6bd46c1.js", + "imports": [ + "_wait-8f4ae121.js" + ], + "isEntry": true, + "src": "resources/js/clients/payment_methods/authorize-stripe-acss.js" + }, +>>>>>>> new_payment_flow "resources/js/clients/payment_methods/braintree-ach.js": { "file": "assets/braintree-ach-b29d040e.js", "isEntry": true, @@ -56,137 +70,339 @@ "src": "resources/js/clients/payment_methods/wepay-bank-account.js" }, "resources/js/clients/payments/authorize-credit-card-payment.js": { +<<<<<<< HEAD "file": "assets/authorize-credit-card-payment-a217579b.js", +======= + "file": "assets/authorize-credit-card-payment-222655bd.js", + "imports": [ + "_wait-8f4ae121.js" + ], +>>>>>>> new_payment_flow "isEntry": true, "src": "resources/js/clients/payments/authorize-credit-card-payment.js" }, "resources/js/clients/payments/braintree-credit-card.js": { +<<<<<<< HEAD "file": "assets/braintree-credit-card-1c3f3108.js", +======= + "file": "assets/braintree-credit-card-60bd8878.js", + "imports": [ + "_wait-8f4ae121.js" + ], +>>>>>>> new_payment_flow "isEntry": true, "src": "resources/js/clients/payments/braintree-credit-card.js" }, "resources/js/clients/payments/braintree-paypal.js": { +<<<<<<< HEAD "file": "assets/braintree-paypal-45391805.js", +======= + "file": "assets/braintree-paypal-f78ad64b.js", + "imports": [ + "_wait-8f4ae121.js" + ], +>>>>>>> new_payment_flow "isEntry": true, "src": "resources/js/clients/payments/braintree-paypal.js" }, "resources/js/clients/payments/checkout-credit-card.js": { +<<<<<<< HEAD "file": "assets/checkout-credit-card-8a04938c.js", +======= + "file": "assets/checkout-credit-card-2cca8b36.js", + "imports": [ + "_wait-8f4ae121.js" + ], +>>>>>>> new_payment_flow "isEntry": true, "src": "resources/js/clients/payments/checkout-credit-card.js" }, "resources/js/clients/payments/eway-credit-card.js": { +<<<<<<< HEAD "file": "assets/eway-credit-card-62ce5f3b.js", +======= + "file": "assets/eway-credit-card-150298fa.js", + "imports": [ + "_wait-8f4ae121.js" + ], +>>>>>>> new_payment_flow "isEntry": true, "src": "resources/js/clients/payments/eway-credit-card.js" }, "resources/js/clients/payments/forte-ach-payment.js": { +<<<<<<< HEAD "file": "assets/forte-ach-payment-2f7fa236.js", +======= + "file": "assets/forte-ach-payment-546428ee.js", + "imports": [ + "_wait-8f4ae121.js" + ], +>>>>>>> new_payment_flow "isEntry": true, "src": "resources/js/clients/payments/forte-ach-payment.js" }, "resources/js/clients/payments/forte-credit-card-payment.js": { +<<<<<<< HEAD "file": "assets/forte-credit-card-payment-7bb15431.js", +======= + "file": "assets/forte-credit-card-payment-ea7d8632.js", + "imports": [ + "_wait-8f4ae121.js" + ], +>>>>>>> new_payment_flow "isEntry": true, "src": "resources/js/clients/payments/forte-credit-card-payment.js" }, "resources/js/clients/payments/mollie-credit-card.js": { +<<<<<<< HEAD "file": "assets/mollie-credit-card-db5c26c6.js", +======= + "file": "assets/mollie-credit-card-d81afbd4.js", + "imports": [ + "_wait-8f4ae121.js" + ], +>>>>>>> new_payment_flow "isEntry": true, "src": "resources/js/clients/payments/mollie-credit-card.js" }, "resources/js/clients/payments/paytrace-credit-card.js": { +<<<<<<< HEAD "file": "assets/paytrace-credit-card-9cea3700.js", +======= + "file": "assets/paytrace-credit-card-d29797c1.js", + "imports": [ + "_wait-8f4ae121.js" + ], +>>>>>>> new_payment_flow "isEntry": true, "src": "resources/js/clients/payments/paytrace-credit-card.js" }, "resources/js/clients/payments/razorpay-aio.js": { +<<<<<<< HEAD "file": "assets/razorpay-aio-3d02ff1d.js", +======= + "file": "assets/razorpay-aio-f8e8c7f0.js", + "imports": [ + "_wait-8f4ae121.js" + ], +>>>>>>> new_payment_flow "isEntry": true, "src": "resources/js/clients/payments/razorpay-aio.js" }, "resources/js/clients/payments/square-credit-card.js": { +<<<<<<< HEAD "file": "assets/square-credit-card-a20464a3.js", "isEntry": true, "src": "resources/js/clients/payments/square-credit-card.js" }, +======= + "file": "assets/square-credit-card-2fc5c3fa.js", + "imports": [ + "_wait-8f4ae121.js" + ], + "isEntry": true, + "src": "resources/js/clients/payments/square-credit-card.js" + }, + "resources/js/clients/payments/stripe-ach-pay.js": { + "file": "assets/stripe-ach-pay-22d14901.js", + "imports": [ + "_wait-8f4ae121.js" + ], + "isEntry": true, + "src": "resources/js/clients/payments/stripe-ach-pay.js" + }, +>>>>>>> new_payment_flow "resources/js/clients/payments/stripe-ach.js": { "file": "assets/stripe-ach-fe366ca7.js", "isEntry": true, "src": "resources/js/clients/payments/stripe-ach.js" }, "resources/js/clients/payments/stripe-acss.js": { +<<<<<<< HEAD "file": "assets/stripe-acss-946fe54a.js", +======= + "file": "assets/stripe-acss-1184fda8.js", + "imports": [ + "_wait-8f4ae121.js" + ], +>>>>>>> new_payment_flow "isEntry": true, "src": "resources/js/clients/payments/stripe-acss.js" }, "resources/js/clients/payments/stripe-alipay.js": { +<<<<<<< HEAD "file": "assets/stripe-alipay-00a4a19f.js", +======= + "file": "assets/stripe-alipay-1457b63d.js", + "imports": [ + "_wait-8f4ae121.js" + ], +>>>>>>> new_payment_flow "isEntry": true, "src": "resources/js/clients/payments/stripe-alipay.js" }, "resources/js/clients/payments/stripe-bacs.js": { +<<<<<<< HEAD "file": "assets/stripe-bacs-38c8b975.js", +======= + "file": "assets/stripe-bacs-425cb13e.js", + "imports": [ + "_wait-8f4ae121.js" + ], +>>>>>>> new_payment_flow "isEntry": true, "src": "resources/js/clients/payments/stripe-bacs.js" }, "resources/js/clients/payments/stripe-bancontact.js": { +<<<<<<< HEAD "file": "assets/stripe-bancontact-cb004d43.js", "isEntry": true, "src": "resources/js/clients/payments/stripe-bancontact.js" }, "resources/js/clients/payments/stripe-becs.js": { "file": "assets/stripe-becs-4d1494ed.js", +======= + "file": "assets/stripe-bancontact-4a0d7a40.js", + "imports": [ + "_wait-8f4ae121.js" + ], + "isEntry": true, + "src": "resources/js/clients/payments/stripe-bancontact.js" + }, + "resources/js/clients/payments/stripe-bank-transfer.js": { + "file": "assets/stripe-bank-transfer-4ab58b35.js", + "imports": [ + "_wait-8f4ae121.js" + ], + "isEntry": true, + "src": "resources/js/clients/payments/stripe-bank-transfer.js" + }, + "resources/js/clients/payments/stripe-becs.js": { + "file": "assets/stripe-becs-483b1b23.js", + "imports": [ + "_wait-8f4ae121.js" + ], +>>>>>>> new_payment_flow "isEntry": true, "src": "resources/js/clients/payments/stripe-becs.js" }, "resources/js/clients/payments/stripe-browserpay.js": { +<<<<<<< HEAD "file": "assets/stripe-browserpay-ac78fb26.js", +======= + "file": "assets/stripe-browserpay-c23582f0.js", + "imports": [ + "_wait-8f4ae121.js" + ], +>>>>>>> new_payment_flow "isEntry": true, "src": "resources/js/clients/payments/stripe-browserpay.js" }, "resources/js/clients/payments/stripe-credit-card.js": { +<<<<<<< HEAD "file": "assets/stripe-credit-card-75322a3b.js", +======= + "file": "assets/stripe-credit-card-5487be17.js", + "imports": [ + "_wait-8f4ae121.js" + ], +>>>>>>> new_payment_flow "isEntry": true, "src": "resources/js/clients/payments/stripe-credit-card.js" }, "resources/js/clients/payments/stripe-eps.js": { +<<<<<<< HEAD "file": "assets/stripe-eps-6ebc87cd.js", +======= + "file": "assets/stripe-eps-0c461508.js", + "imports": [ + "_wait-8f4ae121.js" + ], +>>>>>>> new_payment_flow "isEntry": true, "src": "resources/js/clients/payments/stripe-eps.js" }, "resources/js/clients/payments/stripe-fpx.js": { +<<<<<<< HEAD "file": "assets/stripe-fpx-240a05e2.js", +======= + "file": "assets/stripe-fpx-c82fd7dc.js", + "imports": [ + "_wait-8f4ae121.js" + ], +>>>>>>> new_payment_flow "isEntry": true, "src": "resources/js/clients/payments/stripe-fpx.js" }, "resources/js/clients/payments/stripe-giropay.js": { +<<<<<<< HEAD "file": "assets/stripe-giropay-9d3bfbab.js", +======= + "file": "assets/stripe-giropay-aedb4a64.js", + "imports": [ + "_wait-8f4ae121.js" + ], +>>>>>>> new_payment_flow "isEntry": true, "src": "resources/js/clients/payments/stripe-giropay.js" }, "resources/js/clients/payments/stripe-ideal.js": { +<<<<<<< HEAD "file": "assets/stripe-ideal-efa175e9.js", +======= + "file": "assets/stripe-ideal-95836518.js", + "imports": [ + "_wait-8f4ae121.js" + ], +>>>>>>> new_payment_flow "isEntry": true, "src": "resources/js/clients/payments/stripe-ideal.js" }, "resources/js/clients/payments/stripe-klarna.js": { +<<<<<<< HEAD "file": "assets/stripe-klarna-e45c946d.js", +======= + "file": "assets/stripe-klarna-93dcc6f1.js", + "imports": [ + "_wait-8f4ae121.js" + ], +>>>>>>> new_payment_flow "isEntry": true, "src": "resources/js/clients/payments/stripe-klarna.js" }, "resources/js/clients/payments/stripe-przelewy24.js": { +<<<<<<< HEAD "file": "assets/stripe-przelewy24-f9154acf.js", +======= + "file": "assets/stripe-przelewy24-5db060c5.js", + "imports": [ + "_wait-8f4ae121.js" + ], +>>>>>>> new_payment_flow "isEntry": true, "src": "resources/js/clients/payments/stripe-przelewy24.js" }, "resources/js/clients/payments/stripe-sepa.js": { +<<<<<<< HEAD "file": "assets/stripe-sepa-6dd487fc.js", +======= + "file": "assets/stripe-sepa-9ab85221.js", + "imports": [ + "_wait-8f4ae121.js" + ], +>>>>>>> new_payment_flow "isEntry": true, "src": "resources/js/clients/payments/stripe-sepa.js" }, "resources/js/clients/payments/stripe-sofort.js": { +<<<<<<< HEAD "file": "assets/stripe-sofort-18aeca06.js", +======= + "file": "assets/stripe-sofort-fbef42bb.js", + "imports": [ + "_wait-8f4ae121.js" + ], +>>>>>>> new_payment_flow "isEntry": true, "src": "resources/js/clients/payments/stripe-sofort.js" }, diff --git a/public/vendor/simple-card@0.0.4/simple-card.js b/public/vendor/simple-card@0.0.4/simple-card.js new file mode 100644 index 000000000000..402945d5f520 --- /dev/null +++ b/public/vendor/simple-card@0.0.4/simple-card.js @@ -0,0 +1,4 @@ +var SimpleCard=function(m){"use strict";var Y=m=>{throw TypeError(m)};var $e=(m,v,w)=>v.has(m)||Y("Cannot "+w);var X=(m,v,w)=>v.has(m)?Y("Cannot add the same private member more than once"):v instanceof WeakSet?v.add(m):v.set(m,w);var J=(m,v,w)=>($e(m,v,"access private method"),w);var L,Q;const v={mask:/^.*$/,preprocessors:[],postprocessors:[],plugins:[],overwriteMode:"shift"};class w{constructor(){this.now=null,this.past=[],this.future=[]}undo(){const e=this.past.pop();e&&this.now&&(this.future.push(this.now),this.updateElement(e,"historyUndo"))}redo(){const e=this.future.pop();e&&this.now&&(this.past.push(this.now),this.updateElement(e,"historyRedo"))}updateHistory(e){if(!this.now){this.now=e;return}const s=this.now.value!==e.value,t=this.now.selection.some((i,r)=>i!==e.selection[r]);!s&&!t||(s&&(this.past.push(this.now),this.future=[]),this.now=e)}updateElement(e,s){this.now=e,this.updateElementState(e,{inputType:s,data:null})}}function ee(n,...e){return e.every(({value:s})=>s===n.value)}function te(n,...e){return e.every(({value:s,selection:t})=>s===n.value&&t[0]===n.selection[0]&&t[1]===n.selection[1])}function ne({value:n,selection:e},s,t){const[i,r]=e,l=typeof t=="function"?t({value:n,selection:e}):t;return{value:n,selection:l==="replace"?[i,i+s.length]:[i,r]}}function T(n){return typeof n=="string"}function j(n,e,s,t){let i="";for(let r=e.length;r{const i=e[t];return T(i)?s===i:s.match(i)}):e.test(n)}function se(n,e,s){let t=null,i=null;const r=Array.from(n.value).reduce((o,a,c)=>{const u=j(e,o,a,s),d=o+u,h=e[d.length];return T(h)?d+h:a.match(h)?(t===null&&c>=n.selection[0]&&(t=d.length),i===null&&c>=n.selection[1]&&(i=d.length),d+a):d},""),l=j(e,r,"",s);return{value:$(r+l,e)?r+l:r,selection:[t??r.length,i??r.length]}}function ie({value:n,selection:e},s){const[t,i]=e;let r=t,l=i;return{value:Array.from(n).reduce((a,c,u)=>{const d=a+c;return t===u&&(r=a.length),i===u&&(l=a.length),d.match(s)?d:a},""),selection:[r,l]}}function C(n,e,s=null){if($(n.value,e))return n;const{value:t,selection:i}=Array.isArray(e)?se(n,e,s):ie(n,e);return{selection:i,value:Array.isArray(e)?t.slice(0,e.length):t}}function H(n,e){if(!Array.isArray(e))return n;const[s,t]=n.selection,i=[],r=Array.from(n.value).reduce((l,o,a)=>{const c=e[a];return a===s&&i.push(l.length),a===t&&i.push(l.length),T(c)&&c===o?l:l+o},"");return i.length<2&&i.push(...new Array(2-i.length).fill(r.length)),{value:r,selection:[i[0],i[1]]}}class M{constructor(e,s){this.initialElementState=e,this.maskOptions=s,this.value="",this.selection=[0,0];const{value:t,selection:i}=C(this.initialElementState,this.getMaskExpression(this.initialElementState));this.value=t,this.selection=i}addCharacters([e,s],t){const{value:i}=this,r=this.getMaskExpression({value:i.slice(0,e)+t+i.slice(s),selection:[e+t.length,e+t.length]}),l={value:i,selection:[e,s]},o=H(l,r),[a,c]=ne(o,t,this.maskOptions.overwriteMode).selection,u=o.value.slice(0,a)+t,d=u.length,h=C({value:u+o.value.slice(c),selection:[d,d]},r,l);if(i.slice(0,a)===C({value:u,selection:[d,d]},r,l).value||te(this,h))throw new Error("Invalid mask value");this.value=h.value,this.selection=h.selection}deleteCharacters([e,s]){if(e===s||!s)return;const{value:t}=this,i=this.getMaskExpression({value:t.slice(0,e)+t.slice(s),selection:[e,e]}),r={value:t,selection:[e,s]},l=H(r,i),[o,a]=l.selection,c=l.value.slice(0,o)+l.value.slice(a),u=C({value:c,selection:[o,o]},i,r);this.value=u.value,this.selection=u.selection}getMaskExpression(e){const{mask:s}=this.maskOptions;return typeof s=="function"?s(e):s}}class re{constructor(e){this.element=e,this.listeners=[]}listen(e,s,t){const i=s;this.element.addEventListener(e,i,t),this.listeners.push(()=>this.element.removeEventListener(e,i))}destroy(){this.listeners.forEach(e=>e())}}const g={CTRL:1,ALT:2,SHIFT:4,META:8},b={Y:89,Z:90};function D(n,e,s){return n.ctrlKey===!!(e&g.CTRL)&&n.altKey===!!(e&g.ALT)&&n.shiftKey===!!(e&g.SHIFT)&&n.metaKey===!!(e&g.META)&&n.keyCode===s}function le(n){return D(n,g.CTRL,b.Y)||D(n,g.CTRL|g.SHIFT,b.Z)||D(n,g.META|g.SHIFT,b.Z)}function ae(n){return D(n,g.CTRL,b.Z)||D(n,g.META,b.Z)}function oe({value:n,selection:e},s){const[t,i]=e;if(t!==i)return[t,i];const r=s?n.slice(t).indexOf(` +`)+1||n.length:n.slice(0,i).lastIndexOf(` +`)+1;return[s?t:r,s?r:i]}function ce({value:n,selection:e},s){const[t,i]=e;return t!==i?[t,i]:(s?[t,i+1]:[t-1,i]).map(l=>Math.min(Math.max(l,0),n.length))}const ue=/\s+$/g,de=/^\s+/g,V=/\s/;function he({value:n,selection:e},s){const[t,i]=e;if(t!==i)return[t,i];if(s){const a=n.slice(t),[c]=a.match(de)||[""],u=a.trimStart().search(V);return[t,u!==-1?t+c.length+u:n.length]}const r=n.slice(0,i),[l]=r.match(ue)||[""],o=r.trimEnd().split("").reverse().findIndex(a=>a.match(V));return[o!==-1?i-l.length-o:0,i]}function x(n=[]){return(e,...s)=>n.reduce((t,i)=>Object.assign(Object.assign({},t),i(t,...s)),e)}function fe(n,e){const s=Object.assign(Object.assign({},v),e),t=x(s.preprocessors),i=x(s.postprocessors),r=typeof n=="string"?{value:n,selection:[0,0]}:n,{elementState:l}=t({elementState:r,data:""},"validation"),o=new M(l,s),{value:a,selection:c}=i(o,r);return typeof n=="string"?a:{value:a,selection:c}}class I extends w{constructor(e,s){super(),this.element=e,this.maskitoOptions=s,this.isTextArea=this.element.nodeName==="TEXTAREA",this.eventListener=new re(this.element),this.options=Object.assign(Object.assign({},v),this.maskitoOptions),this.preprocessor=x(this.options.preprocessors),this.postprocessor=x(this.options.postprocessors),this.teardowns=this.options.plugins.map(t=>t(this.element,this.options)),this.updateHistory(this.elementState),this.eventListener.listen("keydown",t=>{if(le(t))return t.preventDefault(),this.redo();if(ae(t))return t.preventDefault(),this.undo()}),this.eventListener.listen("beforeinput",t=>{var i;const r=t.inputType.includes("Forward");switch(this.updateHistory(this.elementState),t.inputType){case"historyUndo":return t.preventDefault(),this.undo();case"historyRedo":return t.preventDefault(),this.redo();case"deleteByCut":case"deleteContentBackward":case"deleteContentForward":return this.handleDelete({event:t,isForward:r,selection:ce(this.elementState,r)});case"deleteWordForward":case"deleteWordBackward":return this.handleDelete({event:t,isForward:r,selection:he(this.elementState,r),force:!0});case"deleteSoftLineBackward":case"deleteSoftLineForward":case"deleteHardLineBackward":case"deleteHardLineForward":return this.handleDelete({event:t,isForward:r,selection:oe(this.elementState,r),force:!0});case"insertCompositionText":return;case"insertReplacementText":return;case"insertLineBreak":case"insertParagraph":return this.handleEnter(t);case"insertFromPaste":case"insertText":case"insertFromDrop":default:return this.handleInsert(t,t.data||((i=t.dataTransfer)===null||i===void 0?void 0:i.getData("text/plain"))||"")}}),this.eventListener.listen("input",({inputType:t})=>{t!=="insertCompositionText"&&(this.ensureValueFitsMask(),this.updateHistory(this.elementState))}),this.eventListener.listen("compositionend",()=>{this.ensureValueFitsMask(),this.updateHistory(this.elementState)})}get elementState(){const{value:e,selectionStart:s,selectionEnd:t}=this.element;return{value:e,selection:[s||0,t||0]}}get maxLength(){const{maxLength:e}=this.element;return e===-1?1/0:e}destroy(){this.eventListener.destroy(),this.teardowns.forEach(e=>e==null?void 0:e())}updateElementState({value:e,selection:s},t={inputType:"insertText",data:null}){const i=this.elementState.value;this.updateValue(e),this.updateSelectionRange(s),i!==e&&this.dispatchInputEvent(t)}updateSelectionRange([e,s]){var t;const{element:i}=this;i.matches(":focus")&&(i.selectionStart!==e||i.selectionEnd!==s)&&((t=i.setSelectionRange)===null||t===void 0||t.call(i,e,s))}updateValue(e){this.element.value=e}ensureValueFitsMask(){this.updateElementState(fe(this.elementState,this.options))}dispatchInputEvent(e={inputType:"insertText",data:null}){globalThis.InputEvent&&this.element.dispatchEvent(new InputEvent("input",Object.assign(Object.assign({},e),{bubbles:!0,cancelable:!1})))}handleDelete({event:e,selection:s,isForward:t,force:i=!1}){const r={value:this.elementState.value,selection:s},[l,o]=r.selection,{elementState:a}=this.preprocessor({elementState:r,data:""},t?"deleteForward":"deleteBackward"),c=new M(a,this.options),[u,d]=a.selection;c.deleteCharacters([u,d]);const h=this.postprocessor(c,r);if(!(r.value.slice(0,l)+r.value.slice(o)===h.value&&!i&&!this.element.isContentEditable)){if(e.preventDefault(),ee(r,a,c,h))return this.updateSelectionRange(t?[d,d]:[u,u]);this.updateElementState(h,{inputType:e.inputType,data:null}),this.updateHistory(h)}}handleInsert(e,s){const t=this.elementState,{elementState:i,data:r=s}=this.preprocessor({data:s,elementState:t},"insert"),l=new M(i,this.options);try{l.addCharacters(i.selection,r)}catch{return e.preventDefault()}const[o,a]=i.selection,c=t.value.slice(0,o)+s+t.value.slice(a),u=this.postprocessor(l,t);if(u.value.length>this.maxLength)return e.preventDefault();(c!==u.value||this.element.isContentEditable)&&(e.preventDefault(),this.updateElementState(u,{data:s,inputType:e.inputType}),this.updateHistory(u))}handleEnter(e){(this.isTextArea||this.element.isContentEditable)&&this.handleInsert(e,` +`)}}function me(n,e,s){const t=Math.min(Number(s),Math.max(Number(e),Number(n)));return n instanceof Date?new Date(t):t}function pe(n){return n.replaceAll(/\W/g,"").length}const N=n=>{var e,s,t;return{day:((e=n.match(/d/g))===null||e===void 0?void 0:e.length)||0,month:((s=n.match(/m/g))===null||s===void 0?void 0:s.length)||0,year:((t=n.match(/y/g))===null||t===void 0?void 0:t.length)||0}};function ve(n){return{day:String(n.getDate()).padStart(2,"0"),month:String(n.getMonth()+1).padStart(2,"0"),year:String(n.getFullYear()).padStart(4,"0"),hours:String(n.getHours()).padStart(2,"0"),minutes:String(n.getMinutes()).padStart(2,"0"),seconds:String(n.getSeconds()).padStart(2,"0"),milliseconds:String(n.getMilliseconds()).padStart(3,"0")}}function ge(n,e){return n.length!s.match(/^0+$/))}function P(n,e,s){const t=pe(e);return n.replace(s,"").match(new RegExp(`(\\D*\\d[^\\d\\s]*){1,${t}}`,"g"))||[]}function O(n,e){const s=e.replaceAll(/[^dmy]/g,""),t=n.replaceAll(/\D+/g,""),i={day:t.slice(s.indexOf("d"),s.lastIndexOf("d")+1),month:t.slice(s.indexOf("m"),s.lastIndexOf("m")+1),year:t.slice(s.indexOf("y"),s.lastIndexOf("y")+1)};return Object.fromEntries(Object.entries(i).filter(([r,l])=>!!l).sort(([r],[l])=>e.toLowerCase().indexOf(r[0])>e.toLowerCase().indexOf(l[0])?1:-1))}function ye(n,e){var s,t,i,r,l,o,a;const c=((s=n.year)===null||s===void 0?void 0:s.length)===2?`20${n.year}`:n.year,u=new Date(Number(c??"0"),Number((t=n.month)!==null&&t!==void 0?t:"1")-1,Number((i=n.day)!==null&&i!==void 0?i:"1"),Number((r=void 0)!==null&&r!==void 0?r:"0"),Number((l=void 0)!==null&&l!==void 0?l:"0"),Number((o=void 0)!==null&&o!==void 0?o:"0"),Number((a=void 0)!==null&&a!==void 0?a:"0"));return u.setFullYear(Number(c??"0")),u}const B=", ";function k({day:n,month:e,year:s,hours:t,minutes:i,seconds:r,milliseconds:l},{dateMode:o,dateTimeSeparator:a=B,timeMode:c}){var u;const d=((u=o.match(/y/g))===null||u===void 0?void 0:u.length)===2?s==null?void 0:s.slice(-2):s;return(o+(c?a+c:"")).replaceAll(/d+/g,n??"").replaceAll(/m+/g,e??"").replaceAll(/y+/g,d??"").replaceAll(/H+/g,t??"").replaceAll("MSS",l??"").replaceAll(/M+/g,i??"").replaceAll(/S+/g,r??"").replaceAll(/^\D+/g,"").replaceAll(/\D+$/g,"")}const W={day:31,month:12,year:9999},Se=new Date("0001-01-01"),Ee=new Date("9999-12-31"),we=[":","."];function Ae({dateString:n,dateModeTemplate:e,dateSegmentsSeparator:s,offset:t,selection:[i,r]}){const l=O(n,e),o=Object.entries(l),a={};for(const[d,h]of o){const p=k(a,{dateMode:e}),A=W[d],S=p.length&&s.length,y=t+p.length+S+N(e)[d],E=y>=i&&y===r;if(E&&Number(h)>Number(A))return{validatedDateString:"",updatedSelection:[i,r]};if(E&&Number(h)<1)return{validatedDateString:"",updatedSelection:[i,r]};a[d]=h}const c=k(a,{dateMode:e}),u=c.length-n.length;return{validatedDateString:c,updatedSelection:[i+u,r+u]}}const U=/[\\^$.*+?()[\]{}|]/g,be=new RegExp(U.source);function G(n){return n&&be.test(n)?n.replaceAll(U,"\\$&"):n}function R(n,e,s=0){return Number(n.padEnd(e.length,"0"))<=Number(e)?{validatedSegmentValue:n,prefixedZeroesCount:s}:n.endsWith("0")?R(`0${n.slice(0,e.length-1)}`,e,s+1):R(`${n.slice(0,e.length-1)}0`,e,s)}function Z(n){return n.replaceAll(/[0-9]/g,e=>String.fromCharCode(e.charCodeAt(0)-65248))}function De({dateModeTemplate:n,dateSegmentSeparator:e,splitFn:s,uniteFn:t}){return({value:i,selection:r})=>{var l;const[o,a]=r,{dateStrings:c,restPart:u=""}=s(i),d=[];let h=0;c.forEach(A=>{const S=O(A,n),E=Object.entries(S).reduce((_,[K,Fe])=>{const{validatedSegmentValue:_e,prefixedZeroesCount:je}=R(Fe,`${W[K]}`);return h+=je,Object.assign(Object.assign({},_),{[K]:_e})},{});d.push(k(E,{dateMode:n}))});const p=t(d,i)+(!((l=c[c.length-1])===null||l===void 0)&&l.endsWith(e)?e:"")+u;return h&&p.slice(a+h,a+h+e.length)===e&&(h+=e.length),{selection:[o+h,a+h],value:p}}}function ke(){return({elementState:n,data:e})=>{const{value:s,selection:t}=n;return{elementState:{selection:t,value:Z(s)},data:Z(e)}}}function Te(n,e){const s=N(e);return Object.fromEntries(Object.entries(n).map(([t,i])=>{const r=s[t];return[t,i.length===r&&i.match(/^0+$/)?"1".padStart(r,"0"):i]}))}function Ce({dateModeTemplate:n,min:e=Se,max:s=Ee,rangeSeparator:t="",dateSegmentSeparator:i="."}){return({value:r,selection:l})=>{const o=t&&r.endsWith(t),a=P(r,n,t);let c="";for(const u of a){c+=c?t:"";const d=O(u,n);if(!ge(u,n)){const A=Te(d,n),S=k(A,{dateMode:n}),y=u.endsWith(i)?i:"";c+=S+y;continue}const h=ye(d),p=me(h,e,s);c+=k(ve(p),{dateMode:n})}return{selection:l,value:c+(o?t:"")}}}function xe({dateModeTemplate:n,dateSegmentsSeparator:e,rangeSeparator:s="",dateTimeSeparator:t=B}){return({elementState:i,data:r})=>{const l=s?new RegExp(`${s}|-`):t,o=r.split(l),a=r.includes(t)?[o[0]]:o;if(a.every(c=>c.trim().split(/\D/).filter(Boolean).length===n.split(e).length)){const c=a.map(u=>Le(u,n,e)).join(s);return{elementState:i,data:`${c}${r.includes(t)&&t+o[1]||""}`}}return{elementState:i,data:r}}}function Le(n,e,s){const t=n.split(/\D/).filter(Boolean),i=e.split(s);return t.map((l,o)=>o===i.length-1?l:l.padStart(i[o].length,"0")).join(s)}function Me({dateModeTemplate:n,dateSegmentsSeparator:e,rangeSeparator:s=""}){return({elementState:t,data:i})=>{const{value:r,selection:l}=t;if(i===e)return{elementState:t,data:l[0]===r.length?i:""};const o=i.replaceAll(new RegExp(`[^\\d${G(e)}${s}]`,"g"),"");if(!o)return{elementState:t,data:""};const[a,c]=l;let u=c+i.length;const d=r.slice(0,a)+o+r.slice(u),h=P(d,n,s);let p="";const A=!!s&&d.includes(s);for(const y of h){const{validatedDateString:E,updatedSelection:_}=Ae({dateString:y,dateModeTemplate:n,dateSegmentsSeparator:e,offset:p.length,selection:[a,u]});if(y&&!E)return{elementState:t,data:""};u=_[1],p+=A&&!p?E+s:E}const S=p.slice(a,u);return{elementState:{selection:l,value:p.slice(0,a)+S.split(e).map(y=>"0".repeat(y.length)).join(e)+p.slice(u)},data:S}}}function Ie(){return({elementState:n},e)=>{const{value:s,selection:t}=n;if(!s||Oe(s,t))return{elementState:n};const[i,r]=t,l=s.slice(i,r).replaceAll(/\d/g,"0"),o=s.slice(0,i)+l+s.slice(r);return e==="validation"||e==="insert"&&i===r?{elementState:{selection:t,value:o}}:{elementState:{selection:e==="deleteBackward"||e==="insert"?[i,i]:[r,r],value:o}}}}function Oe(n,[e,s]){return s===n.length}function Re({mode:n,separator:e=".",max:s,min:t}){const i=n.split("/").join(e);return Object.assign(Object.assign({},v),{mask:Array.from(i).map(r=>e.includes(r)?r:/\d/),overwriteMode:"replace",preprocessors:[ke(),Ie(),xe({dateModeTemplate:i,dateSegmentsSeparator:e}),Me({dateModeTemplate:i,dateSegmentsSeparator:e})],postprocessors:[De({dateModeTemplate:i,dateSegmentSeparator:e,splitFn:r=>({dateStrings:[r]}),uniteFn:([r])=>r}),Ce({min:t,max:s,dateModeTemplate:i,dateSegmentSeparator:e})]})}new RegExp(`[${we.map(G).join("")}]$`);const q=/^(?:\d{4}[ -]?){0,3}\d{0,4}$/,f={visa:{final:/^4[0-9]{12}(?:[0-9]{3})?$/,start:/^4/,mask:[...new Array(4).fill(/\d/)," ",...new Array(4).fill(/\d/)," ",...new Array(4).fill(/\d/)," ",...new Array(4).fill(/\d/)," ",...new Array(3).fill(/\d/)]},mastercard:{final:/^5[1-5][0-9]{14}$/,start:/^5[1-5]/,mask:[...new Array(4).fill(/\d/)," ",...new Array(4).fill(/\d/)," ",...new Array(4).fill(/\d/)," ",...new Array(4).fill(/\d/)]},amex:{final:/^3[47][0-9]{13}$/,start:/^3[47]/,mask:[...new Array(4).fill(/\d/)," ",...new Array(6).fill(/\d/)," ",...new Array(5).fill(/\d/)]},discover:{final:/^6(?:011|5[0-9]{2})[0-9]{12}$/,start:/^(6011|65|64[4-9])/,mask:[...new Array(4).fill(/\d/)," ",...new Array(4).fill(/\d/)," ",...new Array(4).fill(/\d/)," ",...new Array(4).fill(/\d/)]},diners:{final:/^3(?:0[0-5]|[68][0-9])[0-9]{11}$/,start:/^(30[0-5]|36|38|39)/,mask:[...new Array(4).fill(/\d/)," ",...new Array(4).fill(/\d/)," ",...new Array(4).fill(/\d/)]},jcb:{final:/^(?:2131|1800|35\d{3})\d{11}$/,start:/^(2131|1800|35[0-9]{3})/,mask:[...new Array(4).fill(/\d/)," ",...new Array(4).fill(/\d/)," ",...new Array(4).fill(/\d/)," ",...new Array(3).fill(/\d/)]}};class F{constructor(e){X(this,L);this.options=e}mount(){return this.number=this.options.fields.card.number instanceof HTMLInputElement?this.options.fields.card.number:document.querySelector(this.options.fields.card.number),this.date=this.options.fields.card.date instanceof HTMLInputElement?this.options.fields.card.date:document.querySelector(this.options.fields.card.date),this.cvv=this.options.fields.card.cvv instanceof HTMLInputElement?this.options.fields.card.cvv:document.querySelector(this.options.fields.card.cvv),J(this,L,Q).call(this),this}check(){const e=f.visa.final.test(this.value("number"))||f.mastercard.final.test(this.value("number"))||f.amex.final.test(this.value("number"))||f.discover.final.test(this.value("number"))||f.diners.final.test(this.value("number"))||f.jcb.final.test(this.value("number")),s=new RegExp("^(0[1-9]|1[0-2])/(?:\\d{2})$").test(this.date.value),t=new RegExp("^\\d{3}$").test(this.cvv.value);return{valid:e&&s&&t,number:{valid:e,value:this.number.value},date:{valid:s,value:this.date.value},cvv:{valid:t,value:this.cvv.value}}}type(){return f.visa.start.test(this.number.value)?"visa":f.mastercard.start.test(this.number.value)?"mastercard":f.amex.start.test(this.number.value)?"amex":f.discover.start.test(this.number.value)?"discover":f.diners.start.test(this.number.value)?"diners":f.jcb.start.test(this.number.value)?"jcb":"unknown"}value(e){if(e==="number")return this.number.value.replace(/\s+/g,"");if(e==="date")return this.date.value;if(e==="year"){const[,s]=this.date.value.split("/");return s}if(e==="month"){const[s]=this.date.value.split("/");return s}return e==="cvv"?this.cvv.value:null}}L=new WeakSet,Q=function(){new I(this.number,{mask:e=>f.visa.start.test(e.value)?f.visa.mask:f.mastercard.start.test(e.value)?f.mastercard.mask:f.amex.start.test(e.value)?f.amex.mask:f.discover.start.test(e.value)?f.discover.mask:f.diners.start.test(e.value)?f.diners.mask:f.jcb.start.test(e.value)?f.jcb.mask:new RegExp(q)}),new I(this.date,Re({mode:"mm/yy",separator:"/"})),new I(this.cvv,{mask:[/\d/,/\d/,/\d/]})},window.SimpleCard=F,window.createSimpleCard=z;function z(n){return new F(n)}return m.SimpleCard=F,m.createSimpleCard=z,m.masks=f,m.numbers=q,Object.defineProperty(m,Symbol.toStringTag,{value:"Module"}),m}({}); diff --git a/public/vendor/simple-card@alpha/simple-card.d.ts b/public/vendor/simple-card@alpha/simple-card.d.ts deleted file mode 100644 index bb6dc52e8110..000000000000 --- a/public/vendor/simple-card@alpha/simple-card.d.ts +++ /dev/null @@ -1,79 +0,0 @@ -export declare const masks: { - visa: { - final: RegExp; - start: RegExp; - length: RegExp; - }; - mastercard: { - final: RegExp; - start: RegExp; - length: RegExp; - }; - amex: { - final: RegExp; - start: RegExp; - length: RegExp; - }; - discover: { - final: RegExp; - start: RegExp; - length: RegExp; - }; - diners: { - final: RegExp; - start: RegExp; - length: RegExp; - }; - jcb: { - final: RegExp; - start: RegExp; - length: RegExp; - }; -}; - -export declare const numbers: RegExp; - -export declare type Options = { - fields: { - card: { - number: string | HTMLInputElement; - date: string | HTMLInputElement; - cvv: string | HTMLInputElement; - name?: string | HTMLInputElement; - }; - }; -}; - -export declare class SimpleCard { - #private; - options: Options; - number: HTMLInputElement; - date: HTMLInputElement; - cvv: HTMLInputElement; - constructor(options: Options); - mount(): this; - check(): { - valid: boolean; - number: { - valid: boolean; - value: string; - }; - date: { - valid: boolean; - value: string; - }; - cvv: { - valid: boolean; - value: string; - }; - }; - type(): "visa" | "mastercard" | "amex" | "discover" | "diners" | "jcb" | "unknown"; -} - -export declare type TypeChangeOptions = { - type: string; - value: string; - valid: boolean; -}; - -export { } diff --git a/public/vendor/simple-card@alpha/simple-card.js b/public/vendor/simple-card@alpha/simple-card.js deleted file mode 100644 index de4c51207408..000000000000 --- a/public/vendor/simple-card@alpha/simple-card.js +++ /dev/null @@ -1,734 +0,0 @@ -var F = (n) => { - throw TypeError(n); -}; -var J = (n, e, s) => e.has(n) || F("Cannot " + s); -var _ = (n, e, s) => e.has(n) ? F("Cannot add the same private member more than once") : e instanceof WeakSet ? e.add(n) : e.set(n, s); -var $ = (n, e, s) => (J(n, e, "access private method"), s); -const I = { - mask: /^.*$/, - preprocessors: [], - postprocessors: [], - plugins: [], - overwriteMode: "shift" -}; -class Q { - constructor() { - this.now = null, this.past = [], this.future = []; - } - undo() { - const e = this.past.pop(); - e && this.now && (this.future.push(this.now), this.updateElement(e, "historyUndo")); - } - redo() { - const e = this.future.pop(); - e && this.now && (this.past.push(this.now), this.updateElement(e, "historyRedo")); - } - updateHistory(e) { - if (!this.now) { - this.now = e; - return; - } - const s = this.now.value !== e.value, t = this.now.selection.some((i, r) => i !== e.selection[r]); - !s && !t || (s && (this.past.push(this.now), this.future = []), this.now = e); - } - updateElement(e, s) { - this.now = e, this.updateElementState(e, { inputType: s, data: null }); - } -} -function ee(n, ...e) { - return e.every(({ value: s }) => s === n.value); -} -function te(n, ...e) { - return e.every(({ value: s, selection: t }) => s === n.value && t[0] === n.selection[0] && t[1] === n.selection[1]); -} -function ne({ value: n, selection: e }, s, t) { - const [i, r] = e, l = typeof t == "function" ? t({ value: n, selection: e }) : t; - return { - value: n, - selection: l === "replace" ? [i, i + s.length] : [i, r] - }; -} -function T(n) { - return typeof n == "string"; -} -function j(n, e, s, t) { - let i = ""; - for (let r = e.length; r < n.length; r++) { - const l = n[r], a = (t == null ? void 0 : t.value[r]) === l; - if (!T(l) || l === s && !a) - return i; - i += l; - } - return i; -} -function P(n, e) { - return Array.isArray(e) ? n.length === e.length && Array.from(n).every((s, t) => { - const i = e[t]; - return T(i) ? s === i : s.match(i); - }) : e.test(n); -} -function se(n, e, s) { - let t = null, i = null; - const r = Array.from(n.value).reduce((a, o, c) => { - const u = j(e, a, o, s), d = a + u, h = e[d.length]; - return T(h) ? d + h : o.match(h) ? (t === null && c >= n.selection[0] && (t = d.length), i === null && c >= n.selection[1] && (i = d.length), d + o) : d; - }, ""), l = j(e, r, "", s); - return { - value: P(r + l, e) ? r + l : r, - selection: [t ?? r.length, i ?? r.length] - }; -} -function ie({ value: n, selection: e }, s) { - const [t, i] = e; - let r = t, l = i; - return { value: Array.from(n).reduce((o, c, u) => { - const d = o + c; - return t === u && (r = o.length), i === u && (l = o.length), d.match(s) ? d : o; - }, ""), selection: [r, l] }; -} -function D(n, e, s = null) { - if (P(n.value, e)) - return n; - const { value: t, selection: i } = Array.isArray(e) ? se(n, e, s) : ie(n, e); - return { - selection: i, - value: Array.isArray(e) ? t.slice(0, e.length) : t - }; -} -function H(n, e) { - if (!Array.isArray(e)) - return n; - const [s, t] = n.selection, i = [], r = Array.from(n.value).reduce((l, a, o) => { - const c = e[o]; - return o === s && i.push(l.length), o === t && i.push(l.length), T(c) && c === a ? l : l + a; - }, ""); - return i.length < 2 && i.push(...new Array(2 - i.length).fill(r.length)), { - value: r, - selection: [i[0], i[1]] - }; -} -class L { - constructor(e, s) { - this.initialElementState = e, this.maskOptions = s, this.value = "", this.selection = [0, 0]; - const { value: t, selection: i } = D(this.initialElementState, this.getMaskExpression(this.initialElementState)); - this.value = t, this.selection = i; - } - addCharacters([e, s], t) { - const { value: i } = this, r = this.getMaskExpression({ - value: i.slice(0, e) + t + i.slice(s), - selection: [e + t.length, e + t.length] - }), l = { value: i, selection: [e, s] }, a = H(l, r), [o, c] = ne(a, t, this.maskOptions.overwriteMode).selection, u = a.value.slice(0, o) + t, d = u.length, h = D({ - value: u + a.value.slice(c), - selection: [d, d] - }, r, l); - if (// eslint-disable-next-line @typescript-eslint/prefer-string-starts-ends-with - i.slice(0, o) === D({ - value: u, - selection: [d, d] - }, r, l).value || te(this, h)) - throw new Error("Invalid mask value"); - this.value = h.value, this.selection = h.selection; - } - deleteCharacters([e, s]) { - if (e === s || !s) - return; - const { value: t } = this, i = this.getMaskExpression({ - value: t.slice(0, e) + t.slice(s), - selection: [e, e] - }), r = { value: t, selection: [e, s] }, l = H(r, i), [a, o] = l.selection, c = l.value.slice(0, a) + l.value.slice(o), u = D({ value: c, selection: [a, a] }, i, r); - this.value = u.value, this.selection = u.selection; - } - getMaskExpression(e) { - const { mask: s } = this.maskOptions; - return typeof s == "function" ? s(e) : s; - } -} -class re { - constructor(e) { - this.element = e, this.listeners = []; - } - listen(e, s, t) { - const i = s; - this.element.addEventListener(e, i, t), this.listeners.push(() => this.element.removeEventListener(e, i)); - } - destroy() { - this.listeners.forEach((e) => e()); - } -} -const g = { - CTRL: 1, - ALT: 2, - SHIFT: 4, - META: 8 -}, y = { - Y: 89, - Z: 90 -}; -function b(n, e, s) { - return n.ctrlKey === !!(e & g.CTRL) && n.altKey === !!(e & g.ALT) && n.shiftKey === !!(e & g.SHIFT) && n.metaKey === !!(e & g.META) && /** - * We intentionally use legacy {@link KeyboardEvent#keyCode `keyCode`} property. It is more - * "keyboard-layout"-independent than {@link KeyboardEvent#key `key`} or {@link KeyboardEvent#code `code`} properties. - * @see {@link https://github.com/taiga-family/maskito/issues/315 `KeyboardEvent#code` issue} - */ - n.keyCode === s; -} -function le(n) { - return b(n, g.CTRL, y.Y) || // Windows - b(n, g.CTRL | g.SHIFT, y.Z) || // Windows & Android - b(n, g.META | g.SHIFT, y.Z); -} -function oe(n) { - return b(n, g.CTRL, y.Z) || // Windows & Android - b(n, g.META, y.Z); -} -function ae({ value: n, selection: e }, s) { - const [t, i] = e; - if (t !== i) - return [t, i]; - const r = s ? n.slice(t).indexOf(` -`) + 1 || n.length : n.slice(0, i).lastIndexOf(` -`) + 1; - return [s ? t : r, s ? r : i]; -} -function ce({ value: n, selection: e }, s) { - const [t, i] = e; - return t !== i ? [t, i] : (s ? [t, i + 1] : [t - 1, i]).map((l) => Math.min(Math.max(l, 0), n.length)); -} -const ue = /\s+$/g, de = /^\s+/g, V = /\s/; -function he({ value: n, selection: e }, s) { - const [t, i] = e; - if (t !== i) - return [t, i]; - if (s) { - const o = n.slice(t), [c] = o.match(de) || [ - "" - ], u = o.trimStart().search(V); - return [ - t, - u !== -1 ? t + c.length + u : n.length - ]; - } - const r = n.slice(0, i), [l] = r.match(ue) || [""], a = r.trimEnd().split("").reverse().findIndex((o) => o.match(V)); - return [ - a !== -1 ? i - l.length - a : 0, - i - ]; -} -function A(n = []) { - return (e, ...s) => n.reduce((t, i) => Object.assign(Object.assign({}, t), i(t, ...s)), e); -} -function pe(n, e) { - const s = Object.assign(Object.assign({}, I), e), t = A(s.preprocessors), i = A(s.postprocessors), r = typeof n == "string" ? { value: n, selection: [0, 0] } : n, { elementState: l } = t({ elementState: r, data: "" }, "validation"), a = new L(l, s), { value: o, selection: c } = i(a, r); - return typeof n == "string" ? o : { value: o, selection: c }; -} -class C extends Q { - constructor(e, s) { - super(), this.element = e, this.maskitoOptions = s, this.isTextArea = this.element.nodeName === "TEXTAREA", this.eventListener = new re(this.element), this.options = Object.assign(Object.assign({}, I), this.maskitoOptions), this.preprocessor = A(this.options.preprocessors), this.postprocessor = A(this.options.postprocessors), this.teardowns = this.options.plugins.map((t) => t(this.element, this.options)), this.updateHistory(this.elementState), this.eventListener.listen("keydown", (t) => { - if (le(t)) - return t.preventDefault(), this.redo(); - if (oe(t)) - return t.preventDefault(), this.undo(); - }), this.eventListener.listen("beforeinput", (t) => { - var i; - const r = t.inputType.includes("Forward"); - switch (this.updateHistory(this.elementState), t.inputType) { - case "historyUndo": - return t.preventDefault(), this.undo(); - case "historyRedo": - return t.preventDefault(), this.redo(); - case "deleteByCut": - case "deleteContentBackward": - case "deleteContentForward": - return this.handleDelete({ - event: t, - isForward: r, - selection: ce(this.elementState, r) - }); - case "deleteWordForward": - case "deleteWordBackward": - return this.handleDelete({ - event: t, - isForward: r, - selection: he(this.elementState, r), - force: !0 - }); - case "deleteSoftLineBackward": - case "deleteSoftLineForward": - case "deleteHardLineBackward": - case "deleteHardLineForward": - return this.handleDelete({ - event: t, - isForward: r, - selection: ae(this.elementState, r), - force: !0 - }); - case "insertCompositionText": - return; - case "insertReplacementText": - return; - case "insertLineBreak": - case "insertParagraph": - return this.handleEnter(t); - case "insertFromPaste": - case "insertText": - case "insertFromDrop": - default: - return this.handleInsert(t, t.data || // `event.data` for `contentEditable` is always `null` for paste/drop events - ((i = t.dataTransfer) === null || i === void 0 ? void 0 : i.getData("text/plain")) || ""); - } - }), this.eventListener.listen("input", ({ inputType: t }) => { - t !== "insertCompositionText" && (this.ensureValueFitsMask(), this.updateHistory(this.elementState)); - }), this.eventListener.listen("compositionend", () => { - this.ensureValueFitsMask(), this.updateHistory(this.elementState); - }); - } - get elementState() { - const { value: e, selectionStart: s, selectionEnd: t } = this.element; - return { - value: e, - selection: [s || 0, t || 0] - }; - } - get maxLength() { - const { maxLength: e } = this.element; - return e === -1 ? 1 / 0 : e; - } - destroy() { - this.eventListener.destroy(), this.teardowns.forEach((e) => e == null ? void 0 : e()); - } - updateElementState({ value: e, selection: s }, t = { - inputType: "insertText", - data: null - }) { - const i = this.elementState.value; - this.updateValue(e), this.updateSelectionRange(s), i !== e && this.dispatchInputEvent(t); - } - updateSelectionRange([e, s]) { - var t; - const { element: i } = this; - i.matches(":focus") && (i.selectionStart !== e || i.selectionEnd !== s) && ((t = i.setSelectionRange) === null || t === void 0 || t.call(i, e, s)); - } - updateValue(e) { - this.element.value = e; - } - ensureValueFitsMask() { - this.updateElementState(pe(this.elementState, this.options)); - } - dispatchInputEvent(e = { - inputType: "insertText", - data: null - }) { - globalThis.InputEvent && this.element.dispatchEvent(new InputEvent("input", Object.assign(Object.assign({}, e), { bubbles: !0, cancelable: !1 }))); - } - handleDelete({ event: e, selection: s, isForward: t, force: i = !1 }) { - const r = { - value: this.elementState.value, - selection: s - }, [l, a] = r.selection, { elementState: o } = this.preprocessor({ - elementState: r, - data: "" - }, t ? "deleteForward" : "deleteBackward"), c = new L(o, this.options), [u, d] = o.selection; - c.deleteCharacters([u, d]); - const h = this.postprocessor(c, r); - if (!(r.value.slice(0, l) + r.value.slice(a) === h.value && !i && !this.element.isContentEditable)) { - if (e.preventDefault(), ee(r, o, c, h)) - return this.updateSelectionRange(t ? [d, d] : [u, u]); - this.updateElementState(h, { - inputType: e.inputType, - data: null - }), this.updateHistory(h); - } - } - handleInsert(e, s) { - const t = this.elementState, { elementState: i, data: r = s } = this.preprocessor({ - data: s, - elementState: t - }, "insert"), l = new L(i, this.options); - try { - l.addCharacters(i.selection, r); - } catch { - return e.preventDefault(); - } - const [a, o] = i.selection, c = t.value.slice(0, a) + s + t.value.slice(o), u = this.postprocessor(l, t); - if (u.value.length > this.maxLength) - return e.preventDefault(); - (c !== u.value || this.element.isContentEditable) && (e.preventDefault(), this.updateElementState(u, { - data: s, - inputType: e.inputType - }), this.updateHistory(u)); - } - handleEnter(e) { - (this.isTextArea || this.element.isContentEditable) && this.handleInsert(e, ` -`); - } -} -function fe(n, e, s) { - const t = Math.min(Number(s), Math.max(Number(e), Number(n))); - return n instanceof Date ? new Date(t) : t; -} -function ge(n) { - return n.replaceAll(/\W/g, "").length; -} -const B = (n) => { - var e, s, t; - return { - day: ((e = n.match(/d/g)) === null || e === void 0 ? void 0 : e.length) || 0, - month: ((s = n.match(/m/g)) === null || s === void 0 ? void 0 : s.length) || 0, - year: ((t = n.match(/y/g)) === null || t === void 0 ? void 0 : t.length) || 0 - }; -}; -function me(n) { - return { - day: String(n.getDate()).padStart(2, "0"), - month: String(n.getMonth() + 1).padStart(2, "0"), - year: String(n.getFullYear()).padStart(4, "0"), - hours: String(n.getHours()).padStart(2, "0"), - minutes: String(n.getMinutes()).padStart(2, "0"), - seconds: String(n.getSeconds()).padStart(2, "0"), - milliseconds: String(n.getMilliseconds()).padStart(3, "0") - }; -} -function ve(n, e) { - return n.length < e.length ? !1 : n.split(/\D/).every((s) => !s.match(/^0+$/)); -} -function W(n, e, s) { - const t = ge(e); - return n.replace(s, "").match(new RegExp(`(\\D*\\d[^\\d\\s]*){1,${t}}`, "g")) || []; -} -function M(n, e) { - const s = e.replaceAll(/[^dmy]/g, ""), t = n.replaceAll(/\D+/g, ""), i = { - day: t.slice(s.indexOf("d"), s.lastIndexOf("d") + 1), - month: t.slice(s.indexOf("m"), s.lastIndexOf("m") + 1), - year: t.slice(s.indexOf("y"), s.lastIndexOf("y") + 1) - }; - return Object.fromEntries(Object.entries(i).filter(([r, l]) => !!l).sort(([r], [l]) => e.toLowerCase().indexOf(r[0]) > e.toLowerCase().indexOf(l[0]) ? 1 : -1)); -} -function Ee(n, e) { - var s, t, i, r, l, a, o; - const c = ((s = n.year) === null || s === void 0 ? void 0 : s.length) === 2 ? `20${n.year}` : n.year, u = new Date(Number(c ?? "0"), Number((t = n.month) !== null && t !== void 0 ? t : "1") - 1, Number((i = n.day) !== null && i !== void 0 ? i : "1"), Number((r = void 0) !== null && r !== void 0 ? r : "0"), Number((l = void 0) !== null && l !== void 0 ? l : "0"), Number((a = void 0) !== null && a !== void 0 ? a : "0"), Number((o = void 0) !== null && o !== void 0 ? o : "0")); - return u.setFullYear(Number(c ?? "0")), u; -} -const U = ", "; -function w({ day: n, month: e, year: s, hours: t, minutes: i, seconds: r, milliseconds: l }, { dateMode: a, dateTimeSeparator: o = U, timeMode: c }) { - var u; - const d = ((u = a.match(/y/g)) === null || u === void 0 ? void 0 : u.length) === 2 ? s == null ? void 0 : s.slice(-2) : s; - return (a + (c ? o + c : "")).replaceAll(/d+/g, n ?? "").replaceAll(/m+/g, e ?? "").replaceAll(/y+/g, d ?? "").replaceAll(/H+/g, t ?? "").replaceAll("MSS", l ?? "").replaceAll(/M+/g, i ?? "").replaceAll(/S+/g, r ?? "").replaceAll(/^\D+/g, "").replaceAll(/\D+$/g, ""); -} -const G = { - day: 31, - month: 12, - year: 9999 -}, Se = /* @__PURE__ */ new Date("0001-01-01"), ye = /* @__PURE__ */ new Date("9999-12-31"), be = [":", "."]; -function we({ dateString: n, dateModeTemplate: e, dateSegmentsSeparator: s, offset: t, selection: [i, r] }) { - const l = M(n, e), a = Object.entries(l), o = {}; - for (const [d, h] of a) { - const f = w(o, { - dateMode: e - }), S = G[d], v = f.length && s.length, m = t + f.length + v + B(e)[d], E = m >= i && m === r; - if (E && Number(h) > Number(S)) - return { validatedDateString: "", updatedSelection: [i, r] }; - if (E && Number(h) < 1) - return { validatedDateString: "", updatedSelection: [i, r] }; - o[d] = h; - } - const c = w(o, { - dateMode: e - }), u = c.length - n.length; - return { - validatedDateString: c, - updatedSelection: [ - i + u, - r + u - ] - }; -} -const Z = /[\\^$.*+?()[\]{}|]/g, De = new RegExp(Z.source); -function q(n) { - return n && De.test(n) ? n.replaceAll(Z, "\\$&") : n; -} -function R(n, e, s = 0) { - return Number(n.padEnd(e.length, "0")) <= Number(e) ? { validatedSegmentValue: n, prefixedZeroesCount: s } : n.endsWith("0") ? R(`0${n.slice(0, e.length - 1)}`, e, s + 1) : R(`${n.slice(0, e.length - 1)}0`, e, s); -} -function N(n) { - return n.replaceAll(/[0-9]/g, (e) => String.fromCharCode(e.charCodeAt(0) - 65248)); -} -function Ae({ dateModeTemplate: n, dateSegmentSeparator: e, splitFn: s, uniteFn: t }) { - return ({ value: i, selection: r }) => { - var l; - const [a, o] = r, { dateStrings: c, restPart: u = "" } = s(i), d = []; - let h = 0; - c.forEach((S) => { - const v = M(S, n), E = Object.entries(v).reduce((k, [O, K]) => { - const { validatedSegmentValue: Y, prefixedZeroesCount: X } = R(K, `${G[O]}`); - return h += X, Object.assign(Object.assign({}, k), { [O]: Y }); - }, {}); - d.push(w(E, { dateMode: n })); - }); - const f = t(d, i) + (!((l = c[c.length - 1]) === null || l === void 0) && l.endsWith(e) ? e : "") + u; - return h && f.slice(o + h, o + h + e.length) === e && (h += e.length), { - selection: [a + h, o + h], - value: f - }; - }; -} -function xe() { - return ({ elementState: n, data: e }) => { - const { value: s, selection: t } = n; - return { - elementState: { - selection: t, - value: N(s) - }, - data: N(e) - }; - }; -} -function Te(n, e) { - const s = B(e); - return Object.fromEntries(Object.entries(n).map(([t, i]) => { - const r = s[t]; - return [ - t, - i.length === r && i.match(/^0+$/) ? "1".padStart(r, "0") : i - ]; - })); -} -function ke({ dateModeTemplate: n, min: e = Se, max: s = ye, rangeSeparator: t = "", dateSegmentSeparator: i = "." }) { - return ({ value: r, selection: l }) => { - const a = t && r.endsWith(t), o = W(r, n, t); - let c = ""; - for (const u of o) { - c += c ? t : ""; - const d = M(u, n); - if (!ve(u, n)) { - const S = Te(d, n), v = w(S, { dateMode: n }), m = u.endsWith(i) ? i : ""; - c += v + m; - continue; - } - const h = Ee(d), f = fe(h, e, s); - c += w(me(f), { - dateMode: n - }); - } - return { - selection: l, - value: c + (a ? t : "") - }; - }; -} -function Ce({ dateModeTemplate: n, dateSegmentsSeparator: e, rangeSeparator: s = "", dateTimeSeparator: t = U }) { - return ({ elementState: i, data: r }) => { - const l = s ? new RegExp(`${s}|-`) : t, a = r.split(l), o = r.includes(t) ? [a[0]] : a; - if (o.every((c) => c.trim().split(/\D/).filter(Boolean).length === n.split(e).length)) { - const c = o.map((u) => Le(u, n, e)).join(s); - return { - elementState: i, - data: `${c}${r.includes(t) && t + a[1] || ""}` - }; - } - return { elementState: i, data: r }; - }; -} -function Le(n, e, s) { - const t = n.split(/\D/).filter(Boolean), i = e.split(s); - return t.map((l, a) => a === i.length - 1 ? l : l.padStart(i[a].length, "0")).join(s); -} -function Re({ dateModeTemplate: n, dateSegmentsSeparator: e, rangeSeparator: s = "" }) { - return ({ elementState: t, data: i }) => { - const { value: r, selection: l } = t; - if (i === e) - return { - elementState: t, - data: l[0] === r.length ? i : "" - }; - const a = i.replaceAll(new RegExp(`[^\\d${q(e)}${s}]`, "g"), ""); - if (!a) - return { elementState: t, data: "" }; - const [o, c] = l; - let u = c + i.length; - const d = r.slice(0, o) + a + r.slice(u), h = W(d, n, s); - let f = ""; - const S = !!s && d.includes(s); - for (const m of h) { - const { validatedDateString: E, updatedSelection: k } = we({ - dateString: m, - dateModeTemplate: n, - dateSegmentsSeparator: e, - offset: f.length, - selection: [o, u] - }); - if (m && !E) - return { elementState: t, data: "" }; - u = k[1], f += S && !f ? E + s : E; - } - const v = f.slice(o, u); - return { - elementState: { - selection: l, - value: f.slice(0, o) + v.split(e).map((m) => "0".repeat(m.length)).join(e) + f.slice(u) - }, - data: v - }; - }; -} -function Ie() { - return ({ elementState: n }, e) => { - const { value: s, selection: t } = n; - if (!s || Me(s, t)) - return { elementState: n }; - const [i, r] = t, l = s.slice(i, r).replaceAll(/\d/g, "0"), a = s.slice(0, i) + l + s.slice(r); - return e === "validation" || e === "insert" && i === r ? { - elementState: { selection: t, value: a } - } : { - elementState: { - selection: e === "deleteBackward" || e === "insert" ? [i, i] : [r, r], - value: a - } - }; - }; -} -function Me(n, [e, s]) { - return s === n.length; -} -function Oe({ mode: n, separator: e = ".", max: s, min: t }) { - const i = n.split("/").join(e); - return Object.assign(Object.assign({}, I), { mask: Array.from(i).map((r) => e.includes(r) ? r : /\d/), overwriteMode: "replace", preprocessors: [ - xe(), - Ie(), - Ce({ - dateModeTemplate: i, - dateSegmentsSeparator: e - }), - Re({ - dateModeTemplate: i, - dateSegmentsSeparator: e - }) - ], postprocessors: [ - Ae({ - dateModeTemplate: i, - dateSegmentSeparator: e, - splitFn: (r) => ({ dateStrings: [r] }), - uniteFn: ([r]) => r - }), - ke({ - min: t, - max: s, - dateModeTemplate: i, - dateSegmentSeparator: e - }) - ] }); -} -new RegExp(`[${be.map(q).join("")}]$`); -const Fe = /^(?:\d{4}[ -]?){0,3}\d{0,4}$/, p = { - // Visa: Starts with 4, 13 or 16 digits - visa: { - final: /^4(?:\d{3}[- ]?){3}\d{3,4}$/, - // Exactly 13 or 16 digits - start: /^4/, - // Checks if the input starts with 4 - length: /^4\d{0,15}$/ - // Strictly matches 1 to 16 digits after the initial 4, no spaces or dashes - }, - // MasterCard: Starts with 51-55, 16 digits - mastercard: { - final: /^5[1-5]\d{3}[- ]?\d{4}[- ]?\d{4}[- ]?\d{4}$/, - // Exactly 16 digits - start: /^5[1-5]/, - // Checks if the input starts with 51-55 - length: /^5[1-5]\d{0,15}$/ - // Strictly matches 2 to 16 digits after the initial 51-55, no spaces or dashes - }, - // American Express: Starts with 34 or 37, 15 digits - amex: { - final: /^3[47]\d{2}[- ]?\d{6}[- ]?\d{5}$/, - // Exactly 15 digits - start: /^3[47]/, - // Checks if the input starts with 34 or 37 - length: /^3[47]\d{0,15}$/ - // Strictly matches 2 to 15 digits after the initial 34 or 37, no spaces or dashes - }, - // Discover: Starts with 6011 or 65 or 64[4-9], 16 digits - discover: { - final: /^(6011|65|64[4-9])\d{4}[- ]?\d{4}[- ]?\d{4}$/, - // Exactly 16 digits - start: /^(6011|65|64[4-9])/, - // Checks if the input starts with 6011, 65, or 64 followed by 4-9 - length: /^(6011|65|64[4-9])\d{0,15}$/ - // Strictly matches 4 to 16 digits after the initial prefix, no spaces or dashes - }, - // Diners Club: Starts with 30[0-5], 36, 38, or 39, 14 digits - diners: { - final: /^(30[0-5]|36|38|39)\d{4}[- ]?\d{4}[- ]?\d{4}$/, - // Exactly 14 digits - start: /^(30[0-5]|36|38|39)/, - // Checks if the input starts with 30-35, 36, 38, or 39 - length: /^(30[0-5]|36|38|39)\d{0,14}$/ - // Strictly matches 2 to 14 digits after the initial prefix, no spaces or dashes - }, - // JCB: Starts with 2131, 1800, or 35[0-9]{3}, 15 or 16 digits - jcb: { - final: /^(2131|1800|35[0-9]{3})\d{4}[- ]?\d{4}[- ]?\d{4}$/, - // Exactly 15 or 16 digits - start: /^(2131|1800|35[0-9]{3})/, - // Checks if the input starts with 2131, 1800, or 35 followed by 3 digits - length: /^(2131|1800|35[0-9]{3})\d{0,15}$/ - // Strictly matches 4 to 16 digits after the initial prefix, no spaces or dashes - } -}; -var x, z; -class $e { - constructor(e) { - _(this, x); - this.options = e; - } - mount() { - return this.number = this.options.fields.card.number instanceof HTMLInputElement ? this.options.fields.card.number : document.querySelector( - this.options.fields.card.number - ), this.date = this.options.fields.card.date instanceof HTMLInputElement ? this.options.fields.card.date : document.querySelector( - this.options.fields.card.date - ), this.cvv = this.options.fields.card.cvv instanceof HTMLInputElement ? this.options.fields.card.cvv : document.querySelector( - this.options.fields.card.cvv - ), $(this, x, z).call(this), this; - } - check() { - const e = p.visa.final.test(this.number.value) || p.mastercard.final.test(this.number.value) || p.amex.final.test(this.number.value) || p.discover.final.test(this.number.value) || p.diners.final.test(this.number.value) || p.jcb.final.test(this.number.value), s = new RegExp("^(0[1-9]|1[0-2])/(?:\\d{2})$").test( - this.date.value - ), t = new RegExp("^\\d{3}$").test(this.cvv.value); - return { - valid: e && s && t, - number: { - valid: e, - value: this.number.value - }, - date: { - valid: s, - value: this.date.value - }, - cvv: { - valid: t, - value: this.cvv.value - } - }; - } - type() { - return p.visa.start.test(this.number.value) ? "visa" : p.mastercard.start.test(this.number.value) ? "mastercard" : p.amex.start.test(this.number.value) ? "amex" : p.discover.start.test(this.number.value) ? "discover" : p.diners.start.test(this.number.value) ? "diners" : p.jcb.start.test(this.number.value) ? "jcb" : "unknown"; - } -} -x = new WeakSet(), z = function() { - new C(this.number, { - mask: (e) => p.visa.start.test(e.value) ? new RegExp(p.visa.length) : p.mastercard.start.test(e.value) ? new RegExp(p.mastercard.length) : p.amex.start.test(e.value) ? new RegExp(p.amex.length) : p.discover.start.test(e.value) ? new RegExp(p.discover.length) : p.diners.start.test(e.value) ? new RegExp(p.diners.length) : p.jcb.start.test(e.value) ? new RegExp(p.jcb.length) : new RegExp(Fe) - }), new C( - this.date, - Oe({ - mode: "mm/yy", - separator: "/" - }) - ), new C(this.cvv, { - mask: [/\d/, /\d/, /\d/] - }); -}; -export { - $e as SimpleCard, - p as masks, - Fe as numbers -}; diff --git a/resources/js/clients/payment_methods/authorize-authorize-card.js b/resources/js/clients/payment_methods/authorize-authorize-card.js index 2c92b5743e9a..ad025c633493 100644 --- a/resources/js/clients/payment_methods/authorize-authorize-card.js +++ b/resources/js/clients/payment_methods/authorize-authorize-card.js @@ -15,34 +15,49 @@ class AuthorizeAuthorizeCard { this.loginId = loginId; this.cardHolderName = document.getElementById("cardholder_name"); this.cardButton = document.getElementById("card_button"); + + this.sc = createSimpleCard({ + fields: { + card: { + number: '#number', + date: '#date', + cvv: '#cvv', + }, + }, + }); + + this.sc.mount(); } handleAuthorization() { + if ( + this.cvvRequired == '1' && + document.getElementById('cvv').value.length < 3 + ) { + const $errors = document.getElementById('errors'); + + if ($errors) { + $errors.innerText = 'CVV is required'; + $errors.style.display = 'block'; + } - - if (cvvRequired == "1" && document.getElementById("cvv").value.length < 3) { - - var $errors = $('#errors'); - $errors.show().html("

CVV is required

"); - - document.getElementById('card_button').disabled = false; - document.querySelector('#card_button > svg').classList.add('hidden'); - document.querySelector('#card_button > span').classList.remove('hidden'); - + document.getElementById('pay-now').disabled = false; + document.querySelector('#pay-now > svg').classList.add('hidden'); + document + .querySelector('#pay-now > span') + .classList.remove('hidden'); return; } - var myCard = $('#my-card'); - var authData = {}; authData.clientKey = this.publicKey; authData.apiLoginID = this.loginId; var cardData = {}; - cardData.cardNumber = myCard.CardJs('cardNumber').replace(/[^\d]/g, ''); - cardData.month = myCard.CardJs('expiryMonth').replace(/[^\d]/g, ''); - cardData.year = myCard.CardJs('expiryYear').replace(/[^\d]/g, ''); - cardData.cardCode = document.getElementById("cvv").value.replace(/[^\d]/g, '');; + cardData.cardNumber = this.sc.value('number')?.replace(/[^\d]/g, ''); + cardData.month = this.sc.value('month')?.replace(/[^\d]/g, ''); + cardData.year = `20${this.sc.value('year')?.replace(/[^\d]/g, '')}`; + cardData.cardCode = this.sc.value('cvv')?.replace(/[^\d]/g, ''); var secureData = {}; secureData.authData = authData; @@ -61,8 +76,12 @@ class AuthorizeAuthorizeCard { if (response.messages.resultCode === "Error") { var i = 0; - var $errors = $('#errors'); // get the reference of the div - $errors.show().html("

" + response.messages.message[i].code + ": " + response.messages.message[i].text + "

"); + const $errors = document.getElementById('errors'); // get the reference of the div + + if ($errors) { + $errors.innerText = `${response.messages.message[i].code}: ${response.messages.message[i].text}`; + $errors.style.display = 'block'; + } document.getElementById('card_button').disabled = false; document.querySelector('#card_button > svg').classList.add('hidden'); diff --git a/resources/js/clients/payments/authorize-credit-card-payment.js b/resources/js/clients/payments/authorize-credit-card-payment.js index 2d4ec69b3546..768d6eac3bdd 100644 --- a/resources/js/clients/payments/authorize-credit-card-payment.js +++ b/resources/js/clients/payments/authorize-credit-card-payment.js @@ -8,12 +8,31 @@ * @license https://www.elastic.co/licensing/elastic-license */ +import { wait, instant } from '../wait'; + class AuthorizeAuthorizeCard { constructor(publicKey, loginId) { this.publicKey = publicKey; this.loginId = loginId; - this.cardHolderName = document.getElementById("cardholder_name"); + this.cardHolderName = document.getElementById('cardholder_name'); + + this.sc = createSimpleCard({ + fields: { + card: { + number: '#number', + date: '#date', + cvv: '#cvv', + }, + }, + }); + + this.sc.mount(); + + this.cvvRequired = document.querySelector( + 'meta[name="authnet-require-cvv"]' + ).content; + } handleAuthorization = () => { diff --git a/resources/js/clients/payments/braintree-paypal.js b/resources/js/clients/payments/braintree-paypal.js index affaf1cb26b2..2b43a95f69fa 100644 --- a/resources/js/clients/payments/braintree-paypal.js +++ b/resources/js/clients/payments/braintree-paypal.js @@ -86,6 +86,9 @@ class BraintreePayPal { onApprove: function (data, actions) { return paypalCheckoutInstance.tokenizePayment(data).then(function (payload) { + document.querySelector('#paypal-button')?.classList.add('hidden'); + document.querySelector('#paypal-spinner')?.classList.remove('hidden'); + let tokenBillingCheckbox = document.querySelector( 'input[name="token-billing-checkbox"]:checked' ); diff --git a/resources/js/clients/payments/checkout-credit-card.js b/resources/js/clients/payments/checkout-credit-card.js index bb32fa7337ce..a3e3821405b8 100644 --- a/resources/js/clients/payments/checkout-credit-card.js +++ b/resources/js/clients/payments/checkout-credit-card.js @@ -8,6 +8,8 @@ * @license https://www.elastic.co/licensing/elastic-license */ +import { wait, instant } from '../wait'; + class CheckoutCreditCard { constructor() { this.tokens = []; @@ -101,4 +103,10 @@ class CheckoutCreditCard { } } -new CheckoutCreditCard().handle(); +function boot() { + new CheckoutCreditCard().handle() +} + +instant() ? boot() : wait('#checkout-credit-card-payment').then(() => + new CheckoutCreditCard().handle() +); diff --git a/resources/js/clients/payments/eway-credit-card.js b/resources/js/clients/payments/eway-credit-card.js index 3d4f99297e70..500432f3aaca 100644 --- a/resources/js/clients/payments/eway-credit-card.js +++ b/resources/js/clients/payments/eway-credit-card.js @@ -431,6 +431,11 @@ class EwayRapid { completeAuthorization(event) { event.target.parentElement.disabled = true; + const button = document.getElementById('authorize-card'); + + button.querySelector('svg').classList.remove('hidden'); + button.querySelector('span').classList.add('hidden'); + document.getElementById('server-response').submit(); } @@ -498,9 +503,14 @@ class EwayRapid { }); } + const payNowButton = document.getElementById('pay-now'); + document.getElementById('pay-now')?.addEventListener('click', (e) => { let tokenInput = document.querySelector('input[name=token]'); + payNowButton.querySelector('svg').classList.remove('hidden'); + payNowButton.querySelector('span').classList.add('hidden'); + if (tokenInput.value) { return this.completePaymentUsingToken(e); } diff --git a/resources/js/clients/payments/forte-credit-card-payment.js b/resources/js/clients/payments/forte-credit-card-payment.js index e406d2153911..d6bd2d72a845 100644 --- a/resources/js/clients/payments/forte-credit-card-payment.js +++ b/resources/js/clients/payments/forte-credit-card-payment.js @@ -8,10 +8,24 @@ * @license https://opensource.org/licenses/AAL */ +import { wait, instant } from '../wait'; + class ForteAuthorizeCard { constructor(apiLoginId) { this.apiLoginId = apiLoginId; this.cardHolderName = document.getElementById('cardholder_name'); + + this.sc = createSimpleCard({ + fields: { + card: { + number: '#number', + date: '#date', + cvv: '#cvv', + }, + }, + }); + + this.sc.mount(); } handleAuthorization = () => { diff --git a/resources/js/clients/payments/paytrace-credit-card.js b/resources/js/clients/payments/paytrace-credit-card.js index 9b67b1ed8d07..5f659a7f7c9e 100644 --- a/resources/js/clients/payments/paytrace-credit-card.js +++ b/resources/js/clients/payments/paytrace-credit-card.js @@ -122,6 +122,11 @@ class PayTraceCreditCard { } handlePaymentWithCreditCard(event) { + const button = document.getElementById('pay-now'); + + button.querySelector('svg').classList.remove('hidden'); + button.querySelector('span').classList.add('hidden'); + event.target.parentElement.disabled = true; document.getElementById('errors').hidden = true; @@ -132,6 +137,10 @@ class PayTraceCreditCard { errorsContainer.textContent = errors[0].description; errorsContainer.hidden = false; + + button.querySelector('svg').classList.add('hidden'); + button.querySelector('span').classList.remove('hidden'); + return (event.target.parentElement.disabled = false); } @@ -161,6 +170,9 @@ class PayTraceCreditCard { ).textContent = JSON.stringify(error); document.getElementById('errors').hidden = false; + button.querySelector('svg').classList.add('hidden'); + button.querySelector('span').classList.remove('hidden'); + console.log(error); }); }); @@ -169,6 +181,11 @@ class PayTraceCreditCard { handlePaymentWithToken(event) { event.target.parentElement.disabled = true; + const button = document.getElementById('pay-now'); + + button.querySelector('svg').classList.remove('hidden'); + button.querySelector('span').classList.add('hidden'); + document.getElementById('server_response').submit(); } diff --git a/resources/js/clients/payments/stripe-bacs.js b/resources/js/clients/payments/stripe-bacs.js index a67c9057c588..27b7be3ba499 100644 --- a/resources/js/clients/payments/stripe-bacs.js +++ b/resources/js/clients/payments/stripe-bacs.js @@ -9,7 +9,7 @@ */ class ProcessBACS { - constructor(key, stripeConnect) { + constructor(key, stripeConnect, onlyAuthorization) { this.key = key; this.errors = document.getElementById('errors'); this.stripeConnect = stripeConnect; @@ -75,13 +75,17 @@ class ProcessBACS { } } -const publishableKey = document.querySelector( - 'meta[name="stripe-publishable-key"]' -)?.content ?? ''; +function boot() { + const publishableKey = document.querySelector( + 'meta[name="stripe-publishable-key"]' + )?.content ?? ''; + + const stripeConnect = + document.querySelector('meta[name="stripe-account-id"]')?.content ?? ''; + const onlyAuthorization = + document.querySelector('meta[name="only-authorization"]')?.content ?? ''; + + new ProcessBACS(publishableKey, stripeConnect, onlyAuthorization).setupStripe().handle(); +} -const stripeConnect = - document.querySelector('meta[name="stripe-account-id"]')?.content ?? ''; -const onlyAuthorization = - document.querySelector('meta[name="only-authorization"]')?.content ?? ''; - -new ProcessBACS(publishableKey, stripeConnect).setupStripe().handle(); +instant() ? boot() : wait('#stripe-bacs-payment').then(() => boot()); diff --git a/resources/views/portal/ninja2020/gateways/authorize/credit_card/authorize.blade.php b/resources/views/portal/ninja2020/gateways/authorize/credit_card/authorize.blade.php index 9cae6921c53d..1734e6696b01 100644 --- a/resources/views/portal/ninja2020/gateways/authorize/credit_card/authorize.blade.php +++ b/resources/views/portal/ninja2020/gateways/authorize/credit_card/authorize.blade.php @@ -7,11 +7,9 @@ + - - - @endsection @section('gateway_content') @@ -51,25 +49,18 @@ @endif + + @vite('resources/js/clients/payment_methods/authorize-authorize-card.js') @endsection @push('footer') -@endpush \ No newline at end of file +@endpush diff --git a/resources/views/portal/ninja2020/gateways/authorize/credit_card/pay.blade.php b/resources/views/portal/ninja2020/gateways/authorize/credit_card/pay.blade.php index cf5b09816890..c74cdaee0668 100644 --- a/resources/views/portal/ninja2020/gateways/authorize/credit_card/pay.blade.php +++ b/resources/views/portal/ninja2020/gateways/authorize/credit_card/pay.blade.php @@ -6,9 +6,6 @@ - - - @endsection @section('gateway_content') @@ -71,25 +68,17 @@ @endif + @vite('resources/js/clients/payments/authorize-credit-card-payment.js') @endsection @push('footer') -@endpush \ No newline at end of file +@endpush diff --git a/resources/views/portal/ninja2020/gateways/authorize/credit_card/pay_livewire.blade.php b/resources/views/portal/ninja2020/gateways/authorize/credit_card/pay_livewire.blade.php index d591a0561ef0..b708e3e85a88 100644 --- a/resources/views/portal/ninja2020/gateways/authorize/credit_card/pay_livewire.blade.php +++ b/resources/views/portal/ninja2020/gateways/authorize/credit_card/pay_livewire.blade.php @@ -63,5 +63,6 @@ @endif + @vite('resources/js/clients/payments/authorize-credit-card-payment.js') @endassets diff --git a/resources/views/portal/ninja2020/gateways/authorize/includes/credit_card.blade.php b/resources/views/portal/ninja2020/gateways/authorize/includes/credit_card.blade.php index db384defa35b..abb66b7a3157 100644 --- a/resources/views/portal/ninja2020/gateways/authorize/includes/credit_card.blade.php +++ b/resources/views/portal/ninja2020/gateways/authorize/includes/credit_card.blade.php @@ -1,11 +1,16 @@
-
- - - - - +
+ + +
+ + +
+ + +
diff --git a/resources/views/portal/ninja2020/gateways/braintree/paypal/pay.blade.php b/resources/views/portal/ninja2020/gateways/braintree/paypal/pay.blade.php index b405cebafed9..d83b2ea496bb 100644 --- a/resources/views/portal/ninja2020/gateways/braintree/paypal/pay.blade.php +++ b/resources/views/portal/ninja2020/gateways/braintree/paypal/pay.blade.php @@ -59,6 +59,11 @@ @component('portal.ninja2020.components.general.card-element-single')
+ + @endcomponent @include('portal.ninja2020.gateways.includes.pay_now', ['id' => 'pay-now-with-token', 'class' => 'hidden']) diff --git a/resources/views/portal/ninja2020/gateways/braintree/paypal/pay_livewire.blade.php b/resources/views/portal/ninja2020/gateways/braintree/paypal/pay_livewire.blade.php index ac4ac9690c31..a1d4962918bc 100644 --- a/resources/views/portal/ninja2020/gateways/braintree/paypal/pay_livewire.blade.php +++ b/resources/views/portal/ninja2020/gateways/braintree/paypal/pay_livewire.blade.php @@ -53,6 +53,11 @@ @component('portal.ninja2020.components.general.card-element-single')
+ + @endcomponent @include('portal.ninja2020.gateways.includes.pay_now', ['id' => 'pay-now-with-token', 'class' => 'hidden']) diff --git a/resources/views/portal/ninja2020/gateways/checkout/credit_card/pay.blade.php b/resources/views/portal/ninja2020/gateways/checkout/credit_card/pay.blade.php index 308cba1a0656..bbcfed3655cd 100644 --- a/resources/views/portal/ninja2020/gateways/checkout/credit_card/pay.blade.php +++ b/resources/views/portal/ninja2020/gateways/checkout/credit_card/pay.blade.php @@ -6,6 +6,7 @@ + @include('portal.ninja2020.gateways.checkout.credit_card.includes.styles') diff --git a/resources/views/portal/ninja2020/gateways/eway/authorize.blade.php b/resources/views/portal/ninja2020/gateways/eway/authorize.blade.php index 7f062ea3ca63..e33106a9f9cc 100644 --- a/resources/views/portal/ninja2020/gateways/eway/authorize.blade.php +++ b/resources/views/portal/ninja2020/gateways/eway/authorize.blade.php @@ -7,6 +7,7 @@ ctrans('texts.credit_card')]) + @endsection @section('gateway_content') diff --git a/resources/views/portal/ninja2020/gateways/forte/credit_card/authorize.blade.php b/resources/views/portal/ninja2020/gateways/forte/credit_card/authorize.blade.php index 577999262a05..3bf591d8136d 100644 --- a/resources/views/portal/ninja2020/gateways/forte/credit_card/authorize.blade.php +++ b/resources/views/portal/ninja2020/gateways/forte/credit_card/authorize.blade.php @@ -6,9 +6,8 @@ - + - @if($gateway->company_gateway->getConfigField('testMode')) @else @@ -70,7 +69,19 @@ @endsection @section('gateway_footer') - diff --git a/resources/views/portal/ninja2020/gateways/forte/credit_card/pay.blade.php b/resources/views/portal/ninja2020/gateways/forte/credit_card/pay.blade.php index bb5901a58230..3c7b389c7ad0 100644 --- a/resources/views/portal/ninja2020/gateways/forte/credit_card/pay.blade.php +++ b/resources/views/portal/ninja2020/gateways/forte/credit_card/pay.blade.php @@ -3,9 +3,6 @@ @section('gateway_head') - - - @endsection @section('gateway_content') @@ -78,26 +75,19 @@ @else @endif + + @vite('resources/js/clients/payments/forte-credit-card-payment.js') @endsection @push('footer') -@endpush \ No newline at end of file +@endpush diff --git a/resources/views/portal/ninja2020/gateways/forte/credit_card/pay_livewire.blade.php b/resources/views/portal/ninja2020/gateways/forte/credit_card/pay_livewire.blade.php index cff7d20ca4a2..63056fb20178 100644 --- a/resources/views/portal/ninja2020/gateways/forte/credit_card/pay_livewire.blade.php +++ b/resources/views/portal/ninja2020/gateways/forte/credit_card/pay_livewire.blade.php @@ -33,11 +33,14 @@
@assets + @if($gateway->company_gateway->getConfigField('testMode')) @else @endif + + @vite('resources/js/clients/payments/forte-credit-card-payment.js') @endassets diff --git a/resources/views/portal/ninja2020/gateways/forte/includes/credit_card.blade.php b/resources/views/portal/ninja2020/gateways/forte/includes/credit_card.blade.php index b15c3332764a..225c767e4da8 100644 --- a/resources/views/portal/ninja2020/gateways/forte/includes/credit_card.blade.php +++ b/resources/views/portal/ninja2020/gateways/forte/includes/credit_card.blade.php @@ -1,11 +1,16 @@
- - - - - + + +
+ + +
+ + +
diff --git a/resources/views/portal/ninja2020/gateways/paytrace/authorize.blade.php b/resources/views/portal/ninja2020/gateways/paytrace/authorize.blade.php index 43f99ed6da6a..8dbd197d6b78 100644 --- a/resources/views/portal/ninja2020/gateways/paytrace/authorize.blade.php +++ b/resources/views/portal/ninja2020/gateways/paytrace/authorize.blade.php @@ -41,6 +41,10 @@ {{-- @vite('resources/js/clients/payments/paytrace-credit-card.js') --}}