@justifi/webcomponents 6.0.6-rc.2 → 6.0.6-rc.3
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/bank-account-document-form-inputs_4.cjs.entry.js +2 -2
- package/dist/cjs/bank-account-form.cjs.entry.js +2 -2
- package/dist/cjs/card-form.cjs.entry.js +2 -2
- package/dist/cjs/{check-pkg-version-BXAxVT0S.js → check-pkg-version-D2O-HBMD.js} +1 -1
- package/dist/cjs/{checkout.store-CS7dpzYF.js → checkout.store-Bswr7kNY.js} +4 -0
- package/dist/cjs/checkouts-list-core.cjs.entry.js +1 -1
- package/dist/cjs/custom-popper_2.cjs.entry.js +2 -2
- 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.cjs.entry.js +2 -2
- package/dist/cjs/form-control-number-masked_2.cjs.entry.js +2 -2
- 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_2.cjs.entry.js +4 -4
- 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/justifi-additional-statement_8.cjs.entry.js +8 -8
- package/dist/cjs/{justifi-checkout-summary_7.cjs.entry.js → justifi-apple-pay_8.cjs.entry.js} +882 -15
- package/dist/cjs/justifi-bank-account-billing-form-simple_9.cjs.entry.js +11 -11
- package/dist/cjs/justifi-business-details.cjs.entry.js +2 -2
- package/dist/cjs/justifi-business-form.cjs.entry.js +2 -2
- package/dist/cjs/justifi-checkout.cjs.entry.js +4 -4
- package/dist/cjs/justifi-checkouts-list-filters.cjs.entry.js +1 -1
- package/dist/cjs/justifi-checkouts-list.cjs.entry.js +3 -3
- package/dist/cjs/justifi-dispute-management-core.cjs.entry.js +1 -1
- package/dist/cjs/justifi-dispute-management.cjs.entry.js +3 -3
- package/dist/cjs/justifi-dispute-notification_3.cjs.entry.js +5 -5
- package/dist/cjs/justifi-gross-payment-chart.cjs.entry.js +2 -2
- package/dist/cjs/justifi-order-terminals.cjs.entry.js +3 -3
- package/dist/cjs/justifi-payment-details.cjs.entry.js +2 -2
- package/dist/cjs/justifi-payment-provisioning.cjs.entry.js +2 -2
- package/dist/cjs/justifi-payment-transactions-list.cjs.entry.js +3 -3
- package/dist/cjs/justifi-payments-list-filters.cjs.entry.js +2 -2
- package/dist/cjs/justifi-payments-list.cjs.entry.js +3 -3
- package/dist/cjs/justifi-payout-details.cjs.entry.js +2 -2
- package/dist/cjs/justifi-payout-transactions-list.cjs.entry.js +3 -3
- package/dist/cjs/justifi-payouts-list-filters.cjs.entry.js +2 -2
- package/dist/cjs/justifi-payouts-list.cjs.entry.js +3 -3
- package/dist/cjs/justifi-refund-payment.cjs.entry.js +2 -2
- package/dist/cjs/justifi-saved-payment-method.cjs.entry.js +1 -1
- package/dist/cjs/justifi-season-interruption-insurance.cjs.entry.js +3 -3
- package/dist/cjs/justifi-skeleton.cjs.entry.js +1 -1
- package/dist/cjs/justifi-terminal-orders-list-filters.cjs.entry.js +2 -2
- package/dist/cjs/justifi-terminal-orders-list.cjs.entry.js +3 -3
- package/dist/cjs/justifi-terminals-list-filters.cjs.entry.js +1 -1
- package/dist/cjs/justifi-terminals-list.cjs.entry.js +3 -3
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/{package-D8-S3yHl.js → package-B8AreocB.js} +1 -1
- package/dist/cjs/pagination-menu.cjs.entry.js +3 -3
- package/dist/cjs/payment-details-core.cjs.entry.js +8 -8
- package/dist/cjs/payment-method-option.cjs.entry.js +1 -1
- package/dist/cjs/payments-list-core.cjs.entry.js +1 -1
- package/dist/cjs/payout-details-core.cjs.entry.js +3 -3
- package/dist/cjs/payouts-list-core.cjs.entry.js +1 -1
- package/dist/cjs/table-filters-menu.cjs.entry.js +1 -1
- package/dist/cjs/terminal-orders-list-core.cjs.entry.js +1 -1
- package/dist/cjs/terminal-quantity-selector.cjs.entry.js +1 -1
- package/dist/cjs/terminals-list-core.cjs.entry.js +1 -1
- package/dist/cjs/webcomponents.cjs.js +1 -1
- package/dist/collection/api/services/apple-pay.service.js +0 -3
- 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 +1 -1
- 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 +1 -1
- 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/modular-checkout.js +7 -6
- package/dist/collection/components/modular-checkout/sub-components/apple-pay.js +49 -2
- 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/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/tokenize-payment-method.js +1 -1
- package/dist/collection/store/checkout.store.js +4 -0
- package/dist/collection/ui-components/apple-pay-button.js +4 -7
- package/dist/collection/ui-components/custom-popper/custom-popper.js +2 -2
- 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/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-skeleton.js +1 -1
- package/dist/docs.json +69 -3
- package/dist/esm/additional-questions-details_5.entry.js +2 -2
- package/dist/esm/{badge-BYEj23zk.js → badge-CtdO-tEY.js} +1 -1
- package/dist/esm/bank-account-document-form-inputs_4.entry.js +5 -5
- package/dist/esm/bank-account-form.entry.js +4 -4
- package/dist/esm/business-details-core.entry.js +3 -3
- package/dist/esm/{button-BQetT-FB.js → button-DtTaQHMK.js} +1 -1
- package/dist/esm/card-form.entry.js +4 -4
- package/dist/esm/{check-pkg-version-DdZIl21c.js → check-pkg-version-f6satvrI.js} +1 -1
- package/dist/esm/{checkout.store-CWAkbFJL.js → checkout.store-4nUf2OuT.js} +4 -0
- package/dist/esm/checkouts-list-core.entry.js +6 -6
- package/dist/esm/{checkouts-table-D7-slfUE.js → checkouts-table-B6gGDtOr.js} +2 -2
- package/dist/esm/custom-popper_2.entry.js +3 -3
- package/dist/esm/form-alert_5.entry.js +1 -1
- package/dist/esm/form-control-checkbox.entry.js +5 -5
- package/dist/esm/form-control-date.entry.js +4 -4
- package/dist/esm/{form-control-error-text-DU4UNQlE.js → form-control-error-text-bprS-t9d.js} +1 -1
- package/dist/esm/form-control-file-v2_2.entry.js +5 -5
- package/dist/esm/{form-control-help-text-DDLwbCDl.js → form-control-help-text-Bvnp-IAG.js} +1 -1
- package/dist/esm/form-control-monetary-provisioning.entry.js +3 -3
- package/dist/esm/form-control-monetary.entry.js +5 -5
- package/dist/esm/form-control-number-masked_2.entry.js +4 -4
- package/dist/esm/form-control-number.entry.js +5 -5
- package/dist/esm/form-control-radio.entry.js +3 -3
- package/dist/esm/form-control-select_2.entry.js +6 -6
- package/dist/esm/gross-payment-chart-core.entry.js +4 -4
- package/dist/esm/{header-1-CIfsspQD.js → header-1-C1Hnxki8.js} +1 -1
- package/dist/esm/{header-3-0vgSYspf.js → header-3-Bq8fpjm-.js} +1 -1
- package/dist/esm/hidden-input_2.entry.js +7 -7
- package/dist/esm/{insurance-state-QGyiPZ_-.js → insurance-state-CVme82j7.js} +1 -1
- package/dist/esm/justifi-additional-questions-form-step-core_6.entry.js +3 -3
- package/dist/esm/justifi-additional-questions-form-step_9.entry.js +2 -2
- package/dist/esm/justifi-additional-statement_8.entry.js +9 -9
- package/dist/esm/{justifi-checkout-summary_7.entry.js → justifi-apple-pay_8.entry.js} +886 -20
- package/dist/esm/justifi-bank-account-billing-form-simple_9.entry.js +15 -15
- package/dist/esm/justifi-business-details.entry.js +4 -4
- package/dist/esm/justifi-business-form.entry.js +6 -6
- package/dist/esm/justifi-business-representative-form-inputs.entry.js +1 -1
- package/dist/esm/justifi-checkout.entry.js +5 -5
- package/dist/esm/justifi-checkouts-list-filters.entry.js +2 -2
- package/dist/esm/justifi-checkouts-list.entry.js +6 -6
- package/dist/esm/justifi-details.entry.js +2 -2
- package/dist/esm/justifi-dispute-management-core.entry.js +1 -1
- package/dist/esm/justifi-dispute-management.entry.js +3 -3
- package/dist/esm/justifi-dispute-notification_3.entry.js +8 -8
- package/dist/esm/justifi-gross-payment-chart.entry.js +4 -4
- package/dist/esm/justifi-order-terminals.entry.js +5 -5
- package/dist/esm/justifi-owner-form_3.entry.js +2 -2
- package/dist/esm/justifi-payment-details.entry.js +4 -4
- package/dist/esm/justifi-payment-provisioning-core.entry.js +2 -2
- package/dist/esm/justifi-payment-provisioning.entry.js +2 -2
- package/dist/esm/justifi-payment-transactions-list.entry.js +6 -6
- package/dist/esm/justifi-payments-list-filters.entry.js +3 -3
- package/dist/esm/justifi-payments-list.entry.js +7 -7
- package/dist/esm/justifi-payout-details.entry.js +4 -4
- package/dist/esm/justifi-payout-transactions-list.entry.js +6 -6
- package/dist/esm/justifi-payouts-list-filters.entry.js +3 -3
- package/dist/esm/justifi-payouts-list.entry.js +7 -7
- package/dist/esm/justifi-refund-payment.entry.js +5 -5
- package/dist/esm/justifi-saved-payment-method.entry.js +2 -2
- package/dist/esm/justifi-season-interruption-insurance.entry.js +6 -6
- package/dist/esm/justifi-skeleton.entry.js +3 -3
- package/dist/esm/justifi-terminal-orders-list-filters.entry.js +3 -3
- package/dist/esm/justifi-terminal-orders-list.entry.js +6 -6
- package/dist/esm/justifi-terminals-list-filters.entry.js +2 -2
- package/dist/esm/justifi-terminals-list.entry.js +6 -6
- package/dist/esm/loader.js +1 -1
- package/dist/esm/{package-DlT1rYmL.js → package-DOrxxtCs.js} +1 -1
- package/dist/esm/pagination-menu.entry.js +4 -4
- package/dist/esm/{parts-DS3KdLWS.js → parts-xDbRW9xn.js} +1 -1
- package/dist/esm/payment-details-core.entry.js +13 -13
- package/dist/esm/payment-method-option.entry.js +2 -2
- package/dist/esm/payments-list-core.entry.js +7 -7
- package/dist/esm/{payments-status-DpKZIq0D.js → payments-status-cvtVmtY5.js} +1 -1
- package/dist/esm/{payments-table-BhUsDP9C.js → payments-table-D_BlyU1F.js} +2 -2
- package/dist/esm/payout-details-core.entry.js +9 -9
- package/dist/esm/payouts-list-core.entry.js +7 -7
- package/dist/esm/{payouts-status-CZxWiR6g.js → payouts-status-D-vjrqBb.js} +1 -1
- package/dist/esm/{payouts-table-C6bACVT_.js → payouts-table-Clj8YGLV.js} +2 -2
- package/dist/esm/{skeleton-CtxvPKqv.js → skeleton-B8EUwt4b.js} +1 -1
- package/dist/esm/{spinner-DSSWDOaz.js → spinner-CYXkn1fh.js} +1 -1
- package/dist/esm/{table-C7Sw1Lk-.js → table-Bj20uWfu.js} +2 -2
- package/dist/esm/table-filters-menu.entry.js +3 -3
- package/dist/esm/terminal-orders-list-core.entry.js +6 -6
- package/dist/esm/{terminal-orders-table-Cdv_O1iI.js → terminal-orders-table-DzBpIW8i.js} +2 -2
- package/dist/esm/terminal-quantity-selector.entry.js +2 -2
- package/dist/esm/terminals-list-core.entry.js +6 -6
- package/dist/esm/{terminals-table-BBUVz5oU.js → terminals-table-BMS5tazC.js} +2 -2
- package/dist/esm/{utils-DkhVjdbQ.js → utils-DRwofES0.js} +1 -1
- package/dist/esm/webcomponents.js +1 -1
- package/dist/module/additional-statement.js +1 -1
- package/dist/{esm/justifi-apple-pay.entry.js → module/apple-pay.js} +68 -33
- package/dist/module/bank-account-billing-form-simple.js +1 -1
- package/dist/module/bank-account-form.js +2 -2
- package/dist/module/bank-account.js +2 -2
- 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.store.js +4 -0
- package/dist/module/checkouts-list-core2.js +1 -1
- package/dist/module/custom-popper2.js +2 -2
- package/dist/module/customer-details.js +1 -1
- package/dist/module/dispute-management-core.js +1 -1
- package/dist/module/dispute-notification.js +1 -1
- 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-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-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/gross-payment-chart-core2.js +1 -1
- package/dist/module/hidden-input2.js +1 -1
- package/dist/module/iframe-input2.js +3 -3
- package/dist/module/justifi-apple-pay.js +1 -907
- package/dist/module/justifi-button2.js +1 -1
- package/dist/module/justifi-checkout.js +25 -19
- package/dist/module/justifi-checkouts-list-filters.js +1 -1
- package/dist/module/justifi-checkouts-list.js +1 -1
- package/dist/module/justifi-dispute-management.js +1 -1
- package/dist/module/justifi-header2.js +1 -1
- package/dist/module/justifi-order-terminals.js +1 -1
- package/dist/module/justifi-payment-transactions-list.js +1 -1
- package/dist/module/justifi-payments-list-filters.js +2 -2
- package/dist/module/justifi-payments-list.js +1 -1
- package/dist/module/justifi-payout-transactions-list.js +1 -1
- package/dist/module/justifi-payouts-list-filters.js +2 -2
- package/dist/module/justifi-payouts-list.js +1 -1
- package/dist/module/justifi-saved-payment-method.js +1 -1
- package/dist/module/justifi-skeleton.js +1 -1
- package/dist/module/justifi-terminal-orders-list-filters.js +2 -2
- package/dist/module/justifi-terminal-orders-list.js +1 -1
- package/dist/module/justifi-terminals-list-filters.js +1 -1
- package/dist/module/justifi-terminals-list.js +1 -1
- package/dist/module/modular-checkout.js +7 -6
- package/dist/module/package.js +1 -1
- package/dist/module/pagination-menu2.js +3 -3
- package/dist/module/payment-details-core2.js +8 -8
- package/dist/module/payment-method-option.js +1 -1
- package/dist/module/payments-list-core2.js +1 -1
- package/dist/module/payout-details-core2.js +3 -3
- package/dist/module/payouts-list-core2.js +1 -1
- 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 +1 -1
- package/dist/module/terminal-quantity-selector2.js +1 -1
- package/dist/module/terminals-list-core2.js +1 -1
- package/dist/module/tokenize-payment-method.js +1 -1
- package/dist/types/api/Checkout.d.ts +2 -0
- package/dist/types/components/modular-checkout/sub-components/apple-pay.d.ts +2 -0
- package/dist/types/components.d.ts +16 -0
- package/dist/types/store/checkout.store.d.ts +1 -0
- package/dist/webcomponents/{p-8696cf1e.entry.js → p-0217783c.entry.js} +3 -3
- package/dist/webcomponents/p-02fdd7f5.entry.js +1 -0
- package/dist/webcomponents/p-0af5269e.entry.js +1 -0
- package/dist/webcomponents/{p-b3517f18.entry.js → p-0cac8468.entry.js} +1 -1
- package/dist/webcomponents/{p-368aad3e.entry.js → p-0cf71cbd.entry.js} +1 -1
- package/dist/webcomponents/{p-8e6ae277.entry.js → p-0eb69f41.entry.js} +1 -1
- package/dist/webcomponents/{p-064578b9.entry.js → p-17abfc00.entry.js} +1 -1
- package/dist/webcomponents/{p-96cc471a.entry.js → p-24817d58.entry.js} +1 -1
- package/dist/webcomponents/p-28625e07.entry.js +1 -0
- package/dist/webcomponents/{p-f7977891.entry.js → p-293c4517.entry.js} +1 -1
- package/dist/webcomponents/p-2d300faa.entry.js +1 -0
- package/dist/webcomponents/p-2dfbbc7a.entry.js +1 -0
- package/dist/webcomponents/p-328117e4.entry.js +1 -0
- package/dist/webcomponents/{p-72e0698c.entry.js → p-32978110.entry.js} +1 -1
- package/dist/webcomponents/{p-2b1b815a.entry.js → p-37a93597.entry.js} +1 -1
- package/dist/webcomponents/{p-4941bcaf.entry.js → p-38668717.entry.js} +1 -1
- package/dist/webcomponents/{p-32b0593d.entry.js → p-3ff3bb90.entry.js} +1 -1
- package/dist/webcomponents/{p-188f921f.entry.js → p-447b55c0.entry.js} +1 -1
- package/dist/webcomponents/p-451c8e1b.entry.js +1 -0
- package/dist/webcomponents/p-47997bc2.entry.js +1 -0
- package/dist/webcomponents/{p-9f35781b.entry.js → p-50701f16.entry.js} +1 -1
- package/dist/webcomponents/{p-4633e577.entry.js → p-51ac9f40.entry.js} +1 -1
- package/dist/webcomponents/p-526b7442.entry.js +1 -0
- package/dist/webcomponents/p-5aae36f3.entry.js +1 -0
- package/dist/webcomponents/p-5bd3d86e.entry.js +1 -0
- package/dist/webcomponents/{p-25dffee2.entry.js → p-63ad8ebd.entry.js} +1 -1
- package/dist/webcomponents/p-6472b6db.entry.js +1 -0
- package/dist/webcomponents/p-6df72e0f.entry.js +1 -0
- package/dist/webcomponents/p-705dba52.entry.js +1 -0
- package/dist/webcomponents/{p-4c7b6e72.entry.js → p-78cb62a8.entry.js} +1 -1
- package/dist/webcomponents/{p-789e86ef.entry.js → p-7f018623.entry.js} +1 -1
- package/dist/webcomponents/{p-924a25d4.entry.js → p-80b2cdec.entry.js} +1 -1
- package/dist/webcomponents/p-88fcb530.entry.js +1 -0
- package/dist/webcomponents/{p-a871b38b.entry.js → p-8be7fbf6.entry.js} +1 -1
- package/dist/webcomponents/p-8ca21fab.entry.js +1 -0
- package/dist/webcomponents/{p-5ca7a03f.entry.js → p-8f84883e.entry.js} +1 -1
- package/dist/webcomponents/{p-6de344f8.entry.js → p-96694f7d.entry.js} +1 -1
- package/dist/webcomponents/p-9ad7d724.entry.js +1 -0
- package/dist/webcomponents/{p-1162b2fc.entry.js → p-9ed7b13f.entry.js} +1 -1
- package/dist/webcomponents/{p-B7TpAe2k.js → p-B6IWa9Ph.js} +1 -1
- package/dist/webcomponents/{p-BIKX2tSN.js → p-BBx_EQqR.js} +1 -1
- package/dist/webcomponents/p-BoQ6_4Ks.js +1 -0
- package/dist/webcomponents/{p-SWI5-Jo-.js → p-C0wTyoTh.js} +1 -1
- package/dist/webcomponents/{p-YXBIe5uT.js → p-C9EQ459H.js} +1 -1
- package/dist/webcomponents/{p-7663hWTF.js → p-CCmDcLao.js} +1 -1
- package/dist/webcomponents/{p-CqFjmIng.js → p-CH8Y3GSr.js} +1 -1
- package/dist/webcomponents/{p-BbbgFMaz.js → p-ClvhB3WW.js} +1 -1
- package/dist/webcomponents/{p-53MvfN19.js → p-CmBCj61h.js} +1 -1
- package/dist/webcomponents/{p-Cqe5a-d3.js → p-Cq_f4KEI.js} +1 -1
- package/dist/webcomponents/p-D0Peuz-m.js +1 -0
- package/dist/webcomponents/p-D6BImiVi.js +1 -0
- package/dist/webcomponents/p-DGsXKF67.js +1 -0
- package/dist/webcomponents/p-DOrxxtCs.js +1 -0
- package/dist/webcomponents/p-NAjz1Xfo.js +1 -0
- package/dist/webcomponents/p-RQzxYnz_.js +1 -0
- package/dist/webcomponents/p-T2yENPvU.js +1 -0
- package/dist/webcomponents/{p-2bb49747.entry.js → p-a09695c4.entry.js} +1 -1
- package/dist/webcomponents/p-a5fc94fe.entry.js +1 -0
- package/dist/webcomponents/p-abbe97eb.entry.js +1 -0
- package/dist/webcomponents/{p-f1915a72.entry.js → p-ae8ae5bb.entry.js} +1 -1
- package/dist/webcomponents/{p-b82b685d.entry.js → p-aeb22aa2.entry.js} +1 -1
- package/dist/webcomponents/p-au49QgoI.js +1 -0
- package/dist/webcomponents/{p-79a55ed5.entry.js → p-b608add9.entry.js} +1 -1
- package/dist/webcomponents/p-bb53e2e9.entry.js +1 -0
- package/dist/webcomponents/p-bc099dd0.entry.js +1 -0
- package/dist/webcomponents/{p-341eb162.entry.js → p-be5c5154.entry.js} +1 -1
- package/dist/webcomponents/{p-bcc7ebb5.entry.js → p-bf5593bb.entry.js} +1 -1
- package/dist/webcomponents/p-c12d0453.entry.js +1 -0
- package/dist/webcomponents/{p-9b14089f.entry.js → p-c644a9f1.entry.js} +1 -1
- package/dist/webcomponents/{p-fc5eeb40.entry.js → p-c9cfab30.entry.js} +1 -1
- package/dist/webcomponents/{p-22b3b0c2.entry.js → p-cc5c6425.entry.js} +1 -1
- package/dist/webcomponents/{p-507ab3f1.entry.js → p-cf26936c.entry.js} +1 -1
- package/dist/webcomponents/{p-263ee88e.entry.js → p-d0a2035f.entry.js} +1 -1
- package/dist/webcomponents/p-d1bceac6.entry.js +1 -0
- package/dist/webcomponents/p-d2b922cc.entry.js +1 -0
- package/dist/webcomponents/{p-4b1a3cf6.entry.js → p-d4476052.entry.js} +1 -1
- package/dist/webcomponents/{p-62fab960.entry.js → p-de95bf57.entry.js} +1 -1
- package/dist/webcomponents/p-e6be4e19.entry.js +1 -0
- package/dist/webcomponents/p-ec9514f8.entry.js +1 -0
- package/dist/webcomponents/p-edfeb034.entry.js +1 -0
- package/dist/webcomponents/{p-a4a57240.entry.js → p-f705fc49.entry.js} +1 -1
- package/dist/webcomponents/{p-7c7666ad.entry.js → p-fbc5fc6d.entry.js} +1 -1
- package/dist/webcomponents/p-ffefa09c.entry.js +1 -0
- package/dist/webcomponents/p-h5pyZngT.js +1 -0
- package/dist/webcomponents/{p-f6_r41aD.js → p-hbWSMN3O.js} +1 -1
- package/dist/webcomponents/p-wQgEEOq_.js +1 -0
- package/dist/webcomponents/{p-DS3KdLWS.js → p-xDbRW9xn.js} +1 -1
- package/dist/webcomponents/webcomponents.esm.js +1 -1
- package/package.json +1 -1
- package/dist/cjs/justifi-apple-pay.cjs.entry.js +0 -879
- package/dist/webcomponents/p-065999a7.entry.js +0 -1
- package/dist/webcomponents/p-145a2370.entry.js +0 -1
- package/dist/webcomponents/p-185550b1.entry.js +0 -1
- package/dist/webcomponents/p-20c42901.entry.js +0 -1
- package/dist/webcomponents/p-38f4b133.entry.js +0 -1
- package/dist/webcomponents/p-3cd7efc1.entry.js +0 -1
- package/dist/webcomponents/p-49998d80.entry.js +0 -1
- package/dist/webcomponents/p-59b4454a.entry.js +0 -1
- package/dist/webcomponents/p-6217eb14.entry.js +0 -1
- package/dist/webcomponents/p-7bdaf07c.entry.js +0 -1
- package/dist/webcomponents/p-7c4a3118.entry.js +0 -1
- package/dist/webcomponents/p-7fc37722.entry.js +0 -1
- package/dist/webcomponents/p-8948b298.entry.js +0 -1
- package/dist/webcomponents/p-97ea8a2a.entry.js +0 -1
- package/dist/webcomponents/p-98ae711c.entry.js +0 -1
- package/dist/webcomponents/p-BBzXThAT.js +0 -1
- package/dist/webcomponents/p-BCE-dTDp.js +0 -1
- package/dist/webcomponents/p-Baf5crBG.js +0 -1
- package/dist/webcomponents/p-C4AUlhx6.js +0 -1
- package/dist/webcomponents/p-D5KZeFMv.js +0 -1
- package/dist/webcomponents/p-DFEINx3E.js +0 -1
- package/dist/webcomponents/p-DlT1rYmL.js +0 -1
- package/dist/webcomponents/p-DrrHSa75.js +0 -1
- package/dist/webcomponents/p-DszoS3BO.js +0 -1
- package/dist/webcomponents/p-SPYUZxQ9.js +0 -1
- package/dist/webcomponents/p-a3a2f508.entry.js +0 -1
- package/dist/webcomponents/p-a44c1cae.entry.js +0 -1
- package/dist/webcomponents/p-a6008498.entry.js +0 -1
- package/dist/webcomponents/p-a9e7b25b.entry.js +0 -1
- package/dist/webcomponents/p-b2816bb2.entry.js +0 -1
- package/dist/webcomponents/p-b57ba0c7.entry.js +0 -1
- package/dist/webcomponents/p-b701fcf0.entry.js +0 -1
- package/dist/webcomponents/p-bcc22295.entry.js +0 -1
- package/dist/webcomponents/p-cf37b3bb.entry.js +0 -1
- package/dist/webcomponents/p-d55e5756.entry.js +0 -1
- package/dist/webcomponents/p-db03d37a.entry.js +0 -1
- package/dist/webcomponents/p-dce78317.entry.js +0 -1
- package/dist/webcomponents/p-e1e13e85.entry.js +0 -1
- package/dist/webcomponents/p-f605af1c.entry.js +0 -1
- package/dist/webcomponents/p-iT-AQTXJ.js +0 -1
package/dist/cjs/{justifi-checkout-summary_7.cjs.entry.js → justifi-apple-pay_8.cjs.entry.js}
RENAMED
|
@@ -1,15 +1,17 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
var index = require('./index-Bhtk1qkX.js');
|
|
4
|
-
var
|
|
5
|
-
var utils = require('./utils-Bab-tddY.js');
|
|
6
|
-
var checkout_store = require('./checkout.store-CS7dpzYF.js');
|
|
4
|
+
var Api = require('./Api-CjtvTD2_.js');
|
|
7
5
|
var styledHost = require('./styled-host-BSooSIhA.js');
|
|
8
6
|
require('./event-types-YOY5TKUN.js');
|
|
7
|
+
var skeleton = require('./skeleton-BvdAh448.js');
|
|
8
|
+
var checkout_store = require('./checkout.store-Bswr7kNY.js');
|
|
9
|
+
var parts = require('./parts-Pb06tUMp.js');
|
|
10
|
+
var utils = require('./utils-Bab-tddY.js');
|
|
9
11
|
var header1 = require('./header-1-D3r87SC6.js');
|
|
10
12
|
var insuranceState = require('./insurance-state-JbqYvJN3.js');
|
|
11
13
|
var header3 = require('./header-3-BFQJJgBb.js');
|
|
12
|
-
var checkPkgVersion = require('./check-pkg-version-
|
|
14
|
+
var checkPkgVersion = require('./check-pkg-version-D2O-HBMD.js');
|
|
13
15
|
require('./config-state-C7babhLh.js');
|
|
14
16
|
require('./dinero-BwNN_k7x.js');
|
|
15
17
|
var ComponentError = require('./ComponentError-D4OLnOkg.js');
|
|
@@ -19,20 +21,883 @@ require('./Business-DCRzZf0w.js');
|
|
|
19
21
|
require('./Dispute-CruQTF6_.js');
|
|
20
22
|
var utils$1 = require('./utils-DvUQQLmR.js');
|
|
21
23
|
var checkout_service = require('./checkout.service-Bc8L9ixO.js');
|
|
22
|
-
var Api = require('./Api-CjtvTD2_.js');
|
|
23
24
|
var index$1 = require('./index-C2ITzalN.js');
|
|
24
25
|
var paymentMethodOptionUtils = require('./payment-method-option-utils-WYHIHy-l.js');
|
|
25
26
|
require('./index-CWM5ions.js');
|
|
26
|
-
require('./package-
|
|
27
|
+
require('./package-B8AreocB.js');
|
|
27
28
|
require('./helpers-B5OCqlIM.js');
|
|
28
29
|
require('./state-options-CIT9xdTz.js');
|
|
29
30
|
|
|
31
|
+
var ApplePaySessionStatus;
|
|
32
|
+
(function (ApplePaySessionStatus) {
|
|
33
|
+
ApplePaySessionStatus["STATUS_SUCCESS"] = "STATUS_SUCCESS";
|
|
34
|
+
ApplePaySessionStatus["STATUS_FAILURE"] = "STATUS_FAILURE";
|
|
35
|
+
})(ApplePaySessionStatus || (ApplePaySessionStatus = {}));
|
|
36
|
+
var ApplePayButtonType;
|
|
37
|
+
(function (ApplePayButtonType) {
|
|
38
|
+
ApplePayButtonType["PLAIN"] = "plain";
|
|
39
|
+
ApplePayButtonType["BUY"] = "buy";
|
|
40
|
+
ApplePayButtonType["SET_UP"] = "set-up";
|
|
41
|
+
ApplePayButtonType["DONATE"] = "donate";
|
|
42
|
+
ApplePayButtonType["CHECK_OUT"] = "check-out";
|
|
43
|
+
ApplePayButtonType["BOOK"] = "book";
|
|
44
|
+
ApplePayButtonType["SUBSCRIBE"] = "subscribe";
|
|
45
|
+
})(ApplePayButtonType || (ApplePayButtonType = {}));
|
|
46
|
+
var ApplePayButtonStyle;
|
|
47
|
+
(function (ApplePayButtonStyle) {
|
|
48
|
+
ApplePayButtonStyle["BLACK"] = "black";
|
|
49
|
+
ApplePayButtonStyle["WHITE"] = "white";
|
|
50
|
+
ApplePayButtonStyle["WHITE_OUTLINE"] = "white-outline";
|
|
51
|
+
})(ApplePayButtonStyle || (ApplePayButtonStyle = {}));
|
|
52
|
+
var ApplePayMerchantCapability;
|
|
53
|
+
(function (ApplePayMerchantCapability) {
|
|
54
|
+
ApplePayMerchantCapability["SUPPORTS_3DS"] = "supports3DS";
|
|
55
|
+
ApplePayMerchantCapability["SUPPORTS_EMV"] = "supportsEMV";
|
|
56
|
+
ApplePayMerchantCapability["SUPPORTS_CREDIT"] = "supportsCredit";
|
|
57
|
+
ApplePayMerchantCapability["SUPPORTS_DEBIT"] = "supportsDebit";
|
|
58
|
+
})(ApplePayMerchantCapability || (ApplePayMerchantCapability = {}));
|
|
59
|
+
class ApplePayConfig {
|
|
60
|
+
constructor(data) {
|
|
61
|
+
this.merchantIdentifier = data.merchantIdentifier;
|
|
62
|
+
this.displayName = data.displayName;
|
|
63
|
+
this.initiative = data.initiative;
|
|
64
|
+
this.initiativeContext = data.initiativeContext;
|
|
65
|
+
this.buttonType = data.buttonType || ApplePayButtonType.PLAIN;
|
|
66
|
+
this.buttonStyle = data.buttonStyle || ApplePayButtonStyle.BLACK;
|
|
67
|
+
this.buttonLocale = data.buttonLocale || 'en-US';
|
|
68
|
+
}
|
|
69
|
+
get isValid() {
|
|
70
|
+
return !!(this.merchantIdentifier &&
|
|
71
|
+
this.displayName &&
|
|
72
|
+
this.initiative &&
|
|
73
|
+
this.initiativeContext);
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
class ApplePayPaymentRequest {
|
|
77
|
+
constructor(data) {
|
|
78
|
+
this.countryCode = data.countryCode;
|
|
79
|
+
this.currencyCode = data.currencyCode;
|
|
80
|
+
this.merchantCapabilities = data.merchantCapabilities;
|
|
81
|
+
this.supportedNetworks = data.supportedNetworks;
|
|
82
|
+
this.total = data.total;
|
|
83
|
+
this.lineItems = data.lineItems;
|
|
84
|
+
this.shippingMethods = data.shippingMethods;
|
|
85
|
+
this.applicationData = data.applicationData;
|
|
86
|
+
this.supportedCountries = data.supportedCountries;
|
|
87
|
+
}
|
|
88
|
+
get isValid() {
|
|
89
|
+
var _a, _b, _c, _d;
|
|
90
|
+
return !!(this.countryCode &&
|
|
91
|
+
this.currencyCode &&
|
|
92
|
+
((_a = this.merchantCapabilities) === null || _a === void 0 ? void 0 : _a.length) &&
|
|
93
|
+
((_b = this.supportedNetworks) === null || _b === void 0 ? void 0 : _b.length) &&
|
|
94
|
+
((_c = this.total) === null || _c === void 0 ? void 0 : _c.label) &&
|
|
95
|
+
((_d = this.total) === null || _d === void 0 ? void 0 : _d.amount));
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
class ApplePayHelpers {
|
|
99
|
+
static isApplePaySupported() {
|
|
100
|
+
var _a;
|
|
101
|
+
return (typeof window !== 'undefined' &&
|
|
102
|
+
'ApplePaySession' in window &&
|
|
103
|
+
((_a = window.ApplePaySession) === null || _a === void 0 ? void 0 : _a.supportsVersion(3)));
|
|
104
|
+
}
|
|
105
|
+
static canMakePayments() {
|
|
106
|
+
var _a;
|
|
107
|
+
if (!this.isApplePaySupported()) {
|
|
108
|
+
return false;
|
|
109
|
+
}
|
|
110
|
+
return ((_a = window.ApplePaySession) === null || _a === void 0 ? void 0 : _a.canMakePayments()) || false;
|
|
111
|
+
}
|
|
112
|
+
static async canMakePaymentsWithActiveCard(merchantIdentifier) {
|
|
113
|
+
var _a;
|
|
114
|
+
if (!this.isApplePaySupported()) {
|
|
115
|
+
return false;
|
|
116
|
+
}
|
|
117
|
+
try {
|
|
118
|
+
return ((await ((_a = window.ApplePaySession) === null || _a === void 0 ? void 0 : _a.canMakePaymentsWithActiveCard(merchantIdentifier))) || false);
|
|
119
|
+
}
|
|
120
|
+
catch (error) {
|
|
121
|
+
console.error('Error checking Apple Pay active card:', error);
|
|
122
|
+
return false;
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
static formatAmount(amount) {
|
|
126
|
+
return (amount / 100).toFixed(2);
|
|
127
|
+
}
|
|
128
|
+
static parseAmount(amount) {
|
|
129
|
+
return Math.round(parseFloat(amount) * 100);
|
|
130
|
+
}
|
|
131
|
+
static createLineItem(label, amount, type = 'final') {
|
|
132
|
+
return {
|
|
133
|
+
label,
|
|
134
|
+
amount: this.formatAmount(amount),
|
|
135
|
+
type,
|
|
136
|
+
};
|
|
137
|
+
}
|
|
138
|
+
static getDefaultSupportedNetworks() {
|
|
139
|
+
return ['amex', 'discover', 'masterCard', 'visa'];
|
|
140
|
+
}
|
|
141
|
+
static getDefaultMerchantCapabilities() {
|
|
142
|
+
return [
|
|
143
|
+
ApplePayMerchantCapability.SUPPORTS_3DS,
|
|
144
|
+
ApplePayMerchantCapability.SUPPORTS_EMV,
|
|
145
|
+
ApplePayMerchantCapability.SUPPORTS_CREDIT,
|
|
146
|
+
ApplePayMerchantCapability.SUPPORTS_DEBIT,
|
|
147
|
+
];
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
// Centralized error codes for Apple Pay service
|
|
152
|
+
var ApplePayServiceErrorCode;
|
|
153
|
+
(function (ApplePayServiceErrorCode) {
|
|
154
|
+
ApplePayServiceErrorCode["UNAVAILABLE"] = "UNAVAILABLE";
|
|
155
|
+
ApplePayServiceErrorCode["SESSION_ERROR"] = "SESSION_ERROR";
|
|
156
|
+
ApplePayServiceErrorCode["MERCHANT_VALIDATION_ERROR"] = "MERCHANT_VALIDATION_ERROR";
|
|
157
|
+
ApplePayServiceErrorCode["PAYMENT_PROCESSING_ERROR"] = "PAYMENT_PROCESSING_ERROR";
|
|
158
|
+
ApplePayServiceErrorCode["USER_CANCELLED"] = "USER_CANCELLED";
|
|
159
|
+
})(ApplePayServiceErrorCode || (ApplePayServiceErrorCode = {}));
|
|
160
|
+
class ApplePayService {
|
|
161
|
+
constructor() {
|
|
162
|
+
this.api = Api.Api();
|
|
163
|
+
}
|
|
164
|
+
/**
|
|
165
|
+
* Initialize Apple Pay configuration
|
|
166
|
+
*/
|
|
167
|
+
initialize(applePayConfig) {
|
|
168
|
+
this.applePayConfig = new ApplePayConfig(applePayConfig);
|
|
169
|
+
if (!this.applePayConfig.isValid) {
|
|
170
|
+
throw new Error('Invalid Apple Pay configuration provided');
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
/**
|
|
174
|
+
* Validate merchant with Apple Pay servers via API
|
|
175
|
+
*/
|
|
176
|
+
async validateMerchant(authToken, accountId) {
|
|
177
|
+
const endpoint = 'apple_pay/merchant_session';
|
|
178
|
+
try {
|
|
179
|
+
const response = await this.api.post({
|
|
180
|
+
endpoint,
|
|
181
|
+
authToken,
|
|
182
|
+
headers: {
|
|
183
|
+
'Sub-Account': accountId,
|
|
184
|
+
},
|
|
185
|
+
});
|
|
186
|
+
return response;
|
|
187
|
+
}
|
|
188
|
+
catch (error) {
|
|
189
|
+
console.error('Backend validation failed:', error);
|
|
190
|
+
throw new Error('Merchant validation failed');
|
|
191
|
+
}
|
|
192
|
+
}
|
|
193
|
+
/**
|
|
194
|
+
* Process Apple Pay payment via API (fixed to match original logic)
|
|
195
|
+
*/
|
|
196
|
+
async processPayment(authToken, accountId, payload) {
|
|
197
|
+
const endpoint = 'apple_pay/process_token';
|
|
198
|
+
const result = await this.api.post({
|
|
199
|
+
endpoint,
|
|
200
|
+
authToken,
|
|
201
|
+
body: payload,
|
|
202
|
+
headers: {
|
|
203
|
+
'Sub-Account': accountId,
|
|
204
|
+
},
|
|
205
|
+
});
|
|
206
|
+
return {
|
|
207
|
+
success: result.id && !!result.data.token,
|
|
208
|
+
data: result,
|
|
209
|
+
};
|
|
210
|
+
}
|
|
211
|
+
/**
|
|
212
|
+
* Check if Apple Pay is available on this device/browser
|
|
213
|
+
*/
|
|
214
|
+
isAvailable() {
|
|
215
|
+
return (ApplePayHelpers.isApplePaySupported() && ApplePayHelpers.canMakePayments());
|
|
216
|
+
}
|
|
217
|
+
/**
|
|
218
|
+
* Check if the user has an active card for the merchant
|
|
219
|
+
*/
|
|
220
|
+
async canMakePaymentsWithActiveCard() {
|
|
221
|
+
if (!this.applePayConfig) {
|
|
222
|
+
throw new Error('Apple Pay not initialized. Call initialize() first.');
|
|
223
|
+
}
|
|
224
|
+
return await ApplePayHelpers.canMakePaymentsWithActiveCard(this.applePayConfig.merchantIdentifier);
|
|
225
|
+
}
|
|
226
|
+
/**
|
|
227
|
+
* Start Apple Pay session
|
|
228
|
+
*/
|
|
229
|
+
async startPaymentSession(paymentRequest, authToken, accountId) {
|
|
230
|
+
// Begin verbose diagnostics for easier debugging in the field
|
|
231
|
+
console.groupCollapsed('[ApplePayService] startPaymentSession called');
|
|
232
|
+
console.log('[ApplePayService] raw paymentRequest:', JSON.stringify(paymentRequest, null, 2));
|
|
233
|
+
console.log('[ApplePayService] has authToken:', Boolean(authToken));
|
|
234
|
+
console.log('[ApplePayService] accountId:', accountId);
|
|
235
|
+
console.log('[ApplePayService] has config:', Boolean(this.applePayConfig));
|
|
236
|
+
if (!this.applePayConfig) {
|
|
237
|
+
console.error('[ApplePayService] Missing applePayConfig. Did you call initialize()?');
|
|
238
|
+
console.groupEnd();
|
|
239
|
+
throw new Error('Apple Pay not initialized. Call initialize() first.');
|
|
240
|
+
}
|
|
241
|
+
// if (!this.isAvailable()) {
|
|
242
|
+
// throw new Error('Apple Pay is not available on this device/browser');
|
|
243
|
+
// }
|
|
244
|
+
const request = new ApplePayPaymentRequest(paymentRequest);
|
|
245
|
+
console.log('[ApplePayService] created ApplePayPaymentRequest:', request);
|
|
246
|
+
if (!request.isValid) {
|
|
247
|
+
const missingFields = [];
|
|
248
|
+
if (!request.countryCode)
|
|
249
|
+
missingFields.push('countryCode');
|
|
250
|
+
if (!request.currencyCode)
|
|
251
|
+
missingFields.push('currencyCode');
|
|
252
|
+
if (!request.merchantCapabilities ||
|
|
253
|
+
request.merchantCapabilities.length === 0)
|
|
254
|
+
missingFields.push('merchantCapabilities');
|
|
255
|
+
if (!request.supportedNetworks || request.supportedNetworks.length === 0)
|
|
256
|
+
missingFields.push('supportedNetworks');
|
|
257
|
+
if (!request.total || !request.total.label || !request.total.amount)
|
|
258
|
+
missingFields.push('total');
|
|
259
|
+
console.error('[ApplePayService] Payment request is invalid. Missing/invalid:', missingFields);
|
|
260
|
+
console.groupEnd();
|
|
261
|
+
throw new Error('Invalid payment request provided');
|
|
262
|
+
}
|
|
263
|
+
this.currentPaymentRequest = request;
|
|
264
|
+
return new Promise((resolve, reject) => {
|
|
265
|
+
try {
|
|
266
|
+
console.log('[ApplePayService] About to instantiate ApplePaySession');
|
|
267
|
+
// Defensive checks for Apple Pay environment
|
|
268
|
+
if (typeof window === 'undefined' || !('ApplePaySession' in window)) {
|
|
269
|
+
console.error('[ApplePayService] ApplePaySession not available on window');
|
|
270
|
+
console.groupEnd();
|
|
271
|
+
return reject({
|
|
272
|
+
success: false,
|
|
273
|
+
error: {
|
|
274
|
+
code: ApplePayServiceErrorCode.UNAVAILABLE,
|
|
275
|
+
message: 'ApplePaySession API is not available in this environment',
|
|
276
|
+
},
|
|
277
|
+
});
|
|
278
|
+
}
|
|
279
|
+
this.currentSession = new window.ApplePaySession(3, request);
|
|
280
|
+
console.log('[ApplePayService] ApplePaySession instantiated:', this.currentSession);
|
|
281
|
+
this.setupSessionEventHandlers(resolve, reject, authToken, accountId);
|
|
282
|
+
console.log('[ApplePayService] Event handlers set. Beginning session...');
|
|
283
|
+
this.currentSession.begin();
|
|
284
|
+
console.log('[ApplePayService] Session.begin() called');
|
|
285
|
+
console.groupEnd();
|
|
286
|
+
}
|
|
287
|
+
catch (error) {
|
|
288
|
+
console.error('[ApplePayService] Exception while starting session:', error);
|
|
289
|
+
console.groupEnd();
|
|
290
|
+
reject({
|
|
291
|
+
success: false,
|
|
292
|
+
error: {
|
|
293
|
+
code: ApplePayServiceErrorCode.SESSION_ERROR,
|
|
294
|
+
message: error instanceof Error
|
|
295
|
+
? error.message
|
|
296
|
+
: 'Failed to start Apple Pay session',
|
|
297
|
+
},
|
|
298
|
+
});
|
|
299
|
+
}
|
|
300
|
+
});
|
|
301
|
+
}
|
|
302
|
+
/**
|
|
303
|
+
* Abort current Apple Pay session
|
|
304
|
+
*/
|
|
305
|
+
abortPaymentSession() {
|
|
306
|
+
if (this.currentSession) {
|
|
307
|
+
this.currentSession.abort();
|
|
308
|
+
this.currentSession = undefined;
|
|
309
|
+
this.currentPaymentRequest = undefined;
|
|
310
|
+
}
|
|
311
|
+
}
|
|
312
|
+
/**
|
|
313
|
+
* Setup Apple Pay session event handlers
|
|
314
|
+
*/
|
|
315
|
+
setupSessionEventHandlers(resolve, reject, authToken, accountId) {
|
|
316
|
+
if (!this.currentSession ||
|
|
317
|
+
!this.applePayConfig ||
|
|
318
|
+
!this.currentPaymentRequest) {
|
|
319
|
+
console.error('[ApplePayService] setupSessionEventHandlers called without required state', {
|
|
320
|
+
hasSession: Boolean(this.currentSession),
|
|
321
|
+
hasConfig: Boolean(this.applePayConfig),
|
|
322
|
+
hasPaymentRequest: Boolean(this.currentPaymentRequest),
|
|
323
|
+
});
|
|
324
|
+
return;
|
|
325
|
+
}
|
|
326
|
+
this.currentSession.onvalidatemerchant = async () => {
|
|
327
|
+
console.groupCollapsed('[ApplePayService] onvalidatemerchant');
|
|
328
|
+
try {
|
|
329
|
+
console.log('[ApplePayService] accountId:', accountId);
|
|
330
|
+
if (!authToken) {
|
|
331
|
+
console.error('[ApplePayService] Missing authToken for merchant validation');
|
|
332
|
+
throw new Error('Authentication token not provided.');
|
|
333
|
+
}
|
|
334
|
+
const merchantSession = await this.validateMerchant(authToken, accountId);
|
|
335
|
+
console.log('[ApplePayService] merchantSession received');
|
|
336
|
+
try {
|
|
337
|
+
this.currentSession.completeMerchantValidation(merchantSession);
|
|
338
|
+
console.log('[ApplePayService] completeMerchantValidation called');
|
|
339
|
+
}
|
|
340
|
+
catch (completionError) {
|
|
341
|
+
console.error('Error calling completeMerchantValidation:', completionError);
|
|
342
|
+
throw completionError;
|
|
343
|
+
}
|
|
344
|
+
}
|
|
345
|
+
catch (error) {
|
|
346
|
+
console.error('=== MERCHANT VALIDATION ERROR ===');
|
|
347
|
+
console.error('Error during merchant validation:', error);
|
|
348
|
+
if (error && error.stack) {
|
|
349
|
+
console.error('Error stack:', error.stack);
|
|
350
|
+
}
|
|
351
|
+
this.currentSession.abort();
|
|
352
|
+
reject({
|
|
353
|
+
success: false,
|
|
354
|
+
error: {
|
|
355
|
+
code: ApplePayServiceErrorCode.MERCHANT_VALIDATION_ERROR,
|
|
356
|
+
message: error instanceof Error
|
|
357
|
+
? error.message
|
|
358
|
+
: 'Merchant validation failed',
|
|
359
|
+
},
|
|
360
|
+
});
|
|
361
|
+
}
|
|
362
|
+
console.groupEnd();
|
|
363
|
+
};
|
|
364
|
+
this.currentSession.onpaymentauthorized = async (event) => {
|
|
365
|
+
var _a;
|
|
366
|
+
console.groupCollapsed('[ApplePayService] onpaymentauthorized');
|
|
367
|
+
try {
|
|
368
|
+
const payment = event.payment;
|
|
369
|
+
console.log('[ApplePayService] payment payload snapshot:', {
|
|
370
|
+
hasToken: Boolean(payment === null || payment === void 0 ? void 0 : payment.token),
|
|
371
|
+
tokenType: ((_a = payment === null || payment === void 0 ? void 0 : payment.token) === null || _a === void 0 ? void 0 : _a.paymentData) ? 'paymentData' : 'raw',
|
|
372
|
+
});
|
|
373
|
+
const paymentPayload = Object.assign(Object.assign({}, payment.token), { product_details: {
|
|
374
|
+
name: this.currentPaymentRequest.total.label,
|
|
375
|
+
price: ApplePayHelpers.parseAmount(this.currentPaymentRequest.total.amount),
|
|
376
|
+
description: this.currentPaymentRequest.total.label,
|
|
377
|
+
} });
|
|
378
|
+
console.log('[ApplePayService] paymentPayload prepared');
|
|
379
|
+
const paymentResult = await this.processPayment(authToken, accountId, paymentPayload);
|
|
380
|
+
console.log('[ApplePayService] processPayment result:', paymentResult);
|
|
381
|
+
if (paymentResult.success) {
|
|
382
|
+
this.currentSession.completePayment({
|
|
383
|
+
status: ApplePaySessionStatus.STATUS_SUCCESS,
|
|
384
|
+
});
|
|
385
|
+
console.log('[ApplePayService] Payment success; resolving');
|
|
386
|
+
resolve({
|
|
387
|
+
success: true,
|
|
388
|
+
token: payment.token,
|
|
389
|
+
paymentMethodId: paymentResult.data.id,
|
|
390
|
+
});
|
|
391
|
+
}
|
|
392
|
+
else {
|
|
393
|
+
console.error('PSP reported payment failure:', paymentResult.data);
|
|
394
|
+
this.currentSession.completePayment({
|
|
395
|
+
status: ApplePaySessionStatus.STATUS_FAILURE,
|
|
396
|
+
});
|
|
397
|
+
reject({
|
|
398
|
+
success: false,
|
|
399
|
+
error: {
|
|
400
|
+
code: ApplePayServiceErrorCode.PAYMENT_PROCESSING_ERROR,
|
|
401
|
+
message: 'Payment processing failed',
|
|
402
|
+
},
|
|
403
|
+
});
|
|
404
|
+
}
|
|
405
|
+
}
|
|
406
|
+
catch (error) {
|
|
407
|
+
console.error('=== PAYMENT PROCESSING ERROR ===');
|
|
408
|
+
console.error('Error processing payment:', error);
|
|
409
|
+
if (error && error.stack) {
|
|
410
|
+
console.error('Error stack:', error.stack);
|
|
411
|
+
}
|
|
412
|
+
this.currentSession.completePayment({
|
|
413
|
+
status: ApplePaySessionStatus.STATUS_FAILURE,
|
|
414
|
+
});
|
|
415
|
+
reject({
|
|
416
|
+
success: false,
|
|
417
|
+
error: {
|
|
418
|
+
code: ApplePayServiceErrorCode.PAYMENT_PROCESSING_ERROR,
|
|
419
|
+
message: error instanceof Error
|
|
420
|
+
? error.message
|
|
421
|
+
: 'Payment processing failed',
|
|
422
|
+
},
|
|
423
|
+
});
|
|
424
|
+
}
|
|
425
|
+
finally {
|
|
426
|
+
console.log('[ApplePayService] Cleaning up session state');
|
|
427
|
+
this.currentSession = undefined;
|
|
428
|
+
this.currentPaymentRequest = undefined;
|
|
429
|
+
}
|
|
430
|
+
console.groupEnd();
|
|
431
|
+
};
|
|
432
|
+
this.currentSession.onpaymentmethodselected = () => {
|
|
433
|
+
console.groupCollapsed('[ApplePayService] onpaymentmethodselected');
|
|
434
|
+
const paymentUpdate = {
|
|
435
|
+
newTotal: this.currentPaymentRequest.total,
|
|
436
|
+
newLineItems: this.currentPaymentRequest.lineItems || [],
|
|
437
|
+
};
|
|
438
|
+
try {
|
|
439
|
+
this.currentSession.completePaymentMethodSelection(paymentUpdate);
|
|
440
|
+
console.log('[ApplePayService] completePaymentMethodSelection called');
|
|
441
|
+
}
|
|
442
|
+
catch (error) {
|
|
443
|
+
console.error('Error completing payment method selection:', error);
|
|
444
|
+
this.currentSession.abort();
|
|
445
|
+
}
|
|
446
|
+
console.groupEnd();
|
|
447
|
+
};
|
|
448
|
+
this.currentSession.onshippingmethodselected = () => {
|
|
449
|
+
console.groupCollapsed('[ApplePayService] onshippingmethodselected');
|
|
450
|
+
this.currentSession.completeShippingMethodSelection({
|
|
451
|
+
status: ApplePaySessionStatus.STATUS_SUCCESS,
|
|
452
|
+
newTotal: this.currentPaymentRequest.total,
|
|
453
|
+
newLineItems: this.currentPaymentRequest.lineItems || [],
|
|
454
|
+
});
|
|
455
|
+
console.log('[ApplePayService] completeShippingMethodSelection called');
|
|
456
|
+
console.groupEnd();
|
|
457
|
+
};
|
|
458
|
+
this.currentSession.oncancel = (event) => {
|
|
459
|
+
console.groupCollapsed('[ApplePayService] oncancel');
|
|
460
|
+
if (event.sessionError) {
|
|
461
|
+
console.error(event.sessionError);
|
|
462
|
+
switch (event.sessionError.code) {
|
|
463
|
+
case 'unknown':
|
|
464
|
+
console.error('Unknown error - likely merchant validation issue');
|
|
465
|
+
console.error('This usually means:');
|
|
466
|
+
console.error('1. Merchant certificate is invalid or expired');
|
|
467
|
+
console.error('2. Merchant identifier mismatch');
|
|
468
|
+
console.error('3. Backend validation endpoint issues');
|
|
469
|
+
break;
|
|
470
|
+
case 'invalidMerchantSession':
|
|
471
|
+
console.error('Invalid merchant session provided');
|
|
472
|
+
console.error('Check that the merchant session from backend is valid');
|
|
473
|
+
break;
|
|
474
|
+
case 'userCancel':
|
|
475
|
+
console.error('User cancelled the payment');
|
|
476
|
+
break;
|
|
477
|
+
default:
|
|
478
|
+
console.error('Other error code:', event.sessionError.code);
|
|
479
|
+
}
|
|
480
|
+
}
|
|
481
|
+
this.currentSession = undefined;
|
|
482
|
+
this.currentPaymentRequest = undefined;
|
|
483
|
+
reject({
|
|
484
|
+
success: false,
|
|
485
|
+
error: {
|
|
486
|
+
code: ApplePayServiceErrorCode.USER_CANCELLED,
|
|
487
|
+
message: 'User cancelled the Apple Pay session',
|
|
488
|
+
},
|
|
489
|
+
});
|
|
490
|
+
console.groupEnd();
|
|
491
|
+
};
|
|
492
|
+
if ('onerror' in this.currentSession) {
|
|
493
|
+
this.currentSession.onerror = (error) => {
|
|
494
|
+
console.groupCollapsed('[ApplePayService] onerror');
|
|
495
|
+
console.error('=== APPLE PAY SESSION ERROR ===');
|
|
496
|
+
console.error('Session error:', error);
|
|
497
|
+
this.currentSession = undefined;
|
|
498
|
+
this.currentPaymentRequest = undefined;
|
|
499
|
+
reject({
|
|
500
|
+
success: false,
|
|
501
|
+
error: {
|
|
502
|
+
code: ApplePayServiceErrorCode.SESSION_ERROR,
|
|
503
|
+
message: 'Apple Pay session error occurred',
|
|
504
|
+
},
|
|
505
|
+
});
|
|
506
|
+
console.groupEnd();
|
|
507
|
+
};
|
|
508
|
+
}
|
|
509
|
+
}
|
|
510
|
+
/**
|
|
511
|
+
* Create a basic payment request
|
|
512
|
+
*/
|
|
513
|
+
static createPaymentRequest(amount, label, countryCode = 'US', currencyCode = 'USD') {
|
|
514
|
+
return {
|
|
515
|
+
countryCode,
|
|
516
|
+
currencyCode,
|
|
517
|
+
merchantCapabilities: ApplePayHelpers.getDefaultMerchantCapabilities(),
|
|
518
|
+
supportedNetworks: ApplePayHelpers.getDefaultSupportedNetworks(),
|
|
519
|
+
total: ApplePayHelpers.createLineItem(label, amount),
|
|
520
|
+
};
|
|
521
|
+
}
|
|
522
|
+
/**
|
|
523
|
+
* Get current configuration
|
|
524
|
+
*/
|
|
525
|
+
getApplePayConfig() {
|
|
526
|
+
return this.applePayConfig;
|
|
527
|
+
}
|
|
528
|
+
}
|
|
529
|
+
|
|
530
|
+
const ApplePaySkeleton = (props) => {
|
|
531
|
+
const { isLoading } = props;
|
|
532
|
+
if (!isLoading) {
|
|
533
|
+
return null;
|
|
534
|
+
}
|
|
535
|
+
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" } })))));
|
|
536
|
+
};
|
|
537
|
+
|
|
538
|
+
const ProcessingSpinner = () => (index.h("div", { class: 'processing-overlay' }, index.h("div", { class: 'spinner' }), index.h("span", null, "Processing...")));
|
|
539
|
+
const ApplePayButton = (props) => {
|
|
540
|
+
const getApplePayButtonClass = () => {
|
|
541
|
+
let classes = "apple-pay-button";
|
|
542
|
+
switch (props.buttonStyle) {
|
|
543
|
+
case ApplePayButtonStyle.WHITE:
|
|
544
|
+
classes += " apple-pay-button-white";
|
|
545
|
+
break;
|
|
546
|
+
case ApplePayButtonStyle.WHITE_OUTLINE:
|
|
547
|
+
classes += " apple-pay-button-white-outline";
|
|
548
|
+
break;
|
|
549
|
+
case ApplePayButtonStyle.BLACK:
|
|
550
|
+
default:
|
|
551
|
+
classes += " apple-pay-button-black";
|
|
552
|
+
break;
|
|
553
|
+
}
|
|
554
|
+
switch (props.buttonType) {
|
|
555
|
+
case ApplePayButtonType.BUY:
|
|
556
|
+
classes += " apple-pay-button-type-buy";
|
|
557
|
+
break;
|
|
558
|
+
case ApplePayButtonType.DONATE:
|
|
559
|
+
classes += " apple-pay-button-type-donate";
|
|
560
|
+
break;
|
|
561
|
+
case ApplePayButtonType.PLAIN:
|
|
562
|
+
default:
|
|
563
|
+
classes += " apple-pay-button-type-plain";
|
|
564
|
+
break;
|
|
565
|
+
}
|
|
566
|
+
if (props.disabled || props.isProcessing || !props.isAvailable) {
|
|
567
|
+
classes += " disabled";
|
|
568
|
+
}
|
|
569
|
+
return classes;
|
|
570
|
+
};
|
|
571
|
+
const handleClick = () => {
|
|
572
|
+
if (!props.disabled &&
|
|
573
|
+
!props.isProcessing &&
|
|
574
|
+
props.isAvailable &&
|
|
575
|
+
props.clickHandler) {
|
|
576
|
+
props.clickHandler();
|
|
577
|
+
}
|
|
578
|
+
};
|
|
579
|
+
return (index.h("div", { class: 'apple-pay-button-container' }, index.h("button", Object.assign({ class: getApplePayButtonClass(), style: {
|
|
580
|
+
width: props.width,
|
|
581
|
+
height: props.height,
|
|
582
|
+
}, 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, `
|
|
583
|
+
.apple-pay-button-container {
|
|
584
|
+
display: inline-block;
|
|
585
|
+
position: relative;
|
|
586
|
+
}
|
|
587
|
+
|
|
588
|
+
/* Apple Pay CSS classes - these are the official Apple Pay button styles */
|
|
589
|
+
.apple-pay-button {
|
|
590
|
+
display: inline-block;
|
|
591
|
+
-webkit-appearance: -apple-pay-button;
|
|
592
|
+
-apple-pay-button-type: plain; /* default */
|
|
593
|
+
-apple-pay-button-style: black; /* default */
|
|
594
|
+
border-radius: 8px;
|
|
595
|
+
cursor: pointer;
|
|
596
|
+
border: none;
|
|
597
|
+
outline: none;
|
|
598
|
+
transition: opacity 0.2s ease;
|
|
599
|
+
position: relative;
|
|
600
|
+
}
|
|
601
|
+
|
|
602
|
+
/* Button styles */
|
|
603
|
+
.apple-pay-button.apple-pay-button-black {
|
|
604
|
+
-apple-pay-button-style: black;
|
|
605
|
+
}
|
|
606
|
+
|
|
607
|
+
.apple-pay-button.apple-pay-button-white {
|
|
608
|
+
-apple-pay-button-style: white;
|
|
609
|
+
}
|
|
610
|
+
|
|
611
|
+
.apple-pay-button.apple-pay-button-white-outline {
|
|
612
|
+
-apple-pay-button-style: white-outline;
|
|
613
|
+
}
|
|
614
|
+
|
|
615
|
+
/* Button types */
|
|
616
|
+
.apple-pay-button.apple-pay-button-type-plain {
|
|
617
|
+
-apple-pay-button-type: plain;
|
|
618
|
+
}
|
|
619
|
+
|
|
620
|
+
.apple-pay-button.apple-pay-button-type-buy {
|
|
621
|
+
-apple-pay-button-type: buy;
|
|
622
|
+
}
|
|
623
|
+
|
|
624
|
+
.apple-pay-button.apple-pay-button-type-donate {
|
|
625
|
+
-apple-pay-button-type: donate;
|
|
626
|
+
}
|
|
627
|
+
|
|
628
|
+
/* Hover and disabled states */
|
|
629
|
+
.apple-pay-button:hover:not(.disabled) {
|
|
630
|
+
opacity: 0.9;
|
|
631
|
+
}
|
|
632
|
+
|
|
633
|
+
.apple-pay-button.disabled {
|
|
634
|
+
opacity: 0.5;
|
|
635
|
+
cursor: not-allowed;
|
|
636
|
+
}
|
|
637
|
+
|
|
638
|
+
/* Processing overlay */
|
|
639
|
+
.processing-overlay {
|
|
640
|
+
position: absolute;
|
|
641
|
+
top: 0;
|
|
642
|
+
left: 0;
|
|
643
|
+
right: 0;
|
|
644
|
+
bottom: 0;
|
|
645
|
+
display: flex;
|
|
646
|
+
align-items: center;
|
|
647
|
+
justify-content: center;
|
|
648
|
+
gap: 8px;
|
|
649
|
+
background: rgba(0, 0, 0, 0.8);
|
|
650
|
+
color: white;
|
|
651
|
+
border-radius: 8px;
|
|
652
|
+
font-size: 14px;
|
|
653
|
+
font-weight: 500;
|
|
654
|
+
}
|
|
655
|
+
|
|
656
|
+
.spinner {
|
|
657
|
+
width: 16px;
|
|
658
|
+
height: 16px;
|
|
659
|
+
border: 2px solid rgba(255, 255, 255, 0.3);
|
|
660
|
+
border-top: 2px solid #fff;
|
|
661
|
+
border-radius: 50%;
|
|
662
|
+
animation: spin 1s linear infinite;
|
|
663
|
+
}
|
|
664
|
+
|
|
665
|
+
@keyframes spin {
|
|
666
|
+
0% { transform: rotate(0deg); }
|
|
667
|
+
100% { transform: rotate(360deg); }
|
|
668
|
+
}
|
|
669
|
+
|
|
670
|
+
/* Responsive design */
|
|
671
|
+
@media (max-width: 480px) {
|
|
672
|
+
.apple-pay-button {
|
|
673
|
+
width: 100% !important;
|
|
674
|
+
min-width: 200px;
|
|
675
|
+
}
|
|
676
|
+
}
|
|
677
|
+
`)));
|
|
678
|
+
};
|
|
679
|
+
|
|
680
|
+
const ApplePay = class {
|
|
681
|
+
constructor(hostRef) {
|
|
682
|
+
index.registerInstance(this, hostRef);
|
|
683
|
+
this.applePayStarted = index.createEvent(this, "applePayStarted");
|
|
684
|
+
this.applePayCompleted = index.createEvent(this, "applePayCompleted");
|
|
685
|
+
this.applePayCancelled = index.createEvent(this, "applePayCancelled");
|
|
686
|
+
this.applePayError = index.createEvent(this, "applePayError");
|
|
687
|
+
this.countryCode = "US";
|
|
688
|
+
this.merchantIdentifier = "merchant.com.staging-justifi.checkout-dev";
|
|
689
|
+
this.merchantDisplayName = "JustiFi Checkout";
|
|
690
|
+
this.initiativeContext = "dev-checkout.justifi-staging.com";
|
|
691
|
+
this.buttonType = ApplePayButtonType.PLAIN;
|
|
692
|
+
this.buttonStyle = ApplePayButtonStyle.BLACK;
|
|
693
|
+
this.disabled = false;
|
|
694
|
+
this.showSkeleton = true;
|
|
695
|
+
this.width = "100%";
|
|
696
|
+
this.height = "48px";
|
|
697
|
+
this.isLoading = true;
|
|
698
|
+
this.isProcessing = false;
|
|
699
|
+
this.isAvailable = false;
|
|
700
|
+
this.canMakePayments = false;
|
|
701
|
+
this.isConfigValid = true;
|
|
702
|
+
this.error = null;
|
|
703
|
+
this.handleApplePayClick = async () => {
|
|
704
|
+
var _a, _b;
|
|
705
|
+
if (this.isProcessing || this.disabled || !this.isAvailable) {
|
|
706
|
+
return;
|
|
707
|
+
}
|
|
708
|
+
try {
|
|
709
|
+
this.isProcessing = true;
|
|
710
|
+
this.error = null;
|
|
711
|
+
this.applePayStarted.emit();
|
|
712
|
+
console.groupCollapsed('[ApplePay Component] handleApplePayClick');
|
|
713
|
+
console.log('[ApplePay Component] click context:', {
|
|
714
|
+
isProcessing: this.isProcessing,
|
|
715
|
+
disabled: this.disabled,
|
|
716
|
+
isAvailable: this.isAvailable,
|
|
717
|
+
canMakePayments: this.canMakePayments,
|
|
718
|
+
hasService: Boolean(this.applePayService),
|
|
719
|
+
});
|
|
720
|
+
const paymentRequest = {
|
|
721
|
+
countryCode: this.countryCode,
|
|
722
|
+
currencyCode: checkout_store.checkoutStore.paymentCurrency,
|
|
723
|
+
merchantCapabilities: [
|
|
724
|
+
ApplePayMerchantCapability.SUPPORTS_3DS,
|
|
725
|
+
ApplePayMerchantCapability.SUPPORTS_CREDIT,
|
|
726
|
+
ApplePayMerchantCapability.SUPPORTS_DEBIT,
|
|
727
|
+
],
|
|
728
|
+
supportedNetworks: ApplePayHelpers.getDefaultSupportedNetworks(),
|
|
729
|
+
total: ApplePayHelpers.createLineItem(checkout_store.checkoutStore.paymentDescription, checkout_store.checkoutStore.paymentAmount),
|
|
730
|
+
};
|
|
731
|
+
console.log("[ApplePay Component] paymentRequest", paymentRequest);
|
|
732
|
+
console.log('[ApplePay Component] identifiers snapshot:', {
|
|
733
|
+
authTokenLength: checkout_store.checkoutStore.authToken ? String(checkout_store.checkoutStore.authToken).length : 0,
|
|
734
|
+
accountId: checkout_store.checkoutStore.accountId,
|
|
735
|
+
});
|
|
736
|
+
const result = await this.applePayService.startPaymentSession(paymentRequest, checkout_store.checkoutStore.authToken, checkout_store.checkoutStore.accountId);
|
|
737
|
+
console.log("[ApplePay Component] startPaymentSession result", result);
|
|
738
|
+
if (result.success) {
|
|
739
|
+
this.applePayCompleted.emit({
|
|
740
|
+
success: true,
|
|
741
|
+
token: result.token,
|
|
742
|
+
paymentMethodId: result.paymentMethodId,
|
|
743
|
+
});
|
|
744
|
+
}
|
|
745
|
+
else {
|
|
746
|
+
this.applePayCompleted.emit({
|
|
747
|
+
success: false,
|
|
748
|
+
error: result.error,
|
|
749
|
+
});
|
|
750
|
+
this.applePayError.emit({
|
|
751
|
+
error: ((_a = result.error) === null || _a === void 0 ? void 0 : _a.message) || "Payment failed",
|
|
752
|
+
code: ((_b = result.error) === null || _b === void 0 ? void 0 : _b.code) || ApplePay.ErrorCode.PAYMENT_FAILED,
|
|
753
|
+
});
|
|
754
|
+
}
|
|
755
|
+
}
|
|
756
|
+
catch (error) {
|
|
757
|
+
const errorMessage = error instanceof Error ? error.message : "Payment failed";
|
|
758
|
+
this.error = errorMessage;
|
|
759
|
+
this.applePayError.emit({ error: errorMessage, code: ApplePay.ErrorCode.PAYMENT_FAILED });
|
|
760
|
+
this.applePayCompleted.emit({
|
|
761
|
+
success: false,
|
|
762
|
+
error: errorMessage,
|
|
763
|
+
});
|
|
764
|
+
}
|
|
765
|
+
finally {
|
|
766
|
+
this.isProcessing = false;
|
|
767
|
+
console.groupEnd();
|
|
768
|
+
}
|
|
769
|
+
};
|
|
770
|
+
}
|
|
771
|
+
async initializeApplePay() {
|
|
772
|
+
try {
|
|
773
|
+
this.isLoading = true;
|
|
774
|
+
this.error = null;
|
|
775
|
+
this.isConfigValid = true;
|
|
776
|
+
console.groupCollapsed('[ApplePay Component] initializeApplePay');
|
|
777
|
+
console.log('[ApplePay Component] checkout state snapshot:', {
|
|
778
|
+
paymentAmount: checkout_store.checkoutStore.paymentAmount,
|
|
779
|
+
paymentCurrency: checkout_store.checkoutStore.paymentCurrency,
|
|
780
|
+
hasAuthToken: Boolean(checkout_store.checkoutStore.authToken),
|
|
781
|
+
accountId: checkout_store.checkoutStore.accountId,
|
|
782
|
+
});
|
|
783
|
+
const hasRequiredConfig = Boolean(checkout_store.checkoutStore.paymentAmount) &&
|
|
784
|
+
Boolean(checkout_store.checkoutStore.paymentCurrency) &&
|
|
785
|
+
Boolean(checkout_store.checkoutStore.authToken);
|
|
786
|
+
if (!hasRequiredConfig) {
|
|
787
|
+
this.error = "Missing required Apple Pay configuration";
|
|
788
|
+
this.isConfigValid = false;
|
|
789
|
+
console.error("Apple Pay config error: missing required values", {
|
|
790
|
+
paymentAmount: checkout_store.checkoutStore.paymentAmount,
|
|
791
|
+
paymentCurrency: checkout_store.checkoutStore.paymentCurrency,
|
|
792
|
+
hasAuthToken: Boolean(checkout_store.checkoutStore.authToken),
|
|
793
|
+
accountId: checkout_store.checkoutStore.accountId,
|
|
794
|
+
});
|
|
795
|
+
this.applePayError.emit({ error: this.error, code: ApplePay.ErrorCode.CONFIG_ERROR });
|
|
796
|
+
this.isLoading = false;
|
|
797
|
+
console.groupEnd();
|
|
798
|
+
return;
|
|
799
|
+
}
|
|
800
|
+
this.isAvailable = ApplePayHelpers.isApplePaySupported();
|
|
801
|
+
this.canMakePayments = ApplePayHelpers.canMakePayments();
|
|
802
|
+
console.log('[ApplePay Component] support check:', {
|
|
803
|
+
isAvailable: this.isAvailable,
|
|
804
|
+
canMakePayments: this.canMakePayments,
|
|
805
|
+
hasApplePaySessionOnWindow: typeof window !== 'undefined' && 'ApplePaySession' in window,
|
|
806
|
+
});
|
|
807
|
+
if (!this.isAvailable) {
|
|
808
|
+
this.error = "Apple Pay is not supported on this device";
|
|
809
|
+
console.error(this.error);
|
|
810
|
+
this.applePayError.emit({ error: this.error, code: ApplePay.ErrorCode.NOT_SUPPORTED });
|
|
811
|
+
this.isLoading = false;
|
|
812
|
+
console.groupEnd();
|
|
813
|
+
return;
|
|
814
|
+
}
|
|
815
|
+
if (!this.canMakePayments) {
|
|
816
|
+
this.error = "Apple Pay is not available";
|
|
817
|
+
console.error(this.error);
|
|
818
|
+
this.applePayError.emit({ error: this.error, code: ApplePay.ErrorCode.NOT_AVAILABLE });
|
|
819
|
+
this.isLoading = false;
|
|
820
|
+
console.groupEnd();
|
|
821
|
+
return;
|
|
822
|
+
}
|
|
823
|
+
const applePayConfig = {
|
|
824
|
+
merchantIdentifier: this.merchantIdentifier,
|
|
825
|
+
displayName: this.merchantDisplayName,
|
|
826
|
+
initiative: "web",
|
|
827
|
+
initiativeContext: this.initiativeContext,
|
|
828
|
+
buttonType: this.buttonType,
|
|
829
|
+
buttonStyle: this.buttonStyle,
|
|
830
|
+
};
|
|
831
|
+
console.log('[ApplePay Component] initializing service with config:', applePayConfig);
|
|
832
|
+
this.applePayService = new ApplePayService();
|
|
833
|
+
this.applePayService.initialize(applePayConfig);
|
|
834
|
+
const hasActiveCard = await this.applePayService.canMakePaymentsWithActiveCard();
|
|
835
|
+
if (!hasActiveCard) {
|
|
836
|
+
console.warn("No Apple Pay cards available, but continuing...");
|
|
837
|
+
}
|
|
838
|
+
}
|
|
839
|
+
catch (error) {
|
|
840
|
+
console.error("Apple Pay initialization error:", error);
|
|
841
|
+
this.error =
|
|
842
|
+
error instanceof Error
|
|
843
|
+
? error.message
|
|
844
|
+
: "Failed to initialize Apple Pay";
|
|
845
|
+
this.applePayError.emit({ error: this.error, code: ApplePay.ErrorCode.INITIALIZATION_ERROR });
|
|
846
|
+
}
|
|
847
|
+
finally {
|
|
848
|
+
this.isLoading = false;
|
|
849
|
+
console.groupEnd();
|
|
850
|
+
}
|
|
851
|
+
}
|
|
852
|
+
async isSupported() {
|
|
853
|
+
return this.isAvailable && this.canMakePayments;
|
|
854
|
+
}
|
|
855
|
+
async getPaymentMethods() {
|
|
856
|
+
if (!this.isAvailable) {
|
|
857
|
+
return [];
|
|
858
|
+
}
|
|
859
|
+
return ApplePayHelpers.getDefaultSupportedNetworks();
|
|
860
|
+
}
|
|
861
|
+
async abort() {
|
|
862
|
+
this.applePayService.abortPaymentSession();
|
|
863
|
+
this.isProcessing = false;
|
|
864
|
+
this.applePayCancelled.emit();
|
|
865
|
+
}
|
|
866
|
+
render() {
|
|
867
|
+
if (!checkout_store.checkoutStore.applePayEnabled) {
|
|
868
|
+
// Render nothing when Apple Pay is disabled at the checkout settings level
|
|
869
|
+
console.log('[ApplePay Component] Apple Pay disabled in checkout settings; not rendering');
|
|
870
|
+
return null;
|
|
871
|
+
}
|
|
872
|
+
const isReady = !this.isLoading &&
|
|
873
|
+
this.isAvailable &&
|
|
874
|
+
this.canMakePayments &&
|
|
875
|
+
this.isConfigValid;
|
|
876
|
+
return (index.h(styledHost.StyledHost, null, checkout_store.checkoutStore.checkoutLoaded && (index.h("script", { async: true, src: 'https://applepay.cdn-apple.com/jsapi/1.latest/apple-pay-sdk.js', onLoad: () => {
|
|
877
|
+
console.log('[ApplePay Component] Apple Pay SDK script loaded');
|
|
878
|
+
this.initializeApplePay();
|
|
879
|
+
} })), 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, `
|
|
880
|
+
.apple-pay-container {
|
|
881
|
+
width: 100%;
|
|
882
|
+
}
|
|
883
|
+
`)));
|
|
884
|
+
}
|
|
885
|
+
};
|
|
886
|
+
// Centralized error codes for the Apple Pay component layer
|
|
887
|
+
ApplePay.ErrorCode = {
|
|
888
|
+
CONFIG_ERROR: 'CONFIG_ERROR',
|
|
889
|
+
NOT_SUPPORTED: 'NOT_SUPPORTED',
|
|
890
|
+
NOT_AVAILABLE: 'NOT_AVAILABLE',
|
|
891
|
+
INITIALIZATION_ERROR: 'INITIALIZATION_ERROR',
|
|
892
|
+
PAYMENT_FAILED: 'PAYMENT_FAILED',
|
|
893
|
+
};
|
|
894
|
+
|
|
30
895
|
const Summary = class {
|
|
31
896
|
constructor(hostRef) {
|
|
32
897
|
index.registerInstance(this, hostRef);
|
|
33
898
|
}
|
|
34
899
|
render() {
|
|
35
|
-
return (index.h(styledHost.StyledHost, { key: '
|
|
900
|
+
return (index.h(styledHost.StyledHost, { key: 'abd92b499208321582b08a490c78c9167be2ebd4' }, index.h("section", { key: '38e15cef5a19a43249d7ecf3d4eb4ea8e032f248' }, index.h("div", { key: '747f811012ed9707265369e59dbde8cd7ad3bca6' }, index.h("div", { key: '8575f50759664d5c64d235025699c81f055267ca', part: parts.text }, checkout_store.checkoutStore === null || checkout_store.checkoutStore === void 0 ? void 0 : checkout_store.checkoutStore.paymentDescription), index.h("div", { key: 'af77776bbe21bce77586447bbf445e4c5d8c1165' }, index.h("span", { key: '5cdaaec454118197b3e37a942d83907e72444342', part: parts.text }, "Total"), "\u00A0", index.h("span", { key: 'ccc35217ac9740d5a00b7abbcec4133848afcc28', part: parts.text }, utils.formatCurrency(+(checkout_store.checkoutStore === null || checkout_store.checkoutStore === void 0 ? void 0 : checkout_store.checkoutStore.totalAmount))))))));
|
|
36
901
|
}
|
|
37
902
|
};
|
|
38
903
|
|
|
@@ -48,7 +913,7 @@ const Header = class {
|
|
|
48
913
|
}
|
|
49
914
|
render() {
|
|
50
915
|
const HeaderComponent = this.levels[this.level];
|
|
51
|
-
return (index.h(styledHost.StyledHost, { key: '
|
|
916
|
+
return (index.h(styledHost.StyledHost, { key: 'e1d39365c2ff2c291a42b53d6bcbe1d97d602778' }, index.h(HeaderComponent, { key: '0b8c8c3a42ff2151e3b293cafeeaeda72e94d767', text: this.text, class: this.class })));
|
|
52
917
|
}
|
|
53
918
|
};
|
|
54
919
|
|
|
@@ -250,7 +1115,7 @@ const ModularCheckout = class {
|
|
|
250
1115
|
}
|
|
251
1116
|
}
|
|
252
1117
|
updateStore(checkout) {
|
|
253
|
-
var _a, _b, _c, _d, _e;
|
|
1118
|
+
var _a, _b, _c, _d, _e, _f;
|
|
254
1119
|
checkout_store.checkoutStore.accountId = checkout.account_id;
|
|
255
1120
|
checkout_store.checkoutStore.checkoutLoaded = true;
|
|
256
1121
|
checkout_store.checkoutStore.paymentMethods = checkout.payment_methods.map((paymentMethod) => new index$1.PaymentMethod(paymentMethod));
|
|
@@ -261,11 +1126,12 @@ const ModularCheckout = class {
|
|
|
261
1126
|
checkout_store.checkoutStore.bnplEnabled = checkout.payment_settings.bnpl_payments;
|
|
262
1127
|
checkout_store.checkoutStore.insuranceEnabled = checkout.payment_settings.insurance_payments;
|
|
263
1128
|
checkout_store.checkoutStore.bankAccountVerification = (_a = checkout.payment_settings) === null || _a === void 0 ? void 0 : _a.bank_account_verification;
|
|
264
|
-
checkout_store.checkoutStore.
|
|
265
|
-
checkout_store.checkoutStore.
|
|
266
|
-
checkout_store.checkoutStore.
|
|
1129
|
+
checkout_store.checkoutStore.applePayEnabled = Boolean((_b = checkout.payment_settings) === null || _b === void 0 ? void 0 : _b.apple_payments);
|
|
1130
|
+
checkout_store.checkoutStore.bnplProviderClientId = (_c = checkout === null || checkout === void 0 ? void 0 : checkout.bnpl) === null || _c === void 0 ? void 0 : _c.provider_client_id;
|
|
1131
|
+
checkout_store.checkoutStore.bnplProviderMode = (_d = checkout === null || checkout === void 0 ? void 0 : checkout.bnpl) === null || _d === void 0 ? void 0 : _d.provider_mode;
|
|
1132
|
+
checkout_store.checkoutStore.bnplProviderApiVersion = (_e = checkout === null || checkout === void 0 ? void 0 : checkout.bnpl) === null || _e === void 0 ? void 0 : _e.provider_api_version;
|
|
267
1133
|
checkout_store.checkoutStore.bnplProviderCheckoutUrl =
|
|
268
|
-
(
|
|
1134
|
+
(_f = checkout === null || checkout === void 0 ? void 0 : checkout.bnpl) === null || _f === void 0 ? void 0 : _f.provider_checkout_url;
|
|
269
1135
|
}
|
|
270
1136
|
emitCheckoutChanged() {
|
|
271
1137
|
const detail = {
|
|
@@ -476,7 +1342,7 @@ const ModularCheckout = class {
|
|
|
476
1342
|
});
|
|
477
1343
|
}
|
|
478
1344
|
render() {
|
|
479
|
-
return index.h(index.Host, { key: '
|
|
1345
|
+
return index.h(index.Host, { key: '63acafa8f4819ac63e564807779976e352ccbdfb' });
|
|
480
1346
|
}
|
|
481
1347
|
get hostEl() { return index.getElement(this); }
|
|
482
1348
|
};
|
|
@@ -1417,7 +2283,7 @@ const TokenizePaymentMethod = class {
|
|
|
1417
2283
|
return paymentMethodType === index$1.PAYMENT_METHODS.NEW_CARD ? (index.h("justifi-card-form", { ref: (el) => (this.paymentMethodFormRef = el) })) : (index.h("justifi-bank-account-form", { ref: (el) => (this.paymentMethodFormRef = el) }));
|
|
1418
2284
|
}
|
|
1419
2285
|
render() {
|
|
1420
|
-
return (index.h(styledHost.StyledHost, { key: '
|
|
2286
|
+
return (index.h(styledHost.StyledHost, { key: 'bf221d17739bf70c3f581f3b9791a725e76c3f35' }, index.h("form", { key: 'df117d42d4160f31df1fca5d6903967cc48ad573' }, index.h("fieldset", { key: '550e670feffb405c669d44c44eb9073f535c6cb6' }, index.h("div", { key: '8eff7d3ab19618da54161220b92641bf19bfa82d', class: "row gy-3" }, index.h("div", { key: 'bf9d19e92be74abf48ce65c97efb3f9df52d4c3c', class: "col-12" }, this.availablePaymentMethods.map((method) => this.renderPaymentMethodOption(method))), index.h("div", { key: 'eef1f4e1e03c2263efb51ae94085c5a3d73a9166', class: "col-12" }, index.h("justifi-button", { key: 'f0e5697e658236610da45c34e64a8cbb3f0f9d95', text: this.submitButtonText, variant: "primary", type: "submit", clickHandler: (e) => this.tokenizePaymentMethod(e), isLoading: this.isLoading, "data-testid": "submit-button", hidden: this.computedHideSubmitButton })))))));
|
|
1421
2287
|
}
|
|
1422
2288
|
get host() { return index.getElement(this); }
|
|
1423
2289
|
static get watchers() { return {
|
|
@@ -1426,6 +2292,7 @@ const TokenizePaymentMethod = class {
|
|
|
1426
2292
|
}; }
|
|
1427
2293
|
};
|
|
1428
2294
|
|
|
2295
|
+
exports.justifi_apple_pay = ApplePay;
|
|
1429
2296
|
exports.justifi_checkout_summary = Summary;
|
|
1430
2297
|
exports.justifi_header = Header;
|
|
1431
2298
|
exports.justifi_modular_checkout = ModularCheckout;
|