@justifi/webcomponents 6.0.0-rc.5 → 6.0.0-rc.6
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/{Api-CPuq_15r.js → Api-y2G49jOh.js} +1 -1
- package/dist/cjs/{Refund-CqWNG8sx.js → Refund-BVZHsa6Z.js} +5 -4
- package/dist/cjs/additional-questions-details_5.cjs.entry.js +2 -2
- package/dist/cjs/{badge-CMmPvqtE.js → badge-CcJ9H85-.js} +1 -1
- package/dist/cjs/bank-account-document-form-inputs_4.cjs.entry.js +8 -8
- package/dist/cjs/bank-account-form.cjs.entry.js +6 -6
- package/dist/cjs/business-details-core.cjs.entry.js +4 -4
- package/dist/cjs/{business.service-C3BdUPlm.js → business.service-D5IhSyRJ.js} +2 -2
- package/dist/cjs/{button-CfVQSysQ.js → button-DsHDMHaa.js} +1 -1
- package/dist/cjs/card-form.cjs.entry.js +6 -6
- package/dist/cjs/{check-pkg-version-BsodhBbK.js → check-pkg-version-V7aKSlBk.js} +9 -3
- package/dist/cjs/{checkout.service-B0ZmvWwI.js → checkout.service-4aS641tN.js} +2 -2
- package/dist/cjs/{checkout.store-Cn3Jj5gi.js → checkout.store-Ctwy9ahZ.js} +4 -2
- package/dist/cjs/checkouts-list-core.cjs.entry.js +10 -10
- package/dist/cjs/{payments-list-params-state-BNbT1fuJ.js → checkouts-list-params-state-Cewmin_p.js} +1 -1
- package/dist/cjs/{checkouts-table-UN5gPpQ_.js → checkouts-table-B_gpjGhs.js} +2 -2
- package/dist/cjs/{config-state-5xZf-jax.js → config-state-BBOZIS8x.js} +1 -1
- package/dist/cjs/custom-popper_2.cjs.entry.js +3 -3
- package/dist/cjs/{dispute.service-DsPEAcDn.js → dispute.service-64ciJH0r.js} +2 -2
- package/dist/cjs/form-alert_5.cjs.entry.js +1 -1
- package/dist/cjs/form-control-checkbox.cjs.entry.js +5 -5
- package/dist/cjs/form-control-date.cjs.entry.js +4 -4
- package/dist/cjs/{form-control-error-text-HM0zQerh.js → form-control-error-text-B-P5UDhm.js} +1 -1
- package/dist/cjs/form-control-file-v2_2.cjs.entry.js +5 -5
- package/dist/cjs/{form-control-help-text-5KIUw1IP.js → form-control-help-text-JoZjhb9m.js} +1 -1
- package/dist/cjs/form-control-help-text.cjs.entry.js +1 -1
- package/dist/cjs/form-control-monetary-provisioning.cjs.entry.js +3 -3
- package/dist/cjs/form-control-monetary.cjs.entry.js +5 -5
- package/dist/cjs/form-control-number-masked_2.cjs.entry.js +4 -4
- package/dist/cjs/form-control-number.cjs.entry.js +5 -5
- package/dist/cjs/form-control-radio.cjs.entry.js +3 -3
- package/dist/cjs/form-control-select_2.cjs.entry.js +6 -6
- package/dist/cjs/{get-payment-details-DtCXaIMx.js → get-payment-details-DE5xUUpt.js} +2 -2
- package/dist/cjs/{get-subaccounts-CwCH5rC8.js → get-subaccounts-CH477rHs.js} +3 -3
- package/dist/cjs/gross-payment-chart-core.cjs.entry.js +4 -4
- package/dist/cjs/{header-1-DD41iNlG.js → header-1-DRA3f4Jh.js} +1 -1
- package/dist/cjs/{header-3-D9Wa0IfT.js → header-3-sOdOpfx3.js} +1 -1
- package/dist/cjs/hidden-input_2.cjs.entry.js +8 -8
- package/dist/cjs/{index-Yd9aLenr.js → index-B32W0A3m.js} +1 -1
- package/dist/cjs/{index-dm_GlYlb.js → index-C9hBD-32.js} +2 -2
- package/dist/cjs/{insurance-state-Cyva9u6S.js → insurance-state-d2thhXUX.js} +2 -2
- package/dist/cjs/justifi-additional-questions-form-step-core_6.cjs.entry.js +6 -6
- package/dist/cjs/justifi-additional-questions-form-step_9.cjs.entry.js +7 -7
- package/dist/cjs/justifi-additional-statement_8.cjs.entry.js +9 -9
- package/dist/cjs/justifi-apple-pay.cjs.entry.js +47 -102
- package/dist/cjs/justifi-bank-account-billing-form-simple_9.cjs.entry.js +20 -20
- package/dist/cjs/justifi-business-details.cjs.entry.js +9 -9
- package/dist/cjs/justifi-business-form.cjs.entry.js +12 -12
- package/dist/cjs/justifi-business-representative-form-inputs.cjs.entry.js +1 -1
- package/dist/cjs/justifi-checkout-summary_7.cjs.entry.js +1422 -0
- package/dist/cjs/justifi-checkout.cjs.entry.js +16 -45
- package/dist/cjs/justifi-checkouts-list-filters.cjs.entry.js +7 -7
- package/dist/cjs/justifi-checkouts-list.cjs.entry.js +13 -13
- package/dist/cjs/justifi-config-provider.cjs.entry.js +3 -3
- package/dist/cjs/justifi-details.cjs.entry.js +2 -2
- package/dist/cjs/justifi-dispute-management-core.cjs.entry.js +2 -2
- package/dist/cjs/justifi-dispute-management.cjs.entry.js +9 -9
- package/dist/cjs/justifi-dispute-notification_3.cjs.entry.js +14 -14
- package/dist/cjs/justifi-gross-payment-chart.cjs.entry.js +8 -8
- package/dist/cjs/justifi-order-terminals.cjs.entry.js +12 -12
- package/dist/cjs/justifi-owner-form_3.cjs.entry.js +7 -7
- package/dist/cjs/justifi-payment-details.cjs.entry.js +10 -10
- package/dist/cjs/justifi-payment-provisioning-core.cjs.entry.js +3 -3
- package/dist/cjs/justifi-payment-provisioning.cjs.entry.js +8 -8
- package/dist/cjs/justifi-payment-transactions-list.cjs.entry.js +12 -12
- package/dist/cjs/justifi-payments-list-filters.cjs.entry.js +6 -6
- package/dist/cjs/justifi-payments-list.cjs.entry.js +13 -13
- package/dist/cjs/justifi-payout-details.cjs.entry.js +9 -9
- package/dist/cjs/justifi-payout-transactions-list.cjs.entry.js +12 -12
- package/dist/cjs/justifi-payouts-list-filters.cjs.entry.js +6 -6
- package/dist/cjs/justifi-payouts-list.cjs.entry.js +14 -14
- package/dist/cjs/justifi-refund-payment.cjs.entry.js +12 -12
- package/dist/cjs/justifi-saved-payment-method.cjs.entry.js +2 -2
- package/dist/cjs/justifi-season-interruption-insurance.cjs.entry.js +15 -11
- package/dist/cjs/justifi-skeleton.cjs.entry.js +4 -4
- package/dist/cjs/justifi-terminal-orders-list-filters.cjs.entry.js +8 -8
- package/dist/cjs/justifi-terminal-orders-list.cjs.entry.js +11 -11
- package/dist/cjs/justifi-terminals-list-filters.cjs.entry.js +7 -7
- package/dist/cjs/justifi-terminals-list.cjs.entry.js +13 -13
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/cjs/{package-DJaHaxMC.js → package-Dg5ELZpu.js} +1 -1
- package/dist/cjs/pagination-menu.cjs.entry.js +1 -1
- package/dist/cjs/payment-details-core.cjs.entry.js +14 -14
- package/dist/cjs/payment-method-option.cjs.entry.js +3 -3
- package/dist/cjs/{payment.service-1H0VC3LV.js → payment.service--kzMop3L.js} +2 -2
- package/dist/cjs/payments-list-core.cjs.entry.js +11 -11
- package/dist/cjs/{payouts-list-params-state-BNbT1fuJ.js → payments-list-params-state-Cewmin_p.js} +1 -1
- package/dist/cjs/{payments-status-PB63klt3.js → payments-status-DXRh_ekP.js} +2 -2
- package/dist/cjs/{payments-table-quF0NnsS.js → payments-table-DFRtk-T9.js} +2 -2
- package/dist/cjs/payout-details-core.cjs.entry.js +10 -10
- package/dist/cjs/{payout.service-CIZFU-hV.js → payout.service-D3omzNG_.js} +2 -2
- package/dist/cjs/payouts-list-core.cjs.entry.js +11 -11
- package/dist/cjs/{checkouts-list-params-state-BNbT1fuJ.js → payouts-list-params-state-Cewmin_p.js} +1 -1
- package/dist/cjs/{payouts-status-Bk1JFzbP.js → payouts-status-DxTQZv3i.js} +2 -2
- package/dist/cjs/{payouts-table-D_CCTR_k.js → payouts-table-DE3t0x93.js} +2 -2
- package/dist/cjs/{skeleton-x-GSs3xk.js → skeleton-C7DQRD6r.js} +1 -1
- package/dist/cjs/{spinner-Kb1BFvnL.js → spinner-jmeA44Ee.js} +1 -1
- package/dist/cjs/{styled-host-CqQYxX-w.js → styled-host-BfVJlAsJ.js} +1 -1
- package/dist/cjs/{table-BJVUhh3s.js → table-Ccdrt0v_.js} +2 -2
- package/dist/cjs/table-filters-menu.cjs.entry.js +3 -3
- package/dist/cjs/terminal-orders-list-core.cjs.entry.js +10 -10
- package/dist/cjs/{terminal-orders-list-params-state-BNbT1fuJ.js → terminal-orders-list-params-state-Cewmin_p.js} +1 -1
- package/dist/cjs/{terminal-orders-table-0O5jtzYj.js → terminal-orders-table-B1LJitwE.js} +4 -4
- package/dist/cjs/terminal-quantity-selector.cjs.entry.js +2 -2
- package/dist/cjs/{terminal.service-DUlyMTrX.js → terminal.service-BOvYfpQW.js} +2 -2
- package/dist/cjs/terminals-list-core.cjs.entry.js +10 -10
- package/dist/cjs/terminals-list-params-state-Cewmin_p.js +22 -0
- package/dist/cjs/{terminals-table-C2BNRUS5.js → terminals-table-DYt7exFQ.js} +2 -2
- package/dist/cjs/{utils-Df-pajL7.js → utils-Bzyj4qWe.js} +1 -1
- package/dist/cjs/webcomponents.cjs.js +3 -3
- package/dist/collection/api/Payment.js +3 -2
- package/dist/collection/api/services/apple-pay.service.js +31 -72
- package/dist/collection/api/services/plaid.service.js +20 -0
- package/dist/collection/assets/plaid-icon.svg +1 -0
- package/dist/collection/collection-manifest.json +2 -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 +7 -44
- 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/insurance/season-interruption/season-interruption-insurance.js +4 -0
- package/dist/collection/components/modular-checkout/ModularCheckout.js +28 -0
- package/dist/collection/components/modular-checkout/modular-checkout.js +100 -170
- package/dist/collection/components/modular-checkout/sub-components/apple-pay.js +8 -48
- 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/plaid-payment-method.js +864 -0
- package/dist/collection/components/modular-checkout/sub-components/plaid-payment-method.test.js +123 -0
- package/dist/collection/components/modular-checkout/sub-components/saved-payment-methods.js +11 -5
- package/dist/collection/components/modular-checkout/sub-components/sezzle-payment-method.js +3 -2
- 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 +64 -36
- package/dist/collection/store/checkout.store.js +3 -1
- 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/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/collection/utils/check-pkg-version.js +6 -0
- package/dist/docs.json +337 -70
- package/dist/esm/{Api-N_veT2p6.js → Api-C1I68Tfr.js} +1 -1
- package/dist/esm/{Refund-Di6J0oN2.js → Refund-kKW8S1h6.js} +4 -3
- package/dist/esm/additional-questions-details_5.entry.js +2 -2
- package/dist/esm/{badge-D4ZXPFjL.js → badge-DSYSJcRy.js} +1 -1
- package/dist/esm/bank-account-document-form-inputs_4.entry.js +8 -8
- package/dist/esm/bank-account-form.entry.js +6 -6
- package/dist/esm/business-details-core.entry.js +4 -4
- package/dist/esm/{business.service-Bdvhdc_d.js → business.service-B3wlBl1x.js} +2 -2
- package/dist/esm/{button-C0wLsDP3.js → button-CpllL0At.js} +1 -1
- package/dist/esm/card-form.entry.js +6 -6
- package/dist/esm/{check-pkg-version-D_w9UM2s.js → check-pkg-version-DFYosyo9.js} +9 -3
- package/dist/esm/{checkout.service-XgGFa7H8.js → checkout.service-KDp7tISm.js} +2 -2
- package/dist/esm/{checkout.store-OAv_iY1u.js → checkout.store-sQSQqMAD.js} +4 -2
- package/dist/esm/checkouts-list-core.entry.js +10 -10
- package/dist/esm/{checkouts-list-params-state-SMXQIZTt.js → checkouts-list-params-state-D8tzsGR_.js} +1 -1
- package/dist/esm/{checkouts-table-DjGKtqoc.js → checkouts-table-QOdiLpak.js} +2 -2
- package/dist/esm/{config-state-BrllxiM0.js → config-state-DZeVYerv.js} +1 -1
- package/dist/esm/custom-popper_2.entry.js +3 -3
- package/dist/esm/{dispute.service-CKPcmwhH.js → dispute.service-DEZEPwn-.js} +2 -2
- 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-Bzfs_rxk.js → form-control-error-text-R7U07nTg.js} +1 -1
- package/dist/esm/form-control-file-v2_2.entry.js +5 -5
- package/dist/esm/{form-control-help-text-ueLctOBN.js → form-control-help-text-CRLH-2f7.js} +1 -1
- package/dist/esm/form-control-help-text.entry.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/{get-payment-details-Dt-dr16k.js → get-payment-details-CYASKLT7.js} +2 -2
- package/dist/esm/{get-subaccounts-BsoVLANw.js → get-subaccounts-E0PYy_pc.js} +3 -3
- package/dist/esm/gross-payment-chart-core.entry.js +4 -4
- package/dist/esm/{header-1-BMKEv9y6.js → header-1-3M9If0gM.js} +1 -1
- package/dist/esm/{header-3-C3t3m27b.js → header-3-CWa41YWq.js} +1 -1
- package/dist/esm/hidden-input_2.entry.js +8 -8
- package/dist/esm/{index-B9me4yN2.js → index-B_KxSZIF.js} +1 -1
- package/dist/esm/{index-kpoIU4v_.js → index-Bn7inNWG.js} +2 -2
- package/dist/esm/{insurance-state-d4hjThzE.js → insurance-state-CTalqbNa.js} +2 -2
- package/dist/esm/justifi-additional-questions-form-step-core_6.entry.js +6 -6
- package/dist/esm/justifi-additional-questions-form-step_9.entry.js +7 -7
- package/dist/esm/justifi-additional-statement_8.entry.js +9 -9
- package/dist/esm/justifi-apple-pay.entry.js +47 -102
- package/dist/esm/justifi-bank-account-billing-form-simple_9.entry.js +20 -20
- package/dist/esm/justifi-business-details.entry.js +9 -9
- package/dist/esm/justifi-business-form.entry.js +12 -12
- package/dist/esm/justifi-business-representative-form-inputs.entry.js +1 -1
- package/dist/esm/justifi-checkout-summary_7.entry.js +1414 -0
- package/dist/esm/justifi-checkout.entry.js +16 -45
- package/dist/esm/justifi-checkouts-list-filters.entry.js +7 -7
- package/dist/esm/justifi-checkouts-list.entry.js +13 -13
- package/dist/esm/justifi-config-provider.entry.js +3 -3
- package/dist/esm/justifi-details.entry.js +2 -2
- package/dist/esm/justifi-dispute-management-core.entry.js +2 -2
- package/dist/esm/justifi-dispute-management.entry.js +9 -9
- package/dist/esm/justifi-dispute-notification_3.entry.js +14 -14
- package/dist/esm/justifi-gross-payment-chart.entry.js +8 -8
- package/dist/esm/justifi-order-terminals.entry.js +12 -12
- package/dist/esm/justifi-owner-form_3.entry.js +7 -7
- package/dist/esm/justifi-payment-details.entry.js +10 -10
- package/dist/esm/justifi-payment-provisioning-core.entry.js +3 -3
- package/dist/esm/justifi-payment-provisioning.entry.js +8 -8
- package/dist/esm/justifi-payment-transactions-list.entry.js +12 -12
- package/dist/esm/justifi-payments-list-filters.entry.js +6 -6
- package/dist/esm/justifi-payments-list.entry.js +13 -13
- package/dist/esm/justifi-payout-details.entry.js +9 -9
- package/dist/esm/justifi-payout-transactions-list.entry.js +12 -12
- package/dist/esm/justifi-payouts-list-filters.entry.js +6 -6
- package/dist/esm/justifi-payouts-list.entry.js +14 -14
- package/dist/esm/justifi-refund-payment.entry.js +12 -12
- package/dist/esm/justifi-saved-payment-method.entry.js +2 -2
- package/dist/esm/justifi-season-interruption-insurance.entry.js +15 -11
- package/dist/esm/justifi-skeleton.entry.js +4 -4
- package/dist/esm/justifi-terminal-orders-list-filters.entry.js +8 -8
- package/dist/esm/justifi-terminal-orders-list.entry.js +11 -11
- package/dist/esm/justifi-terminals-list-filters.entry.js +7 -7
- package/dist/esm/justifi-terminals-list.entry.js +13 -13
- package/dist/esm/loader.js +3 -3
- package/dist/esm/{package-78C4rMuv.js → package-uY_jN8Gg.js} +1 -1
- package/dist/esm/pagination-menu.entry.js +1 -1
- package/dist/esm/payment-details-core.entry.js +14 -14
- package/dist/esm/payment-method-option.entry.js +3 -3
- package/dist/esm/{payment.service-BWO84KlP.js → payment.service-uJpJaX2Z.js} +2 -2
- package/dist/esm/payments-list-core.entry.js +11 -11
- package/dist/esm/{payments-list-params-state-SMXQIZTt.js → payments-list-params-state-D8tzsGR_.js} +1 -1
- package/dist/esm/{payments-status-1yRdTNeS.js → payments-status-5orNU2Rd.js} +2 -2
- package/dist/esm/{payments-table-8RADYkma.js → payments-table-B0uyodyJ.js} +2 -2
- package/dist/esm/payout-details-core.entry.js +10 -10
- package/dist/esm/{payout.service-Cld6TS5W.js → payout.service-ClUgtbbb.js} +2 -2
- package/dist/esm/payouts-list-core.entry.js +11 -11
- package/dist/esm/{payouts-list-params-state-SMXQIZTt.js → payouts-list-params-state-D8tzsGR_.js} +1 -1
- package/dist/esm/{payouts-status-BqsQVtBp.js → payouts-status-CZPwa2AE.js} +2 -2
- package/dist/esm/{payouts-table-DPw7yIx8.js → payouts-table-CaCSX_0q.js} +2 -2
- package/dist/esm/{skeleton-BmTjpTYa.js → skeleton-qMb0_Cjy.js} +1 -1
- package/dist/esm/{spinner-YGDOI-CS.js → spinner-DUzyWLhj.js} +1 -1
- package/dist/esm/{styled-host-B_XBaM7z.js → styled-host-CTAGIN84.js} +1 -1
- package/dist/esm/{table-ybHxxc9f.js → table-Br3n9Xu-.js} +2 -2
- package/dist/esm/table-filters-menu.entry.js +3 -3
- package/dist/esm/terminal-orders-list-core.entry.js +10 -10
- package/dist/esm/{terminal-orders-list-params-state-SMXQIZTt.js → terminal-orders-list-params-state-D8tzsGR_.js} +1 -1
- package/dist/esm/{terminal-orders-table-D-xP5WuM.js → terminal-orders-table-DPtof5Zb.js} +4 -4
- package/dist/esm/terminal-quantity-selector.entry.js +2 -2
- package/dist/esm/{terminal.service-DmYCUQcA.js → terminal.service-ClNtE3e-.js} +2 -2
- package/dist/esm/terminals-list-core.entry.js +10 -10
- package/dist/esm/terminals-list-params-state-D8tzsGR_.js +16 -0
- package/dist/esm/{terminals-table-DVAPCgEr.js → terminals-table-ClkR_jrC.js} +2 -2
- package/dist/esm/{utils-DG5aMFmf.js → utils-Dg6gMUTv.js} +1 -1
- package/dist/esm/webcomponents.js +4 -4
- package/dist/module/Analytics.js +6 -0
- package/dist/module/ModularCheckout.js +30 -0
- package/dist/module/Refund.js +4 -3
- package/dist/module/additional-statement.js +1 -1
- 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/business-bank-account-form-step-core.js +1 -1
- 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 +3 -1
- 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/get-payment-details.js +1 -1
- 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 +39 -99
- package/dist/module/justifi-button2.js +1 -1
- package/dist/module/justifi-checkout.js +51 -76
- package/dist/module/justifi-checkouts-list-filters.js +2 -2
- package/dist/module/justifi-checkouts-list.js +2 -2
- package/dist/module/justifi-dispute-management.js +1 -1
- package/dist/module/justifi-header2.js +1 -1
- package/dist/module/justifi-order-terminals.js +2 -2
- package/dist/module/justifi-payment-transactions-list.js +2 -2
- package/dist/module/justifi-payments-list-filters.js +2 -2
- package/dist/module/justifi-payments-list.js +2 -2
- package/dist/module/justifi-payout-details.js +1 -1
- package/dist/module/justifi-payout-transactions-list.js +2 -2
- package/dist/module/justifi-payouts-list-filters.js +2 -2
- package/dist/module/justifi-payouts-list.js +2 -2
- package/dist/module/justifi-plaid-payment-method.d.ts +11 -0
- package/dist/module/justifi-plaid-payment-method.js +6 -0
- package/dist/module/justifi-refund-payment.js +1 -1
- package/dist/module/justifi-saved-payment-method.js +1 -1
- package/dist/module/justifi-season-interruption-insurance.js +4 -0
- package/dist/module/justifi-skeleton.js +1 -1
- package/dist/module/justifi-terminal-orders-list-filters.js +3 -3
- package/dist/module/justifi-terminal-orders-list.js +2 -2
- package/dist/module/justifi-terminals-list-filters.js +2 -2
- package/dist/module/justifi-terminals-list.js +2 -2
- package/dist/module/modular-checkout.js +98 -152
- package/dist/module/package.js +1 -1
- 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/plaid-payment-method.js +693 -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/saved-payment-methods.js +11 -5
- package/dist/module/sezzle-payment-method.js +3 -2
- 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 +2 -2
- 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 +46 -37
- package/dist/types/api/ApplePay.d.ts +2 -2
- package/dist/types/api/Checkout.d.ts +4 -0
- package/dist/types/api/Payment.d.ts +3 -4
- package/dist/types/api/services/apple-pay.service.d.ts +4 -15
- package/dist/types/api/services/plaid.service.d.ts +12 -0
- package/dist/types/components/checkout/checkout.d.ts +1 -7
- package/dist/types/components/modular-checkout/ModularCheckout.d.ts +23 -0
- package/dist/types/components/modular-checkout/modular-checkout.d.ts +0 -6
- package/dist/types/components/modular-checkout/sub-components/apple-pay.d.ts +0 -1
- package/dist/types/components/modular-checkout/sub-components/plaid-payment-method.d.ts +80 -0
- package/dist/types/components/modular-checkout/sub-components/plaid-payment-method.test.d.ts +1 -0
- package/dist/types/components/modular-checkout/sub-components/saved-payment-methods.d.ts +1 -1
- package/dist/types/components/tokenize-payment-method/tokenize-payment-method.d.ts +7 -5
- package/dist/types/components.d.ts +45 -11
- package/dist/types/store/checkout.store.d.ts +4 -1
- package/dist/webcomponents/p-040e8524.entry.js +1 -0
- package/dist/webcomponents/{p-DD74a16D.js → p-0mMX1Zv4.js} +1 -1
- package/dist/webcomponents/{p-7b9fa1fb.entry.js → p-14ff3155.entry.js} +1 -1
- package/dist/webcomponents/{p-e8a198fa.entry.js → p-15705e8a.entry.js} +1 -1
- package/dist/webcomponents/p-16f94e08.entry.js +1 -0
- package/dist/webcomponents/p-1c5be37e.entry.js +1 -0
- package/dist/webcomponents/p-255b28fb.entry.js +1 -0
- package/dist/webcomponents/p-26a8b07c.entry.js +1 -0
- package/dist/webcomponents/p-26ce3346.entry.js +1 -0
- package/dist/webcomponents/{p-76a95d07.entry.js → p-28618e6f.entry.js} +1 -1
- package/dist/webcomponents/{p-9009dede.entry.js → p-2de08ab2.entry.js} +1 -1
- package/dist/webcomponents/p-30c1f265.entry.js +1 -0
- package/dist/webcomponents/p-3aecd2cd.entry.js +1 -0
- package/dist/webcomponents/{p-a70bc148.entry.js → p-3bf63d1e.entry.js} +1 -1
- package/dist/webcomponents/p-3c5d92d9.entry.js +1 -0
- package/dist/webcomponents/{p-eca1e808.entry.js → p-3e025b84.entry.js} +1 -1
- package/dist/webcomponents/{p-c029fc20.entry.js → p-3e4db664.entry.js} +1 -1
- package/dist/webcomponents/{p-5afbfafb.entry.js → p-3e667b07.entry.js} +1 -1
- package/dist/webcomponents/{p-dc245644.entry.js → p-4213d10e.entry.js} +4 -4
- package/dist/webcomponents/{p-4c994761.entry.js → p-44450a94.entry.js} +1 -1
- package/dist/webcomponents/p-4723f35b.entry.js +1 -0
- package/dist/webcomponents/{p-6df132e6.entry.js → p-51801ae5.entry.js} +1 -1
- package/dist/webcomponents/p-52098283.entry.js +1 -0
- package/dist/webcomponents/{p-ab308ee3.entry.js → p-54ca3070.entry.js} +1 -1
- package/dist/webcomponents/p-5580e6ca.entry.js +1 -0
- package/dist/webcomponents/p-57dde36e.entry.js +1 -0
- package/dist/webcomponents/p-5bc6f5ca.entry.js +1 -0
- package/dist/webcomponents/p-5f87add5.entry.js +1 -0
- package/dist/webcomponents/{p-1b892b3a.entry.js → p-60206d9c.entry.js} +1 -1
- package/dist/webcomponents/{p-5ad70aae.entry.js → p-613421d4.entry.js} +1 -1
- package/dist/webcomponents/{p-b04cc606.entry.js → p-6255c685.entry.js} +1 -1
- package/dist/webcomponents/p-7089fb85.entry.js +1 -0
- package/dist/webcomponents/{p-03c7cee8.entry.js → p-70f51444.entry.js} +1 -1
- package/dist/webcomponents/{p-c62e23c1.entry.js → p-72dda22b.entry.js} +1 -1
- package/dist/webcomponents/{p-c6860f60.entry.js → p-7cf87637.entry.js} +1 -1
- package/dist/webcomponents/p-87884ca5.entry.js +1 -0
- package/dist/webcomponents/p-88905a54.entry.js +1 -0
- package/dist/webcomponents/p-8990707a.entry.js +1 -0
- package/dist/webcomponents/p-8b7cbdbf.entry.js +1 -0
- package/dist/webcomponents/p-8cca8903.entry.js +1 -0
- package/dist/webcomponents/{p-a406bf1a.entry.js → p-8ff839a4.entry.js} +1 -1
- package/dist/webcomponents/{p-776699bd.entry.js → p-90a1ba6a.entry.js} +1 -1
- package/dist/webcomponents/{p-a9d2dd5e.entry.js → p-95cbb655.entry.js} +1 -1
- package/dist/webcomponents/{p-4a79c737.entry.js → p-97c0dde4.entry.js} +1 -1
- package/dist/webcomponents/{p-fbaf62a5.entry.js → p-9846b23d.entry.js} +1 -1
- package/dist/webcomponents/p-98cffba9.entry.js +1 -0
- package/dist/webcomponents/{p-08a5cc2f.entry.js → p-9a2c044f.entry.js} +1 -1
- package/dist/webcomponents/p-9f0b1bea.entry.js +1 -0
- package/dist/webcomponents/p-9f5c9e41.entry.js +1 -0
- package/dist/webcomponents/p-B5Rc83j1.js +1 -0
- package/dist/webcomponents/p-B71k50jz.js +1 -0
- package/dist/webcomponents/p-B8iBcmNu.js +1 -0
- package/dist/webcomponents/p-BEPUC3Po.js +1 -0
- package/dist/webcomponents/p-BP7op0vq.js +1 -0
- package/dist/webcomponents/{p-I8XpD1TX.js → p-BPtcGAzB.js} +1 -1
- package/dist/webcomponents/p-BQ2TIFoY.js +1 -0
- package/dist/webcomponents/{p-BUadwxkh.js → p-BRLwUSZk.js} +1 -1
- package/dist/webcomponents/p-BSt6p1oq.js +1 -0
- package/dist/webcomponents/p-BY1mRAvj.js +1 -0
- package/dist/webcomponents/{p-nWGo6sHu.js → p-Bb-6bNcq.js} +1 -1
- package/dist/webcomponents/p-BbZwa5UI.js +1 -0
- package/dist/webcomponents/{p-BZzESzqz.js → p-BfM6X7lF.js} +1 -1
- package/dist/webcomponents/{p-kpoIU4v_.js → p-Bn7inNWG.js} +1 -1
- package/dist/webcomponents/{p-DWUnL_zj.js → p-Bu1jU017.js} +1 -1
- package/dist/webcomponents/{p-CP_tg-uH.js → p-C5id7s_l.js} +1 -1
- package/dist/webcomponents/{p-HAk7yBNq.js → p-CB0mCq1M.js} +1 -1
- package/dist/webcomponents/p-CaAVuW6B.js +1 -0
- package/dist/webcomponents/p-CpaS1Lex.js +1 -0
- package/dist/webcomponents/{p-Bpcb3SsP.js → p-CvG-itHC.js} +1 -1
- package/dist/webcomponents/{p-BySyDTv5.js → p-D2_iJUrZ.js} +1 -1
- package/dist/webcomponents/p-DAED83Ew.js +1 -0
- package/dist/webcomponents/p-DD0Mvpeu.js +1 -0
- package/dist/webcomponents/p-DDUmOl3v.js +1 -0
- package/dist/webcomponents/{p-BhdBpAn9.js → p-DGmp4ErD.js} +1 -1
- package/dist/webcomponents/p-DIDloHpm.js +1 -0
- package/dist/webcomponents/{p-DuXN7Akd.js → p-DNo0OPOP.js} +1 -1
- package/dist/webcomponents/{p-DBsw4qpn.js → p-DVBbk00Z.js} +1 -1
- package/dist/webcomponents/{p-Bb6FBEPP.js → p-Dc1CS9Mi.js} +1 -1
- package/dist/webcomponents/p-Dgflaz6J.js +1 -0
- package/dist/webcomponents/{p-9y5MOK55.js → p-DhGNCW2f.js} +1 -1
- package/dist/webcomponents/p-DsZZxRXY.js +1 -0
- package/dist/webcomponents/{p-CRFzwZW6.js → p-DxqCFDtF.js} +1 -1
- package/dist/webcomponents/p-a1d3bb81.entry.js +1 -0
- package/dist/webcomponents/{p-d0729065.entry.js → p-a347d1b1.entry.js} +1 -1
- package/dist/webcomponents/p-a9957ca5.entry.js +1 -0
- package/dist/webcomponents/{p-463ae23a.entry.js → p-abbf14b5.entry.js} +1 -1
- package/dist/webcomponents/p-abd0e71f.entry.js +1 -0
- package/dist/webcomponents/p-b21ncS7l.js +1 -0
- package/dist/webcomponents/{p-DhRb39as.js → p-bjogwLgt.js} +1 -1
- package/dist/webcomponents/p-c2bceb15.entry.js +1 -0
- package/dist/webcomponents/p-c44325f8.entry.js +1 -0
- package/dist/webcomponents/p-c874ca2b.entry.js +1 -0
- package/dist/webcomponents/p-caac63bf.entry.js +1 -0
- package/dist/webcomponents/{p-70cd4cbd.entry.js → p-cbc96430.entry.js} +1 -1
- package/dist/webcomponents/{p-5e10aa65.entry.js → p-d46dbb83.entry.js} +1 -1
- package/dist/webcomponents/p-d72e8541.entry.js +1 -0
- package/dist/webcomponents/{p-4a1198ee.entry.js → p-dc1efbab.entry.js} +1 -1
- package/dist/webcomponents/p-eP3fmhta.js +1 -0
- package/dist/webcomponents/{p-bbbb9225.entry.js → p-ecd9f0e9.entry.js} +1 -1
- package/dist/webcomponents/{p-fcb6e870.entry.js → p-f13ae573.entry.js} +1 -1
- package/dist/webcomponents/{p-afc83e27.entry.js → p-f1cba43c.entry.js} +1 -1
- package/dist/webcomponents/p-f4c4c248.entry.js +1 -0
- package/dist/webcomponents/p-f680e617.entry.js +1 -0
- package/dist/webcomponents/{p-2ab0a2b3.entry.js → p-fb228106.entry.js} +1 -1
- package/dist/webcomponents/p-fd4ffaa2.entry.js +1 -0
- package/dist/webcomponents/{p-wyEq9Pa1.js → p-qWQmu-fb.js} +1 -1
- package/dist/webcomponents/p-sw5RO19U.js +1 -0
- package/dist/webcomponents/p-uY_jN8Gg.js +1 -0
- package/dist/webcomponents/webcomponents.esm.js +1 -1
- package/package.json +1 -1
- package/dist/cjs/justifi-checkout-summary_6.cjs.entry.js +0 -804
- package/dist/cjs/terminals-list-params-state-BNbT1fuJ.js +0 -22
- package/dist/esm/justifi-checkout-summary_6.entry.js +0 -797
- package/dist/esm/terminals-list-params-state-SMXQIZTt.js +0 -16
- package/dist/webcomponents/p-0aee6da6.entry.js +0 -1
- package/dist/webcomponents/p-0e290b6e.entry.js +0 -1
- package/dist/webcomponents/p-0e64cd09.entry.js +0 -1
- package/dist/webcomponents/p-1246b999.entry.js +0 -1
- package/dist/webcomponents/p-12c312a0.entry.js +0 -1
- package/dist/webcomponents/p-134d5029.entry.js +0 -1
- package/dist/webcomponents/p-1c0c1d7b.entry.js +0 -1
- package/dist/webcomponents/p-1e206c92.entry.js +0 -1
- package/dist/webcomponents/p-1ea7868a.entry.js +0 -1
- package/dist/webcomponents/p-281e36be.entry.js +0 -1
- package/dist/webcomponents/p-2a0a907d.entry.js +0 -1
- package/dist/webcomponents/p-32cecfaf.entry.js +0 -1
- package/dist/webcomponents/p-3ffe1e2e.entry.js +0 -1
- package/dist/webcomponents/p-48f42f07.entry.js +0 -1
- package/dist/webcomponents/p-5510b57c.entry.js +0 -1
- package/dist/webcomponents/p-5a5f07be.entry.js +0 -1
- package/dist/webcomponents/p-5acd6add.entry.js +0 -1
- package/dist/webcomponents/p-5rVtZ2GJ.js +0 -1
- package/dist/webcomponents/p-6974a44c.entry.js +0 -1
- package/dist/webcomponents/p-6f2b41f5.entry.js +0 -1
- package/dist/webcomponents/p-6f9755cc.entry.js +0 -1
- package/dist/webcomponents/p-7288473f.entry.js +0 -1
- package/dist/webcomponents/p-78C4rMuv.js +0 -1
- package/dist/webcomponents/p-7WIgS5RM.js +0 -1
- package/dist/webcomponents/p-98939b74.entry.js +0 -1
- package/dist/webcomponents/p-BVD7g3cE.js +0 -1
- package/dist/webcomponents/p-BXKEChoo.js +0 -1
- package/dist/webcomponents/p-BmFoKOM3.js +0 -1
- package/dist/webcomponents/p-Bt388eye.js +0 -1
- package/dist/webcomponents/p-BtOB_CaO.js +0 -1
- package/dist/webcomponents/p-C0AHrswP.js +0 -1
- package/dist/webcomponents/p-CLwzqWk2.js +0 -1
- package/dist/webcomponents/p-CVQyw7ao.js +0 -1
- package/dist/webcomponents/p-D48iERjQ.js +0 -1
- package/dist/webcomponents/p-D7eeJWA-.js +0 -1
- package/dist/webcomponents/p-DKRXPZKS.js +0 -1
- package/dist/webcomponents/p-DOd8HaWV.js +0 -1
- package/dist/webcomponents/p-DaDsBt65.js +0 -1
- package/dist/webcomponents/p-DcE8SQPv.js +0 -1
- package/dist/webcomponents/p-Drz6LnIw.js +0 -1
- package/dist/webcomponents/p-UD2JhYS2.js +0 -1
- package/dist/webcomponents/p-WEguiGt1.js +0 -1
- package/dist/webcomponents/p-a1483fbd.entry.js +0 -1
- package/dist/webcomponents/p-a1a8f6bd.entry.js +0 -1
- package/dist/webcomponents/p-a4cb5604.entry.js +0 -1
- package/dist/webcomponents/p-b10e34b0.entry.js +0 -1
- package/dist/webcomponents/p-b41d2b8f.entry.js +0 -1
- package/dist/webcomponents/p-b8f63e28.entry.js +0 -1
- package/dist/webcomponents/p-bd560810.entry.js +0 -1
- package/dist/webcomponents/p-cbfc8269.entry.js +0 -1
- package/dist/webcomponents/p-dad15b15.entry.js +0 -1
- package/dist/webcomponents/p-e00fd71d.entry.js +0 -1
- package/dist/webcomponents/p-e6ca1872.entry.js +0 -1
- package/dist/webcomponents/p-e70a5f50.entry.js +0 -1
- package/dist/webcomponents/p-fb1904d2.entry.js +0 -1
- package/dist/webcomponents/p-pska2q1M.js +0 -1
|
@@ -0,0 +1,864 @@
|
|
|
1
|
+
import { h } from "@stencil/core";
|
|
2
|
+
import { radioListItem } from "../../../styles/parts";
|
|
3
|
+
import { checkoutStore, onChange } from "../../../store/checkout.store";
|
|
4
|
+
import { StyledHost } from "../../../ui-components";
|
|
5
|
+
import plaidLogoSvg from "../../../assets/plaid-icon.svg";
|
|
6
|
+
import { PlaidService } from "../../../api/services/plaid.service";
|
|
7
|
+
import { ComponentErrorSeverity } from "../../../api/ComponentError";
|
|
8
|
+
import { PAYMENT_METHODS } from "../ModularCheckout";
|
|
9
|
+
// Plaid-specific error codes
|
|
10
|
+
export var PlaidErrorCodes;
|
|
11
|
+
(function (PlaidErrorCodes) {
|
|
12
|
+
PlaidErrorCodes["PLAID_SDK_LOAD_FAILED"] = "plaid-sdk-load-failed";
|
|
13
|
+
PlaidErrorCodes["PLAID_LINK_INIT_FAILED"] = "plaid-link-init-failed";
|
|
14
|
+
PlaidErrorCodes["PLAID_LINK_TOKEN_FAILED"] = "plaid-link-token-failed";
|
|
15
|
+
PlaidErrorCodes["PLAID_AUTHENTICATION_FAILED"] = "plaid-authentication-failed";
|
|
16
|
+
PlaidErrorCodes["PLAID_BANK_NOT_SUPPORTED"] = "plaid-bank-not-supported";
|
|
17
|
+
PlaidErrorCodes["PLAID_TOKEN_EXPIRED"] = "plaid-token-expired";
|
|
18
|
+
PlaidErrorCodes["PLAID_NETWORK_ERROR"] = "plaid-network-error";
|
|
19
|
+
PlaidErrorCodes["PLAID_USER_CANCELLED"] = "plaid-user-cancelled";
|
|
20
|
+
PlaidErrorCodes["PLAID_TIMEOUT"] = "plaid-timeout";
|
|
21
|
+
PlaidErrorCodes["PLAID_INVALID_CREDENTIALS"] = "plaid-invalid-credentials";
|
|
22
|
+
PlaidErrorCodes["PLAID_ACCOUNT_LOCKED"] = "plaid-account-locked";
|
|
23
|
+
PlaidErrorCodes["PLAID_MAINTENANCE"] = "plaid-maintenance";
|
|
24
|
+
PlaidErrorCodes["PLAID_RATE_LIMITED"] = "plaid-rate-limited";
|
|
25
|
+
})(PlaidErrorCodes || (PlaidErrorCodes = {}));
|
|
26
|
+
// Plaid error message mapping
|
|
27
|
+
const PLAID_ERROR_MESSAGES = {
|
|
28
|
+
[PlaidErrorCodes.PLAID_SDK_LOAD_FAILED]: 'Unable to load Plaid. Please refresh the page and try again.',
|
|
29
|
+
[PlaidErrorCodes.PLAID_LINK_INIT_FAILED]: 'Unable to initialize bank connection. Please try again.',
|
|
30
|
+
[PlaidErrorCodes.PLAID_LINK_TOKEN_FAILED]: 'Unable to connect to bank service. Please try again.',
|
|
31
|
+
[PlaidErrorCodes.PLAID_AUTHENTICATION_FAILED]: 'Bank authentication failed. Please try again.',
|
|
32
|
+
[PlaidErrorCodes.PLAID_BANK_NOT_SUPPORTED]: 'Your bank is not currently supported. Please try a different payment method.',
|
|
33
|
+
[PlaidErrorCodes.PLAID_TOKEN_EXPIRED]: 'Your bank session has expired. Please reconnect your account.',
|
|
34
|
+
[PlaidErrorCodes.PLAID_NETWORK_ERROR]: 'Network connection issue. Please check your internet connection and try again.',
|
|
35
|
+
[PlaidErrorCodes.PLAID_USER_CANCELLED]: 'Bank connection was cancelled. Click to try again.',
|
|
36
|
+
[PlaidErrorCodes.PLAID_TIMEOUT]: 'Bank connection timed out. Please try again.',
|
|
37
|
+
[PlaidErrorCodes.PLAID_INVALID_CREDENTIALS]: 'Invalid bank credentials. Please check your username and password.',
|
|
38
|
+
[PlaidErrorCodes.PLAID_ACCOUNT_LOCKED]: 'Your bank account is temporarily locked. Please contact your bank.',
|
|
39
|
+
[PlaidErrorCodes.PLAID_MAINTENANCE]: 'Bank service is temporarily unavailable. Please try again later.',
|
|
40
|
+
[PlaidErrorCodes.PLAID_RATE_LIMITED]: 'Too many connection attempts. Please wait a moment and try again.',
|
|
41
|
+
};
|
|
42
|
+
// Plaid error severity mapping
|
|
43
|
+
const PLAID_ERROR_SEVERITY = {
|
|
44
|
+
[PlaidErrorCodes.PLAID_SDK_LOAD_FAILED]: ComponentErrorSeverity.ERROR,
|
|
45
|
+
[PlaidErrorCodes.PLAID_LINK_INIT_FAILED]: ComponentErrorSeverity.ERROR,
|
|
46
|
+
[PlaidErrorCodes.PLAID_LINK_TOKEN_FAILED]: ComponentErrorSeverity.ERROR,
|
|
47
|
+
[PlaidErrorCodes.PLAID_AUTHENTICATION_FAILED]: ComponentErrorSeverity.ERROR,
|
|
48
|
+
[PlaidErrorCodes.PLAID_BANK_NOT_SUPPORTED]: ComponentErrorSeverity.WARNING,
|
|
49
|
+
[PlaidErrorCodes.PLAID_TOKEN_EXPIRED]: ComponentErrorSeverity.WARNING,
|
|
50
|
+
[PlaidErrorCodes.PLAID_NETWORK_ERROR]: ComponentErrorSeverity.WARNING,
|
|
51
|
+
[PlaidErrorCodes.PLAID_USER_CANCELLED]: ComponentErrorSeverity.INFO,
|
|
52
|
+
[PlaidErrorCodes.PLAID_TIMEOUT]: ComponentErrorSeverity.WARNING,
|
|
53
|
+
[PlaidErrorCodes.PLAID_INVALID_CREDENTIALS]: ComponentErrorSeverity.ERROR,
|
|
54
|
+
[PlaidErrorCodes.PLAID_ACCOUNT_LOCKED]: ComponentErrorSeverity.ERROR,
|
|
55
|
+
[PlaidErrorCodes.PLAID_MAINTENANCE]: ComponentErrorSeverity.WARNING,
|
|
56
|
+
[PlaidErrorCodes.PLAID_RATE_LIMITED]: ComponentErrorSeverity.WARNING,
|
|
57
|
+
};
|
|
58
|
+
export class PlaidPaymentMethod {
|
|
59
|
+
constructor() {
|
|
60
|
+
this.isAuthenticating = false;
|
|
61
|
+
this.publicToken = null;
|
|
62
|
+
this.linkToken = null;
|
|
63
|
+
this.linkTokenId = null;
|
|
64
|
+
this.error = null;
|
|
65
|
+
this.plaidLink = null;
|
|
66
|
+
this.isSelected = false;
|
|
67
|
+
this.retryCount = 0;
|
|
68
|
+
this.isRetrying = false;
|
|
69
|
+
this.plaidService = new PlaidService();
|
|
70
|
+
this.maxRetries = 3;
|
|
71
|
+
this.retryDelay = 2000; // 2 seconds
|
|
72
|
+
this.timeoutId = null;
|
|
73
|
+
this.abortController = null;
|
|
74
|
+
this.hasLoggedDisabledWarning = false;
|
|
75
|
+
this.waitForStoreAndInitialize = () => {
|
|
76
|
+
// Check if store has necessary data
|
|
77
|
+
if (checkoutStore.authToken && checkoutStore.accountId && checkoutStore.checkoutId) {
|
|
78
|
+
this.initializePlaidLink();
|
|
79
|
+
}
|
|
80
|
+
else {
|
|
81
|
+
// Wait a bit and try again
|
|
82
|
+
setTimeout(() => {
|
|
83
|
+
this.waitForStoreAndInitialize();
|
|
84
|
+
}, 100);
|
|
85
|
+
}
|
|
86
|
+
};
|
|
87
|
+
this.onPaymentMethodOptionClick = (e) => {
|
|
88
|
+
e.preventDefault();
|
|
89
|
+
// Update local selection state
|
|
90
|
+
this.isSelected = true;
|
|
91
|
+
// Update store selection
|
|
92
|
+
checkoutStore.selectedPaymentMethod = PAYMENT_METHODS.PLAID;
|
|
93
|
+
// Emit selection event
|
|
94
|
+
this.paymentMethodOptionSelected.emit(PAYMENT_METHODS.PLAID);
|
|
95
|
+
// If there's an error, clear it and try to initialize again
|
|
96
|
+
if (this.error) {
|
|
97
|
+
this.clearError();
|
|
98
|
+
this.waitForStoreAndInitialize();
|
|
99
|
+
return;
|
|
100
|
+
}
|
|
101
|
+
// If Plaid Link is ready and no public token exists, open Plaid Link
|
|
102
|
+
if (this.plaidLink && !this.publicToken && !this.isAuthenticating) {
|
|
103
|
+
this.openPlaidLink();
|
|
104
|
+
}
|
|
105
|
+
};
|
|
106
|
+
this.initializePlaidLink = async () => {
|
|
107
|
+
try {
|
|
108
|
+
// Check if Plaid is available globally
|
|
109
|
+
if (typeof window.Plaid === 'undefined') {
|
|
110
|
+
this.handleError({
|
|
111
|
+
code: PlaidErrorCodes.PLAID_SDK_LOAD_FAILED,
|
|
112
|
+
message: PLAID_ERROR_MESSAGES[PlaidErrorCodes.PLAID_SDK_LOAD_FAILED],
|
|
113
|
+
severity: PLAID_ERROR_SEVERITY[PlaidErrorCodes.PLAID_SDK_LOAD_FAILED],
|
|
114
|
+
retryable: true,
|
|
115
|
+
userAction: 'Refresh the page and try again'
|
|
116
|
+
});
|
|
117
|
+
return;
|
|
118
|
+
}
|
|
119
|
+
// Get link token from backend
|
|
120
|
+
await this.getLinkToken();
|
|
121
|
+
if (!this.linkToken) {
|
|
122
|
+
this.handleError({
|
|
123
|
+
code: PlaidErrorCodes.PLAID_LINK_TOKEN_FAILED,
|
|
124
|
+
message: PLAID_ERROR_MESSAGES[PlaidErrorCodes.PLAID_LINK_TOKEN_FAILED],
|
|
125
|
+
severity: PLAID_ERROR_SEVERITY[PlaidErrorCodes.PLAID_LINK_TOKEN_FAILED],
|
|
126
|
+
retryable: true,
|
|
127
|
+
userAction: 'Click to try again'
|
|
128
|
+
});
|
|
129
|
+
return;
|
|
130
|
+
}
|
|
131
|
+
// Initialize Plaid Link
|
|
132
|
+
const Plaid = window.Plaid;
|
|
133
|
+
this.plaidLink = Plaid.create({
|
|
134
|
+
token: this.linkToken,
|
|
135
|
+
onSuccess: this.handlePlaidSuccess,
|
|
136
|
+
onExit: this.handlePlaidExit,
|
|
137
|
+
onEvent: this.handlePlaidEvent,
|
|
138
|
+
onLoad: this.handlePlaidLoad,
|
|
139
|
+
});
|
|
140
|
+
}
|
|
141
|
+
catch (error) {
|
|
142
|
+
this.handleError({
|
|
143
|
+
code: PlaidErrorCodes.PLAID_LINK_INIT_FAILED,
|
|
144
|
+
message: PLAID_ERROR_MESSAGES[PlaidErrorCodes.PLAID_LINK_INIT_FAILED],
|
|
145
|
+
severity: PLAID_ERROR_SEVERITY[PlaidErrorCodes.PLAID_LINK_INIT_FAILED],
|
|
146
|
+
originalError: error,
|
|
147
|
+
retryable: true,
|
|
148
|
+
userAction: 'Click to try again'
|
|
149
|
+
});
|
|
150
|
+
}
|
|
151
|
+
};
|
|
152
|
+
this.getLinkToken = async () => {
|
|
153
|
+
var _a, _b, _c, _d, _e;
|
|
154
|
+
try {
|
|
155
|
+
if (!checkoutStore.authToken || !checkoutStore.accountId) {
|
|
156
|
+
this.handleError({
|
|
157
|
+
code: PlaidErrorCodes.PLAID_LINK_TOKEN_FAILED,
|
|
158
|
+
message: 'Missing authentication. Please refresh the page and try again.',
|
|
159
|
+
severity: ComponentErrorSeverity.ERROR,
|
|
160
|
+
retryable: false,
|
|
161
|
+
userAction: 'Refresh the page'
|
|
162
|
+
});
|
|
163
|
+
return;
|
|
164
|
+
}
|
|
165
|
+
// Create abort controller for timeout handling
|
|
166
|
+
this.abortController = new AbortController();
|
|
167
|
+
// Set timeout for the request
|
|
168
|
+
this.timeoutId = setTimeout(() => {
|
|
169
|
+
var _a;
|
|
170
|
+
(_a = this.abortController) === null || _a === void 0 ? void 0 : _a.abort();
|
|
171
|
+
}, 30000); // 30 second timeout
|
|
172
|
+
const response = await this.plaidService.getLinkToken(checkoutStore.authToken, checkoutStore.accountId, checkoutStore.checkoutId, this.abortController.signal);
|
|
173
|
+
// Clear timeout
|
|
174
|
+
if (this.timeoutId) {
|
|
175
|
+
clearTimeout(this.timeoutId);
|
|
176
|
+
this.timeoutId = null;
|
|
177
|
+
}
|
|
178
|
+
if (response.error) {
|
|
179
|
+
const errorMessage = typeof response.error === 'string'
|
|
180
|
+
? response.error
|
|
181
|
+
: response.error.message || 'Failed to get link token';
|
|
182
|
+
throw new Error(errorMessage);
|
|
183
|
+
}
|
|
184
|
+
// Some backends may return an id along with the link token
|
|
185
|
+
this.linkToken = response.data.link_token;
|
|
186
|
+
// Try to capture link token id if present in envelope
|
|
187
|
+
this.linkTokenId = (response === null || response === void 0 ? void 0 : response.id) || ((_a = response === null || response === void 0 ? void 0 : response.data) === null || _a === void 0 ? void 0 : _a.id) || null;
|
|
188
|
+
}
|
|
189
|
+
catch (error) {
|
|
190
|
+
// Clear timeout
|
|
191
|
+
if (this.timeoutId) {
|
|
192
|
+
clearTimeout(this.timeoutId);
|
|
193
|
+
this.timeoutId = null;
|
|
194
|
+
}
|
|
195
|
+
let errorCode = PlaidErrorCodes.PLAID_LINK_TOKEN_FAILED;
|
|
196
|
+
let message = PLAID_ERROR_MESSAGES[errorCode];
|
|
197
|
+
let retryable = true;
|
|
198
|
+
// Handle specific error types
|
|
199
|
+
if (error.name === 'AbortError') {
|
|
200
|
+
errorCode = PlaidErrorCodes.PLAID_TIMEOUT;
|
|
201
|
+
message = PLAID_ERROR_MESSAGES[errorCode];
|
|
202
|
+
retryable = true;
|
|
203
|
+
}
|
|
204
|
+
else if (((_b = error.message) === null || _b === void 0 ? void 0 : _b.includes('network')) || ((_c = error.message) === null || _c === void 0 ? void 0 : _c.includes('fetch'))) {
|
|
205
|
+
errorCode = PlaidErrorCodes.PLAID_NETWORK_ERROR;
|
|
206
|
+
message = PLAID_ERROR_MESSAGES[errorCode];
|
|
207
|
+
retryable = true;
|
|
208
|
+
}
|
|
209
|
+
else if (((_d = error.message) === null || _d === void 0 ? void 0 : _d.includes('401')) || ((_e = error.message) === null || _e === void 0 ? void 0 : _e.includes('unauthorized'))) {
|
|
210
|
+
errorCode = PlaidErrorCodes.PLAID_INVALID_CREDENTIALS;
|
|
211
|
+
message = 'Authentication failed. Please refresh the page and try again.';
|
|
212
|
+
retryable = false;
|
|
213
|
+
}
|
|
214
|
+
this.handleError({
|
|
215
|
+
code: errorCode,
|
|
216
|
+
message: message,
|
|
217
|
+
severity: PLAID_ERROR_SEVERITY[errorCode],
|
|
218
|
+
originalError: error,
|
|
219
|
+
retryable,
|
|
220
|
+
userAction: retryable ? 'Click to try again' : 'Refresh the page'
|
|
221
|
+
});
|
|
222
|
+
}
|
|
223
|
+
};
|
|
224
|
+
this.mapApiErrorToPlaidError = (apiError) => {
|
|
225
|
+
if (typeof apiError === 'string') {
|
|
226
|
+
if (apiError.includes('rate_limit'))
|
|
227
|
+
return PlaidErrorCodes.PLAID_RATE_LIMITED;
|
|
228
|
+
if (apiError.includes('maintenance'))
|
|
229
|
+
return PlaidErrorCodes.PLAID_MAINTENANCE;
|
|
230
|
+
if (apiError.includes('not_authenticated'))
|
|
231
|
+
return PlaidErrorCodes.PLAID_INVALID_CREDENTIALS;
|
|
232
|
+
}
|
|
233
|
+
if (apiError === null || apiError === void 0 ? void 0 : apiError.code) {
|
|
234
|
+
switch (apiError.code) {
|
|
235
|
+
case 'rate_limited': return PlaidErrorCodes.PLAID_RATE_LIMITED;
|
|
236
|
+
case 'maintenance': return PlaidErrorCodes.PLAID_MAINTENANCE;
|
|
237
|
+
case 'not_authenticated': return PlaidErrorCodes.PLAID_INVALID_CREDENTIALS;
|
|
238
|
+
case 'invalid_parameter': return PlaidErrorCodes.PLAID_LINK_TOKEN_FAILED;
|
|
239
|
+
default: return PlaidErrorCodes.PLAID_LINK_TOKEN_FAILED;
|
|
240
|
+
}
|
|
241
|
+
}
|
|
242
|
+
return PlaidErrorCodes.PLAID_LINK_TOKEN_FAILED;
|
|
243
|
+
};
|
|
244
|
+
this.openPlaidLink = () => {
|
|
245
|
+
if (this.plaidLink && this.linkToken) {
|
|
246
|
+
this.isAuthenticating = true;
|
|
247
|
+
this.clearError();
|
|
248
|
+
this.plaidLink.open();
|
|
249
|
+
}
|
|
250
|
+
};
|
|
251
|
+
this.handlePlaidSuccess = (publicToken, _metadata) => {
|
|
252
|
+
this.publicToken = publicToken;
|
|
253
|
+
this.isAuthenticating = false;
|
|
254
|
+
this.clearError();
|
|
255
|
+
this.retryCount = 0; // Reset retry count on success
|
|
256
|
+
// Ensure the component remains selected after successful authentication
|
|
257
|
+
if (!this.isSelected) {
|
|
258
|
+
this.isSelected = true;
|
|
259
|
+
checkoutStore.selectedPaymentMethod = PAYMENT_METHODS.PLAID;
|
|
260
|
+
}
|
|
261
|
+
// Emit success event for parent components
|
|
262
|
+
this.plaidErrorRecovered.emit({
|
|
263
|
+
code: 'plaid-success',
|
|
264
|
+
message: 'Bank account connected successfully',
|
|
265
|
+
severity: ComponentErrorSeverity.INFO
|
|
266
|
+
});
|
|
267
|
+
// Immediately exchange the public token for a payment method token via backend
|
|
268
|
+
this.exchangePublicTokenForPaymentMethod();
|
|
269
|
+
};
|
|
270
|
+
this.exchangePublicTokenForPaymentMethod = async () => {
|
|
271
|
+
var _a;
|
|
272
|
+
if (!this.publicToken) {
|
|
273
|
+
console.error('[PlaidPaymentMethod] exchange: missing publicToken');
|
|
274
|
+
return;
|
|
275
|
+
}
|
|
276
|
+
if (!checkoutStore.authToken || !checkoutStore.accountId) {
|
|
277
|
+
console.error('[PlaidPaymentMethod] exchange: missing auth/account context');
|
|
278
|
+
return;
|
|
279
|
+
}
|
|
280
|
+
try {
|
|
281
|
+
const response = await this.plaidService.tokenizeBankAccount(checkoutStore.authToken, checkoutStore.accountId, this.publicToken, this.linkTokenId || undefined, checkoutStore.savePaymentMethod ? checkoutStore.paymentMethodGroupId : undefined);
|
|
282
|
+
if (response === null || response === void 0 ? void 0 : response.error) {
|
|
283
|
+
console.error('[PlaidPaymentMethod] exchange: backend error', response.error);
|
|
284
|
+
return;
|
|
285
|
+
}
|
|
286
|
+
// Extract token from payment method response
|
|
287
|
+
const paymentMethod = response === null || response === void 0 ? void 0 : response.data;
|
|
288
|
+
const token = ((_a = paymentMethod === null || paymentMethod === void 0 ? void 0 : paymentMethod.bank_account) === null || _a === void 0 ? void 0 : _a.token) || (paymentMethod === null || paymentMethod === void 0 ? void 0 : paymentMethod.token) || (paymentMethod === null || paymentMethod === void 0 ? void 0 : paymentMethod.id);
|
|
289
|
+
if (!token) {
|
|
290
|
+
console.error('[PlaidPaymentMethod] exchange: no token in response');
|
|
291
|
+
return;
|
|
292
|
+
}
|
|
293
|
+
// Save for downstream submit flows
|
|
294
|
+
checkoutStore.paymentToken = token;
|
|
295
|
+
}
|
|
296
|
+
catch (err) {
|
|
297
|
+
console.error('[PlaidPaymentMethod] exchange: exception', {
|
|
298
|
+
message: (err === null || err === void 0 ? void 0 : err.message) || String(err),
|
|
299
|
+
});
|
|
300
|
+
}
|
|
301
|
+
};
|
|
302
|
+
this.handlePlaidExit = (err, _metadata) => {
|
|
303
|
+
this.isAuthenticating = false;
|
|
304
|
+
if (err) {
|
|
305
|
+
this.handlePlaidError(err);
|
|
306
|
+
}
|
|
307
|
+
else {
|
|
308
|
+
// User closed the modal without error
|
|
309
|
+
// If user closed without completing authentication, ensure component remains selected
|
|
310
|
+
// but clear any existing tokens to force re-authentication
|
|
311
|
+
if (this.isSelected && !this.publicToken) {
|
|
312
|
+
// Component is selected but no token, this is expected state
|
|
313
|
+
}
|
|
314
|
+
}
|
|
315
|
+
};
|
|
316
|
+
this.handlePlaidEvent = (eventName, metadata) => {
|
|
317
|
+
// Handle specific events if needed
|
|
318
|
+
switch (eventName) {
|
|
319
|
+
case 'OPEN':
|
|
320
|
+
this.isAuthenticating = true;
|
|
321
|
+
break;
|
|
322
|
+
case 'CLOSE':
|
|
323
|
+
this.isAuthenticating = false;
|
|
324
|
+
break;
|
|
325
|
+
case 'ERROR':
|
|
326
|
+
this.handlePlaidError(metadata);
|
|
327
|
+
break;
|
|
328
|
+
case 'HANDOFF':
|
|
329
|
+
// User is being redirected to their bank
|
|
330
|
+
break;
|
|
331
|
+
case 'TRANSITION_VIEW':
|
|
332
|
+
// Plaid Link view transition
|
|
333
|
+
break;
|
|
334
|
+
}
|
|
335
|
+
};
|
|
336
|
+
this.handlePlaidLoad = () => {
|
|
337
|
+
};
|
|
338
|
+
this.handlePlaidError = (error) => {
|
|
339
|
+
let errorCode = PlaidErrorCodes.PLAID_AUTHENTICATION_FAILED;
|
|
340
|
+
let message = PLAID_ERROR_MESSAGES[errorCode];
|
|
341
|
+
let retryable = true;
|
|
342
|
+
let userAction = 'Click to try again';
|
|
343
|
+
// Map Plaid error codes to our error codes
|
|
344
|
+
if (error.error_code) {
|
|
345
|
+
switch (error.error_code) {
|
|
346
|
+
case 'INVALID_CREDENTIALS':
|
|
347
|
+
errorCode = PlaidErrorCodes.PLAID_INVALID_CREDENTIALS;
|
|
348
|
+
message = PLAID_ERROR_MESSAGES[errorCode];
|
|
349
|
+
retryable = true;
|
|
350
|
+
break;
|
|
351
|
+
case 'ITEM_LOGIN_REQUIRED':
|
|
352
|
+
errorCode = PlaidErrorCodes.PLAID_INVALID_CREDENTIALS;
|
|
353
|
+
message = 'Your bank requires re-authentication. Please try again.';
|
|
354
|
+
retryable = true;
|
|
355
|
+
break;
|
|
356
|
+
case 'ITEM_LOCKED':
|
|
357
|
+
errorCode = PlaidErrorCodes.PLAID_ACCOUNT_LOCKED;
|
|
358
|
+
message = PLAID_ERROR_MESSAGES[errorCode];
|
|
359
|
+
retryable = false;
|
|
360
|
+
userAction = 'Contact your bank';
|
|
361
|
+
break;
|
|
362
|
+
case 'INSTITUTION_NOT_RESPONDING':
|
|
363
|
+
errorCode = PlaidErrorCodes.PLAID_MAINTENANCE;
|
|
364
|
+
message = PLAID_ERROR_MESSAGES[errorCode];
|
|
365
|
+
retryable = true;
|
|
366
|
+
break;
|
|
367
|
+
case 'RATE_LIMIT_EXCEEDED':
|
|
368
|
+
errorCode = PlaidErrorCodes.PLAID_RATE_LIMITED;
|
|
369
|
+
message = PLAID_ERROR_MESSAGES[errorCode];
|
|
370
|
+
retryable = true;
|
|
371
|
+
break;
|
|
372
|
+
case 'INVALID_REQUEST':
|
|
373
|
+
errorCode = PlaidErrorCodes.PLAID_AUTHENTICATION_FAILED;
|
|
374
|
+
message = 'Invalid request. Please try again.';
|
|
375
|
+
retryable = true;
|
|
376
|
+
break;
|
|
377
|
+
case 'PLAID_ERROR':
|
|
378
|
+
errorCode = PlaidErrorCodes.PLAID_AUTHENTICATION_FAILED;
|
|
379
|
+
message = error.error_message || 'Bank authentication failed. Please try again.';
|
|
380
|
+
retryable = true;
|
|
381
|
+
break;
|
|
382
|
+
default:
|
|
383
|
+
// Use the error message from Plaid if available
|
|
384
|
+
if (error.error_message) {
|
|
385
|
+
message = error.error_message;
|
|
386
|
+
}
|
|
387
|
+
break;
|
|
388
|
+
}
|
|
389
|
+
}
|
|
390
|
+
// Handle specific error messages
|
|
391
|
+
if (error.error_message) {
|
|
392
|
+
const lowerMessage = error.error_message.toLowerCase();
|
|
393
|
+
if (lowerMessage.includes('not supported') || lowerMessage.includes('unsupported')) {
|
|
394
|
+
errorCode = PlaidErrorCodes.PLAID_BANK_NOT_SUPPORTED;
|
|
395
|
+
message = PLAID_ERROR_MESSAGES[errorCode];
|
|
396
|
+
retryable = false;
|
|
397
|
+
userAction = 'Try a different payment method';
|
|
398
|
+
}
|
|
399
|
+
else if (lowerMessage.includes('expired') || lowerMessage.includes('timeout')) {
|
|
400
|
+
errorCode = PlaidErrorCodes.PLAID_TOKEN_EXPIRED;
|
|
401
|
+
message = PLAID_ERROR_MESSAGES[errorCode];
|
|
402
|
+
retryable = true;
|
|
403
|
+
}
|
|
404
|
+
}
|
|
405
|
+
this.handleError({
|
|
406
|
+
code: errorCode,
|
|
407
|
+
message,
|
|
408
|
+
severity: PLAID_ERROR_SEVERITY[errorCode],
|
|
409
|
+
originalError: error,
|
|
410
|
+
retryable,
|
|
411
|
+
userAction
|
|
412
|
+
});
|
|
413
|
+
this.isAuthenticating = false;
|
|
414
|
+
// Even with an error, the component should remain selected to allow retry
|
|
415
|
+
if (this.isSelected) {
|
|
416
|
+
}
|
|
417
|
+
};
|
|
418
|
+
this.handleError = (plaidError) => {
|
|
419
|
+
this.error = plaidError;
|
|
420
|
+
// Emit error event for parent components
|
|
421
|
+
this.plaidError.emit({
|
|
422
|
+
code: plaidError.code,
|
|
423
|
+
message: plaidError.message,
|
|
424
|
+
severity: plaidError.severity,
|
|
425
|
+
data: {
|
|
426
|
+
originalError: plaidError.originalError,
|
|
427
|
+
retryable: plaidError.retryable,
|
|
428
|
+
userAction: plaidError.userAction,
|
|
429
|
+
retryCount: this.retryCount
|
|
430
|
+
}
|
|
431
|
+
});
|
|
432
|
+
console.error('Plaid error:', plaidError);
|
|
433
|
+
// Auto-retry for retryable errors if under max retries
|
|
434
|
+
if (plaidError.retryable && this.retryCount < this.maxRetries) {
|
|
435
|
+
this.scheduleRetry();
|
|
436
|
+
}
|
|
437
|
+
};
|
|
438
|
+
this.scheduleRetry = () => {
|
|
439
|
+
if (this.isRetrying)
|
|
440
|
+
return;
|
|
441
|
+
this.isRetrying = true;
|
|
442
|
+
this.retryCount++;
|
|
443
|
+
setTimeout(() => {
|
|
444
|
+
this.isRetrying = false;
|
|
445
|
+
this.clearError();
|
|
446
|
+
this.waitForStoreAndInitialize();
|
|
447
|
+
}, this.retryDelay * this.retryCount); // Exponential backoff
|
|
448
|
+
};
|
|
449
|
+
this.clearError = () => {
|
|
450
|
+
if (this.error) {
|
|
451
|
+
this.error = null;
|
|
452
|
+
this.retryCount = 0;
|
|
453
|
+
}
|
|
454
|
+
};
|
|
455
|
+
// Watch for store changes to sync component state
|
|
456
|
+
this.syncWithStore = () => {
|
|
457
|
+
const shouldBeSelected = checkoutStore.selectedPaymentMethod === PAYMENT_METHODS.PLAID;
|
|
458
|
+
if (this.isSelected !== shouldBeSelected) {
|
|
459
|
+
this.isSelected = shouldBeSelected;
|
|
460
|
+
}
|
|
461
|
+
};
|
|
462
|
+
}
|
|
463
|
+
onSelectionChange(newValue) {
|
|
464
|
+
// Ensure store is updated when component selection changes
|
|
465
|
+
if (newValue && checkoutStore.selectedPaymentMethod !== PAYMENT_METHODS.PLAID) {
|
|
466
|
+
checkoutStore.selectedPaymentMethod = PAYMENT_METHODS.PLAID;
|
|
467
|
+
}
|
|
468
|
+
}
|
|
469
|
+
componentDidRender() {
|
|
470
|
+
if (!this.scriptRef)
|
|
471
|
+
return;
|
|
472
|
+
this.scriptRef.onload = () => {
|
|
473
|
+
// Wait for store to be populated before initializing
|
|
474
|
+
this.waitForStoreAndInitialize();
|
|
475
|
+
};
|
|
476
|
+
// Add error handler for script loading failures
|
|
477
|
+
this.scriptRef.onerror = () => {
|
|
478
|
+
this.handleError({
|
|
479
|
+
code: PlaidErrorCodes.PLAID_SDK_LOAD_FAILED,
|
|
480
|
+
message: PLAID_ERROR_MESSAGES[PlaidErrorCodes.PLAID_SDK_LOAD_FAILED],
|
|
481
|
+
severity: PLAID_ERROR_SEVERITY[PlaidErrorCodes.PLAID_SDK_LOAD_FAILED],
|
|
482
|
+
retryable: true,
|
|
483
|
+
userAction: 'Refresh the page and try again'
|
|
484
|
+
});
|
|
485
|
+
};
|
|
486
|
+
}
|
|
487
|
+
componentWillLoad() {
|
|
488
|
+
// Initialize selection state based on store
|
|
489
|
+
this.isSelected = checkoutStore.selectedPaymentMethod === PAYMENT_METHODS.PLAID;
|
|
490
|
+
}
|
|
491
|
+
async resolvePaymentMethod() {
|
|
492
|
+
if (!this.publicToken) {
|
|
493
|
+
return { validationError: true };
|
|
494
|
+
}
|
|
495
|
+
return {
|
|
496
|
+
token: this.publicToken,
|
|
497
|
+
data: {
|
|
498
|
+
type: 'bank_account',
|
|
499
|
+
plaid_public_token: this.publicToken
|
|
500
|
+
}
|
|
501
|
+
};
|
|
502
|
+
}
|
|
503
|
+
// Returns a usable payment method token for checkout completion.
|
|
504
|
+
// Will perform the backend exchange if the token is not yet present in the store.
|
|
505
|
+
async getPaymentToken() {
|
|
506
|
+
if (checkoutStore.paymentToken) {
|
|
507
|
+
return checkoutStore.paymentToken;
|
|
508
|
+
}
|
|
509
|
+
await this.exchangePublicTokenForPaymentMethod();
|
|
510
|
+
return checkoutStore.paymentToken;
|
|
511
|
+
}
|
|
512
|
+
// Method to handle external selection changes (e.g., from other payment methods)
|
|
513
|
+
async setSelected(selected) {
|
|
514
|
+
this.isSelected = selected;
|
|
515
|
+
if (selected) {
|
|
516
|
+
checkoutStore.selectedPaymentMethod = PAYMENT_METHODS.PLAID;
|
|
517
|
+
}
|
|
518
|
+
}
|
|
519
|
+
// Method to check if component is currently selected
|
|
520
|
+
async isCurrentlySelected() {
|
|
521
|
+
return this.isSelected;
|
|
522
|
+
}
|
|
523
|
+
// Method to handle external deselection (when another payment method is selected)
|
|
524
|
+
async deselect() {
|
|
525
|
+
this.isSelected = false;
|
|
526
|
+
// Don't clear the public token or error state as they might be needed if user reselects
|
|
527
|
+
}
|
|
528
|
+
// Method to reset component state (useful for testing or error recovery)
|
|
529
|
+
async reset() {
|
|
530
|
+
this.publicToken = null;
|
|
531
|
+
this.clearError();
|
|
532
|
+
this.isAuthenticating = false;
|
|
533
|
+
this.linkToken = null;
|
|
534
|
+
this.plaidLink = null;
|
|
535
|
+
this.retryCount = 0;
|
|
536
|
+
this.isRetrying = false;
|
|
537
|
+
// Clear any pending timeouts
|
|
538
|
+
if (this.timeoutId) {
|
|
539
|
+
clearTimeout(this.timeoutId);
|
|
540
|
+
this.timeoutId = null;
|
|
541
|
+
}
|
|
542
|
+
// Abort any pending requests
|
|
543
|
+
if (this.abortController) {
|
|
544
|
+
this.abortController.abort();
|
|
545
|
+
this.abortController = null;
|
|
546
|
+
}
|
|
547
|
+
}
|
|
548
|
+
// Method to check if component is ready for authentication
|
|
549
|
+
async isReadyForAuthentication() {
|
|
550
|
+
return !!(this.plaidLink && this.linkToken && !this.isAuthenticating);
|
|
551
|
+
}
|
|
552
|
+
// Method to manually retry after an error
|
|
553
|
+
async retry() {
|
|
554
|
+
if (this.error && this.error.retryable) {
|
|
555
|
+
this.clearError();
|
|
556
|
+
this.waitForStoreAndInitialize();
|
|
557
|
+
}
|
|
558
|
+
}
|
|
559
|
+
// Method to get current error information
|
|
560
|
+
async getErrorInfo() {
|
|
561
|
+
return this.error;
|
|
562
|
+
}
|
|
563
|
+
componentDidLoad() {
|
|
564
|
+
// Set up store change listener to keep component in sync
|
|
565
|
+
const unsubscribe = onChange('selectedPaymentMethod', this.syncWithStore);
|
|
566
|
+
// Store unsubscribe function for cleanup
|
|
567
|
+
this.unsubscribeFromStore = unsubscribe;
|
|
568
|
+
}
|
|
569
|
+
disconnectedCallback() {
|
|
570
|
+
// Clean up store subscription
|
|
571
|
+
if (this.unsubscribeFromStore) {
|
|
572
|
+
this.unsubscribeFromStore();
|
|
573
|
+
}
|
|
574
|
+
// Clean up timeouts and abort controllers
|
|
575
|
+
if (this.timeoutId) {
|
|
576
|
+
clearTimeout(this.timeoutId);
|
|
577
|
+
}
|
|
578
|
+
if (this.abortController) {
|
|
579
|
+
this.abortController.abort();
|
|
580
|
+
}
|
|
581
|
+
}
|
|
582
|
+
render() {
|
|
583
|
+
// Only allow use if enabled in checkout settings
|
|
584
|
+
if (checkoutStore.bankAccountVerification !== true) {
|
|
585
|
+
if (!this.hasLoggedDisabledWarning) {
|
|
586
|
+
// Log once per component lifecycle
|
|
587
|
+
console.warn('[PlaidPaymentMethod] bank_account_verification is disabled. Component will not render.');
|
|
588
|
+
this.hasLoggedDisabledWarning = true;
|
|
589
|
+
}
|
|
590
|
+
return null;
|
|
591
|
+
}
|
|
592
|
+
const plaidLogo = (h("img", { class: "plaid-logo-img", src: plaidLogoSvg, alt: "Plaid", title: "Plaid", style: {
|
|
593
|
+
display: 'inline',
|
|
594
|
+
width: '20px',
|
|
595
|
+
height: '20px',
|
|
596
|
+
marginLeft: '5px',
|
|
597
|
+
marginTop: '-2px',
|
|
598
|
+
} }));
|
|
599
|
+
const renderErrorState = () => {
|
|
600
|
+
if (!this.error)
|
|
601
|
+
return null;
|
|
602
|
+
const errorClass = this.error.severity === ComponentErrorSeverity.ERROR
|
|
603
|
+
? 'text-danger'
|
|
604
|
+
: this.error.severity === ComponentErrorSeverity.WARNING
|
|
605
|
+
? 'text-warning'
|
|
606
|
+
: 'text-info';
|
|
607
|
+
return (h("div", { class: `${errorClass} mt-2` }, h("small", null, this.error.message), h("br", null), h("small", { class: "text-muted" }, this.error.userAction, this.error.retryable && this.retryCount < this.maxRetries && (h("span", null, " \u2022 Auto-retry in progress...")))));
|
|
608
|
+
};
|
|
609
|
+
const renderStatusState = () => {
|
|
610
|
+
if (this.error)
|
|
611
|
+
return null;
|
|
612
|
+
if (this.isAuthenticating) {
|
|
613
|
+
return (h("div", { class: "text-info mt-2" }, h("small", null, "Connecting to your bank...")));
|
|
614
|
+
}
|
|
615
|
+
if (this.publicToken) {
|
|
616
|
+
return (h("div", { class: "text-success mt-2" }, h("small", null, "\u2713 Bank account connected successfully")));
|
|
617
|
+
}
|
|
618
|
+
if (this.isSelected && !this.publicToken && !this.error && !this.isAuthenticating) {
|
|
619
|
+
return (h("div", { class: "text-muted mt-2" }, h("small", null, "Click to connect your bank account")));
|
|
620
|
+
}
|
|
621
|
+
return null;
|
|
622
|
+
};
|
|
623
|
+
return (h(StyledHost, { class: "payment-method" }, h("script", { src: "https://cdn.plaid.com/link/v2/stable/link-initialize.js", async: true, ref: (el) => (this.scriptRef = el) }), h("div", { class: "radio-list-item p-3", part: radioListItem, onClick: this.onPaymentMethodOptionClick, title: "Pay with Plaid" }, h("form-control-radio", { name: "paymentMethodType", value: PAYMENT_METHODS.PLAID, checked: this.isSelected, label: h("div", null, h("div", null, "Pay with Bank Account ", plaidLogo, " "), renderErrorState(), renderStatusState()) }))));
|
|
624
|
+
}
|
|
625
|
+
static get is() { return "justifi-plaid-payment-method"; }
|
|
626
|
+
static get encapsulation() { return "shadow"; }
|
|
627
|
+
static get states() {
|
|
628
|
+
return {
|
|
629
|
+
"isAuthenticating": {},
|
|
630
|
+
"publicToken": {},
|
|
631
|
+
"linkToken": {},
|
|
632
|
+
"linkTokenId": {},
|
|
633
|
+
"error": {},
|
|
634
|
+
"plaidLink": {},
|
|
635
|
+
"isSelected": {},
|
|
636
|
+
"retryCount": {},
|
|
637
|
+
"isRetrying": {}
|
|
638
|
+
};
|
|
639
|
+
}
|
|
640
|
+
static get events() {
|
|
641
|
+
return [{
|
|
642
|
+
"method": "paymentMethodOptionSelected",
|
|
643
|
+
"name": "paymentMethodOptionSelected",
|
|
644
|
+
"bubbles": true,
|
|
645
|
+
"cancelable": true,
|
|
646
|
+
"composed": true,
|
|
647
|
+
"docs": {
|
|
648
|
+
"tags": [],
|
|
649
|
+
"text": ""
|
|
650
|
+
},
|
|
651
|
+
"complexType": {
|
|
652
|
+
"original": "any",
|
|
653
|
+
"resolved": "any",
|
|
654
|
+
"references": {}
|
|
655
|
+
}
|
|
656
|
+
}, {
|
|
657
|
+
"method": "plaidError",
|
|
658
|
+
"name": "plaidError",
|
|
659
|
+
"bubbles": true,
|
|
660
|
+
"cancelable": true,
|
|
661
|
+
"composed": true,
|
|
662
|
+
"docs": {
|
|
663
|
+
"tags": [],
|
|
664
|
+
"text": ""
|
|
665
|
+
},
|
|
666
|
+
"complexType": {
|
|
667
|
+
"original": "any",
|
|
668
|
+
"resolved": "any",
|
|
669
|
+
"references": {}
|
|
670
|
+
}
|
|
671
|
+
}, {
|
|
672
|
+
"method": "plaidErrorRecovered",
|
|
673
|
+
"name": "plaidErrorRecovered",
|
|
674
|
+
"bubbles": true,
|
|
675
|
+
"cancelable": true,
|
|
676
|
+
"composed": true,
|
|
677
|
+
"docs": {
|
|
678
|
+
"tags": [],
|
|
679
|
+
"text": ""
|
|
680
|
+
},
|
|
681
|
+
"complexType": {
|
|
682
|
+
"original": "any",
|
|
683
|
+
"resolved": "any",
|
|
684
|
+
"references": {}
|
|
685
|
+
}
|
|
686
|
+
}];
|
|
687
|
+
}
|
|
688
|
+
static get methods() {
|
|
689
|
+
return {
|
|
690
|
+
"resolvePaymentMethod": {
|
|
691
|
+
"complexType": {
|
|
692
|
+
"signature": "() => Promise<PaymentMethodPayload>",
|
|
693
|
+
"parameters": [],
|
|
694
|
+
"references": {
|
|
695
|
+
"Promise": {
|
|
696
|
+
"location": "global",
|
|
697
|
+
"id": "global::Promise"
|
|
698
|
+
},
|
|
699
|
+
"PaymentMethodPayload": {
|
|
700
|
+
"location": "import",
|
|
701
|
+
"path": "../../checkout/payment-method-payload",
|
|
702
|
+
"id": "src/components/checkout/payment-method-payload.ts::PaymentMethodPayload"
|
|
703
|
+
}
|
|
704
|
+
},
|
|
705
|
+
"return": "Promise<PaymentMethodPayload>"
|
|
706
|
+
},
|
|
707
|
+
"docs": {
|
|
708
|
+
"text": "",
|
|
709
|
+
"tags": []
|
|
710
|
+
}
|
|
711
|
+
},
|
|
712
|
+
"getPaymentToken": {
|
|
713
|
+
"complexType": {
|
|
714
|
+
"signature": "() => Promise<string | undefined>",
|
|
715
|
+
"parameters": [],
|
|
716
|
+
"references": {
|
|
717
|
+
"Promise": {
|
|
718
|
+
"location": "global",
|
|
719
|
+
"id": "global::Promise"
|
|
720
|
+
}
|
|
721
|
+
},
|
|
722
|
+
"return": "Promise<string>"
|
|
723
|
+
},
|
|
724
|
+
"docs": {
|
|
725
|
+
"text": "",
|
|
726
|
+
"tags": []
|
|
727
|
+
}
|
|
728
|
+
},
|
|
729
|
+
"setSelected": {
|
|
730
|
+
"complexType": {
|
|
731
|
+
"signature": "(selected: boolean) => Promise<void>",
|
|
732
|
+
"parameters": [{
|
|
733
|
+
"name": "selected",
|
|
734
|
+
"type": "boolean",
|
|
735
|
+
"docs": ""
|
|
736
|
+
}],
|
|
737
|
+
"references": {
|
|
738
|
+
"Promise": {
|
|
739
|
+
"location": "global",
|
|
740
|
+
"id": "global::Promise"
|
|
741
|
+
}
|
|
742
|
+
},
|
|
743
|
+
"return": "Promise<void>"
|
|
744
|
+
},
|
|
745
|
+
"docs": {
|
|
746
|
+
"text": "",
|
|
747
|
+
"tags": []
|
|
748
|
+
}
|
|
749
|
+
},
|
|
750
|
+
"isCurrentlySelected": {
|
|
751
|
+
"complexType": {
|
|
752
|
+
"signature": "() => Promise<boolean>",
|
|
753
|
+
"parameters": [],
|
|
754
|
+
"references": {
|
|
755
|
+
"Promise": {
|
|
756
|
+
"location": "global",
|
|
757
|
+
"id": "global::Promise"
|
|
758
|
+
}
|
|
759
|
+
},
|
|
760
|
+
"return": "Promise<boolean>"
|
|
761
|
+
},
|
|
762
|
+
"docs": {
|
|
763
|
+
"text": "",
|
|
764
|
+
"tags": []
|
|
765
|
+
}
|
|
766
|
+
},
|
|
767
|
+
"deselect": {
|
|
768
|
+
"complexType": {
|
|
769
|
+
"signature": "() => Promise<void>",
|
|
770
|
+
"parameters": [],
|
|
771
|
+
"references": {
|
|
772
|
+
"Promise": {
|
|
773
|
+
"location": "global",
|
|
774
|
+
"id": "global::Promise"
|
|
775
|
+
}
|
|
776
|
+
},
|
|
777
|
+
"return": "Promise<void>"
|
|
778
|
+
},
|
|
779
|
+
"docs": {
|
|
780
|
+
"text": "",
|
|
781
|
+
"tags": []
|
|
782
|
+
}
|
|
783
|
+
},
|
|
784
|
+
"reset": {
|
|
785
|
+
"complexType": {
|
|
786
|
+
"signature": "() => Promise<void>",
|
|
787
|
+
"parameters": [],
|
|
788
|
+
"references": {
|
|
789
|
+
"Promise": {
|
|
790
|
+
"location": "global",
|
|
791
|
+
"id": "global::Promise"
|
|
792
|
+
}
|
|
793
|
+
},
|
|
794
|
+
"return": "Promise<void>"
|
|
795
|
+
},
|
|
796
|
+
"docs": {
|
|
797
|
+
"text": "",
|
|
798
|
+
"tags": []
|
|
799
|
+
}
|
|
800
|
+
},
|
|
801
|
+
"isReadyForAuthentication": {
|
|
802
|
+
"complexType": {
|
|
803
|
+
"signature": "() => Promise<boolean>",
|
|
804
|
+
"parameters": [],
|
|
805
|
+
"references": {
|
|
806
|
+
"Promise": {
|
|
807
|
+
"location": "global",
|
|
808
|
+
"id": "global::Promise"
|
|
809
|
+
}
|
|
810
|
+
},
|
|
811
|
+
"return": "Promise<boolean>"
|
|
812
|
+
},
|
|
813
|
+
"docs": {
|
|
814
|
+
"text": "",
|
|
815
|
+
"tags": []
|
|
816
|
+
}
|
|
817
|
+
},
|
|
818
|
+
"retry": {
|
|
819
|
+
"complexType": {
|
|
820
|
+
"signature": "() => Promise<void>",
|
|
821
|
+
"parameters": [],
|
|
822
|
+
"references": {
|
|
823
|
+
"Promise": {
|
|
824
|
+
"location": "global",
|
|
825
|
+
"id": "global::Promise"
|
|
826
|
+
}
|
|
827
|
+
},
|
|
828
|
+
"return": "Promise<void>"
|
|
829
|
+
},
|
|
830
|
+
"docs": {
|
|
831
|
+
"text": "",
|
|
832
|
+
"tags": []
|
|
833
|
+
}
|
|
834
|
+
},
|
|
835
|
+
"getErrorInfo": {
|
|
836
|
+
"complexType": {
|
|
837
|
+
"signature": "() => Promise<PlaidError | null>",
|
|
838
|
+
"parameters": [],
|
|
839
|
+
"references": {
|
|
840
|
+
"Promise": {
|
|
841
|
+
"location": "global",
|
|
842
|
+
"id": "global::Promise"
|
|
843
|
+
},
|
|
844
|
+
"PlaidError": {
|
|
845
|
+
"location": "global",
|
|
846
|
+
"id": "global::PlaidError"
|
|
847
|
+
}
|
|
848
|
+
},
|
|
849
|
+
"return": "Promise<PlaidError>"
|
|
850
|
+
},
|
|
851
|
+
"docs": {
|
|
852
|
+
"text": "",
|
|
853
|
+
"tags": []
|
|
854
|
+
}
|
|
855
|
+
}
|
|
856
|
+
};
|
|
857
|
+
}
|
|
858
|
+
static get watchers() {
|
|
859
|
+
return [{
|
|
860
|
+
"propName": "isSelected",
|
|
861
|
+
"methodName": "onSelectionChange"
|
|
862
|
+
}];
|
|
863
|
+
}
|
|
864
|
+
}
|