@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
|
@@ -0,0 +1,781 @@
|
|
|
1
|
+
import { h, proxyCustomElement, HTMLElement, createEvent } from '@stencil/core/internal/client';
|
|
2
|
+
import { A as Api } from './Api.js';
|
|
3
|
+
import { G as GooglePayConfig, a as GooglePayHelpers, b as GooglePayPaymentDataRequest, c as GooglePayButtonSizeMode, d as GooglePayButtonStyle, e as GooglePayButtonType, f as GooglePayEnvironment } from './GooglePay.js';
|
|
4
|
+
import { S as StyledHost } from './styled-host.js';
|
|
5
|
+
import './details.js';
|
|
6
|
+
import './event-types.js';
|
|
7
|
+
import './justifi-radio-list-item2.js';
|
|
8
|
+
import { S as Skeleton } from './skeleton.js';
|
|
9
|
+
import { c as checkoutStore, b as onChange } from './checkout.store.js';
|
|
10
|
+
import { P as PAYMENT_METHODS } from './ModularCheckout.js';
|
|
11
|
+
|
|
12
|
+
const PROCESS_TOKEN_ENDPOINT = 'google_pay/process_token';
|
|
13
|
+
class GooglePayService {
|
|
14
|
+
constructor() {
|
|
15
|
+
this.api = Api();
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Initialize Google Pay configuration
|
|
19
|
+
*/
|
|
20
|
+
initialize(googlePayConfig) {
|
|
21
|
+
this.googlePayConfig = new GooglePayConfig(googlePayConfig);
|
|
22
|
+
if (!this.googlePayConfig.isValid) {
|
|
23
|
+
throw new Error('Invalid Google Pay configuration provided');
|
|
24
|
+
}
|
|
25
|
+
// Create Google Pay client
|
|
26
|
+
this.googlePayClient = GooglePayHelpers.createGooglePayClient(this.googlePayConfig.environment);
|
|
27
|
+
if (!this.googlePayClient) {
|
|
28
|
+
throw new Error('Failed to create Google Pay client');
|
|
29
|
+
}
|
|
30
|
+
// No debug logs
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* Process Google Pay payment via API
|
|
34
|
+
*/
|
|
35
|
+
async processPayment(authToken, accountId, payload) {
|
|
36
|
+
const endpoint = PROCESS_TOKEN_ENDPOINT;
|
|
37
|
+
try {
|
|
38
|
+
const result = await this.api.post({
|
|
39
|
+
endpoint,
|
|
40
|
+
authToken,
|
|
41
|
+
body: payload,
|
|
42
|
+
headers: {
|
|
43
|
+
'sub-account': accountId,
|
|
44
|
+
},
|
|
45
|
+
});
|
|
46
|
+
return {
|
|
47
|
+
success: result.id && !!result.data.token,
|
|
48
|
+
data: result,
|
|
49
|
+
};
|
|
50
|
+
}
|
|
51
|
+
catch (_error) {
|
|
52
|
+
throw new Error('Google Pay payment processing failed');
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* Check if Google Pay is available on this device/browser
|
|
57
|
+
*/
|
|
58
|
+
isAvailable() {
|
|
59
|
+
return GooglePayHelpers.isGooglePaySupported() && !!this.googlePayClient;
|
|
60
|
+
}
|
|
61
|
+
/**
|
|
62
|
+
* Check if the user can make payments with Google Pay
|
|
63
|
+
*/
|
|
64
|
+
async canMakePayments() {
|
|
65
|
+
if (!this.googlePayClient || !this.googlePayConfig) {
|
|
66
|
+
return false;
|
|
67
|
+
}
|
|
68
|
+
try {
|
|
69
|
+
const baseRequest = GooglePayHelpers.createBasePaymentDataRequest();
|
|
70
|
+
const response = await this.googlePayClient.isReadyToPay(baseRequest);
|
|
71
|
+
return response.result;
|
|
72
|
+
}
|
|
73
|
+
catch (_error) {
|
|
74
|
+
return false;
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
/**
|
|
78
|
+
* Start Google Pay payment session
|
|
79
|
+
*/
|
|
80
|
+
async startPaymentSession(paymentDataRequest, authToken, accountId) {
|
|
81
|
+
var _a;
|
|
82
|
+
if (!this.googlePayConfig || !this.googlePayClient) {
|
|
83
|
+
throw new Error('Google Pay not initialized. Call initialize() first.');
|
|
84
|
+
}
|
|
85
|
+
if (!this.isAvailable()) {
|
|
86
|
+
throw new Error('Google Pay is not available on this device/browser');
|
|
87
|
+
}
|
|
88
|
+
const request = new GooglePayPaymentDataRequest(paymentDataRequest);
|
|
89
|
+
if (!request.isValid) {
|
|
90
|
+
throw new Error('Invalid payment data request provided');
|
|
91
|
+
}
|
|
92
|
+
try {
|
|
93
|
+
const paymentData = await this.googlePayClient.loadPaymentData(request);
|
|
94
|
+
// Build top-level snake_case fields from Google Pay tokenizationData
|
|
95
|
+
const tokenizationData = (_a = paymentData === null || paymentData === void 0 ? void 0 : paymentData.paymentMethodData) === null || _a === void 0 ? void 0 : _a.tokenizationData;
|
|
96
|
+
const tokenObj = (() => {
|
|
97
|
+
if ((tokenizationData === null || tokenizationData === void 0 ? void 0 : tokenizationData.token) &&
|
|
98
|
+
typeof tokenizationData.token === 'string') {
|
|
99
|
+
try {
|
|
100
|
+
return JSON.parse(tokenizationData.token);
|
|
101
|
+
}
|
|
102
|
+
catch (_e) {
|
|
103
|
+
return tokenizationData;
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
return tokenizationData;
|
|
107
|
+
})();
|
|
108
|
+
const tokenProcessRequest = {
|
|
109
|
+
protocolVersion: tokenObj === null || tokenObj === void 0 ? void 0 : tokenObj.protocolVersion,
|
|
110
|
+
signature: tokenObj === null || tokenObj === void 0 ? void 0 : tokenObj.signature,
|
|
111
|
+
intermediateSigningKey: (tokenObj === null || tokenObj === void 0 ? void 0 : tokenObj.intermediateSigningKey)
|
|
112
|
+
? {
|
|
113
|
+
signedKey: tokenObj.intermediateSigningKey.signedKey,
|
|
114
|
+
signatures: tokenObj.intermediateSigningKey.signatures,
|
|
115
|
+
}
|
|
116
|
+
: undefined,
|
|
117
|
+
signedMessage: tokenObj === null || tokenObj === void 0 ? void 0 : tokenObj.signedMessage,
|
|
118
|
+
};
|
|
119
|
+
const paymentResult = await this.processPayment(authToken, accountId, tokenProcessRequest);
|
|
120
|
+
if (paymentResult.success) {
|
|
121
|
+
return {
|
|
122
|
+
success: true,
|
|
123
|
+
paymentData: paymentData,
|
|
124
|
+
paymentMethodId: paymentResult.data.id,
|
|
125
|
+
};
|
|
126
|
+
}
|
|
127
|
+
else {
|
|
128
|
+
return {
|
|
129
|
+
success: false,
|
|
130
|
+
error: {
|
|
131
|
+
code: 'PAYMENT_PROCESSING_ERROR',
|
|
132
|
+
message: 'Payment processing failed',
|
|
133
|
+
},
|
|
134
|
+
};
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
catch (error) {
|
|
138
|
+
// Handle different types of errors
|
|
139
|
+
if (error && typeof error === 'object' && 'statusCode' in error) {
|
|
140
|
+
const googlePayError = error;
|
|
141
|
+
switch (googlePayError.statusCode) {
|
|
142
|
+
case 'CANCELED':
|
|
143
|
+
return {
|
|
144
|
+
success: false,
|
|
145
|
+
error: {
|
|
146
|
+
code: 'USER_CANCELLED',
|
|
147
|
+
message: 'User cancelled the Google Pay session',
|
|
148
|
+
},
|
|
149
|
+
};
|
|
150
|
+
case 'DEVELOPER_ERROR':
|
|
151
|
+
return {
|
|
152
|
+
success: false,
|
|
153
|
+
error: {
|
|
154
|
+
code: 'DEVELOPER_ERROR',
|
|
155
|
+
message: 'Google Pay configuration error',
|
|
156
|
+
},
|
|
157
|
+
};
|
|
158
|
+
default:
|
|
159
|
+
return {
|
|
160
|
+
success: false,
|
|
161
|
+
error: {
|
|
162
|
+
code: 'PAYMENT_ERROR',
|
|
163
|
+
message: googlePayError.statusMessage || 'Google Pay payment failed',
|
|
164
|
+
},
|
|
165
|
+
};
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
return {
|
|
169
|
+
success: false,
|
|
170
|
+
error: {
|
|
171
|
+
code: 'PAYMENT_ERROR',
|
|
172
|
+
message: error instanceof Error
|
|
173
|
+
? error.message
|
|
174
|
+
: 'Google Pay payment failed',
|
|
175
|
+
},
|
|
176
|
+
};
|
|
177
|
+
}
|
|
178
|
+
}
|
|
179
|
+
/**
|
|
180
|
+
* Create Google Pay button element
|
|
181
|
+
*/
|
|
182
|
+
createButton(options) {
|
|
183
|
+
if (!this.googlePayClient || !this.googlePayConfig) {
|
|
184
|
+
return null;
|
|
185
|
+
}
|
|
186
|
+
try {
|
|
187
|
+
return this.googlePayClient.createButton({
|
|
188
|
+
onClick: options.onClick,
|
|
189
|
+
buttonType: options.buttonType,
|
|
190
|
+
buttonSizeMode: options.buttonSizeMode,
|
|
191
|
+
buttonColor: options.buttonColor,
|
|
192
|
+
buttonLocale: options.buttonLocale,
|
|
193
|
+
});
|
|
194
|
+
}
|
|
195
|
+
catch (_error) {
|
|
196
|
+
return null;
|
|
197
|
+
}
|
|
198
|
+
}
|
|
199
|
+
/**
|
|
200
|
+
* Prefetch payment data for faster loading
|
|
201
|
+
*/
|
|
202
|
+
prefetchPaymentData(paymentDataRequest) {
|
|
203
|
+
if (!this.googlePayClient) {
|
|
204
|
+
return;
|
|
205
|
+
}
|
|
206
|
+
const request = new GooglePayPaymentDataRequest(paymentDataRequest);
|
|
207
|
+
if (!request.isValid) {
|
|
208
|
+
return;
|
|
209
|
+
}
|
|
210
|
+
try {
|
|
211
|
+
this.googlePayClient.prefetchPaymentData(request);
|
|
212
|
+
}
|
|
213
|
+
catch (_error) { }
|
|
214
|
+
}
|
|
215
|
+
/**
|
|
216
|
+
* Create a basic payment data request
|
|
217
|
+
*/
|
|
218
|
+
static createPaymentDataRequest(amount, label, countryCode = 'US', currencyCode = 'USD', merchantName) {
|
|
219
|
+
const request = {
|
|
220
|
+
apiVersion: 2,
|
|
221
|
+
apiVersionMinor: 0,
|
|
222
|
+
allowedPaymentMethods: [GooglePayHelpers.createPaymentMethodData()],
|
|
223
|
+
transactionInfo: {
|
|
224
|
+
countryCode,
|
|
225
|
+
currencyCode,
|
|
226
|
+
totalPriceStatus: 'FINAL',
|
|
227
|
+
totalPrice: GooglePayHelpers.formatAmount(amount),
|
|
228
|
+
totalPriceLabel: label,
|
|
229
|
+
},
|
|
230
|
+
merchantInfo: {
|
|
231
|
+
merchantName,
|
|
232
|
+
},
|
|
233
|
+
};
|
|
234
|
+
// No debug logs
|
|
235
|
+
return request;
|
|
236
|
+
}
|
|
237
|
+
/**
|
|
238
|
+
* Get current configuration
|
|
239
|
+
*/
|
|
240
|
+
getGooglePayConfig() {
|
|
241
|
+
return this.googlePayConfig;
|
|
242
|
+
}
|
|
243
|
+
/**
|
|
244
|
+
* Get current Google Pay client
|
|
245
|
+
*/
|
|
246
|
+
getGooglePayClient() {
|
|
247
|
+
return this.googlePayClient;
|
|
248
|
+
}
|
|
249
|
+
}
|
|
250
|
+
|
|
251
|
+
const GooglePaySkeleton = (props) => {
|
|
252
|
+
const { isLoading } = props;
|
|
253
|
+
if (!isLoading) {
|
|
254
|
+
return null;
|
|
255
|
+
}
|
|
256
|
+
return (h("div", { class: 'container-fluid p-0' }, h("div", { class: 'row mb-3' }, h("div", { class: 'col-12 align-content-center' }, h(Skeleton, { height: '44px', width: '100%', styles: { borderRadius: "8px" } })))));
|
|
257
|
+
};
|
|
258
|
+
|
|
259
|
+
const ProcessingSpinner = () => (h("div", { class: 'processing-overlay' }, h("div", { class: 'spinner' }), h("span", null, "Processing...")));
|
|
260
|
+
const GooglePayButton = (props) => {
|
|
261
|
+
const getGooglePayButtonClass = () => {
|
|
262
|
+
let classes = "google-pay-button";
|
|
263
|
+
// Button style
|
|
264
|
+
switch (props.buttonStyle) {
|
|
265
|
+
case GooglePayButtonStyle.WHITE:
|
|
266
|
+
classes += " google-pay-button-white";
|
|
267
|
+
break;
|
|
268
|
+
case GooglePayButtonStyle.BLACK:
|
|
269
|
+
default:
|
|
270
|
+
classes += " google-pay-button-black";
|
|
271
|
+
break;
|
|
272
|
+
}
|
|
273
|
+
// Button type
|
|
274
|
+
switch (props.buttonType) {
|
|
275
|
+
case GooglePayButtonType.BUY:
|
|
276
|
+
classes += " google-pay-button-type-buy";
|
|
277
|
+
break;
|
|
278
|
+
case GooglePayButtonType.BOOK:
|
|
279
|
+
classes += " google-pay-button-type-book";
|
|
280
|
+
break;
|
|
281
|
+
case GooglePayButtonType.CHECKOUT:
|
|
282
|
+
classes += " google-pay-button-type-checkout";
|
|
283
|
+
break;
|
|
284
|
+
case GooglePayButtonType.DONATE:
|
|
285
|
+
classes += " google-pay-button-type-donate";
|
|
286
|
+
break;
|
|
287
|
+
case GooglePayButtonType.ORDER:
|
|
288
|
+
classes += " google-pay-button-type-order";
|
|
289
|
+
break;
|
|
290
|
+
case GooglePayButtonType.PAY:
|
|
291
|
+
classes += " google-pay-button-type-pay";
|
|
292
|
+
break;
|
|
293
|
+
case GooglePayButtonType.SUBSCRIBE:
|
|
294
|
+
classes += " google-pay-button-type-subscribe";
|
|
295
|
+
break;
|
|
296
|
+
case GooglePayButtonType.PLAIN:
|
|
297
|
+
default:
|
|
298
|
+
classes += " google-pay-button-type-plain";
|
|
299
|
+
break;
|
|
300
|
+
}
|
|
301
|
+
// Size mode
|
|
302
|
+
switch (props.buttonSizeMode) {
|
|
303
|
+
case GooglePayButtonSizeMode.FILL:
|
|
304
|
+
classes += " google-pay-button-fill";
|
|
305
|
+
break;
|
|
306
|
+
case GooglePayButtonSizeMode.STATIC:
|
|
307
|
+
default:
|
|
308
|
+
classes += " google-pay-button-static";
|
|
309
|
+
break;
|
|
310
|
+
}
|
|
311
|
+
if (props.disabled || props.isProcessing || !props.isAvailable) {
|
|
312
|
+
classes += " disabled";
|
|
313
|
+
}
|
|
314
|
+
return classes;
|
|
315
|
+
};
|
|
316
|
+
const getButtonStyles = () => {
|
|
317
|
+
const styles = {};
|
|
318
|
+
if (props.buttonSizeMode === GooglePayButtonSizeMode.FILL) {
|
|
319
|
+
styles.width = '100%';
|
|
320
|
+
styles.minWidth = '200px';
|
|
321
|
+
}
|
|
322
|
+
else {
|
|
323
|
+
styles.width = props.width || '200px';
|
|
324
|
+
}
|
|
325
|
+
styles.height = props.height || '48px';
|
|
326
|
+
return styles;
|
|
327
|
+
};
|
|
328
|
+
const handleClick = () => {
|
|
329
|
+
if (!props.disabled &&
|
|
330
|
+
!props.isProcessing &&
|
|
331
|
+
props.isAvailable &&
|
|
332
|
+
props.clickHandler) {
|
|
333
|
+
props.clickHandler();
|
|
334
|
+
}
|
|
335
|
+
};
|
|
336
|
+
return (h("div", { class: "google-pay-button-container" }, 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(), h("div", { class: 'google-pay-button-content' }, h("svg", { width: "41", height: "17", xmlns: "http://www.w3.org/2000/svg" }, h("g", { fill: "none", "fill-rule": "evenodd" }, 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" }), 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" }), 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" }), 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" }), 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" }))))), h("style", null, `
|
|
337
|
+
.google-pay-button-container {
|
|
338
|
+
display: block;
|
|
339
|
+
position: relative;
|
|
340
|
+
}
|
|
341
|
+
|
|
342
|
+
.google-pay-button {
|
|
343
|
+
display: flex;
|
|
344
|
+
align-items: center;
|
|
345
|
+
justify-content: center;
|
|
346
|
+
border: none;
|
|
347
|
+
border-radius: 4px;
|
|
348
|
+
cursor: pointer;
|
|
349
|
+
font-size: 14px;
|
|
350
|
+
font-weight: 500;
|
|
351
|
+
letter-spacing: 0.25px;
|
|
352
|
+
line-height: 16px;
|
|
353
|
+
outline: none;
|
|
354
|
+
padding: 0 20px;
|
|
355
|
+
position: relative;
|
|
356
|
+
min-width: 140px;
|
|
357
|
+
min-height: 48px;
|
|
358
|
+
}
|
|
359
|
+
|
|
360
|
+
/* Button styles */
|
|
361
|
+
.google-pay-button.google-pay-button-black {
|
|
362
|
+
background-color: #000;
|
|
363
|
+
color: #fff;
|
|
364
|
+
}
|
|
365
|
+
|
|
366
|
+
.google-pay-button.google-pay-button-white {
|
|
367
|
+
background-color: #fff;
|
|
368
|
+
color: #3c4043;
|
|
369
|
+
}
|
|
370
|
+
|
|
371
|
+
/* Button content */
|
|
372
|
+
.google-pay-button-content {
|
|
373
|
+
display: flex;
|
|
374
|
+
align-items: center;
|
|
375
|
+
justify-content: center;
|
|
376
|
+
gap: 8px;
|
|
377
|
+
white-space: nowrap;
|
|
378
|
+
}
|
|
379
|
+
|
|
380
|
+
.google-g-logo {
|
|
381
|
+
width: 20px;
|
|
382
|
+
height: 20px;
|
|
383
|
+
flex-shrink: 0;
|
|
384
|
+
}
|
|
385
|
+
|
|
386
|
+
.pay-text {
|
|
387
|
+
font-family: 'Google Sans', arial, sans-serif;
|
|
388
|
+
font-size: 14px;
|
|
389
|
+
font-weight: 500;
|
|
390
|
+
margin-left: 8px;
|
|
391
|
+
}
|
|
392
|
+
|
|
393
|
+
/* Button types - text content handled by ::before pseudo-element */
|
|
394
|
+
.google-pay-button-type-buy .google-pay-button-content::before {
|
|
395
|
+
content: 'Buy with';
|
|
396
|
+
margin-right: 8px;
|
|
397
|
+
}
|
|
398
|
+
|
|
399
|
+
.google-pay-button-type-book .google-pay-button-content::before {
|
|
400
|
+
content: 'Book with';
|
|
401
|
+
margin-right: 8px;
|
|
402
|
+
}
|
|
403
|
+
|
|
404
|
+
.google-pay-button-type-checkout .google-pay-button-content::before {
|
|
405
|
+
content: 'Checkout with';
|
|
406
|
+
margin-right: 8px;
|
|
407
|
+
}
|
|
408
|
+
|
|
409
|
+
.google-pay-button-type-donate .google-pay-button-content::before {
|
|
410
|
+
content: 'Donate with';
|
|
411
|
+
margin-right: 8px;
|
|
412
|
+
}
|
|
413
|
+
|
|
414
|
+
.google-pay-button-type-order .google-pay-button-content::before {
|
|
415
|
+
content: 'Order with';
|
|
416
|
+
margin-right: 8px;
|
|
417
|
+
}
|
|
418
|
+
|
|
419
|
+
.google-pay-button-type-pay .google-pay-button-content::before {
|
|
420
|
+
content: 'Pay with';
|
|
421
|
+
margin-right: 8px;
|
|
422
|
+
}
|
|
423
|
+
|
|
424
|
+
.google-pay-button-type-subscribe .google-pay-button-content::before {
|
|
425
|
+
content: 'Subscribe with';
|
|
426
|
+
margin-right: 8px;
|
|
427
|
+
}
|
|
428
|
+
|
|
429
|
+
/* Size modes */
|
|
430
|
+
.google-pay-button.google-pay-button-fill {
|
|
431
|
+
width: 100%;
|
|
432
|
+
min-width: 200px;
|
|
433
|
+
}
|
|
434
|
+
|
|
435
|
+
.google-pay-button.google-pay-button-static {
|
|
436
|
+
width: auto;
|
|
437
|
+
}
|
|
438
|
+
|
|
439
|
+
/* Hover and focus states */
|
|
440
|
+
.google-pay-button:hover:not(.disabled) {
|
|
441
|
+
box-shadow: 0 1px 1px 0 rgba(0, 0, 0, 0.15), 0 1px 3px 1px rgba(0, 0, 0, 0.30);
|
|
442
|
+
}
|
|
443
|
+
|
|
444
|
+
.google-pay-button:focus:not(.disabled) {
|
|
445
|
+
box-shadow: 0 1px 1px 0 rgba(0, 0, 0, 0.15), 0 1px 3px 1px rgba(0, 0, 0, 0.30);
|
|
446
|
+
}
|
|
447
|
+
|
|
448
|
+
.google-pay-button:active:not(.disabled) {
|
|
449
|
+
box-shadow: 0 1px 1px 0 rgba(0, 0, 0, 0.15), 0 1px 3px 1px rgba(0, 0, 0, 0.30);
|
|
450
|
+
transform: translateY(1px);
|
|
451
|
+
}
|
|
452
|
+
|
|
453
|
+
/* Disabled state */
|
|
454
|
+
.google-pay-button.disabled {
|
|
455
|
+
opacity: 0.5;
|
|
456
|
+
cursor: not-allowed;
|
|
457
|
+
box-shadow: none;
|
|
458
|
+
}
|
|
459
|
+
|
|
460
|
+
.google-pay-button.disabled:hover,
|
|
461
|
+
.google-pay-button.disabled:focus,
|
|
462
|
+
.google-pay-button.disabled:active {
|
|
463
|
+
box-shadow: none;
|
|
464
|
+
transform: none;
|
|
465
|
+
}
|
|
466
|
+
|
|
467
|
+
/* Processing overlay */
|
|
468
|
+
.processing-overlay {
|
|
469
|
+
position: absolute;
|
|
470
|
+
top: 0;
|
|
471
|
+
left: 0;
|
|
472
|
+
right: 0;
|
|
473
|
+
bottom: 0;
|
|
474
|
+
display: flex;
|
|
475
|
+
align-items: center;
|
|
476
|
+
justify-content: center;
|
|
477
|
+
gap: 8px;
|
|
478
|
+
background: rgba(0, 0, 0, 0.8);
|
|
479
|
+
color: white;
|
|
480
|
+
border-radius: 4px;
|
|
481
|
+
font-size: 14px;
|
|
482
|
+
font-weight: 500;
|
|
483
|
+
}
|
|
484
|
+
|
|
485
|
+
.spinner {
|
|
486
|
+
width: 16px;
|
|
487
|
+
height: 16px;
|
|
488
|
+
border: 2px solid rgba(255, 255, 255, 0.3);
|
|
489
|
+
border-top: 2px solid #fff;
|
|
490
|
+
border-radius: 50%;
|
|
491
|
+
animation: spin 1s linear infinite;
|
|
492
|
+
}
|
|
493
|
+
|
|
494
|
+
@keyframes spin {
|
|
495
|
+
0% { transform: rotate(0deg); }
|
|
496
|
+
100% { transform: rotate(360deg); }
|
|
497
|
+
}
|
|
498
|
+
|
|
499
|
+
/* Responsive design */
|
|
500
|
+
@media (max-width: 480px) {
|
|
501
|
+
.google-pay-button {
|
|
502
|
+
width: 100% !important;
|
|
503
|
+
min-width: 200px;
|
|
504
|
+
}
|
|
505
|
+
}
|
|
506
|
+
`)));
|
|
507
|
+
};
|
|
508
|
+
|
|
509
|
+
const GooglePay = /*@__PURE__*/ proxyCustomElement(class GooglePay extends HTMLElement {
|
|
510
|
+
constructor(registerHost) {
|
|
511
|
+
super();
|
|
512
|
+
if (registerHost !== false) {
|
|
513
|
+
this.__registerHost();
|
|
514
|
+
}
|
|
515
|
+
this.__attachShadow();
|
|
516
|
+
this.googlePayCancelled = createEvent(this, "googlePayCancelled", 7);
|
|
517
|
+
this.googlePayCompleted = createEvent(this, "googlePayCompleted", 7);
|
|
518
|
+
this.googlePayStarted = createEvent(this, "googlePayStarted", 7);
|
|
519
|
+
this.unsubscribes = [];
|
|
520
|
+
this.canMakePayments = false;
|
|
521
|
+
this.error = null;
|
|
522
|
+
this.isAvailable = false;
|
|
523
|
+
this.isLoading = true;
|
|
524
|
+
this.isProcessing = false;
|
|
525
|
+
this.buttonSizeMode = GooglePayButtonSizeMode.FILL;
|
|
526
|
+
this.buttonStyle = GooglePayButtonStyle.BLACK;
|
|
527
|
+
this.buttonType = GooglePayButtonType.PLAIN;
|
|
528
|
+
this.countryCode = "US";
|
|
529
|
+
this.disabled = false;
|
|
530
|
+
this.environment = GooglePayEnvironment.PRODUCTION;
|
|
531
|
+
this.merchantId = "gateway:justifi";
|
|
532
|
+
this.merchantName = "justifi";
|
|
533
|
+
this.showSkeleton = true;
|
|
534
|
+
this.handleGooglePayClick = async () => {
|
|
535
|
+
var _a;
|
|
536
|
+
if (this.isProcessing ||
|
|
537
|
+
this.disabled ||
|
|
538
|
+
!this.isAvailable ||
|
|
539
|
+
!this.canMakePayments) {
|
|
540
|
+
return;
|
|
541
|
+
}
|
|
542
|
+
try {
|
|
543
|
+
this.isProcessing = true;
|
|
544
|
+
this.error = null;
|
|
545
|
+
this.googlePayStarted.emit();
|
|
546
|
+
const paymentDataRequest = this.createPaymentDataRequest();
|
|
547
|
+
const result = await this.googlePayService.startPaymentSession(paymentDataRequest, checkoutStore.authToken, checkoutStore.accountId);
|
|
548
|
+
if (result.success) {
|
|
549
|
+
this.googlePayCompleted.emit({
|
|
550
|
+
success: true,
|
|
551
|
+
paymentData: result.paymentData,
|
|
552
|
+
paymentMethodId: result.paymentMethodId,
|
|
553
|
+
});
|
|
554
|
+
}
|
|
555
|
+
else {
|
|
556
|
+
this.googlePayCompleted.emit({
|
|
557
|
+
success: false,
|
|
558
|
+
error: result.error,
|
|
559
|
+
});
|
|
560
|
+
if (((_a = result.error) === null || _a === void 0 ? void 0 : _a.code) === "USER_CANCELLED") {
|
|
561
|
+
this.googlePayCancelled.emit();
|
|
562
|
+
}
|
|
563
|
+
}
|
|
564
|
+
}
|
|
565
|
+
catch (error) {
|
|
566
|
+
const errorMessage = error instanceof Error ? error.message : "Payment failed";
|
|
567
|
+
this.error = errorMessage;
|
|
568
|
+
this.googlePayCompleted.emit({
|
|
569
|
+
success: false,
|
|
570
|
+
error: errorMessage,
|
|
571
|
+
});
|
|
572
|
+
}
|
|
573
|
+
finally {
|
|
574
|
+
this.isProcessing = false;
|
|
575
|
+
}
|
|
576
|
+
};
|
|
577
|
+
}
|
|
578
|
+
watchConfigChange() {
|
|
579
|
+
this.initializeGooglePay();
|
|
580
|
+
}
|
|
581
|
+
componentWillLoad() {
|
|
582
|
+
this.googlePayService = new GooglePayService();
|
|
583
|
+
}
|
|
584
|
+
componentDidLoad() {
|
|
585
|
+
const unsub = onChange("paymentAmount", () => {
|
|
586
|
+
this.prefetchPaymentData();
|
|
587
|
+
});
|
|
588
|
+
if (typeof unsub === 'function')
|
|
589
|
+
this.unsubscribes.push(unsub);
|
|
590
|
+
const unsubCurrency = onChange("paymentCurrency", () => {
|
|
591
|
+
this.prefetchPaymentData();
|
|
592
|
+
});
|
|
593
|
+
if (typeof unsubCurrency === 'function')
|
|
594
|
+
this.unsubscribes.push(unsubCurrency);
|
|
595
|
+
const unsubDesc = onChange("paymentDescription", () => {
|
|
596
|
+
this.prefetchPaymentData();
|
|
597
|
+
});
|
|
598
|
+
if (typeof unsubDesc === 'function')
|
|
599
|
+
this.unsubscribes.push(unsubDesc);
|
|
600
|
+
}
|
|
601
|
+
disconnectedCallback() {
|
|
602
|
+
this.unsubscribes.forEach((fn) => {
|
|
603
|
+
try {
|
|
604
|
+
fn();
|
|
605
|
+
}
|
|
606
|
+
catch (_a) { }
|
|
607
|
+
});
|
|
608
|
+
this.unsubscribes = [];
|
|
609
|
+
}
|
|
610
|
+
/**
|
|
611
|
+
* Returns supported authentication methods when Google Pay is available.
|
|
612
|
+
*/
|
|
613
|
+
async getSupportedAuthMethods() {
|
|
614
|
+
if (!this.isAvailable) {
|
|
615
|
+
return [];
|
|
616
|
+
}
|
|
617
|
+
return GooglePayHelpers.getDefaultAuthMethods();
|
|
618
|
+
}
|
|
619
|
+
/**
|
|
620
|
+
* Returns supported card networks when Google Pay is available.
|
|
621
|
+
*/
|
|
622
|
+
async getSupportedNetworks() {
|
|
623
|
+
if (!this.isAvailable) {
|
|
624
|
+
return [];
|
|
625
|
+
}
|
|
626
|
+
return GooglePayHelpers.getDefaultSupportedNetworks();
|
|
627
|
+
}
|
|
628
|
+
/**
|
|
629
|
+
* Select Google Pay in the modular checkout parent.
|
|
630
|
+
*/
|
|
631
|
+
async handleSelectionClick() {
|
|
632
|
+
checkoutStore.selectedPaymentMethod = { type: PAYMENT_METHODS.GOOGLE_PAY };
|
|
633
|
+
}
|
|
634
|
+
/**
|
|
635
|
+
* Returns whether Google Pay is both available and can make payments.
|
|
636
|
+
*/
|
|
637
|
+
async isSupported() {
|
|
638
|
+
return this.isAvailable && this.canMakePayments;
|
|
639
|
+
}
|
|
640
|
+
/**
|
|
641
|
+
* Prefetch payment data for faster load times of the Google Pay sheet.
|
|
642
|
+
*/
|
|
643
|
+
async prefetchPaymentData() {
|
|
644
|
+
if (!this.isAvailable || !this.canMakePayments) {
|
|
645
|
+
return;
|
|
646
|
+
}
|
|
647
|
+
const paymentDataRequest = this.createPaymentDataRequest();
|
|
648
|
+
this.googlePayService.prefetchPaymentData(paymentDataRequest);
|
|
649
|
+
}
|
|
650
|
+
async initializeGooglePay() {
|
|
651
|
+
try {
|
|
652
|
+
this.isLoading = true;
|
|
653
|
+
this.error = null;
|
|
654
|
+
if (!checkoutStore.paymentAmount) {
|
|
655
|
+
this.error = "Missing required Google Pay configuration";
|
|
656
|
+
this.isLoading = false;
|
|
657
|
+
return;
|
|
658
|
+
}
|
|
659
|
+
const googlePayConfig = {
|
|
660
|
+
environment: this.environment,
|
|
661
|
+
merchantId: this.merchantId,
|
|
662
|
+
merchantName: this.merchantName,
|
|
663
|
+
buttonType: this.buttonType,
|
|
664
|
+
buttonStyle: this.buttonStyle,
|
|
665
|
+
buttonSizeMode: this.buttonSizeMode,
|
|
666
|
+
};
|
|
667
|
+
this.googlePayService.initialize(googlePayConfig);
|
|
668
|
+
this.isAvailable = this.googlePayService.isAvailable();
|
|
669
|
+
if (!this.isAvailable) {
|
|
670
|
+
this.error = "Google Pay is not supported on this device";
|
|
671
|
+
this.isLoading = false;
|
|
672
|
+
return;
|
|
673
|
+
}
|
|
674
|
+
this.canMakePayments = await this.googlePayService.canMakePayments();
|
|
675
|
+
if (!this.canMakePayments) {
|
|
676
|
+
this.error = "Google Pay is not available for payments";
|
|
677
|
+
this.isLoading = false;
|
|
678
|
+
return;
|
|
679
|
+
}
|
|
680
|
+
const paymentDataRequest = this.createPaymentDataRequest();
|
|
681
|
+
this.googlePayService.prefetchPaymentData(paymentDataRequest);
|
|
682
|
+
}
|
|
683
|
+
catch (error) {
|
|
684
|
+
this.error =
|
|
685
|
+
error instanceof Error
|
|
686
|
+
? error.message
|
|
687
|
+
: "Failed to initialize Google Pay";
|
|
688
|
+
}
|
|
689
|
+
finally {
|
|
690
|
+
this.isLoading = false;
|
|
691
|
+
}
|
|
692
|
+
}
|
|
693
|
+
createPaymentDataRequest() {
|
|
694
|
+
return GooglePayService.createPaymentDataRequest(checkoutStore.paymentAmount, checkoutStore.paymentDescription, this.countryCode, checkoutStore.paymentCurrency, this.merchantName);
|
|
695
|
+
}
|
|
696
|
+
render() {
|
|
697
|
+
const showError = !this.isLoading && !!this.error;
|
|
698
|
+
const showDeviceUnavailable = !this.isLoading && !this.error && !this.isAvailable;
|
|
699
|
+
const showPaymentsUnavailable = !this.isLoading && !this.error && this.isAvailable && !this.canMakePayments;
|
|
700
|
+
const showButton = !this.isLoading && !this.error && this.isAvailable && this.canMakePayments;
|
|
701
|
+
return (h(StyledHost, { key: 'd85684b123cdba175d68a2e216f9150780ac7cf9' }, checkoutStore.checkoutLoaded && (h("script", { key: 'b78bb8980d670e5b66cb907f89cee6ff2238205c', async: true, src: 'https://pay.google.com/gp/p/js/pay.js', onLoad: () => {
|
|
702
|
+
this.initializeGooglePay();
|
|
703
|
+
} })), h("div", { key: 'e405efb3a164be9e1d9db5beeb3c01471b647aaf', class: 'google-pay-container' }, h(GooglePaySkeleton, { key: 'c17dbb3e305678a1da10e3741ff0b610c549be6e', isLoading: this.isLoading }), showError && (h("div", { key: '726895b7c76f3edbbbb1930a317d826b8f8f11fd', class: 'google-pay-error', role: 'alert', "data-testid": 'gp-error' }, h("span", { key: '23342ca70b6b5bf28f846ca519cc4fbfb065fc67', class: 'error-icon' }, "\u26A0\uFE0F"), h("span", { key: '008315696bc7b7f78f69cfc80160dacabf1205b5', class: 'error-message' }, this.error))), showDeviceUnavailable && (h("div", { key: '2e87b4a9e5d0c0201333b79b9c190ca14932391b', class: 'google-pay-unavailable', "data-testid": 'gp-device-unavailable' }, h("span", { key: '6db13fc44661500a964422d18550cb31e275f076', class: 'unavailable-message' }, "Google Pay is not available on this device"))), showPaymentsUnavailable && (h("div", { key: 'c2ca09e36652800092cc6bcbe4a351b0d604bae2', class: 'google-pay-unavailable', "data-testid": 'gp-payments-unavailable' }, h("span", { key: 'a5e75ccbb269249327192b927a0df879d90aefe5', class: 'unavailable-message' }, "Google Pay is not available for payments"))), showButton && (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 }))), h("style", { key: '9890ac44c4f047484396e0b4ae0d04a31489e61f' }, `
|
|
704
|
+
.google-pay-container {
|
|
705
|
+
width: 100%;
|
|
706
|
+
}
|
|
707
|
+
|
|
708
|
+
.google-pay-error {
|
|
709
|
+
display: flex;
|
|
710
|
+
align-items: center;
|
|
711
|
+
gap: 8px;
|
|
712
|
+
padding: 12px;
|
|
713
|
+
background: #fef2f2;
|
|
714
|
+
border: 1px solid #fecaca;
|
|
715
|
+
border-radius: 8px;
|
|
716
|
+
color: #dc2626;
|
|
717
|
+
font-size: 14px;
|
|
718
|
+
}
|
|
719
|
+
|
|
720
|
+
.google-pay-unavailable {
|
|
721
|
+
display: flex;
|
|
722
|
+
align-items: center;
|
|
723
|
+
justify-content: center;
|
|
724
|
+
padding: 12px;
|
|
725
|
+
background: #f9fafb;
|
|
726
|
+
border: 1px solid #e5e7eb;
|
|
727
|
+
border-radius: 8px;
|
|
728
|
+
color: #6b7280;
|
|
729
|
+
font-size: 14px;
|
|
730
|
+
}
|
|
731
|
+
|
|
732
|
+
.error-icon {
|
|
733
|
+
font-size: 16px;
|
|
734
|
+
}
|
|
735
|
+
|
|
736
|
+
`)));
|
|
737
|
+
}
|
|
738
|
+
static get watchers() { return {
|
|
739
|
+
"merchantId": ["watchConfigChange"],
|
|
740
|
+
"environment": ["watchConfigChange"]
|
|
741
|
+
}; }
|
|
742
|
+
}, [257, "justifi-google-pay", {
|
|
743
|
+
"buttonSizeMode": [1, "button-size-mode"],
|
|
744
|
+
"buttonStyle": [1, "button-style"],
|
|
745
|
+
"buttonType": [1, "button-type"],
|
|
746
|
+
"countryCode": [1, "country-code"],
|
|
747
|
+
"disabled": [4],
|
|
748
|
+
"environment": [1],
|
|
749
|
+
"merchantId": [1, "merchant-id"],
|
|
750
|
+
"merchantName": [1, "merchant-name"],
|
|
751
|
+
"showSkeleton": [4, "show-skeleton"],
|
|
752
|
+
"canMakePayments": [32],
|
|
753
|
+
"error": [32],
|
|
754
|
+
"isAvailable": [32],
|
|
755
|
+
"isLoading": [32],
|
|
756
|
+
"isProcessing": [32],
|
|
757
|
+
"getSupportedAuthMethods": [64],
|
|
758
|
+
"getSupportedNetworks": [64],
|
|
759
|
+
"handleSelectionClick": [64],
|
|
760
|
+
"isSupported": [64],
|
|
761
|
+
"prefetchPaymentData": [64]
|
|
762
|
+
}, undefined, {
|
|
763
|
+
"merchantId": ["watchConfigChange"],
|
|
764
|
+
"environment": ["watchConfigChange"]
|
|
765
|
+
}]);
|
|
766
|
+
function defineCustomElement() {
|
|
767
|
+
if (typeof customElements === "undefined") {
|
|
768
|
+
return;
|
|
769
|
+
}
|
|
770
|
+
const components = ["justifi-google-pay"];
|
|
771
|
+
components.forEach(tagName => { switch (tagName) {
|
|
772
|
+
case "justifi-google-pay":
|
|
773
|
+
if (!customElements.get(tagName)) {
|
|
774
|
+
customElements.define(tagName, GooglePay);
|
|
775
|
+
}
|
|
776
|
+
break;
|
|
777
|
+
} });
|
|
778
|
+
}
|
|
779
|
+
defineCustomElement();
|
|
780
|
+
|
|
781
|
+
export { GooglePay as G, defineCustomElement as d };
|