@justifi/webcomponents 6.5.0 → 6.5.1-rc.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/{Refund-Blquw3jZ.js → GooglePay-HXBAmTgL.js} +415 -0
- package/dist/cjs/bank-account-document-form-inputs_6.cjs.entry.js +8 -7
- package/dist/cjs/bank-account-form.cjs.entry.js +2 -2
- package/dist/cjs/{business.service-DrBmfEbR.js → business.service-DMzf08nC.js} +1 -1
- package/dist/cjs/card-form.cjs.entry.js +2 -2
- package/dist/cjs/{check-pkg-version-D06Nzj0h.js → check-pkg-version-Bw6Rz_E3.js} +2 -2
- package/dist/cjs/{checkout.service-BEU6CI0t.js → checkout.service-CHNHEsrp.js} +1 -1
- package/dist/cjs/checkouts-list-core.cjs.entry.js +3 -2
- package/dist/cjs/custom-popper.cjs.entry.js +2 -2
- package/dist/cjs/{dispute.service-c0CZxPpe.js → dispute.service-B63kcFkU.js} +1 -1
- package/dist/cjs/form-alert_5.cjs.entry.js +6 -6
- package/dist/cjs/form-control-checkbox.cjs.entry.js +2 -2
- package/dist/cjs/form-control-date.cjs.entry.js +2 -2
- package/dist/cjs/form-control-file-v2_2.cjs.entry.js +3 -3
- package/dist/cjs/form-control-monetary-provisioning.cjs.entry.js +2 -2
- package/dist/cjs/form-control-monetary.cjs.entry.js +2 -2
- package/dist/cjs/form-control-number-masked_3.cjs.entry.js +4 -4
- package/dist/cjs/form-control-number.cjs.entry.js +2 -2
- package/dist/cjs/form-control-radio.cjs.entry.js +2 -2
- package/dist/cjs/form-control-select_3.cjs.entry.js +4 -4
- package/dist/cjs/{get-payment-details-D8UQRtX1.js → get-payment-details-BN139jp0.js} +2 -2
- package/dist/cjs/{get-subaccounts-fKcKqvrx.js → get-subaccounts-IgHJX5J4.js} +2 -2
- package/dist/cjs/gross-payment-chart-core.cjs.entry.js +1 -1
- package/dist/cjs/hidden-input_2.cjs.entry.js +5 -5
- package/dist/cjs/{index-C2ITzalN.js → index-CajjbB9t.js} +1 -0
- package/dist/cjs/index.cjs.js +1 -1
- package/dist/cjs/internal-tokenize-payment-method_7.cjs.entry.js +23 -24
- package/dist/cjs/justifi-additional-questions-form-step-core_6.cjs.entry.js +6 -5
- package/dist/cjs/justifi-additional-questions-form-step_9.cjs.entry.js +12 -11
- package/dist/cjs/justifi-additional-statement_8.cjs.entry.js +8 -8
- package/dist/cjs/{justifi-apple-pay_7.cjs.entry.js → justifi-apple-pay_8.cjs.entry.js} +899 -253
- package/dist/cjs/justifi-bank-account-billing-form-simple_3.cjs.entry.js +2 -2
- package/dist/cjs/justifi-business-details.cjs.entry.js +5 -4
- package/dist/cjs/justifi-business-form.cjs.entry.js +5 -4
- package/dist/cjs/justifi-business-representative-form-inputs.cjs.entry.js +2 -2
- package/dist/cjs/justifi-checkout.cjs.entry.js +14 -15
- package/dist/cjs/justifi-checkouts-list-filters.cjs.entry.js +10 -9
- package/dist/cjs/justifi-checkouts-list.cjs.entry.js +8 -7
- package/dist/cjs/justifi-details.cjs.entry.js +1 -1
- package/dist/cjs/justifi-dispute-management-core.cjs.entry.js +1 -1
- package/dist/cjs/justifi-dispute-management.cjs.entry.js +6 -5
- package/dist/cjs/justifi-dispute-notification_3.cjs.entry.js +9 -8
- package/dist/cjs/justifi-gross-payment-chart.cjs.entry.js +4 -3
- package/dist/cjs/justifi-order-terminals.cjs.entry.js +10 -9
- package/dist/cjs/justifi-owner-form_3.cjs.entry.js +7 -6
- package/dist/cjs/justifi-payment-details.cjs.entry.js +6 -5
- package/dist/cjs/justifi-payment-provisioning-core.cjs.entry.js +1 -1
- package/dist/cjs/justifi-payment-provisioning.cjs.entry.js +6 -5
- package/dist/cjs/justifi-payment-transactions-list.cjs.entry.js +7 -6
- package/dist/cjs/justifi-payments-list-filters.cjs.entry.js +2 -2
- package/dist/cjs/justifi-payments-list.cjs.entry.js +7 -6
- package/dist/cjs/justifi-payout-details.cjs.entry.js +6 -5
- package/dist/cjs/justifi-payout-transactions-list.cjs.entry.js +7 -6
- package/dist/cjs/justifi-payouts-list-filters.cjs.entry.js +2 -2
- package/dist/cjs/justifi-payouts-list.cjs.entry.js +8 -7
- package/dist/cjs/justifi-refund-payment.cjs.entry.js +10 -9
- package/dist/cjs/justifi-saved-payment-method.cjs.entry.js +1 -1
- package/dist/cjs/justifi-season-interruption-insurance.cjs.entry.js +7 -8
- package/dist/cjs/justifi-skeleton.cjs.entry.js +1 -1
- package/dist/cjs/justifi-terminal-orders-list-filters.cjs.entry.js +12 -11
- package/dist/cjs/justifi-terminal-orders-list.cjs.entry.js +7 -6
- package/dist/cjs/justifi-terminals-list-filters.cjs.entry.js +8 -7
- package/dist/cjs/justifi-terminals-list.cjs.entry.js +8 -7
- package/dist/cjs/justifi-tokenize-payment-method.cjs.entry.js +1 -1
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/{package-gCv25hzn.js → package--UMqvxMQ.js} +1 -1
- package/dist/cjs/pagination-menu.cjs.entry.js +3 -3
- package/dist/cjs/payment-details-core.cjs.entry.js +11 -10
- package/dist/cjs/payment-method-option.cjs.entry.js +1 -1
- package/dist/cjs/{payment.service-DXbR13Kq.js → payment.service-eOZc1Qay.js} +1 -1
- package/dist/cjs/payments-list-core.cjs.entry.js +3 -2
- package/dist/cjs/payout-details-core.cjs.entry.js +3 -3
- package/dist/cjs/{payout.service-D0U6kzXJ.js → payout.service-QVl5N-UV.js} +1 -1
- package/dist/cjs/payouts-list-core.cjs.entry.js +3 -2
- package/dist/cjs/table-filters-menu.cjs.entry.js +1 -1
- package/dist/cjs/terminal-orders-list-core.cjs.entry.js +4 -3
- package/dist/cjs/{terminal-orders-table-BByfBAEK.js → terminal-orders-table-g2fwrh2P.js} +3 -3
- package/dist/cjs/terminal-quantity-selector.cjs.entry.js +1 -1
- package/dist/cjs/{terminal.service-BqXeiERV.js → terminal.service-BuSFyt0j.js} +1 -1
- package/dist/cjs/terminals-list-core.cjs.entry.js +3 -2
- package/dist/cjs/webcomponents.cjs.js +1 -1
- package/dist/collection/api/GooglePay.js +181 -0
- package/dist/collection/api/index.js +2 -0
- package/dist/collection/api/services/google-pay.service.js +240 -0
- package/dist/collection/collection-manifest.json +2 -1
- package/dist/collection/components/business-forms/business-form/additional-questions/additional-questions.js +7 -6
- package/dist/collection/components/business-forms/business-form/business-core-info/business-core-info.js +2 -2
- package/dist/collection/components/business-forms/business-form/business-representative/business-representative.js +8 -7
- package/dist/collection/components/business-forms/business-form/legal-address-form/legal-address-form.js +7 -6
- package/dist/collection/components/business-forms/owner-form/identity-address/identity-address-form.js +1 -1
- package/dist/collection/components/business-forms/owner-form/owner-form-core.js +1 -1
- package/dist/collection/components/business-forms/owner-form/owner-form-inputs.js +8 -7
- package/dist/collection/components/business-forms/owner-form/owner-form.js +1 -1
- package/dist/collection/components/business-forms/payment-provisioning/additional-questions/business-additional-questions-form-step.js +1 -1
- package/dist/collection/components/business-forms/payment-provisioning/bank-account/bank-account-document-inputs.js +1 -1
- package/dist/collection/components/business-forms/payment-provisioning/bank-account/bank-account-form-inputs-canada.js +1 -1
- package/dist/collection/components/business-forms/payment-provisioning/bank-account/bank-account-form-inputs.js +1 -1
- package/dist/collection/components/business-forms/payment-provisioning/bank-account/bank-account-read-only-value.js +1 -1
- package/dist/collection/components/business-forms/payment-provisioning/bank-account/business-bank-account-form-step.js +1 -1
- package/dist/collection/components/business-forms/payment-provisioning/business-core-info/business-core-info-form-step.js +1 -1
- package/dist/collection/components/business-forms/payment-provisioning/business-owners/business-owners-form-step.js +1 -1
- package/dist/collection/components/business-forms/payment-provisioning/business-representative/business-representative-form-inputs.js +2 -2
- package/dist/collection/components/business-forms/payment-provisioning/business-representative/business-representative-form-step.js +1 -1
- package/dist/collection/components/business-forms/payment-provisioning/form-address-fields/form-address-fields.js +1 -1
- package/dist/collection/components/business-forms/payment-provisioning/form-control-monetary-provisioning.js +2 -2
- package/dist/collection/components/business-forms/payment-provisioning/legal-address-form/legal-address-form-step.js +1 -1
- package/dist/collection/components/business-forms/payment-provisioning/payment-provisioning-core.js +1 -1
- package/dist/collection/components/business-forms/payment-provisioning/payment-provisioning-form-buttons.js +1 -1
- package/dist/collection/components/business-forms/payment-provisioning/payment-provisioning-form-steps.js +1 -1
- package/dist/collection/components/business-forms/payment-provisioning/payment-provisioning.js +1 -1
- package/dist/collection/components/business-forms/payment-provisioning/terms-and-conditions/business-terms-conditions-form-step.js +1 -1
- package/dist/collection/components/checkout/bank-account-form/bank-account-form.js +2 -2
- package/dist/collection/components/checkout/card-form/card-form.js +2 -2
- package/dist/collection/components/checkout/checkout.js +2 -2
- package/dist/collection/components/checkout/save-new-payment-method.js +1 -1
- package/dist/collection/components/checkout/saved-payment-method.js +1 -1
- package/dist/collection/components/checkouts-list/checkouts-list-core.js +1 -1
- package/dist/collection/components/checkouts-list/checkouts-list-filters.js +1 -1
- package/dist/collection/components/checkouts-list/checkouts-list.js +1 -1
- package/dist/collection/components/dispute-management/dispute-management-core.js +1 -1
- package/dist/collection/components/dispute-management/dispute-management.js +1 -1
- package/dist/collection/components/dispute-management/dispute-notification.js +2 -2
- package/dist/collection/components/dispute-management/dispute-response/additional-statement.js +1 -1
- package/dist/collection/components/dispute-management/dispute-response/cancellation-policy.js +1 -1
- package/dist/collection/components/dispute-management/dispute-response/customer-details.js +1 -1
- package/dist/collection/components/dispute-management/dispute-response/dispute-response-core.js +1 -1
- package/dist/collection/components/dispute-management/dispute-response/dispute-response.js +1 -1
- package/dist/collection/components/dispute-management/dispute-response/duplicate-charge.js +1 -1
- package/dist/collection/components/dispute-management/dispute-response/electronic-evidence.js +1 -1
- package/dist/collection/components/dispute-management/dispute-response/product-or-service.js +1 -1
- package/dist/collection/components/dispute-management/dispute-response/refund-policy.js +1 -1
- package/dist/collection/components/dispute-management/dispute-response/shipping-details.js +1 -1
- package/dist/collection/components/filters/table-filters-menu.js +1 -1
- package/dist/collection/components/gross-payment-chart/gross-payment-chart-core.js +1 -1
- package/dist/collection/components/modular-checkout/ModularCheckout.js +1 -0
- package/dist/collection/components/modular-checkout/modular-checkout.js +46 -9
- package/dist/collection/components/modular-checkout/sub-components/bank-account-billing-form-simple.js +1 -1
- package/dist/collection/components/modular-checkout/sub-components/bank-account.js +2 -2
- package/dist/collection/components/modular-checkout/sub-components/card-billing-form-simple.js +1 -1
- package/dist/collection/components/modular-checkout/sub-components/card-form.js +2 -2
- package/dist/collection/components/modular-checkout/sub-components/google-pay-skeleton.js +10 -0
- package/dist/collection/components/modular-checkout/sub-components/google-pay.js +609 -0
- package/dist/collection/components/modular-checkout/sub-components/payment-method-option.js +1 -1
- package/dist/collection/components/modular-checkout/sub-components/summary.js +1 -1
- package/dist/collection/components/order-terminals/order-terminals.js +1 -1
- package/dist/collection/components/order-terminals/terminal-quantity-selector/terminal-quantity-selector.js +1 -1
- package/dist/collection/components/payment-details/payment-details-core.js +8 -8
- package/dist/collection/components/payment-transactions-list/payment-transactions-list.js +1 -1
- package/dist/collection/components/payments-list/payments-list-core.js +1 -1
- package/dist/collection/components/payments-list/payments-list-filters.js +2 -2
- package/dist/collection/components/payments-list/payments-list.js +1 -1
- package/dist/collection/components/payout-details/payout-details-core.js +3 -3
- package/dist/collection/components/payout-transactions-list/payout-transactions-list.js +1 -1
- package/dist/collection/components/payouts-list/payouts-list-core.js +1 -1
- package/dist/collection/components/payouts-list/payouts-list-filters.js +2 -2
- package/dist/collection/components/payouts-list/payouts-list.js +1 -1
- package/dist/collection/components/terminal-orders-list/terminal-orders-list-core.js +1 -1
- package/dist/collection/components/terminal-orders-list/terminal-orders-list-filters.js +2 -2
- package/dist/collection/components/terminal-orders-list/terminal-orders-list.js +1 -1
- package/dist/collection/components/terminals-list/terminals-list-core.js +1 -1
- package/dist/collection/components/terminals-list/terminals-list-filters.js +1 -1
- package/dist/collection/components/terminals-list/terminals-list.js +1 -1
- package/dist/collection/components/tokenize-payment-method/internal-tokenize-payment-method.js +3 -4
- package/dist/collection/components/tokenize-payment-method/tokenize-payment-method.js +5 -10
- package/dist/collection/store/checkout.store.js +4 -0
- package/dist/collection/ui-components/custom-popper/custom-popper.js +2 -2
- package/dist/collection/ui-components/details/details.js +1 -1
- package/dist/collection/ui-components/form/form-control-checkbox.js +2 -2
- package/dist/collection/ui-components/form/form-control-date.js +2 -2
- package/dist/collection/ui-components/form/form-control-file-v2.js +1 -1
- package/dist/collection/ui-components/form/form-control-file.js +2 -2
- package/dist/collection/ui-components/form/form-control-monetary.js +2 -2
- package/dist/collection/ui-components/form/form-control-number-masked.js +2 -2
- package/dist/collection/ui-components/form/form-control-number.js +2 -2
- package/dist/collection/ui-components/form/form-control-radio.js +2 -2
- package/dist/collection/ui-components/form/form-control-select.js +2 -2
- package/dist/collection/ui-components/form/form-control-text.js +2 -2
- package/dist/collection/ui-components/form/form-control-textarea.js +2 -2
- package/dist/collection/ui-components/form/hidden-input.js +1 -1
- package/dist/collection/ui-components/form/iframe-input.js +3 -3
- package/dist/collection/ui-components/google-pay-button.js +251 -0
- package/dist/collection/ui-components/pagination-menu/pagination-menu.js +3 -3
- package/dist/collection/ui-components/shadow-dom-components/justifi-button.js +1 -1
- package/dist/collection/ui-components/shadow-dom-components/justifi-header.js +1 -1
- package/dist/collection/ui-components/shadow-dom-components/justifi-radio-list-item.js +1 -1
- package/dist/collection/ui-components/shadow-dom-components/justifi-skeleton.js +1 -1
- package/dist/docs.json +567 -119
- package/dist/esm/{Refund-BugCdfRo.js → GooglePay-9bPcqGZ9.js} +405 -1
- package/dist/esm/bank-account-document-form-inputs_6.entry.js +8 -7
- package/dist/esm/bank-account-form.entry.js +2 -2
- package/dist/esm/{business.service-pWcc3kfX.js → business.service-2j91Emgq.js} +1 -1
- package/dist/esm/card-form.entry.js +2 -2
- package/dist/esm/{check-pkg-version-AQP98jzk.js → check-pkg-version-2BU_KPHv.js} +2 -2
- package/dist/esm/{checkout.service-B4xSV2-X.js → checkout.service-D-dEMyXF.js} +1 -1
- package/dist/esm/checkouts-list-core.entry.js +3 -2
- package/dist/esm/custom-popper.entry.js +2 -2
- package/dist/esm/{dispute.service-3Kbbh1J9.js → dispute.service-DPumDIuV.js} +1 -1
- package/dist/esm/form-alert_5.entry.js +6 -6
- package/dist/esm/form-control-checkbox.entry.js +2 -2
- package/dist/esm/form-control-date.entry.js +2 -2
- package/dist/esm/form-control-file-v2_2.entry.js +3 -3
- package/dist/esm/form-control-monetary-provisioning.entry.js +2 -2
- package/dist/esm/form-control-monetary.entry.js +2 -2
- package/dist/esm/form-control-number-masked_3.entry.js +4 -4
- package/dist/esm/form-control-number.entry.js +2 -2
- package/dist/esm/form-control-radio.entry.js +2 -2
- package/dist/esm/form-control-select_3.entry.js +4 -4
- package/dist/esm/{get-payment-details-CakzKvOr.js → get-payment-details-CD_K6FQ3.js} +1 -1
- package/dist/esm/{get-subaccounts-Cw1Adtmo.js → get-subaccounts-D1eF6c0B.js} +1 -1
- package/dist/esm/gross-payment-chart-core.entry.js +1 -1
- package/dist/esm/hidden-input_2.entry.js +5 -5
- package/dist/esm/{index-DCIW8z1f.js → index-DkoufM1t.js} +1 -0
- package/dist/esm/index.js +1 -1
- package/dist/esm/internal-tokenize-payment-method_7.entry.js +12 -13
- package/dist/esm/justifi-additional-questions-form-step-core_6.entry.js +2 -1
- package/dist/esm/justifi-additional-questions-form-step_9.entry.js +12 -11
- package/dist/esm/justifi-additional-statement_8.entry.js +8 -8
- package/dist/esm/{justifi-apple-pay_7.entry.js → justifi-apple-pay_8.entry.js} +782 -137
- package/dist/esm/justifi-bank-account-billing-form-simple_3.entry.js +2 -2
- package/dist/esm/justifi-business-details.entry.js +5 -4
- package/dist/esm/justifi-business-form.entry.js +5 -4
- package/dist/esm/justifi-business-representative-form-inputs.entry.js +2 -2
- package/dist/esm/justifi-checkout.entry.js +7 -8
- package/dist/esm/justifi-checkouts-list-filters.entry.js +3 -2
- package/dist/esm/justifi-checkouts-list.entry.js +7 -6
- package/dist/esm/justifi-details.entry.js +1 -1
- package/dist/esm/justifi-dispute-management-core.entry.js +1 -1
- package/dist/esm/justifi-dispute-management.entry.js +6 -5
- package/dist/esm/justifi-dispute-notification_3.entry.js +9 -8
- package/dist/esm/justifi-gross-payment-chart.entry.js +4 -3
- package/dist/esm/justifi-order-terminals.entry.js +7 -6
- package/dist/esm/justifi-owner-form_3.entry.js +7 -6
- package/dist/esm/justifi-payment-details.entry.js +6 -5
- package/dist/esm/justifi-payment-provisioning-core.entry.js +1 -1
- package/dist/esm/justifi-payment-provisioning.entry.js +6 -5
- package/dist/esm/justifi-payment-transactions-list.entry.js +6 -5
- package/dist/esm/justifi-payments-list-filters.entry.js +2 -2
- package/dist/esm/justifi-payments-list.entry.js +6 -5
- package/dist/esm/justifi-payout-details.entry.js +5 -4
- package/dist/esm/justifi-payout-transactions-list.entry.js +6 -5
- package/dist/esm/justifi-payouts-list-filters.entry.js +2 -2
- package/dist/esm/justifi-payouts-list.entry.js +7 -6
- package/dist/esm/justifi-refund-payment.entry.js +6 -5
- package/dist/esm/justifi-saved-payment-method.entry.js +1 -1
- package/dist/esm/justifi-season-interruption-insurance.entry.js +4 -5
- package/dist/esm/justifi-skeleton.entry.js +1 -1
- package/dist/esm/justifi-terminal-orders-list-filters.entry.js +4 -3
- package/dist/esm/justifi-terminal-orders-list.entry.js +6 -5
- package/dist/esm/justifi-terminals-list-filters.entry.js +3 -2
- package/dist/esm/justifi-terminals-list.entry.js +7 -6
- package/dist/esm/justifi-tokenize-payment-method.entry.js +1 -1
- package/dist/esm/loader.js +1 -1
- package/dist/esm/{package-DQf0KCJj.js → package-Bx3wyDU2.js} +1 -1
- package/dist/esm/pagination-menu.entry.js +3 -3
- package/dist/esm/payment-details-core.entry.js +10 -9
- package/dist/esm/payment-method-option.entry.js +1 -1
- package/dist/esm/{payment.service-nExZY_sU.js → payment.service-BreQSu6J.js} +1 -1
- package/dist/esm/payments-list-core.entry.js +3 -2
- package/dist/esm/payout-details-core.entry.js +3 -3
- package/dist/esm/{payout.service-B9-JQqU6.js → payout.service-DuqRe6oq.js} +1 -1
- package/dist/esm/payouts-list-core.entry.js +3 -2
- package/dist/esm/table-filters-menu.entry.js +1 -1
- package/dist/esm/terminal-orders-list-core.entry.js +4 -3
- package/dist/esm/{terminal-orders-table-DsrpmD9F.js → terminal-orders-table-DSo5x2D7.js} +1 -1
- package/dist/esm/terminal-quantity-selector.entry.js +1 -1
- package/dist/esm/{terminal.service-DvFiKAKV.js → terminal.service-CkzrYIA_.js} +1 -1
- package/dist/esm/terminals-list-core.entry.js +3 -2
- package/dist/esm/webcomponents.js +1 -1
- package/dist/module/Analytics.js +2 -0
- package/dist/module/ApplePay.js +121 -0
- package/dist/module/GooglePay.js +184 -0
- package/dist/module/ModularCheckout.js +1 -0
- package/dist/module/additional-questions.js +2 -2
- package/dist/module/additional-statement.js +1 -1
- package/dist/module/apple-pay.js +1 -120
- package/dist/module/bank-account-billing-form-simple.js +1 -1
- package/dist/module/bank-account-document-inputs.js +3 -1
- package/dist/module/bank-account-form-inputs-canada2.js +1 -1
- package/dist/module/bank-account-form-inputs2.js +1 -1
- package/dist/module/bank-account-form.js +2 -2
- package/dist/module/bank-account-read-only-value2.js +1 -1
- package/dist/module/bank-account.js +2 -2
- package/dist/module/business-additional-questions-form-step.js +1 -1
- package/dist/module/business-bank-account-form-step-core.js +2 -0
- package/dist/module/business-bank-account-form-step.js +3 -1
- package/dist/module/business-core-info-form-step.js +1 -1
- package/dist/module/business-core-info.js +2 -2
- package/dist/module/business-owners-form-step.js +1 -1
- package/dist/module/business-representative-form-inputs.js +2 -2
- package/dist/module/business-representative-form-step.js +1 -1
- package/dist/module/business-representative.js +3 -3
- package/dist/module/business-terms-conditions-form-step.js +3 -1
- package/dist/module/business.service.js +2 -0
- package/dist/module/cancellation-policy.js +1 -1
- package/dist/module/card-billing-form-simple.js +1 -1
- package/dist/module/card-form.js +2 -2
- package/dist/module/card-form2.js +2 -2
- package/dist/module/checkout.service.js +2 -0
- package/dist/module/checkout.store.js +4 -0
- package/dist/module/checkouts-list-core2.js +3 -1
- package/dist/module/custom-popper2.js +2 -2
- package/dist/module/customer-details.js +1 -1
- package/dist/module/details.js +1 -1
- package/dist/module/dispute-management-core.js +1 -1
- package/dist/module/dispute-notification.js +2 -2
- package/dist/module/dispute-response-actions.js +2 -0
- package/dist/module/dispute-response-core.js +1 -1
- package/dist/module/dispute-response.js +1 -1
- package/dist/module/duplicate-charge.js +1 -1
- package/dist/module/electronic-evidence.js +1 -1
- package/dist/module/form-address-fields.js +1 -1
- package/dist/module/form-control-checkbox2.js +2 -2
- package/dist/module/form-control-date2.js +2 -2
- package/dist/module/form-control-file-v22.js +1 -1
- package/dist/module/form-control-file2.js +2 -2
- package/dist/module/form-control-monetary-provisioning2.js +2 -2
- package/dist/module/form-control-monetary2.js +2 -2
- package/dist/module/form-control-number-masked2.js +2 -2
- package/dist/module/form-control-number.js +2 -2
- package/dist/module/form-control-radio2.js +2 -2
- package/dist/module/form-control-select2.js +2 -2
- package/dist/module/form-control-text2.js +2 -2
- package/dist/module/form-control-textarea2.js +2 -2
- package/dist/module/get-payment-details.js +2 -0
- package/dist/module/get-subaccounts.js +2 -0
- package/dist/module/google-pay.js +781 -0
- package/dist/module/gross-payment-chart-core2.js +1 -1
- package/dist/module/hidden-input2.js +1 -1
- package/dist/module/identity-address-form.js +1 -1
- package/dist/module/iframe-input2.js +3 -3
- package/dist/module/internal-tokenize-payment-method2.js +3 -1
- package/dist/module/justifi-business-form.js +2 -0
- package/dist/module/justifi-button2.js +1 -1
- package/dist/module/justifi-checkout.js +46 -40
- package/dist/module/justifi-checkouts-list-filters.js +3 -1
- package/dist/module/justifi-checkouts-list.js +3 -1
- package/dist/module/justifi-dispute-management.js +1 -1
- package/dist/module/justifi-google-pay.d.ts +11 -0
- package/dist/module/justifi-google-pay.js +6 -0
- package/dist/module/justifi-gross-payment-chart.js +2 -0
- package/dist/module/justifi-header2.js +1 -1
- package/dist/module/justifi-order-terminals.js +3 -1
- package/dist/module/justifi-payment-provisioning.js +3 -1
- package/dist/module/justifi-payment-transactions-list.js +3 -1
- package/dist/module/justifi-payments-list-filters.js +2 -2
- package/dist/module/justifi-payments-list.js +3 -1
- package/dist/module/justifi-payout-details.js +2 -0
- package/dist/module/justifi-payout-transactions-list.js +3 -1
- package/dist/module/justifi-payouts-list-filters.js +2 -2
- package/dist/module/justifi-payouts-list.js +3 -1
- package/dist/module/justifi-radio-list-item2.js +1 -1
- package/dist/module/justifi-refund-payment.js +2 -0
- package/dist/module/justifi-saved-payment-method.js +1 -1
- package/dist/module/justifi-season-interruption-insurance.js +2 -0
- package/dist/module/justifi-skeleton.js +1 -1
- package/dist/module/justifi-terminal-orders-list-filters.js +4 -2
- package/dist/module/justifi-terminal-orders-list.js +3 -1
- package/dist/module/justifi-terminals-list-filters.js +3 -1
- package/dist/module/justifi-terminals-list.js +3 -1
- package/dist/module/justifi-tokenize-payment-method.js +1 -1
- package/dist/module/legal-address-form-step.js +1 -1
- package/dist/module/legal-address-form.js +2 -2
- package/dist/module/modular-checkout.js +46 -6
- package/dist/module/owner-form-core2.js +1 -1
- package/dist/module/owner-form-inputs2.js +3 -3
- package/dist/module/owner-form.js +1 -1
- package/dist/module/package.js +1 -1
- package/dist/module/pagination-menu2.js +3 -3
- package/dist/module/payment-details-core2.js +10 -8
- package/dist/module/payment-method-option.js +1 -1
- package/dist/module/payment-provisioning-core.js +1 -1
- package/dist/module/payment-provisioning-form-buttons.js +1 -1
- package/dist/module/payment-provisioning-form-steps.js +1 -1
- package/dist/module/payment.service.js +2 -0
- package/dist/module/payments-list-core2.js +3 -1
- package/dist/module/payout-details-core2.js +3 -3
- package/dist/module/payout.service.js +2 -0
- package/dist/module/payouts-list-core2.js +3 -1
- package/dist/module/plaid.service.js +2 -0
- package/dist/module/product-or-service.js +1 -1
- package/dist/module/refund-policy.js +1 -1
- package/dist/module/save-new-payment-method.js +1 -1
- package/dist/module/shipping-details.js +1 -1
- package/dist/module/summary.js +1 -1
- package/dist/module/table-filters-menu2.js +1 -1
- package/dist/module/terminal-orders-list-core2.js +3 -1
- package/dist/module/terminal-quantity-selector2.js +1 -1
- package/dist/module/terminal.service.js +2 -0
- package/dist/module/terminals-list-core2.js +3 -1
- package/dist/types/api/Checkout.d.ts +2 -0
- package/dist/types/api/GooglePay.d.ts +271 -0
- package/dist/types/api/index.d.ts +2 -0
- package/dist/types/api/services/google-pay.service.d.ts +60 -0
- package/dist/types/components/business-forms/schemas/business-form-schema.d.ts +3 -3
- package/dist/types/components/checkout/checkout.d.ts +1 -0
- package/dist/types/components/modular-checkout/ModularCheckout.d.ts +2 -1
- package/dist/types/components/modular-checkout/modular-checkout.d.ts +5 -0
- package/dist/types/components/modular-checkout/sub-components/google-pay-skeleton.d.ts +6 -0
- package/dist/types/components/modular-checkout/sub-components/google-pay.d.ts +59 -0
- package/dist/types/components/tokenize-payment-method/tokenize-payment-method.d.ts +1 -1
- package/dist/types/components.d.ts +160 -22
- package/dist/types/store/checkout.store.d.ts +1 -0
- package/dist/types/ui-components/google-pay-button.d.ts +18 -0
- package/dist/webcomponents/index.esm.js +1 -1
- package/dist/webcomponents/p-03930216.entry.js +1 -0
- package/dist/webcomponents/{p-aec9185f.entry.js → p-03c8c754.entry.js} +1 -1
- package/dist/webcomponents/p-0412f491.entry.js +1 -0
- package/dist/webcomponents/p-04154136.entry.js +1 -0
- package/dist/webcomponents/p-06ce1202.entry.js +1 -0
- package/dist/webcomponents/p-0772719b.entry.js +1 -0
- package/dist/webcomponents/p-0cd1c683.entry.js +1 -0
- package/dist/webcomponents/p-136b29e3.entry.js +1 -0
- package/dist/webcomponents/p-13bdb5ed.entry.js +1 -0
- package/dist/webcomponents/p-16812327.entry.js +1 -0
- package/dist/webcomponents/{p-1193a1ac.entry.js → p-19dabeab.entry.js} +1 -1
- package/dist/webcomponents/p-1d04bd7a.entry.js +1 -0
- package/dist/webcomponents/p-1f196690.entry.js +1 -0
- package/dist/webcomponents/{p-800660f2.entry.js → p-270bf699.entry.js} +1 -1
- package/dist/webcomponents/p-2da4e6ca.entry.js +1 -0
- package/dist/webcomponents/p-2eb123a3.entry.js +1 -0
- package/dist/webcomponents/p-38e1ef4b.entry.js +1 -0
- package/dist/webcomponents/p-3ae12b98.entry.js +1 -0
- package/dist/webcomponents/{p-58ae4f9e.entry.js → p-3bacf834.entry.js} +1 -1
- package/dist/webcomponents/p-3c006a15.entry.js +1 -0
- package/dist/webcomponents/p-404b3f02.entry.js +1 -0
- package/dist/webcomponents/p-42658888.entry.js +1 -0
- package/dist/webcomponents/p-43390a7f.entry.js +1 -0
- package/dist/webcomponents/p-47f6d271.entry.js +1 -0
- package/dist/webcomponents/{p-e2e6c201.entry.js → p-48d1bc83.entry.js} +1 -1
- package/dist/webcomponents/{p-af48a6bb.entry.js → p-4e71de94.entry.js} +1 -1
- package/dist/webcomponents/p-4f102cfd.entry.js +1 -0
- package/dist/webcomponents/p-5cba8448.entry.js +1 -0
- package/dist/webcomponents/p-7b610d9e.entry.js +1 -0
- package/dist/webcomponents/p-7bf6ded7.entry.js +1 -0
- package/dist/webcomponents/p-7dbd0618.entry.js +1 -0
- package/dist/webcomponents/{p-1edec396.entry.js → p-86111a0a.entry.js} +1 -1
- package/dist/webcomponents/p-88f58abe.entry.js +1 -0
- package/dist/webcomponents/p-8b6b7e20.entry.js +1 -0
- package/dist/webcomponents/p-8f4adcfd.entry.js +1 -0
- package/dist/webcomponents/p-8fcd277c.entry.js +1 -0
- package/dist/webcomponents/p-9065d67e.entry.js +1 -0
- package/dist/webcomponents/p-914b590d.entry.js +1 -0
- package/dist/webcomponents/p-9370cf0d.entry.js +1 -0
- package/dist/webcomponents/p-9a795f44.entry.js +1 -0
- package/dist/webcomponents/{p-CPtsjcdm.js → p-BKM7YeAB.js} +1 -1
- package/dist/webcomponents/p-BN1PYSFf.js +1 -0
- package/dist/webcomponents/p-BRbk6oSh.js +1 -0
- package/dist/webcomponents/{p-CFevTCAJ.js → p-BVwVhXcQ.js} +1 -1
- package/dist/webcomponents/p-Bx3wyDU2.js +1 -0
- package/dist/webcomponents/p-BxtmTjqW.js +1 -0
- package/dist/webcomponents/{p-LeyS3YJV.js → p-C01zp4xw.js} +1 -1
- package/dist/webcomponents/p-CQrwlULd.js +1 -0
- package/dist/webcomponents/{p-B4ZUYyNh.js → p-CVhnuewz.js} +1 -1
- package/dist/webcomponents/{p-D_IJC4HG.js → p-Cmb6PRFh.js} +1 -1
- package/dist/webcomponents/p-DkoufM1t.js +1 -0
- package/dist/webcomponents/{p-BCPutgAi.js → p-Dy5btfGV.js} +1 -1
- package/dist/webcomponents/p-a020c889.entry.js +1 -0
- package/dist/webcomponents/p-a0c9f0bd.entry.js +1 -0
- package/dist/webcomponents/{p-0082f428.entry.js → p-a22d1078.entry.js} +1 -1
- package/dist/webcomponents/p-a6e816f6.entry.js +1 -0
- package/dist/webcomponents/p-a87187c3.entry.js +1 -0
- package/dist/webcomponents/p-a9f75a9e.entry.js +1 -0
- package/dist/webcomponents/{p-8681f258.entry.js → p-aaed4997.entry.js} +1 -1
- package/dist/webcomponents/p-ad9307c1.entry.js +1 -0
- package/dist/webcomponents/p-b3f8d5d4.entry.js +1 -0
- package/dist/webcomponents/{p-f6ea74db.entry.js → p-b8426810.entry.js} +1 -1
- package/dist/webcomponents/p-ba0762f9.entry.js +1 -0
- package/dist/webcomponents/p-c41191e7.entry.js +1 -0
- package/dist/webcomponents/p-c621e7af.entry.js +1 -0
- package/dist/webcomponents/p-c63b0271.entry.js +1 -0
- package/dist/webcomponents/p-c88babbe.entry.js +1 -0
- package/dist/webcomponents/p-d2935214.entry.js +1 -0
- package/dist/webcomponents/p-d88d228f.entry.js +1 -0
- package/dist/webcomponents/{p-2769f945.entry.js → p-e6507b93.entry.js} +1 -1
- package/dist/webcomponents/{p-ed55d333.entry.js → p-e7e5fee9.entry.js} +1 -1
- package/dist/webcomponents/p-e9d13cca.entry.js +1 -0
- package/dist/webcomponents/p-ee122560.entry.js +1 -0
- package/dist/webcomponents/{p-4e23116c.entry.js → p-f2650bfc.entry.js} +1 -1
- package/dist/webcomponents/p-f4cb581f.entry.js +1 -0
- package/dist/webcomponents/p-f528da70.entry.js +1 -0
- package/dist/webcomponents/{p-9f70ce93.entry.js → p-fe862786.entry.js} +1 -1
- package/dist/webcomponents/{p-C8QOezo8.js → p-t8p0WAW4.js} +1 -1
- package/dist/webcomponents/webcomponents.esm.js +1 -1
- package/package.json +13 -13
- package/LICENSE +0 -21
- package/dist/cjs/checkout.store-BA6h-dp2.js +0 -107
- package/dist/esm/checkout.store-CaS_htQd.js +0 -101
- package/dist/webcomponents/p-159d8ae7.entry.js +0 -1
- package/dist/webcomponents/p-20a8b0c0.entry.js +0 -1
- package/dist/webcomponents/p-22f74666.entry.js +0 -1
- package/dist/webcomponents/p-25b382b8.entry.js +0 -1
- package/dist/webcomponents/p-30f61f44.entry.js +0 -1
- package/dist/webcomponents/p-3437ce38.entry.js +0 -1
- package/dist/webcomponents/p-34aa9298.entry.js +0 -1
- package/dist/webcomponents/p-36720116.entry.js +0 -1
- package/dist/webcomponents/p-39706e38.entry.js +0 -1
- package/dist/webcomponents/p-3c38cec5.entry.js +0 -1
- package/dist/webcomponents/p-42d756b8.entry.js +0 -1
- package/dist/webcomponents/p-44a94dac.entry.js +0 -1
- package/dist/webcomponents/p-45936490.entry.js +0 -1
- package/dist/webcomponents/p-4761e0aa.entry.js +0 -1
- package/dist/webcomponents/p-4baabba0.entry.js +0 -1
- package/dist/webcomponents/p-4dcbc0af.entry.js +0 -1
- package/dist/webcomponents/p-54ff9b59.entry.js +0 -1
- package/dist/webcomponents/p-5c8c88c6.entry.js +0 -1
- package/dist/webcomponents/p-66688508.entry.js +0 -1
- package/dist/webcomponents/p-7218c312.entry.js +0 -1
- package/dist/webcomponents/p-77b76007.entry.js +0 -1
- package/dist/webcomponents/p-77bd4fb0.entry.js +0 -1
- package/dist/webcomponents/p-79d77eb9.entry.js +0 -1
- package/dist/webcomponents/p-7ee0bae1.entry.js +0 -1
- package/dist/webcomponents/p-80f5b2c8.entry.js +0 -1
- package/dist/webcomponents/p-84e2bd93.entry.js +0 -1
- package/dist/webcomponents/p-89518b26.entry.js +0 -1
- package/dist/webcomponents/p-8b944d09.entry.js +0 -1
- package/dist/webcomponents/p-942c8949.entry.js +0 -1
- package/dist/webcomponents/p-98b8028e.entry.js +0 -1
- package/dist/webcomponents/p-9e1f4231.entry.js +0 -1
- package/dist/webcomponents/p-BojLBYsY.js +0 -1
- package/dist/webcomponents/p-BpaE8q5f.js +0 -1
- package/dist/webcomponents/p-Ch9cTPyq.js +0 -1
- package/dist/webcomponents/p-DCIW8z1f.js +0 -1
- package/dist/webcomponents/p-DQf0KCJj.js +0 -1
- package/dist/webcomponents/p-DU8dqq9U.js +0 -1
- package/dist/webcomponents/p-MQxr_LMC.js +0 -1
- package/dist/webcomponents/p-a4540205.entry.js +0 -1
- package/dist/webcomponents/p-a655b996.entry.js +0 -1
- package/dist/webcomponents/p-ad5e488a.entry.js +0 -1
- package/dist/webcomponents/p-af236d05.entry.js +0 -1
- package/dist/webcomponents/p-af4e501d.entry.js +0 -1
- package/dist/webcomponents/p-b0e80802.entry.js +0 -1
- package/dist/webcomponents/p-b4d8a3f6.entry.js +0 -1
- package/dist/webcomponents/p-bf8cf72d.entry.js +0 -1
- package/dist/webcomponents/p-c3b71a1f.entry.js +0 -1
- package/dist/webcomponents/p-d2d69454.entry.js +0 -1
- package/dist/webcomponents/p-da26e869.entry.js +0 -1
- package/dist/webcomponents/p-daa534f1.entry.js +0 -1
- package/dist/webcomponents/p-dc0d3484.entry.js +0 -1
- package/dist/webcomponents/p-e91af879.entry.js +0 -1
- package/dist/webcomponents/p-eb56ba9b.entry.js +0 -1
- package/dist/webcomponents/p-ed006dd6.entry.js +0 -1
- package/dist/webcomponents/p-edcb84bf.entry.js +0 -1
- package/dist/webcomponents/p-efb2a58a.entry.js +0 -1
- package/dist/webcomponents/p-f91b79fb.entry.js +0 -1
- package/dist/webcomponents/p-fab28b02.entry.js +0 -1
|
@@ -2,149 +2,28 @@
|
|
|
2
2
|
|
|
3
3
|
var index = require('./index-BhI7cJcE.js');
|
|
4
4
|
var Api = require('./Api-BeSnjEuW.js');
|
|
5
|
+
var GooglePay$1 = require('./GooglePay-HXBAmTgL.js');
|
|
5
6
|
var styledHost = require('./styled-host-D5g7INLE.js');
|
|
6
7
|
require('./event-types-YOY5TKUN.js');
|
|
7
8
|
var skeleton = require('./skeleton-BF3HGL9X.js');
|
|
8
|
-
var checkout_store = require('./checkout.store-BA6h-dp2.js');
|
|
9
9
|
var parts = require('./parts-Pb06tUMp.js');
|
|
10
10
|
var utils = require('./utils-Bab-tddY.js');
|
|
11
|
+
var index$1 = require('./index-CajjbB9t.js');
|
|
11
12
|
var header1 = require('./header-1-CBO8uDuZ.js');
|
|
12
13
|
var insuranceState = require('./insurance-state-BMHITXoD.js');
|
|
13
14
|
var header3 = require('./header-3-CPWtI1t0.js');
|
|
14
|
-
var checkPkgVersion = require('./check-pkg-version-
|
|
15
|
+
var checkPkgVersion = require('./check-pkg-version-Bw6Rz_E3.js');
|
|
15
16
|
require('./config-state-CYoBVAca.js');
|
|
16
17
|
require('./dinero-BwNN_k7x.js');
|
|
17
18
|
var ComponentError = require('./ComponentError-D4OLnOkg.js');
|
|
18
|
-
var Refund = require('./Refund-Blquw3jZ.js');
|
|
19
19
|
require('./Pagination-Dediz133.js');
|
|
20
20
|
require('./Business-DWHy_-z9.js');
|
|
21
21
|
require('./Dispute-CruQTF6_.js');
|
|
22
22
|
var utils$1 = require('./utils-DvUQQLmR.js');
|
|
23
|
-
var checkout_service = require('./checkout.service-
|
|
24
|
-
var index$1 = require('./index-C2ITzalN.js');
|
|
23
|
+
var checkout_service = require('./checkout.service-CHNHEsrp.js');
|
|
25
24
|
var paymentMethodOptionUtils = require('./payment-method-option-utils-WYHIHy-l.js');
|
|
26
25
|
require('./index-mmd0OhmD.js');
|
|
27
|
-
require('./package
|
|
28
|
-
|
|
29
|
-
var ApplePaySessionStatus;
|
|
30
|
-
(function (ApplePaySessionStatus) {
|
|
31
|
-
ApplePaySessionStatus["STATUS_SUCCESS"] = "STATUS_SUCCESS";
|
|
32
|
-
ApplePaySessionStatus["STATUS_FAILURE"] = "STATUS_FAILURE";
|
|
33
|
-
})(ApplePaySessionStatus || (ApplePaySessionStatus = {}));
|
|
34
|
-
var ApplePayButtonType;
|
|
35
|
-
(function (ApplePayButtonType) {
|
|
36
|
-
ApplePayButtonType["PLAIN"] = "plain";
|
|
37
|
-
ApplePayButtonType["BUY"] = "buy";
|
|
38
|
-
ApplePayButtonType["SET_UP"] = "set-up";
|
|
39
|
-
ApplePayButtonType["DONATE"] = "donate";
|
|
40
|
-
ApplePayButtonType["CHECK_OUT"] = "check-out";
|
|
41
|
-
ApplePayButtonType["BOOK"] = "book";
|
|
42
|
-
ApplePayButtonType["SUBSCRIBE"] = "subscribe";
|
|
43
|
-
})(ApplePayButtonType || (ApplePayButtonType = {}));
|
|
44
|
-
var ApplePayButtonStyle;
|
|
45
|
-
(function (ApplePayButtonStyle) {
|
|
46
|
-
ApplePayButtonStyle["BLACK"] = "black";
|
|
47
|
-
ApplePayButtonStyle["WHITE"] = "white";
|
|
48
|
-
ApplePayButtonStyle["WHITE_OUTLINE"] = "white-outline";
|
|
49
|
-
})(ApplePayButtonStyle || (ApplePayButtonStyle = {}));
|
|
50
|
-
var ApplePayMerchantCapability;
|
|
51
|
-
(function (ApplePayMerchantCapability) {
|
|
52
|
-
ApplePayMerchantCapability["SUPPORTS_3DS"] = "supports3DS";
|
|
53
|
-
ApplePayMerchantCapability["SUPPORTS_EMV"] = "supportsEMV";
|
|
54
|
-
ApplePayMerchantCapability["SUPPORTS_CREDIT"] = "supportsCredit";
|
|
55
|
-
ApplePayMerchantCapability["SUPPORTS_DEBIT"] = "supportsDebit";
|
|
56
|
-
})(ApplePayMerchantCapability || (ApplePayMerchantCapability = {}));
|
|
57
|
-
class ApplePayConfig {
|
|
58
|
-
constructor(data) {
|
|
59
|
-
this.merchantIdentifier = data.merchantIdentifier;
|
|
60
|
-
this.displayName = data.displayName;
|
|
61
|
-
this.initiative = data.initiative;
|
|
62
|
-
this.initiativeContext = data.initiativeContext;
|
|
63
|
-
this.buttonType = data.buttonType || ApplePayButtonType.PLAIN;
|
|
64
|
-
this.buttonStyle = data.buttonStyle || ApplePayButtonStyle.BLACK;
|
|
65
|
-
this.buttonLocale = data.buttonLocale || 'en-US';
|
|
66
|
-
}
|
|
67
|
-
get isValid() {
|
|
68
|
-
return !!(this.merchantIdentifier &&
|
|
69
|
-
this.displayName &&
|
|
70
|
-
this.initiative &&
|
|
71
|
-
this.initiativeContext);
|
|
72
|
-
}
|
|
73
|
-
}
|
|
74
|
-
class ApplePayPaymentRequest {
|
|
75
|
-
constructor(data) {
|
|
76
|
-
this.countryCode = data.countryCode;
|
|
77
|
-
this.currencyCode = data.currencyCode;
|
|
78
|
-
this.merchantCapabilities = data.merchantCapabilities;
|
|
79
|
-
this.supportedNetworks = data.supportedNetworks;
|
|
80
|
-
this.total = data.total;
|
|
81
|
-
this.lineItems = data.lineItems;
|
|
82
|
-
this.shippingMethods = data.shippingMethods;
|
|
83
|
-
this.applicationData = data.applicationData;
|
|
84
|
-
this.supportedCountries = data.supportedCountries;
|
|
85
|
-
}
|
|
86
|
-
get isValid() {
|
|
87
|
-
var _a, _b, _c, _d;
|
|
88
|
-
return !!(this.countryCode &&
|
|
89
|
-
this.currencyCode &&
|
|
90
|
-
((_a = this.merchantCapabilities) === null || _a === void 0 ? void 0 : _a.length) &&
|
|
91
|
-
((_b = this.supportedNetworks) === null || _b === void 0 ? void 0 : _b.length) &&
|
|
92
|
-
((_c = this.total) === null || _c === void 0 ? void 0 : _c.label) &&
|
|
93
|
-
((_d = this.total) === null || _d === void 0 ? void 0 : _d.amount));
|
|
94
|
-
}
|
|
95
|
-
}
|
|
96
|
-
class ApplePayHelpers {
|
|
97
|
-
static isApplePaySupported() {
|
|
98
|
-
var _a;
|
|
99
|
-
return (typeof window !== 'undefined' &&
|
|
100
|
-
'ApplePaySession' in window &&
|
|
101
|
-
((_a = window.ApplePaySession) === null || _a === void 0 ? void 0 : _a.supportsVersion(3)));
|
|
102
|
-
}
|
|
103
|
-
static canMakePayments() {
|
|
104
|
-
var _a;
|
|
105
|
-
if (!this.isApplePaySupported()) {
|
|
106
|
-
return false;
|
|
107
|
-
}
|
|
108
|
-
return ((_a = window.ApplePaySession) === null || _a === void 0 ? void 0 : _a.canMakePayments()) || false;
|
|
109
|
-
}
|
|
110
|
-
static async canMakePaymentsWithActiveCard(merchantIdentifier) {
|
|
111
|
-
var _a;
|
|
112
|
-
if (!this.isApplePaySupported()) {
|
|
113
|
-
return false;
|
|
114
|
-
}
|
|
115
|
-
try {
|
|
116
|
-
return ((await ((_a = window.ApplePaySession) === null || _a === void 0 ? void 0 : _a.canMakePaymentsWithActiveCard(merchantIdentifier))) || false);
|
|
117
|
-
}
|
|
118
|
-
catch (error) {
|
|
119
|
-
console.error('Error checking Apple Pay active card:', error);
|
|
120
|
-
return false;
|
|
121
|
-
}
|
|
122
|
-
}
|
|
123
|
-
static formatAmount(amount) {
|
|
124
|
-
return (amount / 100).toFixed(2);
|
|
125
|
-
}
|
|
126
|
-
static parseAmount(amount) {
|
|
127
|
-
return Math.round(parseFloat(amount) * 100);
|
|
128
|
-
}
|
|
129
|
-
static createLineItem(label, amount, type = 'final') {
|
|
130
|
-
return {
|
|
131
|
-
label,
|
|
132
|
-
amount: this.formatAmount(amount),
|
|
133
|
-
type,
|
|
134
|
-
};
|
|
135
|
-
}
|
|
136
|
-
static getDefaultSupportedNetworks() {
|
|
137
|
-
return ['amex', 'discover', 'masterCard', 'visa'];
|
|
138
|
-
}
|
|
139
|
-
static getDefaultMerchantCapabilities() {
|
|
140
|
-
return [
|
|
141
|
-
ApplePayMerchantCapability.SUPPORTS_3DS,
|
|
142
|
-
ApplePayMerchantCapability.SUPPORTS_EMV,
|
|
143
|
-
ApplePayMerchantCapability.SUPPORTS_CREDIT,
|
|
144
|
-
ApplePayMerchantCapability.SUPPORTS_DEBIT,
|
|
145
|
-
];
|
|
146
|
-
}
|
|
147
|
-
}
|
|
26
|
+
require('./package--UMqvxMQ.js');
|
|
148
27
|
|
|
149
28
|
// Centralized error codes for Apple Pay service
|
|
150
29
|
var ApplePayServiceErrorCode;
|
|
@@ -163,7 +42,7 @@ class ApplePayService {
|
|
|
163
42
|
* Initialize Apple Pay configuration
|
|
164
43
|
*/
|
|
165
44
|
initialize(applePayConfig) {
|
|
166
|
-
this.applePayConfig = new ApplePayConfig(applePayConfig);
|
|
45
|
+
this.applePayConfig = new GooglePay$1.ApplePayConfig(applePayConfig);
|
|
167
46
|
if (!this.applePayConfig.isValid) {
|
|
168
47
|
throw new Error('Invalid Apple Pay configuration provided');
|
|
169
48
|
}
|
|
@@ -214,7 +93,7 @@ class ApplePayService {
|
|
|
214
93
|
* Check if Apple Pay is available on this device/browser
|
|
215
94
|
*/
|
|
216
95
|
isAvailable() {
|
|
217
|
-
return (ApplePayHelpers.isApplePaySupported() && ApplePayHelpers.canMakePayments());
|
|
96
|
+
return (GooglePay$1.ApplePayHelpers.isApplePaySupported() && GooglePay$1.ApplePayHelpers.canMakePayments());
|
|
218
97
|
}
|
|
219
98
|
/**
|
|
220
99
|
* Check if the user has an active card for the merchant
|
|
@@ -223,7 +102,7 @@ class ApplePayService {
|
|
|
223
102
|
if (!this.applePayConfig) {
|
|
224
103
|
throw new Error('Apple Pay not initialized. Call initialize() first.');
|
|
225
104
|
}
|
|
226
|
-
return await ApplePayHelpers.canMakePaymentsWithActiveCard(this.applePayConfig.merchantIdentifier);
|
|
105
|
+
return await GooglePay$1.ApplePayHelpers.canMakePaymentsWithActiveCard(this.applePayConfig.merchantIdentifier);
|
|
227
106
|
}
|
|
228
107
|
/**
|
|
229
108
|
* Start Apple Pay session
|
|
@@ -237,7 +116,7 @@ class ApplePayService {
|
|
|
237
116
|
// if (!this.isAvailable()) {
|
|
238
117
|
// throw new Error('Apple Pay is not available on this device/browser');
|
|
239
118
|
// }
|
|
240
|
-
const request = new ApplePayPaymentRequest(paymentRequest);
|
|
119
|
+
const request = new GooglePay$1.ApplePayPaymentRequest(paymentRequest);
|
|
241
120
|
if (!request.isValid) {
|
|
242
121
|
const missingFields = [];
|
|
243
122
|
if (!request.countryCode)
|
|
@@ -348,13 +227,13 @@ class ApplePayService {
|
|
|
348
227
|
const payment = event.payment;
|
|
349
228
|
const paymentPayload = Object.assign(Object.assign({}, payment.token), { product_details: {
|
|
350
229
|
name: this.currentPaymentRequest.total.label,
|
|
351
|
-
price: ApplePayHelpers.parseAmount(this.currentPaymentRequest.total.amount),
|
|
230
|
+
price: GooglePay$1.ApplePayHelpers.parseAmount(this.currentPaymentRequest.total.amount),
|
|
352
231
|
description: this.currentPaymentRequest.total.label,
|
|
353
232
|
} });
|
|
354
233
|
const paymentResult = await this.processPayment(authToken, accountId, paymentPayload);
|
|
355
234
|
if (paymentResult.success) {
|
|
356
235
|
this.currentSession.completePayment({
|
|
357
|
-
status: ApplePaySessionStatus.STATUS_SUCCESS,
|
|
236
|
+
status: GooglePay$1.ApplePaySessionStatus.STATUS_SUCCESS,
|
|
358
237
|
});
|
|
359
238
|
resolve({
|
|
360
239
|
success: true,
|
|
@@ -365,7 +244,7 @@ class ApplePayService {
|
|
|
365
244
|
else {
|
|
366
245
|
console.error('PSP reported payment failure:', paymentResult.data);
|
|
367
246
|
this.currentSession.completePayment({
|
|
368
|
-
status: ApplePaySessionStatus.STATUS_FAILURE,
|
|
247
|
+
status: GooglePay$1.ApplePaySessionStatus.STATUS_FAILURE,
|
|
369
248
|
});
|
|
370
249
|
reject({
|
|
371
250
|
success: false,
|
|
@@ -383,7 +262,7 @@ class ApplePayService {
|
|
|
383
262
|
console.error('Error stack:', error.stack);
|
|
384
263
|
}
|
|
385
264
|
this.currentSession.completePayment({
|
|
386
|
-
status: ApplePaySessionStatus.STATUS_FAILURE,
|
|
265
|
+
status: GooglePay$1.ApplePaySessionStatus.STATUS_FAILURE,
|
|
387
266
|
});
|
|
388
267
|
reject({
|
|
389
268
|
success: false,
|
|
@@ -415,7 +294,7 @@ class ApplePayService {
|
|
|
415
294
|
};
|
|
416
295
|
this.currentSession.onshippingmethodselected = () => {
|
|
417
296
|
this.currentSession.completeShippingMethodSelection({
|
|
418
|
-
status: ApplePaySessionStatus.STATUS_SUCCESS,
|
|
297
|
+
status: GooglePay$1.ApplePaySessionStatus.STATUS_SUCCESS,
|
|
419
298
|
newTotal: this.currentPaymentRequest.total,
|
|
420
299
|
newLineItems: this.currentPaymentRequest.lineItems || [],
|
|
421
300
|
});
|
|
@@ -475,9 +354,9 @@ class ApplePayService {
|
|
|
475
354
|
return {
|
|
476
355
|
countryCode,
|
|
477
356
|
currencyCode,
|
|
478
|
-
merchantCapabilities: ApplePayHelpers.getDefaultMerchantCapabilities(),
|
|
479
|
-
supportedNetworks: ApplePayHelpers.getDefaultSupportedNetworks(),
|
|
480
|
-
total: ApplePayHelpers.createLineItem(label, amount),
|
|
357
|
+
merchantCapabilities: GooglePay$1.ApplePayHelpers.getDefaultMerchantCapabilities(),
|
|
358
|
+
supportedNetworks: GooglePay$1.ApplePayHelpers.getDefaultSupportedNetworks(),
|
|
359
|
+
total: GooglePay$1.ApplePayHelpers.createLineItem(label, amount),
|
|
481
360
|
};
|
|
482
361
|
}
|
|
483
362
|
/**
|
|
@@ -496,30 +375,30 @@ const ApplePaySkeleton = (props) => {
|
|
|
496
375
|
return (index.h("div", { class: 'container-fluid p-0' }, index.h("div", { class: 'row mb-3' }, index.h("div", { class: 'col-12 align-content-center' }, index.h(skeleton.Skeleton, { height: '44px', width: '100%', styles: { borderRadius: "8px" } })))));
|
|
497
376
|
};
|
|
498
377
|
|
|
499
|
-
const ProcessingSpinner = () => (index.h("div", { class: 'processing-overlay' }, index.h("div", { class: 'spinner' }), index.h("span", null, "Processing...")));
|
|
378
|
+
const ProcessingSpinner$1 = () => (index.h("div", { class: 'processing-overlay' }, index.h("div", { class: 'spinner' }), index.h("span", null, "Processing...")));
|
|
500
379
|
const ApplePayButton = (props) => {
|
|
501
380
|
const getApplePayButtonClass = () => {
|
|
502
381
|
let classes = "apple-pay-button";
|
|
503
382
|
switch (props.buttonStyle) {
|
|
504
|
-
case ApplePayButtonStyle.WHITE:
|
|
383
|
+
case GooglePay$1.ApplePayButtonStyle.WHITE:
|
|
505
384
|
classes += " apple-pay-button-white";
|
|
506
385
|
break;
|
|
507
|
-
case ApplePayButtonStyle.WHITE_OUTLINE:
|
|
386
|
+
case GooglePay$1.ApplePayButtonStyle.WHITE_OUTLINE:
|
|
508
387
|
classes += " apple-pay-button-white-outline";
|
|
509
388
|
break;
|
|
510
|
-
case ApplePayButtonStyle.BLACK:
|
|
389
|
+
case GooglePay$1.ApplePayButtonStyle.BLACK:
|
|
511
390
|
default:
|
|
512
391
|
classes += " apple-pay-button-black";
|
|
513
392
|
break;
|
|
514
393
|
}
|
|
515
394
|
switch (props.buttonType) {
|
|
516
|
-
case ApplePayButtonType.BUY:
|
|
395
|
+
case GooglePay$1.ApplePayButtonType.BUY:
|
|
517
396
|
classes += " apple-pay-button-type-buy";
|
|
518
397
|
break;
|
|
519
|
-
case ApplePayButtonType.DONATE:
|
|
398
|
+
case GooglePay$1.ApplePayButtonType.DONATE:
|
|
520
399
|
classes += " apple-pay-button-type-donate";
|
|
521
400
|
break;
|
|
522
|
-
case ApplePayButtonType.PLAIN:
|
|
401
|
+
case GooglePay$1.ApplePayButtonType.PLAIN:
|
|
523
402
|
default:
|
|
524
403
|
classes += " apple-pay-button-type-plain";
|
|
525
404
|
break;
|
|
@@ -540,7 +419,7 @@ const ApplePayButton = (props) => {
|
|
|
540
419
|
return (index.h("div", { class: 'apple-pay-button-container' }, index.h("button", Object.assign({ class: getApplePayButtonClass(), style: {
|
|
541
420
|
width: props.width,
|
|
542
421
|
height: props.height,
|
|
543
|
-
}, onClick: handleClick, disabled: props.disabled || props.isProcessing || !props.isAvailable, "aria-label": 'Pay with Apple Pay', type: 'button' }, props), props.isProcessing && ProcessingSpinner()), index.h("style", null, `
|
|
422
|
+
}, onClick: handleClick, disabled: props.disabled || props.isProcessing || !props.isAvailable, "aria-label": 'Pay with Apple Pay', type: 'button' }, props), props.isProcessing && ProcessingSpinner$1()), index.h("style", null, `
|
|
544
423
|
.apple-pay-button-container {
|
|
545
424
|
display: block;
|
|
546
425
|
position: relative;
|
|
@@ -650,8 +529,8 @@ const ApplePay = class {
|
|
|
650
529
|
this.merchantIdentifier = "merchant.com.staging-justifi.checkout-dev";
|
|
651
530
|
this.merchantDisplayName = "JustiFi Checkout";
|
|
652
531
|
this.initiativeContext = "dev-checkout.justifi-staging.com";
|
|
653
|
-
this.buttonType = ApplePayButtonType.PLAIN;
|
|
654
|
-
this.buttonStyle = ApplePayButtonStyle.BLACK;
|
|
532
|
+
this.buttonType = GooglePay$1.ApplePayButtonType.PLAIN;
|
|
533
|
+
this.buttonStyle = GooglePay$1.ApplePayButtonStyle.BLACK;
|
|
655
534
|
this.disabled = false;
|
|
656
535
|
this.showSkeleton = true;
|
|
657
536
|
this.width = "100%";
|
|
@@ -673,16 +552,16 @@ const ApplePay = class {
|
|
|
673
552
|
this.applePayStarted.emit();
|
|
674
553
|
const paymentRequest = {
|
|
675
554
|
countryCode: this.countryCode,
|
|
676
|
-
currencyCode:
|
|
555
|
+
currencyCode: GooglePay$1.checkoutStore.paymentCurrency,
|
|
677
556
|
merchantCapabilities: [
|
|
678
|
-
ApplePayMerchantCapability.SUPPORTS_3DS,
|
|
679
|
-
ApplePayMerchantCapability.SUPPORTS_CREDIT,
|
|
680
|
-
ApplePayMerchantCapability.SUPPORTS_DEBIT,
|
|
557
|
+
GooglePay$1.ApplePayMerchantCapability.SUPPORTS_3DS,
|
|
558
|
+
GooglePay$1.ApplePayMerchantCapability.SUPPORTS_CREDIT,
|
|
559
|
+
GooglePay$1.ApplePayMerchantCapability.SUPPORTS_DEBIT,
|
|
681
560
|
],
|
|
682
|
-
supportedNetworks: ApplePayHelpers.getDefaultSupportedNetworks(),
|
|
683
|
-
total: ApplePayHelpers.createLineItem(
|
|
561
|
+
supportedNetworks: GooglePay$1.ApplePayHelpers.getDefaultSupportedNetworks(),
|
|
562
|
+
total: GooglePay$1.ApplePayHelpers.createLineItem(GooglePay$1.checkoutStore.paymentDescription, GooglePay$1.checkoutStore.paymentAmount),
|
|
684
563
|
};
|
|
685
|
-
const result = await this.applePayService.startPaymentSession(paymentRequest,
|
|
564
|
+
const result = await this.applePayService.startPaymentSession(paymentRequest, GooglePay$1.checkoutStore.authToken, GooglePay$1.checkoutStore.accountId);
|
|
686
565
|
if (result.success) {
|
|
687
566
|
this.applePayCompleted.emit({
|
|
688
567
|
success: true,
|
|
@@ -720,24 +599,24 @@ const ApplePay = class {
|
|
|
720
599
|
this.isLoading = true;
|
|
721
600
|
this.error = null;
|
|
722
601
|
this.isConfigValid = true;
|
|
723
|
-
const hasRequiredConfig = Boolean(
|
|
724
|
-
Boolean(
|
|
725
|
-
Boolean(
|
|
602
|
+
const hasRequiredConfig = Boolean(GooglePay$1.checkoutStore.paymentAmount) &&
|
|
603
|
+
Boolean(GooglePay$1.checkoutStore.paymentCurrency) &&
|
|
604
|
+
Boolean(GooglePay$1.checkoutStore.authToken);
|
|
726
605
|
if (!hasRequiredConfig) {
|
|
727
606
|
this.error = "Missing required Apple Pay configuration";
|
|
728
607
|
this.isConfigValid = false;
|
|
729
608
|
console.error("Apple Pay config error: missing required values", {
|
|
730
|
-
paymentAmount:
|
|
731
|
-
paymentCurrency:
|
|
732
|
-
hasAuthToken: Boolean(
|
|
733
|
-
accountId:
|
|
609
|
+
paymentAmount: GooglePay$1.checkoutStore.paymentAmount,
|
|
610
|
+
paymentCurrency: GooglePay$1.checkoutStore.paymentCurrency,
|
|
611
|
+
hasAuthToken: Boolean(GooglePay$1.checkoutStore.authToken),
|
|
612
|
+
accountId: GooglePay$1.checkoutStore.accountId,
|
|
734
613
|
});
|
|
735
614
|
this.applePayError.emit({ error: this.error, code: ApplePay.ErrorCode.CONFIG_ERROR });
|
|
736
615
|
this.isLoading = false;
|
|
737
616
|
return;
|
|
738
617
|
}
|
|
739
|
-
this.isAvailable = ApplePayHelpers.isApplePaySupported();
|
|
740
|
-
this.canMakePayments = ApplePayHelpers.canMakePayments();
|
|
618
|
+
this.isAvailable = GooglePay$1.ApplePayHelpers.isApplePaySupported();
|
|
619
|
+
this.canMakePayments = GooglePay$1.ApplePayHelpers.canMakePayments();
|
|
741
620
|
if (!this.isAvailable) {
|
|
742
621
|
this.error = "Apple Pay is not supported on this device";
|
|
743
622
|
console.error(this.error);
|
|
@@ -786,7 +665,7 @@ const ApplePay = class {
|
|
|
786
665
|
if (!this.isAvailable) {
|
|
787
666
|
return [];
|
|
788
667
|
}
|
|
789
|
-
return ApplePayHelpers.getDefaultSupportedNetworks();
|
|
668
|
+
return GooglePay$1.ApplePayHelpers.getDefaultSupportedNetworks();
|
|
790
669
|
}
|
|
791
670
|
async abort() {
|
|
792
671
|
this.applePayService.abortPaymentSession();
|
|
@@ -794,7 +673,7 @@ const ApplePay = class {
|
|
|
794
673
|
this.applePayCancelled.emit();
|
|
795
674
|
}
|
|
796
675
|
render() {
|
|
797
|
-
if (!
|
|
676
|
+
if (!GooglePay$1.checkoutStore.applePayEnabled) {
|
|
798
677
|
// Render nothing when Apple Pay is disabled at the checkout settings level
|
|
799
678
|
return null;
|
|
800
679
|
}
|
|
@@ -802,7 +681,7 @@ const ApplePay = class {
|
|
|
802
681
|
this.isAvailable &&
|
|
803
682
|
this.canMakePayments &&
|
|
804
683
|
this.isConfigValid;
|
|
805
|
-
return (index.h(styledHost.StyledHost, null,
|
|
684
|
+
return (index.h(styledHost.StyledHost, null, GooglePay$1.checkoutStore.checkoutLoaded && (index.h("script", { async: true, src: 'https://applepay.cdn-apple.com/jsapi/1.latest/apple-pay-sdk.js', onLoad: () => {
|
|
806
685
|
this.initializeApplePay();
|
|
807
686
|
} })), index.h("div", { class: 'apple-pay-container' }, index.h(ApplePaySkeleton, { isLoading: this.isLoading }), isReady && (index.h(ApplePayButton, { buttonType: this.buttonType, buttonStyle: this.buttonStyle, disabled: this.disabled, isProcessing: this.isProcessing, isAvailable: this.isAvailable, clickHandler: this.handleApplePayClick, width: this.width, height: this.height }))), index.h("style", null, `
|
|
808
687
|
.apple-pay-container {
|
|
@@ -825,8 +704,736 @@ const Summary = class {
|
|
|
825
704
|
index.registerInstance(this, hostRef);
|
|
826
705
|
}
|
|
827
706
|
render() {
|
|
828
|
-
return (index.h(styledHost.StyledHost, { key: '
|
|
707
|
+
return (index.h(styledHost.StyledHost, { key: '3ebaf90f9085614d44043d9b5ba7de3f926bf6f1' }, index.h("section", { key: '888ea6f17ece8e78b7ddf9302be5b1b355cd54c6' }, index.h("div", { key: 'bb7db155a31ceb9e824c5290b8fb8d8713622bdd' }, index.h("div", { key: 'dc954f18e824dabfb09fc727aeb87685020e2d1e', part: parts.text }, GooglePay$1.checkoutStore === null || GooglePay$1.checkoutStore === void 0 ? void 0 : GooglePay$1.checkoutStore.paymentDescription), index.h("div", { key: 'e7f6b12c142655fc967bd6a37e00193b9f743f84' }, index.h("span", { key: '25996f66626d428385422d72f5e2bba1a8301628', part: parts.text }, "Total"), "\u00A0", index.h("span", { key: '958bd1242ac23e13e66b73563d2c6f73499d2574', part: parts.text }, utils.formatCurrency(+(GooglePay$1.checkoutStore === null || GooglePay$1.checkoutStore === void 0 ? void 0 : GooglePay$1.checkoutStore.totalAmount))))))));
|
|
708
|
+
}
|
|
709
|
+
};
|
|
710
|
+
|
|
711
|
+
const PROCESS_TOKEN_ENDPOINT = 'google_pay/process_token';
|
|
712
|
+
class GooglePayService {
|
|
713
|
+
constructor() {
|
|
714
|
+
this.api = Api.Api();
|
|
715
|
+
}
|
|
716
|
+
/**
|
|
717
|
+
* Initialize Google Pay configuration
|
|
718
|
+
*/
|
|
719
|
+
initialize(googlePayConfig) {
|
|
720
|
+
this.googlePayConfig = new GooglePay$1.GooglePayConfig(googlePayConfig);
|
|
721
|
+
if (!this.googlePayConfig.isValid) {
|
|
722
|
+
throw new Error('Invalid Google Pay configuration provided');
|
|
723
|
+
}
|
|
724
|
+
// Create Google Pay client
|
|
725
|
+
this.googlePayClient = GooglePay$1.GooglePayHelpers.createGooglePayClient(this.googlePayConfig.environment);
|
|
726
|
+
if (!this.googlePayClient) {
|
|
727
|
+
throw new Error('Failed to create Google Pay client');
|
|
728
|
+
}
|
|
729
|
+
// No debug logs
|
|
730
|
+
}
|
|
731
|
+
/**
|
|
732
|
+
* Process Google Pay payment via API
|
|
733
|
+
*/
|
|
734
|
+
async processPayment(authToken, accountId, payload) {
|
|
735
|
+
const endpoint = PROCESS_TOKEN_ENDPOINT;
|
|
736
|
+
try {
|
|
737
|
+
const result = await this.api.post({
|
|
738
|
+
endpoint,
|
|
739
|
+
authToken,
|
|
740
|
+
body: payload,
|
|
741
|
+
headers: {
|
|
742
|
+
'sub-account': accountId,
|
|
743
|
+
},
|
|
744
|
+
});
|
|
745
|
+
return {
|
|
746
|
+
success: result.id && !!result.data.token,
|
|
747
|
+
data: result,
|
|
748
|
+
};
|
|
749
|
+
}
|
|
750
|
+
catch (_error) {
|
|
751
|
+
throw new Error('Google Pay payment processing failed');
|
|
752
|
+
}
|
|
753
|
+
}
|
|
754
|
+
/**
|
|
755
|
+
* Check if Google Pay is available on this device/browser
|
|
756
|
+
*/
|
|
757
|
+
isAvailable() {
|
|
758
|
+
return GooglePay$1.GooglePayHelpers.isGooglePaySupported() && !!this.googlePayClient;
|
|
759
|
+
}
|
|
760
|
+
/**
|
|
761
|
+
* Check if the user can make payments with Google Pay
|
|
762
|
+
*/
|
|
763
|
+
async canMakePayments() {
|
|
764
|
+
if (!this.googlePayClient || !this.googlePayConfig) {
|
|
765
|
+
return false;
|
|
766
|
+
}
|
|
767
|
+
try {
|
|
768
|
+
const baseRequest = GooglePay$1.GooglePayHelpers.createBasePaymentDataRequest();
|
|
769
|
+
const response = await this.googlePayClient.isReadyToPay(baseRequest);
|
|
770
|
+
return response.result;
|
|
771
|
+
}
|
|
772
|
+
catch (_error) {
|
|
773
|
+
return false;
|
|
774
|
+
}
|
|
775
|
+
}
|
|
776
|
+
/**
|
|
777
|
+
* Start Google Pay payment session
|
|
778
|
+
*/
|
|
779
|
+
async startPaymentSession(paymentDataRequest, authToken, accountId) {
|
|
780
|
+
var _a;
|
|
781
|
+
if (!this.googlePayConfig || !this.googlePayClient) {
|
|
782
|
+
throw new Error('Google Pay not initialized. Call initialize() first.');
|
|
783
|
+
}
|
|
784
|
+
if (!this.isAvailable()) {
|
|
785
|
+
throw new Error('Google Pay is not available on this device/browser');
|
|
786
|
+
}
|
|
787
|
+
const request = new GooglePay$1.GooglePayPaymentDataRequest(paymentDataRequest);
|
|
788
|
+
if (!request.isValid) {
|
|
789
|
+
throw new Error('Invalid payment data request provided');
|
|
790
|
+
}
|
|
791
|
+
try {
|
|
792
|
+
const paymentData = await this.googlePayClient.loadPaymentData(request);
|
|
793
|
+
// Build top-level snake_case fields from Google Pay tokenizationData
|
|
794
|
+
const tokenizationData = (_a = paymentData === null || paymentData === void 0 ? void 0 : paymentData.paymentMethodData) === null || _a === void 0 ? void 0 : _a.tokenizationData;
|
|
795
|
+
const tokenObj = (() => {
|
|
796
|
+
if ((tokenizationData === null || tokenizationData === void 0 ? void 0 : tokenizationData.token) &&
|
|
797
|
+
typeof tokenizationData.token === 'string') {
|
|
798
|
+
try {
|
|
799
|
+
return JSON.parse(tokenizationData.token);
|
|
800
|
+
}
|
|
801
|
+
catch (_e) {
|
|
802
|
+
return tokenizationData;
|
|
803
|
+
}
|
|
804
|
+
}
|
|
805
|
+
return tokenizationData;
|
|
806
|
+
})();
|
|
807
|
+
const tokenProcessRequest = {
|
|
808
|
+
protocolVersion: tokenObj === null || tokenObj === void 0 ? void 0 : tokenObj.protocolVersion,
|
|
809
|
+
signature: tokenObj === null || tokenObj === void 0 ? void 0 : tokenObj.signature,
|
|
810
|
+
intermediateSigningKey: (tokenObj === null || tokenObj === void 0 ? void 0 : tokenObj.intermediateSigningKey)
|
|
811
|
+
? {
|
|
812
|
+
signedKey: tokenObj.intermediateSigningKey.signedKey,
|
|
813
|
+
signatures: tokenObj.intermediateSigningKey.signatures,
|
|
814
|
+
}
|
|
815
|
+
: undefined,
|
|
816
|
+
signedMessage: tokenObj === null || tokenObj === void 0 ? void 0 : tokenObj.signedMessage,
|
|
817
|
+
};
|
|
818
|
+
const paymentResult = await this.processPayment(authToken, accountId, tokenProcessRequest);
|
|
819
|
+
if (paymentResult.success) {
|
|
820
|
+
return {
|
|
821
|
+
success: true,
|
|
822
|
+
paymentData: paymentData,
|
|
823
|
+
paymentMethodId: paymentResult.data.id,
|
|
824
|
+
};
|
|
825
|
+
}
|
|
826
|
+
else {
|
|
827
|
+
return {
|
|
828
|
+
success: false,
|
|
829
|
+
error: {
|
|
830
|
+
code: 'PAYMENT_PROCESSING_ERROR',
|
|
831
|
+
message: 'Payment processing failed',
|
|
832
|
+
},
|
|
833
|
+
};
|
|
834
|
+
}
|
|
835
|
+
}
|
|
836
|
+
catch (error) {
|
|
837
|
+
// Handle different types of errors
|
|
838
|
+
if (error && typeof error === 'object' && 'statusCode' in error) {
|
|
839
|
+
const googlePayError = error;
|
|
840
|
+
switch (googlePayError.statusCode) {
|
|
841
|
+
case 'CANCELED':
|
|
842
|
+
return {
|
|
843
|
+
success: false,
|
|
844
|
+
error: {
|
|
845
|
+
code: 'USER_CANCELLED',
|
|
846
|
+
message: 'User cancelled the Google Pay session',
|
|
847
|
+
},
|
|
848
|
+
};
|
|
849
|
+
case 'DEVELOPER_ERROR':
|
|
850
|
+
return {
|
|
851
|
+
success: false,
|
|
852
|
+
error: {
|
|
853
|
+
code: 'DEVELOPER_ERROR',
|
|
854
|
+
message: 'Google Pay configuration error',
|
|
855
|
+
},
|
|
856
|
+
};
|
|
857
|
+
default:
|
|
858
|
+
return {
|
|
859
|
+
success: false,
|
|
860
|
+
error: {
|
|
861
|
+
code: 'PAYMENT_ERROR',
|
|
862
|
+
message: googlePayError.statusMessage || 'Google Pay payment failed',
|
|
863
|
+
},
|
|
864
|
+
};
|
|
865
|
+
}
|
|
866
|
+
}
|
|
867
|
+
return {
|
|
868
|
+
success: false,
|
|
869
|
+
error: {
|
|
870
|
+
code: 'PAYMENT_ERROR',
|
|
871
|
+
message: error instanceof Error
|
|
872
|
+
? error.message
|
|
873
|
+
: 'Google Pay payment failed',
|
|
874
|
+
},
|
|
875
|
+
};
|
|
876
|
+
}
|
|
877
|
+
}
|
|
878
|
+
/**
|
|
879
|
+
* Create Google Pay button element
|
|
880
|
+
*/
|
|
881
|
+
createButton(options) {
|
|
882
|
+
if (!this.googlePayClient || !this.googlePayConfig) {
|
|
883
|
+
return null;
|
|
884
|
+
}
|
|
885
|
+
try {
|
|
886
|
+
return this.googlePayClient.createButton({
|
|
887
|
+
onClick: options.onClick,
|
|
888
|
+
buttonType: options.buttonType,
|
|
889
|
+
buttonSizeMode: options.buttonSizeMode,
|
|
890
|
+
buttonColor: options.buttonColor,
|
|
891
|
+
buttonLocale: options.buttonLocale,
|
|
892
|
+
});
|
|
893
|
+
}
|
|
894
|
+
catch (_error) {
|
|
895
|
+
return null;
|
|
896
|
+
}
|
|
897
|
+
}
|
|
898
|
+
/**
|
|
899
|
+
* Prefetch payment data for faster loading
|
|
900
|
+
*/
|
|
901
|
+
prefetchPaymentData(paymentDataRequest) {
|
|
902
|
+
if (!this.googlePayClient) {
|
|
903
|
+
return;
|
|
904
|
+
}
|
|
905
|
+
const request = new GooglePay$1.GooglePayPaymentDataRequest(paymentDataRequest);
|
|
906
|
+
if (!request.isValid) {
|
|
907
|
+
return;
|
|
908
|
+
}
|
|
909
|
+
try {
|
|
910
|
+
this.googlePayClient.prefetchPaymentData(request);
|
|
911
|
+
}
|
|
912
|
+
catch (_error) { }
|
|
913
|
+
}
|
|
914
|
+
/**
|
|
915
|
+
* Create a basic payment data request
|
|
916
|
+
*/
|
|
917
|
+
static createPaymentDataRequest(amount, label, countryCode = 'US', currencyCode = 'USD', merchantName) {
|
|
918
|
+
const request = {
|
|
919
|
+
apiVersion: 2,
|
|
920
|
+
apiVersionMinor: 0,
|
|
921
|
+
allowedPaymentMethods: [GooglePay$1.GooglePayHelpers.createPaymentMethodData()],
|
|
922
|
+
transactionInfo: {
|
|
923
|
+
countryCode,
|
|
924
|
+
currencyCode,
|
|
925
|
+
totalPriceStatus: 'FINAL',
|
|
926
|
+
totalPrice: GooglePay$1.GooglePayHelpers.formatAmount(amount),
|
|
927
|
+
totalPriceLabel: label,
|
|
928
|
+
},
|
|
929
|
+
merchantInfo: {
|
|
930
|
+
merchantName,
|
|
931
|
+
},
|
|
932
|
+
};
|
|
933
|
+
// No debug logs
|
|
934
|
+
return request;
|
|
935
|
+
}
|
|
936
|
+
/**
|
|
937
|
+
* Get current configuration
|
|
938
|
+
*/
|
|
939
|
+
getGooglePayConfig() {
|
|
940
|
+
return this.googlePayConfig;
|
|
941
|
+
}
|
|
942
|
+
/**
|
|
943
|
+
* Get current Google Pay client
|
|
944
|
+
*/
|
|
945
|
+
getGooglePayClient() {
|
|
946
|
+
return this.googlePayClient;
|
|
947
|
+
}
|
|
948
|
+
}
|
|
949
|
+
|
|
950
|
+
const GooglePaySkeleton = (props) => {
|
|
951
|
+
const { isLoading } = props;
|
|
952
|
+
if (!isLoading) {
|
|
953
|
+
return null;
|
|
954
|
+
}
|
|
955
|
+
return (index.h("div", { class: 'container-fluid p-0' }, index.h("div", { class: 'row mb-3' }, index.h("div", { class: 'col-12 align-content-center' }, index.h(skeleton.Skeleton, { height: '44px', width: '100%', styles: { borderRadius: "8px" } })))));
|
|
956
|
+
};
|
|
957
|
+
|
|
958
|
+
const ProcessingSpinner = () => (index.h("div", { class: 'processing-overlay' }, index.h("div", { class: 'spinner' }), index.h("span", null, "Processing...")));
|
|
959
|
+
const GooglePayButton = (props) => {
|
|
960
|
+
const getGooglePayButtonClass = () => {
|
|
961
|
+
let classes = "google-pay-button";
|
|
962
|
+
// Button style
|
|
963
|
+
switch (props.buttonStyle) {
|
|
964
|
+
case GooglePay$1.GooglePayButtonStyle.WHITE:
|
|
965
|
+
classes += " google-pay-button-white";
|
|
966
|
+
break;
|
|
967
|
+
case GooglePay$1.GooglePayButtonStyle.BLACK:
|
|
968
|
+
default:
|
|
969
|
+
classes += " google-pay-button-black";
|
|
970
|
+
break;
|
|
971
|
+
}
|
|
972
|
+
// Button type
|
|
973
|
+
switch (props.buttonType) {
|
|
974
|
+
case GooglePay$1.GooglePayButtonType.BUY:
|
|
975
|
+
classes += " google-pay-button-type-buy";
|
|
976
|
+
break;
|
|
977
|
+
case GooglePay$1.GooglePayButtonType.BOOK:
|
|
978
|
+
classes += " google-pay-button-type-book";
|
|
979
|
+
break;
|
|
980
|
+
case GooglePay$1.GooglePayButtonType.CHECKOUT:
|
|
981
|
+
classes += " google-pay-button-type-checkout";
|
|
982
|
+
break;
|
|
983
|
+
case GooglePay$1.GooglePayButtonType.DONATE:
|
|
984
|
+
classes += " google-pay-button-type-donate";
|
|
985
|
+
break;
|
|
986
|
+
case GooglePay$1.GooglePayButtonType.ORDER:
|
|
987
|
+
classes += " google-pay-button-type-order";
|
|
988
|
+
break;
|
|
989
|
+
case GooglePay$1.GooglePayButtonType.PAY:
|
|
990
|
+
classes += " google-pay-button-type-pay";
|
|
991
|
+
break;
|
|
992
|
+
case GooglePay$1.GooglePayButtonType.SUBSCRIBE:
|
|
993
|
+
classes += " google-pay-button-type-subscribe";
|
|
994
|
+
break;
|
|
995
|
+
case GooglePay$1.GooglePayButtonType.PLAIN:
|
|
996
|
+
default:
|
|
997
|
+
classes += " google-pay-button-type-plain";
|
|
998
|
+
break;
|
|
999
|
+
}
|
|
1000
|
+
// Size mode
|
|
1001
|
+
switch (props.buttonSizeMode) {
|
|
1002
|
+
case GooglePay$1.GooglePayButtonSizeMode.FILL:
|
|
1003
|
+
classes += " google-pay-button-fill";
|
|
1004
|
+
break;
|
|
1005
|
+
case GooglePay$1.GooglePayButtonSizeMode.STATIC:
|
|
1006
|
+
default:
|
|
1007
|
+
classes += " google-pay-button-static";
|
|
1008
|
+
break;
|
|
1009
|
+
}
|
|
1010
|
+
if (props.disabled || props.isProcessing || !props.isAvailable) {
|
|
1011
|
+
classes += " disabled";
|
|
1012
|
+
}
|
|
1013
|
+
return classes;
|
|
1014
|
+
};
|
|
1015
|
+
const getButtonStyles = () => {
|
|
1016
|
+
const styles = {};
|
|
1017
|
+
if (props.buttonSizeMode === GooglePay$1.GooglePayButtonSizeMode.FILL) {
|
|
1018
|
+
styles.width = '100%';
|
|
1019
|
+
styles.minWidth = '200px';
|
|
1020
|
+
}
|
|
1021
|
+
else {
|
|
1022
|
+
styles.width = props.width || '200px';
|
|
1023
|
+
}
|
|
1024
|
+
styles.height = props.height || '48px';
|
|
1025
|
+
return styles;
|
|
1026
|
+
};
|
|
1027
|
+
const handleClick = () => {
|
|
1028
|
+
if (!props.disabled &&
|
|
1029
|
+
!props.isProcessing &&
|
|
1030
|
+
props.isAvailable &&
|
|
1031
|
+
props.clickHandler) {
|
|
1032
|
+
props.clickHandler();
|
|
1033
|
+
}
|
|
1034
|
+
};
|
|
1035
|
+
return (index.h("div", { class: "google-pay-button-container" }, index.h("button", Object.assign({ class: getGooglePayButtonClass(), style: getButtonStyles(), onClick: handleClick, disabled: props.disabled || props.isProcessing || !props.isAvailable, "aria-label": "Google Pay", type: "button" }, props), props.isProcessing && ProcessingSpinner(), index.h("div", { class: 'google-pay-button-content' }, index.h("svg", { width: "41", height: "17", xmlns: "http://www.w3.org/2000/svg" }, index.h("g", { fill: "none", "fill-rule": "evenodd" }, index.h("path", { d: "M19.526 2.635v4.083h2.518c.6 0 1.096-.202 1.488-.605.403-.402.605-.882.605-1.437 0-.544-.202-1.018-.605-1.422-.392-.413-.888-.62-1.488-.62h-2.518zm0 5.52v4.736h-1.504V1.198h3.99c1.013 0 1.873.337 2.582 1.012.72.675 1.08 1.497 1.08 2.466 0 .991-.36 1.819-1.08 2.482-.697.665-1.559.996-2.583.996h-2.485v.001zm7.668 2.287c0 .392.166.718.499.98.332.26.722.391 1.168.391.633 0 1.196-.234 1.692-.701.497-.469.744-1.019.744-1.65-.469-.37-1.123-.555-1.962-.555-.61 0-1.12.148-1.528.442-.409.294-.613.657-.613 1.093m1.946-5.815c1.112 0 1.989.297 2.633.89.642.594.964 1.408.964 2.442v4.932h-1.439v-1.11h-.065c-.622.914-1.45 1.372-2.486 1.372-.882 0-1.621-.262-2.215-.784-.594-.523-.891-1.176-.891-1.96 0-.828.313-1.486.94-1.976s1.463-.735 2.51-.735c.892 0 1.629.163 2.206.49v-.344c0-.522-.207-.966-.621-1.33a2.132 2.132 0 0 0-1.455-.547c-.84 0-1.504.353-1.995 1.062l-1.324-.834c.73-1.045 1.81-1.568 3.238-1.568m11.853.262l-5.02 11.53H34.42l1.864-4.034-3.302-7.496h1.635l2.387 5.749h.032l2.322-5.75z", fill: "#FFF" }), index.h("path", { d: "M13.448 7.134c0-.473-.04-.93-.116-1.366H6.988v2.588h3.634a3.11 3.11 0 0 1-1.344 2.042v1.68h2.169c1.27-1.17 2.001-2.9 2.001-4.944", fill: "#4285F4" }), index.h("path", { d: "M6.988 13.7c1.816 0 3.344-.595 4.459-1.621l-2.169-1.681c-.603.406-1.38.643-2.29.643-1.754 0-3.244-1.182-3.776-2.774H.978v1.731a6.728 6.728 0 0 0 6.01 3.703", fill: "#34A853" }), index.h("path", { d: "M3.212 8.267a4.034 4.034 0 0 1 0-2.572V3.964H.978A6.678 6.678 0 0 0 .261 6.98c0 1.085.26 2.11.717 3.017l2.234-1.731z", fill: "#FABB05" }), index.h("path", { d: "M6.988 2.921c.992 0 1.88.34 2.58 1.008v.001l1.92-1.918C10.324.928 8.804.262 6.989.262a6.728 6.728 0 0 0-6.01 3.702l2.234 1.731c.532-1.592 2.022-2.774 3.776-2.774", fill: "#E94235" }))))), index.h("style", null, `
|
|
1036
|
+
.google-pay-button-container {
|
|
1037
|
+
display: block;
|
|
1038
|
+
position: relative;
|
|
1039
|
+
}
|
|
1040
|
+
|
|
1041
|
+
.google-pay-button {
|
|
1042
|
+
display: flex;
|
|
1043
|
+
align-items: center;
|
|
1044
|
+
justify-content: center;
|
|
1045
|
+
border: none;
|
|
1046
|
+
border-radius: 4px;
|
|
1047
|
+
cursor: pointer;
|
|
1048
|
+
font-size: 14px;
|
|
1049
|
+
font-weight: 500;
|
|
1050
|
+
letter-spacing: 0.25px;
|
|
1051
|
+
line-height: 16px;
|
|
1052
|
+
outline: none;
|
|
1053
|
+
padding: 0 20px;
|
|
1054
|
+
position: relative;
|
|
1055
|
+
min-width: 140px;
|
|
1056
|
+
min-height: 48px;
|
|
1057
|
+
}
|
|
1058
|
+
|
|
1059
|
+
/* Button styles */
|
|
1060
|
+
.google-pay-button.google-pay-button-black {
|
|
1061
|
+
background-color: #000;
|
|
1062
|
+
color: #fff;
|
|
1063
|
+
}
|
|
1064
|
+
|
|
1065
|
+
.google-pay-button.google-pay-button-white {
|
|
1066
|
+
background-color: #fff;
|
|
1067
|
+
color: #3c4043;
|
|
1068
|
+
}
|
|
1069
|
+
|
|
1070
|
+
/* Button content */
|
|
1071
|
+
.google-pay-button-content {
|
|
1072
|
+
display: flex;
|
|
1073
|
+
align-items: center;
|
|
1074
|
+
justify-content: center;
|
|
1075
|
+
gap: 8px;
|
|
1076
|
+
white-space: nowrap;
|
|
1077
|
+
}
|
|
1078
|
+
|
|
1079
|
+
.google-g-logo {
|
|
1080
|
+
width: 20px;
|
|
1081
|
+
height: 20px;
|
|
1082
|
+
flex-shrink: 0;
|
|
1083
|
+
}
|
|
1084
|
+
|
|
1085
|
+
.pay-text {
|
|
1086
|
+
font-family: 'Google Sans', arial, sans-serif;
|
|
1087
|
+
font-size: 14px;
|
|
1088
|
+
font-weight: 500;
|
|
1089
|
+
margin-left: 8px;
|
|
1090
|
+
}
|
|
1091
|
+
|
|
1092
|
+
/* Button types - text content handled by ::before pseudo-element */
|
|
1093
|
+
.google-pay-button-type-buy .google-pay-button-content::before {
|
|
1094
|
+
content: 'Buy with';
|
|
1095
|
+
margin-right: 8px;
|
|
1096
|
+
}
|
|
1097
|
+
|
|
1098
|
+
.google-pay-button-type-book .google-pay-button-content::before {
|
|
1099
|
+
content: 'Book with';
|
|
1100
|
+
margin-right: 8px;
|
|
1101
|
+
}
|
|
1102
|
+
|
|
1103
|
+
.google-pay-button-type-checkout .google-pay-button-content::before {
|
|
1104
|
+
content: 'Checkout with';
|
|
1105
|
+
margin-right: 8px;
|
|
1106
|
+
}
|
|
1107
|
+
|
|
1108
|
+
.google-pay-button-type-donate .google-pay-button-content::before {
|
|
1109
|
+
content: 'Donate with';
|
|
1110
|
+
margin-right: 8px;
|
|
1111
|
+
}
|
|
1112
|
+
|
|
1113
|
+
.google-pay-button-type-order .google-pay-button-content::before {
|
|
1114
|
+
content: 'Order with';
|
|
1115
|
+
margin-right: 8px;
|
|
1116
|
+
}
|
|
1117
|
+
|
|
1118
|
+
.google-pay-button-type-pay .google-pay-button-content::before {
|
|
1119
|
+
content: 'Pay with';
|
|
1120
|
+
margin-right: 8px;
|
|
1121
|
+
}
|
|
1122
|
+
|
|
1123
|
+
.google-pay-button-type-subscribe .google-pay-button-content::before {
|
|
1124
|
+
content: 'Subscribe with';
|
|
1125
|
+
margin-right: 8px;
|
|
1126
|
+
}
|
|
1127
|
+
|
|
1128
|
+
/* Size modes */
|
|
1129
|
+
.google-pay-button.google-pay-button-fill {
|
|
1130
|
+
width: 100%;
|
|
1131
|
+
min-width: 200px;
|
|
1132
|
+
}
|
|
1133
|
+
|
|
1134
|
+
.google-pay-button.google-pay-button-static {
|
|
1135
|
+
width: auto;
|
|
1136
|
+
}
|
|
1137
|
+
|
|
1138
|
+
/* Hover and focus states */
|
|
1139
|
+
.google-pay-button:hover:not(.disabled) {
|
|
1140
|
+
box-shadow: 0 1px 1px 0 rgba(0, 0, 0, 0.15), 0 1px 3px 1px rgba(0, 0, 0, 0.30);
|
|
1141
|
+
}
|
|
1142
|
+
|
|
1143
|
+
.google-pay-button:focus:not(.disabled) {
|
|
1144
|
+
box-shadow: 0 1px 1px 0 rgba(0, 0, 0, 0.15), 0 1px 3px 1px rgba(0, 0, 0, 0.30);
|
|
1145
|
+
}
|
|
1146
|
+
|
|
1147
|
+
.google-pay-button:active:not(.disabled) {
|
|
1148
|
+
box-shadow: 0 1px 1px 0 rgba(0, 0, 0, 0.15), 0 1px 3px 1px rgba(0, 0, 0, 0.30);
|
|
1149
|
+
transform: translateY(1px);
|
|
1150
|
+
}
|
|
1151
|
+
|
|
1152
|
+
/* Disabled state */
|
|
1153
|
+
.google-pay-button.disabled {
|
|
1154
|
+
opacity: 0.5;
|
|
1155
|
+
cursor: not-allowed;
|
|
1156
|
+
box-shadow: none;
|
|
1157
|
+
}
|
|
1158
|
+
|
|
1159
|
+
.google-pay-button.disabled:hover,
|
|
1160
|
+
.google-pay-button.disabled:focus,
|
|
1161
|
+
.google-pay-button.disabled:active {
|
|
1162
|
+
box-shadow: none;
|
|
1163
|
+
transform: none;
|
|
1164
|
+
}
|
|
1165
|
+
|
|
1166
|
+
/* Processing overlay */
|
|
1167
|
+
.processing-overlay {
|
|
1168
|
+
position: absolute;
|
|
1169
|
+
top: 0;
|
|
1170
|
+
left: 0;
|
|
1171
|
+
right: 0;
|
|
1172
|
+
bottom: 0;
|
|
1173
|
+
display: flex;
|
|
1174
|
+
align-items: center;
|
|
1175
|
+
justify-content: center;
|
|
1176
|
+
gap: 8px;
|
|
1177
|
+
background: rgba(0, 0, 0, 0.8);
|
|
1178
|
+
color: white;
|
|
1179
|
+
border-radius: 4px;
|
|
1180
|
+
font-size: 14px;
|
|
1181
|
+
font-weight: 500;
|
|
1182
|
+
}
|
|
1183
|
+
|
|
1184
|
+
.spinner {
|
|
1185
|
+
width: 16px;
|
|
1186
|
+
height: 16px;
|
|
1187
|
+
border: 2px solid rgba(255, 255, 255, 0.3);
|
|
1188
|
+
border-top: 2px solid #fff;
|
|
1189
|
+
border-radius: 50%;
|
|
1190
|
+
animation: spin 1s linear infinite;
|
|
1191
|
+
}
|
|
1192
|
+
|
|
1193
|
+
@keyframes spin {
|
|
1194
|
+
0% { transform: rotate(0deg); }
|
|
1195
|
+
100% { transform: rotate(360deg); }
|
|
1196
|
+
}
|
|
1197
|
+
|
|
1198
|
+
/* Responsive design */
|
|
1199
|
+
@media (max-width: 480px) {
|
|
1200
|
+
.google-pay-button {
|
|
1201
|
+
width: 100% !important;
|
|
1202
|
+
min-width: 200px;
|
|
1203
|
+
}
|
|
1204
|
+
}
|
|
1205
|
+
`)));
|
|
1206
|
+
};
|
|
1207
|
+
|
|
1208
|
+
const GooglePay = class {
|
|
1209
|
+
constructor(hostRef) {
|
|
1210
|
+
index.registerInstance(this, hostRef);
|
|
1211
|
+
this.googlePayCancelled = index.createEvent(this, "googlePayCancelled");
|
|
1212
|
+
this.googlePayCompleted = index.createEvent(this, "googlePayCompleted");
|
|
1213
|
+
this.googlePayStarted = index.createEvent(this, "googlePayStarted");
|
|
1214
|
+
this.unsubscribes = [];
|
|
1215
|
+
this.canMakePayments = false;
|
|
1216
|
+
this.error = null;
|
|
1217
|
+
this.isAvailable = false;
|
|
1218
|
+
this.isLoading = true;
|
|
1219
|
+
this.isProcessing = false;
|
|
1220
|
+
this.buttonSizeMode = GooglePay$1.GooglePayButtonSizeMode.FILL;
|
|
1221
|
+
this.buttonStyle = GooglePay$1.GooglePayButtonStyle.BLACK;
|
|
1222
|
+
this.buttonType = GooglePay$1.GooglePayButtonType.PLAIN;
|
|
1223
|
+
this.countryCode = "US";
|
|
1224
|
+
this.disabled = false;
|
|
1225
|
+
this.environment = GooglePay$1.GooglePayEnvironment.PRODUCTION;
|
|
1226
|
+
this.merchantId = "gateway:justifi";
|
|
1227
|
+
this.merchantName = "justifi";
|
|
1228
|
+
this.showSkeleton = true;
|
|
1229
|
+
this.handleGooglePayClick = async () => {
|
|
1230
|
+
var _a;
|
|
1231
|
+
if (this.isProcessing ||
|
|
1232
|
+
this.disabled ||
|
|
1233
|
+
!this.isAvailable ||
|
|
1234
|
+
!this.canMakePayments) {
|
|
1235
|
+
return;
|
|
1236
|
+
}
|
|
1237
|
+
try {
|
|
1238
|
+
this.isProcessing = true;
|
|
1239
|
+
this.error = null;
|
|
1240
|
+
this.googlePayStarted.emit();
|
|
1241
|
+
const paymentDataRequest = this.createPaymentDataRequest();
|
|
1242
|
+
const result = await this.googlePayService.startPaymentSession(paymentDataRequest, GooglePay$1.checkoutStore.authToken, GooglePay$1.checkoutStore.accountId);
|
|
1243
|
+
if (result.success) {
|
|
1244
|
+
this.googlePayCompleted.emit({
|
|
1245
|
+
success: true,
|
|
1246
|
+
paymentData: result.paymentData,
|
|
1247
|
+
paymentMethodId: result.paymentMethodId,
|
|
1248
|
+
});
|
|
1249
|
+
}
|
|
1250
|
+
else {
|
|
1251
|
+
this.googlePayCompleted.emit({
|
|
1252
|
+
success: false,
|
|
1253
|
+
error: result.error,
|
|
1254
|
+
});
|
|
1255
|
+
if (((_a = result.error) === null || _a === void 0 ? void 0 : _a.code) === "USER_CANCELLED") {
|
|
1256
|
+
this.googlePayCancelled.emit();
|
|
1257
|
+
}
|
|
1258
|
+
}
|
|
1259
|
+
}
|
|
1260
|
+
catch (error) {
|
|
1261
|
+
const errorMessage = error instanceof Error ? error.message : "Payment failed";
|
|
1262
|
+
this.error = errorMessage;
|
|
1263
|
+
this.googlePayCompleted.emit({
|
|
1264
|
+
success: false,
|
|
1265
|
+
error: errorMessage,
|
|
1266
|
+
});
|
|
1267
|
+
}
|
|
1268
|
+
finally {
|
|
1269
|
+
this.isProcessing = false;
|
|
1270
|
+
}
|
|
1271
|
+
};
|
|
1272
|
+
}
|
|
1273
|
+
watchConfigChange() {
|
|
1274
|
+
this.initializeGooglePay();
|
|
1275
|
+
}
|
|
1276
|
+
componentWillLoad() {
|
|
1277
|
+
this.googlePayService = new GooglePayService();
|
|
1278
|
+
}
|
|
1279
|
+
componentDidLoad() {
|
|
1280
|
+
const unsub = GooglePay$1.onChange("paymentAmount", () => {
|
|
1281
|
+
this.prefetchPaymentData();
|
|
1282
|
+
});
|
|
1283
|
+
if (typeof unsub === 'function')
|
|
1284
|
+
this.unsubscribes.push(unsub);
|
|
1285
|
+
const unsubCurrency = GooglePay$1.onChange("paymentCurrency", () => {
|
|
1286
|
+
this.prefetchPaymentData();
|
|
1287
|
+
});
|
|
1288
|
+
if (typeof unsubCurrency === 'function')
|
|
1289
|
+
this.unsubscribes.push(unsubCurrency);
|
|
1290
|
+
const unsubDesc = GooglePay$1.onChange("paymentDescription", () => {
|
|
1291
|
+
this.prefetchPaymentData();
|
|
1292
|
+
});
|
|
1293
|
+
if (typeof unsubDesc === 'function')
|
|
1294
|
+
this.unsubscribes.push(unsubDesc);
|
|
1295
|
+
}
|
|
1296
|
+
disconnectedCallback() {
|
|
1297
|
+
this.unsubscribes.forEach((fn) => {
|
|
1298
|
+
try {
|
|
1299
|
+
fn();
|
|
1300
|
+
}
|
|
1301
|
+
catch (_a) { }
|
|
1302
|
+
});
|
|
1303
|
+
this.unsubscribes = [];
|
|
1304
|
+
}
|
|
1305
|
+
/**
|
|
1306
|
+
* Returns supported authentication methods when Google Pay is available.
|
|
1307
|
+
*/
|
|
1308
|
+
async getSupportedAuthMethods() {
|
|
1309
|
+
if (!this.isAvailable) {
|
|
1310
|
+
return [];
|
|
1311
|
+
}
|
|
1312
|
+
return GooglePay$1.GooglePayHelpers.getDefaultAuthMethods();
|
|
1313
|
+
}
|
|
1314
|
+
/**
|
|
1315
|
+
* Returns supported card networks when Google Pay is available.
|
|
1316
|
+
*/
|
|
1317
|
+
async getSupportedNetworks() {
|
|
1318
|
+
if (!this.isAvailable) {
|
|
1319
|
+
return [];
|
|
1320
|
+
}
|
|
1321
|
+
return GooglePay$1.GooglePayHelpers.getDefaultSupportedNetworks();
|
|
1322
|
+
}
|
|
1323
|
+
/**
|
|
1324
|
+
* Select Google Pay in the modular checkout parent.
|
|
1325
|
+
*/
|
|
1326
|
+
async handleSelectionClick() {
|
|
1327
|
+
GooglePay$1.checkoutStore.selectedPaymentMethod = { type: index$1.PAYMENT_METHODS.GOOGLE_PAY };
|
|
1328
|
+
}
|
|
1329
|
+
/**
|
|
1330
|
+
* Returns whether Google Pay is both available and can make payments.
|
|
1331
|
+
*/
|
|
1332
|
+
async isSupported() {
|
|
1333
|
+
return this.isAvailable && this.canMakePayments;
|
|
1334
|
+
}
|
|
1335
|
+
/**
|
|
1336
|
+
* Prefetch payment data for faster load times of the Google Pay sheet.
|
|
1337
|
+
*/
|
|
1338
|
+
async prefetchPaymentData() {
|
|
1339
|
+
if (!this.isAvailable || !this.canMakePayments) {
|
|
1340
|
+
return;
|
|
1341
|
+
}
|
|
1342
|
+
const paymentDataRequest = this.createPaymentDataRequest();
|
|
1343
|
+
this.googlePayService.prefetchPaymentData(paymentDataRequest);
|
|
1344
|
+
}
|
|
1345
|
+
async initializeGooglePay() {
|
|
1346
|
+
try {
|
|
1347
|
+
this.isLoading = true;
|
|
1348
|
+
this.error = null;
|
|
1349
|
+
if (!GooglePay$1.checkoutStore.paymentAmount) {
|
|
1350
|
+
this.error = "Missing required Google Pay configuration";
|
|
1351
|
+
this.isLoading = false;
|
|
1352
|
+
return;
|
|
1353
|
+
}
|
|
1354
|
+
const googlePayConfig = {
|
|
1355
|
+
environment: this.environment,
|
|
1356
|
+
merchantId: this.merchantId,
|
|
1357
|
+
merchantName: this.merchantName,
|
|
1358
|
+
buttonType: this.buttonType,
|
|
1359
|
+
buttonStyle: this.buttonStyle,
|
|
1360
|
+
buttonSizeMode: this.buttonSizeMode,
|
|
1361
|
+
};
|
|
1362
|
+
this.googlePayService.initialize(googlePayConfig);
|
|
1363
|
+
this.isAvailable = this.googlePayService.isAvailable();
|
|
1364
|
+
if (!this.isAvailable) {
|
|
1365
|
+
this.error = "Google Pay is not supported on this device";
|
|
1366
|
+
this.isLoading = false;
|
|
1367
|
+
return;
|
|
1368
|
+
}
|
|
1369
|
+
this.canMakePayments = await this.googlePayService.canMakePayments();
|
|
1370
|
+
if (!this.canMakePayments) {
|
|
1371
|
+
this.error = "Google Pay is not available for payments";
|
|
1372
|
+
this.isLoading = false;
|
|
1373
|
+
return;
|
|
1374
|
+
}
|
|
1375
|
+
const paymentDataRequest = this.createPaymentDataRequest();
|
|
1376
|
+
this.googlePayService.prefetchPaymentData(paymentDataRequest);
|
|
1377
|
+
}
|
|
1378
|
+
catch (error) {
|
|
1379
|
+
this.error =
|
|
1380
|
+
error instanceof Error
|
|
1381
|
+
? error.message
|
|
1382
|
+
: "Failed to initialize Google Pay";
|
|
1383
|
+
}
|
|
1384
|
+
finally {
|
|
1385
|
+
this.isLoading = false;
|
|
1386
|
+
}
|
|
1387
|
+
}
|
|
1388
|
+
createPaymentDataRequest() {
|
|
1389
|
+
return GooglePayService.createPaymentDataRequest(GooglePay$1.checkoutStore.paymentAmount, GooglePay$1.checkoutStore.paymentDescription, this.countryCode, GooglePay$1.checkoutStore.paymentCurrency, this.merchantName);
|
|
1390
|
+
}
|
|
1391
|
+
render() {
|
|
1392
|
+
const showError = !this.isLoading && !!this.error;
|
|
1393
|
+
const showDeviceUnavailable = !this.isLoading && !this.error && !this.isAvailable;
|
|
1394
|
+
const showPaymentsUnavailable = !this.isLoading && !this.error && this.isAvailable && !this.canMakePayments;
|
|
1395
|
+
const showButton = !this.isLoading && !this.error && this.isAvailable && this.canMakePayments;
|
|
1396
|
+
return (index.h(styledHost.StyledHost, { key: 'd85684b123cdba175d68a2e216f9150780ac7cf9' }, GooglePay$1.checkoutStore.checkoutLoaded && (index.h("script", { key: 'b78bb8980d670e5b66cb907f89cee6ff2238205c', async: true, src: 'https://pay.google.com/gp/p/js/pay.js', onLoad: () => {
|
|
1397
|
+
this.initializeGooglePay();
|
|
1398
|
+
} })), index.h("div", { key: 'e405efb3a164be9e1d9db5beeb3c01471b647aaf', class: 'google-pay-container' }, index.h(GooglePaySkeleton, { key: 'c17dbb3e305678a1da10e3741ff0b610c549be6e', isLoading: this.isLoading }), showError && (index.h("div", { key: '726895b7c76f3edbbbb1930a317d826b8f8f11fd', class: 'google-pay-error', role: 'alert', "data-testid": 'gp-error' }, index.h("span", { key: '23342ca70b6b5bf28f846ca519cc4fbfb065fc67', class: 'error-icon' }, "\u26A0\uFE0F"), index.h("span", { key: '008315696bc7b7f78f69cfc80160dacabf1205b5', class: 'error-message' }, this.error))), showDeviceUnavailable && (index.h("div", { key: '2e87b4a9e5d0c0201333b79b9c190ca14932391b', class: 'google-pay-unavailable', "data-testid": 'gp-device-unavailable' }, index.h("span", { key: '6db13fc44661500a964422d18550cb31e275f076', class: 'unavailable-message' }, "Google Pay is not available on this device"))), showPaymentsUnavailable && (index.h("div", { key: 'c2ca09e36652800092cc6bcbe4a351b0d604bae2', class: 'google-pay-unavailable', "data-testid": 'gp-payments-unavailable' }, index.h("span", { key: 'a5e75ccbb269249327192b927a0df879d90aefe5', class: 'unavailable-message' }, "Google Pay is not available for payments"))), showButton && (index.h(GooglePayButton, { key: 'a2af46b3970620491e5c005e2b57f7a6d6f06e2c', "data-testid": 'gp-button', buttonType: this.buttonType, buttonStyle: this.buttonStyle, buttonSizeMode: this.buttonSizeMode, disabled: this.disabled, isProcessing: this.isProcessing, isAvailable: this.isAvailable, clickHandler: this.handleGooglePayClick }))), index.h("style", { key: '9890ac44c4f047484396e0b4ae0d04a31489e61f' }, `
|
|
1399
|
+
.google-pay-container {
|
|
1400
|
+
width: 100%;
|
|
1401
|
+
}
|
|
1402
|
+
|
|
1403
|
+
.google-pay-error {
|
|
1404
|
+
display: flex;
|
|
1405
|
+
align-items: center;
|
|
1406
|
+
gap: 8px;
|
|
1407
|
+
padding: 12px;
|
|
1408
|
+
background: #fef2f2;
|
|
1409
|
+
border: 1px solid #fecaca;
|
|
1410
|
+
border-radius: 8px;
|
|
1411
|
+
color: #dc2626;
|
|
1412
|
+
font-size: 14px;
|
|
1413
|
+
}
|
|
1414
|
+
|
|
1415
|
+
.google-pay-unavailable {
|
|
1416
|
+
display: flex;
|
|
1417
|
+
align-items: center;
|
|
1418
|
+
justify-content: center;
|
|
1419
|
+
padding: 12px;
|
|
1420
|
+
background: #f9fafb;
|
|
1421
|
+
border: 1px solid #e5e7eb;
|
|
1422
|
+
border-radius: 8px;
|
|
1423
|
+
color: #6b7280;
|
|
1424
|
+
font-size: 14px;
|
|
1425
|
+
}
|
|
1426
|
+
|
|
1427
|
+
.error-icon {
|
|
1428
|
+
font-size: 16px;
|
|
1429
|
+
}
|
|
1430
|
+
|
|
1431
|
+
`)));
|
|
829
1432
|
}
|
|
1433
|
+
static get watchers() { return {
|
|
1434
|
+
"merchantId": ["watchConfigChange"],
|
|
1435
|
+
"environment": ["watchConfigChange"]
|
|
1436
|
+
}; }
|
|
830
1437
|
};
|
|
831
1438
|
|
|
832
1439
|
const Header = class {
|
|
@@ -841,7 +1448,7 @@ const Header = class {
|
|
|
841
1448
|
}
|
|
842
1449
|
render() {
|
|
843
1450
|
const HeaderComponent = this.levels[this.level];
|
|
844
|
-
return (index.h(styledHost.StyledHost, { key: '
|
|
1451
|
+
return (index.h(styledHost.StyledHost, { key: '73104ea086f8a9948e69f86451adf19e0f39fb32' }, index.h(HeaderComponent, { key: 'a8582109634299a24e2a9b3c7181c6bba511fde7', text: this.text, class: this.class })));
|
|
845
1452
|
}
|
|
846
1453
|
};
|
|
847
1454
|
|
|
@@ -927,11 +1534,30 @@ const ModularCheckout = class {
|
|
|
927
1534
|
this.submitEvent = index.createEvent(this, "submit-event");
|
|
928
1535
|
this.checkoutChangedEvent = index.createEvent(this, "checkout-changed");
|
|
929
1536
|
this.plaidService = new PlaidService();
|
|
1537
|
+
this.handleGooglePayCompleted = (event) => {
|
|
1538
|
+
const { success, paymentMethodId, error } = event.detail || {};
|
|
1539
|
+
if (success && paymentMethodId) {
|
|
1540
|
+
GooglePay$1.checkoutStore.paymentToken = paymentMethodId;
|
|
1541
|
+
GooglePay$1.checkoutStore.selectedPaymentMethod = { type: index$1.PAYMENT_METHODS.GOOGLE_PAY };
|
|
1542
|
+
this.submitCheckout();
|
|
1543
|
+
}
|
|
1544
|
+
else {
|
|
1545
|
+
this.errorEvent.emit({
|
|
1546
|
+
message: (error && error.message) || "Google Pay payment failed",
|
|
1547
|
+
errorCode: ComponentError.ComponentErrorCodes.TOKENIZE_ERROR,
|
|
1548
|
+
severity: ComponentError.ComponentErrorSeverity.ERROR,
|
|
1549
|
+
});
|
|
1550
|
+
}
|
|
1551
|
+
};
|
|
1552
|
+
this.handleGooglePayCancelled = () => {
|
|
1553
|
+
GooglePay$1.checkoutStore.paymentToken = undefined;
|
|
1554
|
+
GooglePay$1.checkoutStore.selectedPaymentMethod = undefined;
|
|
1555
|
+
};
|
|
930
1556
|
this.handleApplePayCompleted = (event) => {
|
|
931
1557
|
const { success, token, paymentMethodId, error } = event.detail;
|
|
932
1558
|
if (success && token) {
|
|
933
|
-
|
|
934
|
-
|
|
1559
|
+
GooglePay$1.checkoutStore.paymentToken = paymentMethodId;
|
|
1560
|
+
GooglePay$1.checkoutStore.selectedPaymentMethod = { type: index$1.PAYMENT_METHODS.APPLE_PAY };
|
|
935
1561
|
this.submitCheckout();
|
|
936
1562
|
}
|
|
937
1563
|
else {
|
|
@@ -954,20 +1580,21 @@ const ModularCheckout = class {
|
|
|
954
1580
|
});
|
|
955
1581
|
};
|
|
956
1582
|
this.handleApplePayCancelled = () => {
|
|
957
|
-
|
|
958
|
-
|
|
1583
|
+
GooglePay$1.checkoutStore.paymentToken = undefined;
|
|
1584
|
+
GooglePay$1.checkoutStore.selectedPaymentMethod = undefined;
|
|
959
1585
|
};
|
|
960
1586
|
}
|
|
961
1587
|
connectedCallback() {
|
|
962
1588
|
this.observer = new MutationObserver(() => {
|
|
963
1589
|
this.queryFormRefs();
|
|
964
1590
|
this.setupApplePayListeners(); // set up again listeners when DOM changes
|
|
1591
|
+
this.setupGooglePayListeners();
|
|
965
1592
|
});
|
|
966
1593
|
this.observer.observe(this.hostEl, {
|
|
967
1594
|
childList: true,
|
|
968
1595
|
subtree: true,
|
|
969
1596
|
});
|
|
970
|
-
|
|
1597
|
+
GooglePay$1.checkoutStore.checkoutId = this.checkoutId;
|
|
971
1598
|
const config = {
|
|
972
1599
|
authToken: this.authToken,
|
|
973
1600
|
checkoutId: this.checkoutId,
|
|
@@ -976,14 +1603,14 @@ const ModularCheckout = class {
|
|
|
976
1603
|
this.getCheckout = makeGetCheckout(config);
|
|
977
1604
|
this.completeCheckout = makeCheckoutComplete(config);
|
|
978
1605
|
// Emit checkout-changed whenever any store key changes
|
|
979
|
-
|
|
1606
|
+
GooglePay$1.onAnyChange(() => {
|
|
980
1607
|
this.emitCheckoutChanged();
|
|
981
1608
|
});
|
|
982
1609
|
}
|
|
983
1610
|
componentWillLoad() {
|
|
984
1611
|
this.analytics = new checkPkgVersion.JustifiAnalytics(this);
|
|
985
1612
|
checkPkgVersion.checkPkgVersion();
|
|
986
|
-
|
|
1613
|
+
GooglePay$1.checkoutStore.authToken = this.authToken;
|
|
987
1614
|
this.fetchCheckout();
|
|
988
1615
|
// Refresh the checkout data when insurance values actually change (not on initial load)
|
|
989
1616
|
insuranceState.insuranceValuesOn("set", (key) => {
|
|
@@ -996,11 +1623,13 @@ const ModularCheckout = class {
|
|
|
996
1623
|
componentDidLoad() {
|
|
997
1624
|
this.queryFormRefs();
|
|
998
1625
|
this.setupApplePayListeners();
|
|
1626
|
+
this.setupGooglePayListeners();
|
|
999
1627
|
}
|
|
1000
1628
|
disconnectedCallback() {
|
|
1001
1629
|
var _a;
|
|
1002
1630
|
(_a = this.observer) === null || _a === void 0 ? void 0 : _a.disconnect();
|
|
1003
1631
|
this.removeApplePayListeners();
|
|
1632
|
+
this.removeGooglePayListeners();
|
|
1004
1633
|
}
|
|
1005
1634
|
fetchCheckout() {
|
|
1006
1635
|
if (!this.authToken || !this.checkoutId) {
|
|
@@ -1015,7 +1644,7 @@ const ModularCheckout = class {
|
|
|
1015
1644
|
this.getCheckout({
|
|
1016
1645
|
onSuccess: ({ checkout }) => {
|
|
1017
1646
|
this.updateStore(checkout);
|
|
1018
|
-
if (checkout.status ===
|
|
1647
|
+
if (checkout.status === GooglePay$1.ICheckoutStatus.completed) {
|
|
1019
1648
|
this.errorEvent.emit({
|
|
1020
1649
|
message: ComponentError.ComponentErrorMessages.CHECKOUT_ALREADY_COMPLETED,
|
|
1021
1650
|
errorCode: ComponentError.ComponentErrorCodes.CHECKOUT_ALREADY_COMPLETED,
|
|
@@ -1023,7 +1652,7 @@ const ModularCheckout = class {
|
|
|
1023
1652
|
});
|
|
1024
1653
|
return;
|
|
1025
1654
|
}
|
|
1026
|
-
else if (checkout.status ===
|
|
1655
|
+
else if (checkout.status === GooglePay$1.ICheckoutStatus.expired) {
|
|
1027
1656
|
this.errorEvent.emit({
|
|
1028
1657
|
message: ComponentError.ComponentErrorMessages.CHECKOUT_EXPIRED,
|
|
1029
1658
|
errorCode: ComponentError.ComponentErrorCodes.CHECKOUT_EXPIRED,
|
|
@@ -1043,35 +1672,37 @@ const ModularCheckout = class {
|
|
|
1043
1672
|
}
|
|
1044
1673
|
}
|
|
1045
1674
|
updateStore(checkout) {
|
|
1046
|
-
var _a, _b, _c, _d, _e, _f;
|
|
1047
|
-
|
|
1048
|
-
|
|
1049
|
-
|
|
1050
|
-
|
|
1051
|
-
|
|
1052
|
-
|
|
1053
|
-
|
|
1054
|
-
|
|
1055
|
-
|
|
1056
|
-
|
|
1057
|
-
|
|
1058
|
-
|
|
1059
|
-
|
|
1060
|
-
|
|
1061
|
-
|
|
1062
|
-
|
|
1675
|
+
var _a, _b, _c, _d, _e, _f, _g;
|
|
1676
|
+
GooglePay$1.checkoutStore.accountId = checkout.account_id;
|
|
1677
|
+
GooglePay$1.checkoutStore.checkoutLoaded = true;
|
|
1678
|
+
GooglePay$1.checkoutStore.paymentMethods = checkout.payment_methods.map((paymentMethod) => new index$1.PaymentMethod(paymentMethod));
|
|
1679
|
+
GooglePay$1.checkoutStore.paymentMethodGroupId = checkout.payment_method_group_id;
|
|
1680
|
+
GooglePay$1.checkoutStore.paymentDescription = checkout.payment_description;
|
|
1681
|
+
GooglePay$1.checkoutStore.totalAmount = checkout.total_amount;
|
|
1682
|
+
GooglePay$1.checkoutStore.paymentAmount = checkout.payment_amount;
|
|
1683
|
+
GooglePay$1.checkoutStore.bnplEnabled = checkout.payment_settings.bnpl_payments;
|
|
1684
|
+
GooglePay$1.checkoutStore.insuranceEnabled = checkout.payment_settings.insurance_payments;
|
|
1685
|
+
GooglePay$1.checkoutStore.bankAccountVerification = (_a = checkout.payment_settings) === null || _a === void 0 ? void 0 : _a.bank_account_verification;
|
|
1686
|
+
GooglePay$1.checkoutStore.applePayEnabled = (_b = checkout.payment_settings) === null || _b === void 0 ? void 0 : _b.apple_payments;
|
|
1687
|
+
GooglePay$1.checkoutStore.googlePayEnabled = (_c = checkout.payment_settings) === null || _c === void 0 ? void 0 : _c.google_payments;
|
|
1688
|
+
GooglePay$1.checkoutStore.bnplProviderClientId = (_d = checkout === null || checkout === void 0 ? void 0 : checkout.bnpl) === null || _d === void 0 ? void 0 : _d.provider_client_id;
|
|
1689
|
+
GooglePay$1.checkoutStore.bnplProviderMode = (_e = checkout === null || checkout === void 0 ? void 0 : checkout.bnpl) === null || _e === void 0 ? void 0 : _e.provider_mode;
|
|
1690
|
+
GooglePay$1.checkoutStore.bnplProviderApiVersion = (_f = checkout === null || checkout === void 0 ? void 0 : checkout.bnpl) === null || _f === void 0 ? void 0 : _f.provider_api_version;
|
|
1691
|
+
GooglePay$1.checkoutStore.bnplProviderCheckoutUrl =
|
|
1692
|
+
(_g = checkout === null || checkout === void 0 ? void 0 : checkout.bnpl) === null || _g === void 0 ? void 0 : _g.provider_checkout_url;
|
|
1063
1693
|
}
|
|
1064
1694
|
emitCheckoutChanged() {
|
|
1065
1695
|
const detail = {
|
|
1066
|
-
availablePaymentMethodTypes:
|
|
1067
|
-
selectedPaymentMethod:
|
|
1068
|
-
savedPaymentMethods:
|
|
1696
|
+
availablePaymentMethodTypes: GooglePay$1.getAvailablePaymentMethodTypes(),
|
|
1697
|
+
selectedPaymentMethod: GooglePay$1.checkoutStore.selectedPaymentMethod,
|
|
1698
|
+
savedPaymentMethods: GooglePay$1.checkoutStore.paymentMethods,
|
|
1069
1699
|
};
|
|
1070
1700
|
this.checkoutChangedEvent.emit(detail);
|
|
1071
1701
|
}
|
|
1072
1702
|
queryFormRefs() {
|
|
1073
1703
|
this.billingFormRef = this.hostEl.querySelector("justifi-billing-form, justifi-bank-account-billing-form-simple, justifi-card-billing-form-simple, justifi-billing-form-full");
|
|
1074
1704
|
this.applePayRef = this.hostEl.querySelector("justifi-apple-pay");
|
|
1705
|
+
this.googlePayRef = this.hostEl.querySelector("justifi-google-pay");
|
|
1075
1706
|
this.paymentMethodFormRef =
|
|
1076
1707
|
this.hostEl.querySelector('justifi-card-form, justifi-bank-account-form, justifi-tokenize-payment-method');
|
|
1077
1708
|
this.insuranceFormRef = this.hostEl.querySelector('justifi-season-interruption-insurance');
|
|
@@ -1090,40 +1721,52 @@ const ModularCheckout = class {
|
|
|
1090
1721
|
this.applePayRef.removeEventListener("applePayCancelled", this.handleApplePayCancelled);
|
|
1091
1722
|
}
|
|
1092
1723
|
}
|
|
1724
|
+
setupGooglePayListeners() {
|
|
1725
|
+
if (this.googlePayRef) {
|
|
1726
|
+
this.googlePayRef.addEventListener("googlePayCompleted", this.handleGooglePayCompleted);
|
|
1727
|
+
this.googlePayRef.addEventListener("googlePayCancelled", this.handleGooglePayCancelled);
|
|
1728
|
+
}
|
|
1729
|
+
}
|
|
1730
|
+
removeGooglePayListeners() {
|
|
1731
|
+
if (this.googlePayRef) {
|
|
1732
|
+
this.googlePayRef.removeEventListener("googlePayCompleted", this.handleGooglePayCompleted);
|
|
1733
|
+
this.googlePayRef.removeEventListener("googlePayCancelled", this.handleGooglePayCancelled);
|
|
1734
|
+
}
|
|
1735
|
+
}
|
|
1093
1736
|
async tokenizePaymentMethod(tokenizeArgs) {
|
|
1094
1737
|
var _a, _b, _c;
|
|
1095
1738
|
const billingInfoValues = (_b = (await ((_a = this.billingFormRef) === null || _a === void 0 ? void 0 : _a.getValues()))) !== null && _b !== void 0 ? _b : {};
|
|
1096
1739
|
const combinedBillingInfo = Object.assign(Object.assign({}, tokenizeArgs), billingInfoValues);
|
|
1097
|
-
const paymentMethodMetadata = Object.assign({ accountId:
|
|
1098
|
-
if (
|
|
1740
|
+
const paymentMethodMetadata = Object.assign({ accountId: GooglePay$1.checkoutStore.accountId, payment_method_group_id: undefined }, combinedBillingInfo);
|
|
1741
|
+
if (GooglePay$1.checkoutStore.savePaymentMethod) {
|
|
1099
1742
|
paymentMethodMetadata.payment_method_group_id =
|
|
1100
|
-
|
|
1743
|
+
GooglePay$1.checkoutStore.paymentMethodGroupId;
|
|
1101
1744
|
}
|
|
1102
1745
|
const tokenizeResult = await ((_c = this.paymentMethodFormRef) === null || _c === void 0 ? void 0 : _c.tokenize({
|
|
1103
1746
|
clientId: this.authToken,
|
|
1104
1747
|
paymentMethodMetadata,
|
|
1105
|
-
account:
|
|
1748
|
+
account: GooglePay$1.checkoutStore.accountId,
|
|
1106
1749
|
}));
|
|
1107
1750
|
if (tokenizeResult.error) {
|
|
1108
1751
|
return tokenizeResult;
|
|
1109
1752
|
}
|
|
1110
|
-
|
|
1753
|
+
GooglePay$1.checkoutStore.paymentToken = tokenizeResult.id;
|
|
1111
1754
|
return tokenizeResult.id;
|
|
1112
1755
|
}
|
|
1113
1756
|
// set the selected payment method to the checkout store from outside the component
|
|
1114
1757
|
async setSelectedPaymentMethod(paymentMethod) {
|
|
1115
|
-
|
|
1116
|
-
|
|
1758
|
+
GooglePay$1.checkoutStore.selectedPaymentMethod = paymentMethod;
|
|
1759
|
+
GooglePay$1.checkoutStore.paymentToken = paymentMethod.id || undefined;
|
|
1117
1760
|
}
|
|
1118
1761
|
// if validation fails, the error will be emitted by the component
|
|
1119
1762
|
async validate() {
|
|
1120
1763
|
var _a, _b;
|
|
1121
1764
|
const promises = [];
|
|
1122
|
-
if (
|
|
1765
|
+
if (GooglePay$1.checkoutStore.insuranceEnabled && this.insuranceFormRef) {
|
|
1123
1766
|
promises.push(this.insuranceFormRef.validate());
|
|
1124
1767
|
}
|
|
1125
|
-
const isNewCard = ((_a =
|
|
1126
|
-
const isNewBankAccount = ((_b =
|
|
1768
|
+
const isNewCard = ((_a = GooglePay$1.checkoutStore.selectedPaymentMethod) === null || _a === void 0 ? void 0 : _a.type) === index$1.PAYMENT_METHODS.NEW_CARD;
|
|
1769
|
+
const isNewBankAccount = ((_b = GooglePay$1.checkoutStore.selectedPaymentMethod) === null || _b === void 0 ? void 0 : _b.type) === index$1.PAYMENT_METHODS.NEW_BANK_ACCOUNT;
|
|
1127
1770
|
// For new card/bank account, validate payment method + billing.
|
|
1128
1771
|
if (isNewCard || isNewBankAccount) {
|
|
1129
1772
|
if (this.paymentMethodFormRef)
|
|
@@ -1157,7 +1800,7 @@ const ModularCheckout = class {
|
|
|
1157
1800
|
async submitCheckout(submitCheckoutArgs) {
|
|
1158
1801
|
var _a, _b, _c, _d, _e;
|
|
1159
1802
|
const isValid = await this.validate();
|
|
1160
|
-
if (!
|
|
1803
|
+
if (!GooglePay$1.checkoutStore.selectedPaymentMethod) {
|
|
1161
1804
|
this.errorEvent.emit({
|
|
1162
1805
|
message: 'No payment method selected.',
|
|
1163
1806
|
errorCode: ComponentError.ComponentErrorCodes.VALIDATION_ERROR,
|
|
@@ -1165,9 +1808,9 @@ const ModularCheckout = class {
|
|
|
1165
1808
|
});
|
|
1166
1809
|
return;
|
|
1167
1810
|
}
|
|
1168
|
-
const isNewCard = ((_a =
|
|
1169
|
-
const isNewBankAccount = ((_b =
|
|
1170
|
-
const isPlaid = ((_c =
|
|
1811
|
+
const isNewCard = ((_a = GooglePay$1.checkoutStore.selectedPaymentMethod) === null || _a === void 0 ? void 0 : _a.type) === index$1.PAYMENT_METHODS.NEW_CARD;
|
|
1812
|
+
const isNewBankAccount = ((_b = GooglePay$1.checkoutStore.selectedPaymentMethod) === null || _b === void 0 ? void 0 : _b.type) === index$1.PAYMENT_METHODS.NEW_BANK_ACCOUNT;
|
|
1813
|
+
const isPlaid = ((_c = GooglePay$1.checkoutStore.selectedPaymentMethod) === null || _c === void 0 ? void 0 : _c.type) === index$1.PAYMENT_METHODS.PLAID;
|
|
1171
1814
|
const shouldTokenize = isNewCard || isNewBankAccount;
|
|
1172
1815
|
if (shouldTokenize) {
|
|
1173
1816
|
const tokenizeResult = await this.tokenizePaymentMethod(submitCheckoutArgs);
|
|
@@ -1181,9 +1824,9 @@ const ModularCheckout = class {
|
|
|
1181
1824
|
}
|
|
1182
1825
|
}
|
|
1183
1826
|
// For Plaid, perform exchange at submit time using stored public token and link token id
|
|
1184
|
-
if (isPlaid && !
|
|
1185
|
-
const publicToken =
|
|
1186
|
-
const linkTokenId =
|
|
1827
|
+
if (isPlaid && !GooglePay$1.checkoutStore.paymentToken) {
|
|
1828
|
+
const publicToken = GooglePay$1.checkoutStore.plaidPublicToken;
|
|
1829
|
+
const linkTokenId = GooglePay$1.checkoutStore.plaidLinkTokenId;
|
|
1187
1830
|
if (!publicToken) {
|
|
1188
1831
|
this.errorEvent.emit({
|
|
1189
1832
|
message: 'Missing Plaid public token. Please connect your bank.',
|
|
@@ -1193,7 +1836,7 @@ const ModularCheckout = class {
|
|
|
1193
1836
|
return;
|
|
1194
1837
|
}
|
|
1195
1838
|
try {
|
|
1196
|
-
const response = await this.plaidService.tokenizeBankAccount(
|
|
1839
|
+
const response = await this.plaidService.tokenizeBankAccount(GooglePay$1.checkoutStore.authToken, GooglePay$1.checkoutStore.accountId, publicToken, linkTokenId || undefined, GooglePay$1.checkoutStore.savePaymentMethod ? GooglePay$1.checkoutStore.paymentMethodGroupId : undefined);
|
|
1197
1840
|
if (response === null || response === void 0 ? void 0 : response.error) {
|
|
1198
1841
|
this.errorEvent.emit({
|
|
1199
1842
|
message: typeof response.error === 'string' ? response.error : response.error.message || 'Failed to tokenize bank account',
|
|
@@ -1204,7 +1847,7 @@ const ModularCheckout = class {
|
|
|
1204
1847
|
}
|
|
1205
1848
|
const paymentMethod = response === null || response === void 0 ? void 0 : response.data;
|
|
1206
1849
|
const token = ((_d = paymentMethod === null || paymentMethod === void 0 ? void 0 : paymentMethod.bank_account) === null || _d === void 0 ? void 0 : _d.token) || (paymentMethod === null || paymentMethod === void 0 ? void 0 : paymentMethod.token) || (paymentMethod === null || paymentMethod === void 0 ? void 0 : paymentMethod.id);
|
|
1207
|
-
|
|
1850
|
+
GooglePay$1.checkoutStore.paymentToken = token;
|
|
1208
1851
|
}
|
|
1209
1852
|
catch (err) {
|
|
1210
1853
|
this.errorEvent.emit({
|
|
@@ -1223,7 +1866,7 @@ const ModularCheckout = class {
|
|
|
1223
1866
|
});
|
|
1224
1867
|
return;
|
|
1225
1868
|
}
|
|
1226
|
-
if (!
|
|
1869
|
+
if (!GooglePay$1.checkoutStore.paymentToken) {
|
|
1227
1870
|
this.errorEvent.emit({
|
|
1228
1871
|
message: 'Payment token not found.',
|
|
1229
1872
|
errorCode: ComponentError.ComponentErrorCodes.TOKENIZE_ERROR,
|
|
@@ -1244,16 +1887,18 @@ const ModularCheckout = class {
|
|
|
1244
1887
|
return index$1.PAYMENT_MODE.BNPL;
|
|
1245
1888
|
case index$1.PAYMENT_METHODS.APPLE_PAY:
|
|
1246
1889
|
return index$1.PAYMENT_MODE.APPLE_PAY;
|
|
1890
|
+
case index$1.PAYMENT_METHODS.GOOGLE_PAY:
|
|
1891
|
+
return index$1.PAYMENT_MODE.GOOGLE_PAY;
|
|
1247
1892
|
default:
|
|
1248
1893
|
return undefined;
|
|
1249
1894
|
}
|
|
1250
1895
|
};
|
|
1251
1896
|
payment = {
|
|
1252
|
-
payment_mode: mapTypeToPaymentMode((_e =
|
|
1253
|
-
payment_token:
|
|
1897
|
+
payment_mode: mapTypeToPaymentMode((_e = GooglePay$1.checkoutStore.selectedPaymentMethod) === null || _e === void 0 ? void 0 : _e.type),
|
|
1898
|
+
payment_token: GooglePay$1.checkoutStore.paymentToken,
|
|
1254
1899
|
};
|
|
1255
1900
|
if (this.preCompleteHook) {
|
|
1256
|
-
const state =
|
|
1901
|
+
const state = GooglePay$1.getCheckoutState();
|
|
1257
1902
|
try {
|
|
1258
1903
|
await new Promise((resolve, reject) => {
|
|
1259
1904
|
this.preCompleteHook(state, () => resolve(), () => reject());
|
|
@@ -1281,7 +1926,7 @@ const ModularCheckout = class {
|
|
|
1281
1926
|
});
|
|
1282
1927
|
}
|
|
1283
1928
|
render() {
|
|
1284
|
-
return index.h(index.Host, { key: '
|
|
1929
|
+
return index.h(index.Host, { key: '43f4be87e218b23251f2ccac90e0c980bf157d68' });
|
|
1285
1930
|
}
|
|
1286
1931
|
get hostEl() { return index.getElement(this); }
|
|
1287
1932
|
};
|
|
@@ -1360,7 +2005,7 @@ const PlaidPaymentMethod = class {
|
|
|
1360
2005
|
this.hasLoggedDisabledWarning = false;
|
|
1361
2006
|
this.waitForStoreAndInitialize = () => {
|
|
1362
2007
|
// Check if store has necessary data
|
|
1363
|
-
if (
|
|
2008
|
+
if (GooglePay$1.checkoutStore.authToken && GooglePay$1.checkoutStore.accountId && GooglePay$1.checkoutStore.checkoutId) {
|
|
1364
2009
|
this.initializePlaidLink();
|
|
1365
2010
|
}
|
|
1366
2011
|
else {
|
|
@@ -1419,7 +2064,7 @@ const PlaidPaymentMethod = class {
|
|
|
1419
2064
|
this.getLinkToken = async () => {
|
|
1420
2065
|
var _a, _b, _c, _d, _e;
|
|
1421
2066
|
try {
|
|
1422
|
-
if (!
|
|
2067
|
+
if (!GooglePay$1.checkoutStore.authToken || !GooglePay$1.checkoutStore.accountId) {
|
|
1423
2068
|
this.handleError({
|
|
1424
2069
|
code: PlaidErrorCodes.PLAID_LINK_TOKEN_FAILED,
|
|
1425
2070
|
message: 'Missing authentication. Please refresh the page and try again.',
|
|
@@ -1436,7 +2081,7 @@ const PlaidPaymentMethod = class {
|
|
|
1436
2081
|
var _a;
|
|
1437
2082
|
(_a = this.abortController) === null || _a === void 0 ? void 0 : _a.abort();
|
|
1438
2083
|
}, 30000); // 30 second timeout
|
|
1439
|
-
const response = await this.plaidService.getLinkToken(
|
|
2084
|
+
const response = await this.plaidService.getLinkToken(GooglePay$1.checkoutStore.authToken, GooglePay$1.checkoutStore.accountId, GooglePay$1.checkoutStore.checkoutId, this.abortController.signal);
|
|
1440
2085
|
// Clear timeout
|
|
1441
2086
|
if (this.timeoutId) {
|
|
1442
2087
|
clearTimeout(this.timeoutId);
|
|
@@ -1453,7 +2098,7 @@ const PlaidPaymentMethod = class {
|
|
|
1453
2098
|
// Try to capture link token id if present in envelope
|
|
1454
2099
|
this.linkTokenId = (response === null || response === void 0 ? void 0 : response.id) || ((_a = response === null || response === void 0 ? void 0 : response.data) === null || _a === void 0 ? void 0 : _a.id) || null;
|
|
1455
2100
|
if (this.linkTokenId) {
|
|
1456
|
-
|
|
2101
|
+
GooglePay$1.checkoutStore.plaidLinkTokenId = this.linkTokenId;
|
|
1457
2102
|
}
|
|
1458
2103
|
}
|
|
1459
2104
|
catch (error) {
|
|
@@ -1526,7 +2171,7 @@ const PlaidPaymentMethod = class {
|
|
|
1526
2171
|
// Ensure the component remains selected after successful authentication
|
|
1527
2172
|
if (!this.isSelected) {
|
|
1528
2173
|
this.isSelected = true;
|
|
1529
|
-
|
|
2174
|
+
GooglePay$1.checkoutStore.selectedPaymentMethod = { type: index$1.PAYMENT_METHODS.PLAID };
|
|
1530
2175
|
}
|
|
1531
2176
|
// Emit success event for parent components
|
|
1532
2177
|
this.plaidErrorRecovered.emit({
|
|
@@ -1535,7 +2180,7 @@ const PlaidPaymentMethod = class {
|
|
|
1535
2180
|
severity: ComponentError.ComponentErrorSeverity.INFO
|
|
1536
2181
|
});
|
|
1537
2182
|
// Store public token in checkout store; exchange will be handled on submit
|
|
1538
|
-
|
|
2183
|
+
GooglePay$1.checkoutStore.plaidPublicToken = publicToken;
|
|
1539
2184
|
};
|
|
1540
2185
|
// Exchange logic moved to Modular Checkout submit flow.
|
|
1541
2186
|
this.handlePlaidExit = (err, _metadata) => {
|
|
@@ -1677,7 +2322,7 @@ const PlaidPaymentMethod = class {
|
|
|
1677
2322
|
// Watch for store changes to sync component state
|
|
1678
2323
|
this.syncWithStore = () => {
|
|
1679
2324
|
var _a;
|
|
1680
|
-
const shouldBeSelected = ((_a =
|
|
2325
|
+
const shouldBeSelected = ((_a = GooglePay$1.checkoutStore.selectedPaymentMethod) === null || _a === void 0 ? void 0 : _a.type) === index$1.PAYMENT_METHODS.PLAID;
|
|
1681
2326
|
if (this.isSelected !== shouldBeSelected) {
|
|
1682
2327
|
this.isSelected = shouldBeSelected;
|
|
1683
2328
|
}
|
|
@@ -1686,8 +2331,8 @@ const PlaidPaymentMethod = class {
|
|
|
1686
2331
|
onSelectionChange(newValue) {
|
|
1687
2332
|
var _a;
|
|
1688
2333
|
// Ensure store is updated when component selection changes
|
|
1689
|
-
if (newValue && ((_a =
|
|
1690
|
-
|
|
2334
|
+
if (newValue && ((_a = GooglePay$1.checkoutStore.selectedPaymentMethod) === null || _a === void 0 ? void 0 : _a.type) !== index$1.PAYMENT_METHODS.PLAID) {
|
|
2335
|
+
GooglePay$1.checkoutStore.selectedPaymentMethod = { type: index$1.PAYMENT_METHODS.PLAID };
|
|
1691
2336
|
}
|
|
1692
2337
|
// Auto-start Plaid flow when selected and ready
|
|
1693
2338
|
if (newValue &&
|
|
@@ -1719,7 +2364,7 @@ const PlaidPaymentMethod = class {
|
|
|
1719
2364
|
componentWillLoad() {
|
|
1720
2365
|
var _a;
|
|
1721
2366
|
// Initialize selection state based on store
|
|
1722
|
-
this.isSelected = ((_a =
|
|
2367
|
+
this.isSelected = ((_a = GooglePay$1.checkoutStore.selectedPaymentMethod) === null || _a === void 0 ? void 0 : _a.type) === index$1.PAYMENT_METHODS.PLAID;
|
|
1723
2368
|
}
|
|
1724
2369
|
async resolvePaymentMethod() {
|
|
1725
2370
|
if (!this.publicToken) {
|
|
@@ -1736,13 +2381,13 @@ const PlaidPaymentMethod = class {
|
|
|
1736
2381
|
// Returns a usable payment method token for checkout completion.
|
|
1737
2382
|
// Will perform the backend exchange if the token is not yet present in the store.
|
|
1738
2383
|
async getPaymentToken() {
|
|
1739
|
-
return
|
|
2384
|
+
return GooglePay$1.checkoutStore.paymentToken;
|
|
1740
2385
|
}
|
|
1741
2386
|
async handleSelectionClick() {
|
|
1742
2387
|
// Update local selection state
|
|
1743
2388
|
this.isSelected = true;
|
|
1744
2389
|
// Update store selection
|
|
1745
|
-
|
|
2390
|
+
GooglePay$1.checkoutStore.selectedPaymentMethod = { type: index$1.PAYMENT_METHODS.PLAID };
|
|
1746
2391
|
// If there's an error, clear it and try to initialize again
|
|
1747
2392
|
if (this.error) {
|
|
1748
2393
|
this.clearError();
|
|
@@ -1758,7 +2403,7 @@ const PlaidPaymentMethod = class {
|
|
|
1758
2403
|
async setSelected(selected) {
|
|
1759
2404
|
this.isSelected = selected;
|
|
1760
2405
|
if (selected) {
|
|
1761
|
-
|
|
2406
|
+
GooglePay$1.checkoutStore.selectedPaymentMethod = { type: index$1.PAYMENT_METHODS.PLAID };
|
|
1762
2407
|
}
|
|
1763
2408
|
}
|
|
1764
2409
|
// Method to check if component is currently selected
|
|
@@ -1807,7 +2452,7 @@ const PlaidPaymentMethod = class {
|
|
|
1807
2452
|
}
|
|
1808
2453
|
componentDidLoad() {
|
|
1809
2454
|
// Set up store change listener to keep component in sync
|
|
1810
|
-
const unsubscribe =
|
|
2455
|
+
const unsubscribe = GooglePay$1.onChange('selectedPaymentMethod', this.syncWithStore);
|
|
1811
2456
|
// Store unsubscribe function for cleanup
|
|
1812
2457
|
this.unsubscribeFromStore = unsubscribe;
|
|
1813
2458
|
}
|
|
@@ -1826,7 +2471,7 @@ const PlaidPaymentMethod = class {
|
|
|
1826
2471
|
}
|
|
1827
2472
|
render() {
|
|
1828
2473
|
// Only allow use if enabled in checkout settings
|
|
1829
|
-
if (
|
|
2474
|
+
if (GooglePay$1.checkoutStore.bankAccountVerification !== true) {
|
|
1830
2475
|
if (!this.hasLoggedDisabledWarning) {
|
|
1831
2476
|
// Log once per component lifecycle
|
|
1832
2477
|
console.warn('[PlaidPaymentMethod] bank_account_verification is disabled. Component will not render.');
|
|
@@ -1877,36 +2522,36 @@ const SavedPaymentMethods = class {
|
|
|
1877
2522
|
index.registerInstance(this, hostRef);
|
|
1878
2523
|
this.onPaymentMethodOptionClick = (paymentMethod) => (e) => {
|
|
1879
2524
|
e.preventDefault();
|
|
1880
|
-
|
|
1881
|
-
|
|
2525
|
+
GooglePay$1.checkoutStore.selectedPaymentMethod = { id: paymentMethod.id, type: paymentMethod.type };
|
|
2526
|
+
GooglePay$1.checkoutStore.paymentToken = paymentMethod.id;
|
|
1882
2527
|
};
|
|
1883
2528
|
this.isAllowedPaymentMethod = (paymentMethodType) => {
|
|
1884
2529
|
const isCard = paymentMethodType === index$1.PAYMENT_METHODS.SAVED_CARD;
|
|
1885
2530
|
const isBankAccount = paymentMethodType === index$1.PAYMENT_METHODS.SAVED_BANK_ACCOUNT;
|
|
1886
|
-
if (isCard &&
|
|
2531
|
+
if (isCard && GooglePay$1.checkoutStore.disableCreditCard) {
|
|
1887
2532
|
return false;
|
|
1888
2533
|
}
|
|
1889
|
-
if (isBankAccount &&
|
|
2534
|
+
if (isBankAccount && GooglePay$1.checkoutStore.disableBankAccount) {
|
|
1890
2535
|
return false;
|
|
1891
2536
|
}
|
|
1892
2537
|
return true;
|
|
1893
2538
|
};
|
|
1894
2539
|
}
|
|
1895
2540
|
componentWillLoad() {
|
|
1896
|
-
if (!
|
|
2541
|
+
if (!GooglePay$1.checkoutStore.paymentMethods.length) {
|
|
1897
2542
|
console.warn('No saved payment methods available.');
|
|
1898
2543
|
}
|
|
1899
|
-
if (
|
|
2544
|
+
if (GooglePay$1.checkoutStore.disablePaymentMethodGroup) {
|
|
1900
2545
|
console.warn('Payment method group is disabled.');
|
|
1901
2546
|
}
|
|
1902
2547
|
}
|
|
1903
2548
|
render() {
|
|
1904
|
-
if (
|
|
2549
|
+
if (GooglePay$1.checkoutStore.disablePaymentMethodGroup) {
|
|
1905
2550
|
return null;
|
|
1906
2551
|
}
|
|
1907
|
-
return (index.h(styledHost.StyledHost, null, index.h("div", { class: "saved-payment-methods" },
|
|
2552
|
+
return (index.h(styledHost.StyledHost, null, index.h("div", { class: "saved-payment-methods" }, GooglePay$1.checkoutStore.paymentMethods.length ? GooglePay$1.checkoutStore.paymentMethods
|
|
1908
2553
|
.filter((paymentMethod) => this.isAllowedPaymentMethod(paymentMethod.type))
|
|
1909
|
-
.map((paymentMethod) => (index.h("div", { class: "radio-list-item p-3", part: parts.radioListItem, onClick: this.onPaymentMethodOptionClick(paymentMethod) }, index.h("form-control-radio", { name: "paymentMethodType", value: paymentMethod === null || paymentMethod === void 0 ? void 0 : paymentMethod.id, checked:
|
|
2554
|
+
.map((paymentMethod) => (index.h("div", { class: "radio-list-item p-3", part: parts.radioListItem, onClick: this.onPaymentMethodOptionClick(paymentMethod) }, index.h("form-control-radio", { name: "paymentMethodType", value: paymentMethod === null || paymentMethod === void 0 ? void 0 : paymentMethod.id, checked: GooglePay$1.checkoutStore.paymentToken === (paymentMethod === null || paymentMethod === void 0 ? void 0 : paymentMethod.id), label: `${paymentMethodOptionUtils.CardBrandLabels[paymentMethod === null || paymentMethod === void 0 ? void 0 : paymentMethod.brand] || ''} *${paymentMethod === null || paymentMethod === void 0 ? void 0 : paymentMethod.acct_last_four}` })))) : null)));
|
|
1910
2555
|
}
|
|
1911
2556
|
};
|
|
1912
2557
|
|
|
@@ -1924,20 +2569,20 @@ const SezzlePaymentMethod = class {
|
|
|
1924
2569
|
this.initializeSezzleCheckout = () => {
|
|
1925
2570
|
let resolveSezzlePromise;
|
|
1926
2571
|
this.sezzlePromise = new Promise((resolve) => { resolveSezzlePromise = resolve; });
|
|
1927
|
-
const amount = Number(
|
|
2572
|
+
const amount = Number(GooglePay$1.checkoutStore.paymentAmount);
|
|
1928
2573
|
const Checkout = window.Checkout;
|
|
1929
2574
|
const checkout = new Checkout({
|
|
1930
2575
|
mode: 'popup',
|
|
1931
|
-
publicKey:
|
|
1932
|
-
apiMode:
|
|
1933
|
-
apiVersion:
|
|
2576
|
+
publicKey: GooglePay$1.checkoutStore.bnplProviderClientId,
|
|
2577
|
+
apiMode: GooglePay$1.checkoutStore.bnplProviderMode,
|
|
2578
|
+
apiVersion: GooglePay$1.checkoutStore.bnplProviderApiVersion,
|
|
1934
2579
|
});
|
|
1935
2580
|
checkout.sezzleButtonElement = this.sezzleButtonRef;
|
|
1936
2581
|
checkout.init({
|
|
1937
2582
|
onClick: function (event) {
|
|
1938
2583
|
event.preventDefault();
|
|
1939
2584
|
checkout.startCheckout({
|
|
1940
|
-
checkout_url:
|
|
2585
|
+
checkout_url: GooglePay$1.checkoutStore.bnplProviderCheckoutUrl,
|
|
1941
2586
|
});
|
|
1942
2587
|
},
|
|
1943
2588
|
onComplete: (event) => resolveSezzlePromise({ bnpl: event.data }),
|
|
@@ -1964,12 +2609,12 @@ const SezzlePaymentMethod = class {
|
|
|
1964
2609
|
return this.sezzlePromise;
|
|
1965
2610
|
}
|
|
1966
2611
|
async handleSelectionClick() {
|
|
1967
|
-
|
|
2612
|
+
GooglePay$1.checkoutStore.selectedPaymentMethod = { type: index$1.PAYMENT_METHODS.SEZZLE };
|
|
1968
2613
|
this.paymentMethodOptionSelected.emit(this.paymentMethodOptionId);
|
|
1969
2614
|
}
|
|
1970
2615
|
render() {
|
|
1971
2616
|
var _a, _b;
|
|
1972
|
-
if (!
|
|
2617
|
+
if (!GooglePay$1.checkoutStore.bnplEnabled) {
|
|
1973
2618
|
console.warn('justifi-sezzle-payment-method: BNPL is not enabled for this account.');
|
|
1974
2619
|
return null;
|
|
1975
2620
|
}
|
|
@@ -1979,6 +2624,7 @@ const SezzlePaymentMethod = class {
|
|
|
1979
2624
|
|
|
1980
2625
|
exports.justifi_apple_pay = ApplePay;
|
|
1981
2626
|
exports.justifi_checkout_summary = Summary;
|
|
2627
|
+
exports.justifi_google_pay = GooglePay;
|
|
1982
2628
|
exports.justifi_header = Header;
|
|
1983
2629
|
exports.justifi_modular_checkout = ModularCheckout;
|
|
1984
2630
|
exports.justifi_plaid_payment_method = PlaidPaymentMethod;
|