@justifi/webcomponents 4.10.0-rc.0 → 4.11.0
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/{Business-79361c8a.js → Business-7ae04d4f.js} +58 -2
- package/dist/cjs/{SubAccount-b3902202.js → SubAccount-05867651.js} +1 -1
- package/dist/cjs/additional-questions-details_5.cjs.entry.js +2 -1
- package/dist/cjs/business-additional-questions-schema-18a82d19.js +47 -0
- package/dist/cjs/business-details-core.cjs.entry.js +7 -2
- package/dist/cjs/{business-form-types-3cdd5447.js → business-form-types-29b2bad9.js} +7 -0
- package/dist/cjs/{form-control-datepart_3.cjs.entry.js → form-control-datepart_4.cjs.entry.js} +97 -46
- package/dist/cjs/form-control-monetary.cjs.entry.js +19 -17
- package/dist/cjs/{form-control-number_3.cjs.entry.js → form-control-select_2.cjs.entry.js} +7 -45
- package/dist/cjs/gross-payment-chart-core.cjs.entry.js +9 -2
- package/dist/cjs/justifi-additional-questions-form-step_5.cjs.entry.js +29 -24
- package/dist/cjs/justifi-additional-questions_4.cjs.entry.js +7 -7
- package/dist/cjs/justifi-billing-form_4.cjs.entry.js +3 -3
- package/dist/cjs/justifi-business-details.cjs.entry.js +23 -4
- package/dist/cjs/justifi-business-form.cjs.entry.js +62 -51
- package/dist/cjs/justifi-business-list.cjs.entry.js +3 -2
- package/dist/cjs/justifi-checkout-core.cjs.entry.js +5 -4
- package/dist/cjs/justifi-checkout.cjs.entry.js +1 -1
- package/dist/cjs/justifi-gross-payment-chart.cjs.entry.js +29 -5
- package/dist/cjs/justifi-owner-form.cjs.entry.js +22 -12
- package/dist/cjs/justifi-payment-balance-transactions.cjs.entry.js +2 -1
- package/dist/cjs/justifi-payment-details.cjs.entry.js +25 -4
- package/dist/cjs/justifi-payment-form.cjs.entry.js +18 -4
- package/dist/cjs/{justifi-business-form-stepped.cjs.entry.js → justifi-payment-provisioning.cjs.entry.js} +20 -20
- package/dist/cjs/justifi-payments-list.cjs.entry.js +25 -5
- package/dist/cjs/justifi-payout-details.cjs.entry.js +27 -7
- package/dist/cjs/justifi-payouts-list.cjs.entry.js +26 -6
- package/dist/cjs/justifi-proceeds-list.cjs.entry.js +2 -1
- package/dist/cjs/justifi-subaccount-details.cjs.entry.js +3 -2
- package/dist/cjs/justifi-subaccounts-list.cjs.entry.js +3 -2
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/payload-parsers-f437272e.js +132 -0
- package/dist/cjs/payment-details-core.cjs.entry.js +9 -2
- package/dist/cjs/payments-list-core.cjs.entry.js +10 -3
- package/dist/cjs/payout-details-core.cjs.entry.js +10 -4
- package/dist/cjs/payouts-list-core.cjs.entry.js +10 -3
- package/dist/cjs/subaccount-account-details_4.cjs.entry.js +2 -1
- package/dist/cjs/{utils-6f62f7a1.js → utils-2b9940e1.js} +7 -0
- package/dist/cjs/{utils-df5167a8.js → utils-87435719.js} +7 -0
- package/dist/cjs/utils-f8079741.js +41 -0
- package/dist/cjs/webcomponents.cjs.js +1 -1
- package/dist/collection/api/Business.js +12 -2
- package/dist/collection/api/ComponentError.js +14 -0
- package/dist/collection/api/services/utils.js +11 -0
- package/dist/collection/api/shared.js +11 -1
- package/dist/collection/collection-manifest.json +7 -8
- package/dist/collection/components/billing-form/billing-form.js +1 -1
- package/dist/collection/components/business-details/additional-questions-details/additional-questions-details.js +4 -4
- package/dist/collection/components/business-details/additional-questions-details/test/additional-questions.spec.js +1 -1
- package/dist/collection/components/business-details/business-details-core.js +30 -2
- package/dist/collection/components/business-details/business-details.js +30 -0
- package/dist/collection/components/business-details/generic-info-details/test/generic-info-details.spec.js +1 -1
- package/dist/collection/components/business-details/get-business.js +15 -3
- package/dist/collection/components/business-details/legal-address-details/test/legal-address-details.spec.js +1 -1
- package/dist/collection/components/business-details/owner-details/test/owner-details.spec.js +1 -1
- package/dist/collection/components/business-details/representative-details/test/representative-details.spec.js +1 -1
- package/dist/collection/components/business-details/test/busines-details-core.spec.js +56 -16
- package/dist/collection/components/business-details/test/business-details.spec.js +20 -4
- package/dist/collection/components/business-details/test/get-business.spec.js +13 -6
- package/dist/collection/components/business-forms/business-form/business-form.js +79 -50
- package/dist/collection/components/business-forms/business-form/business-representative/business-representative.js +1 -4
- package/dist/collection/components/business-forms/business-form/legal-address-form/legal-address-form.js +4 -2
- package/dist/collection/components/business-forms/{business-form-stepped/business-address/business-address-form-step.js → owner-form/identity-address/identity-address-form.js} +14 -11
- package/dist/collection/components/business-forms/owner-form/identity-address/test/identity-address.e2e.js +9 -0
- package/dist/collection/components/business-forms/{business-form/business-address/test/business-address.spec.js → owner-form/identity-address/test/identity-address.spec.js} +21 -14
- package/dist/collection/components/business-forms/owner-form/owner-form.js +54 -8
- package/dist/collection/components/business-forms/{business-form-stepped → payment-provisioning}/additional-questions/business-additional-questions-form-step.js +23 -4
- package/dist/collection/components/business-forms/{business-form-stepped → payment-provisioning}/business-core-info/business-core-info-form-step.js +19 -1
- package/dist/collection/components/business-forms/{business-form-stepped → payment-provisioning}/business-owners/business-owners-form-step.js +44 -4
- package/dist/collection/components/business-forms/{business-form-stepped → payment-provisioning}/business-representative/business-representative-form-step.js +24 -8
- package/dist/collection/components/business-forms/{business-form-stepped → payment-provisioning}/legal-address-form/legal-address-form-step.js +24 -4
- package/dist/collection/components/business-forms/{business-form-stepped/business-form-stepped.js → payment-provisioning/payment-provisioning.js} +36 -18
- package/dist/collection/components/business-forms/payment-provisioning/test/payment-provisioning.spec.js +61 -0
- package/dist/collection/components/business-forms/schemas/business-additional-questions-schema.js +15 -6
- package/dist/collection/components/business-forms/schemas/business-address-schema.js +49 -13
- package/dist/collection/components/business-forms/schemas/business-core-info-schema.js +24 -12
- package/dist/collection/components/business-forms/schemas/business-form-schema.js +4 -4
- package/dist/collection/components/business-forms/schemas/business-identity-schema.js +29 -34
- package/dist/collection/components/business-forms/utils/business-form-types.js +7 -0
- package/dist/collection/components/business-forms/utils/helpers.js +2 -0
- package/dist/collection/components/checkout/checkout-core.js +4 -4
- package/dist/collection/components/form/form-control-datepart.js +39 -34
- package/dist/collection/components/form/form-control-monetary.js +22 -20
- package/dist/collection/components/form/form-control-number.js +1 -0
- package/dist/collection/components/form/form-control-select.js +3 -1
- package/dist/collection/components/form/form-control-text.js +36 -1
- package/dist/collection/components/form/test/form-control-datepart.spec.js +88 -0
- package/dist/collection/components/form/test/form-control-monetary.spec.js +69 -0
- package/dist/collection/components/form/test/form-control-number.spec.js +77 -0
- package/dist/collection/components/form/test/form-control-select.spec.js +84 -0
- package/dist/collection/components/form/test/form-control-text.spec.js +104 -0
- package/dist/collection/components/form/test/form.spec.js +60 -0
- package/dist/collection/components/form/utils.js +6 -0
- package/dist/collection/components/gross-payment-chart/get-gross-payment-chart-data.js +17 -2
- package/dist/collection/components/gross-payment-chart/gross-payment-chart-core.js +30 -1
- package/dist/collection/components/gross-payment-chart/gross-payment-chart.js +35 -1
- package/dist/collection/components/gross-payment-chart/test/get-gross-payment-chart-data.spec.js +26 -8
- package/dist/collection/components/gross-payment-chart/test/gross-payment-chart-core.spec.js +51 -11
- package/dist/collection/components/gross-payment-chart/test/gross-payment-chart.spec.js +55 -3
- package/dist/collection/components/payment-details/get-payment-details.js +15 -3
- package/dist/collection/components/payment-details/payment-details-core.js +30 -1
- package/dist/collection/components/payment-details/payment-details.js +35 -1
- package/dist/collection/components/payment-details/test/get-payment-details.spec.js +11 -3
- package/dist/collection/components/payment-details/test/payment-details-core.spec.js +55 -12
- package/dist/collection/components/payment-details/test/payment-details.spec.js +69 -3
- package/dist/collection/components/payment-form/payment-form.js +54 -3
- package/dist/collection/components/payment-form/test/payment-form.spec.js +60 -1
- package/dist/collection/components/payments-list/get-payments.js +15 -4
- package/dist/collection/components/payments-list/payments-list-core.js +28 -2
- package/dist/collection/components/payments-list/payments-list.js +35 -1
- package/dist/collection/components/payments-list/test/get-payments.spec.js +11 -3
- package/dist/collection/components/payments-list/test/payments-list-core.spec.js +43 -28
- package/dist/collection/components/payments-list/test/payments-list.spec.js +31 -3
- package/dist/collection/components/payout-details/get-payout-details.js +17 -6
- package/dist/collection/components/payout-details/payout-details-core.js +31 -3
- package/dist/collection/components/payout-details/payout-details.js +35 -1
- package/dist/collection/components/payout-details/test/get-payout-details.spec.js +15 -5
- package/dist/collection/components/payout-details/test/payout-details-core.spec.js +54 -16
- package/dist/collection/components/payout-details/test/payout-details.spec.js +50 -1
- package/dist/collection/components/payouts-list/get-payouts.js +17 -5
- package/dist/collection/components/payouts-list/payouts-list-core.js +28 -2
- package/dist/collection/components/payouts-list/payouts-list.js +34 -1
- package/dist/collection/components/payouts-list/test/get-payouts.spec.js +11 -3
- package/dist/collection/components/payouts-list/test/payouts-list-core.spec.js +42 -29
- package/dist/collection/components/payouts-list/test/payouts-list.spec.js +33 -0
- package/dist/collection/utils/utils.js +5 -0
- package/dist/docs.json +1018 -618
- package/dist/esm/{Business-1df362e0.js → Business-91caaccb.js} +56 -3
- package/dist/esm/{SubAccount-f4ae9809.js → SubAccount-61ac70eb.js} +1 -1
- package/dist/esm/additional-questions-details_5.entry.js +2 -1
- package/dist/esm/business-additional-questions-schema-b642a2b7.js +44 -0
- package/dist/esm/business-details-core.entry.js +8 -3
- package/dist/esm/{business-form-types-de9f38cd.js → business-form-types-0d76133c.js} +8 -1
- package/dist/esm/{form-control-datepart_3.entry.js → form-control-datepart_4.entry.js} +97 -47
- package/dist/esm/form-control-monetary.entry.js +19 -17
- package/dist/esm/{form-control-number_3.entry.js → form-control-select_2.entry.js} +8 -45
- package/dist/esm/gross-payment-chart-core.entry.js +10 -3
- package/dist/esm/justifi-additional-questions-form-step_5.entry.js +28 -23
- package/dist/esm/justifi-additional-questions_4.entry.js +7 -7
- package/dist/esm/justifi-billing-form_4.entry.js +3 -3
- package/dist/esm/justifi-business-details.entry.js +24 -5
- package/dist/esm/justifi-business-form.entry.js +62 -51
- package/dist/esm/justifi-business-list.entry.js +3 -2
- package/dist/esm/justifi-checkout-core.entry.js +5 -4
- package/dist/esm/justifi-checkout.entry.js +1 -1
- package/dist/esm/justifi-gross-payment-chart.entry.js +28 -4
- package/dist/esm/justifi-owner-form.entry.js +21 -11
- package/dist/esm/justifi-payment-balance-transactions.entry.js +2 -1
- package/dist/esm/justifi-payment-details.entry.js +26 -5
- package/dist/esm/justifi-payment-form.entry.js +18 -4
- package/dist/esm/{justifi-business-form-stepped.entry.js → justifi-payment-provisioning.entry.js} +20 -20
- package/dist/esm/justifi-payments-list.entry.js +26 -6
- package/dist/esm/justifi-payout-details.entry.js +28 -8
- package/dist/esm/justifi-payouts-list.entry.js +27 -7
- package/dist/esm/justifi-proceeds-list.entry.js +2 -1
- package/dist/esm/justifi-subaccount-details.entry.js +3 -2
- package/dist/esm/justifi-subaccounts-list.entry.js +3 -2
- package/dist/esm/loader.js +1 -1
- package/dist/esm/payload-parsers-920f49dd.js +123 -0
- package/dist/esm/payment-details-core.entry.js +10 -3
- package/dist/esm/payments-list-core.entry.js +10 -3
- package/dist/esm/payout-details-core.entry.js +11 -5
- package/dist/esm/payouts-list-core.entry.js +10 -3
- package/dist/esm/subaccount-account-details_4.entry.js +2 -1
- package/dist/esm/utils-4609f32c.js +38 -0
- package/dist/esm/{utils-2828201a.js → utils-684d2e47.js} +7 -1
- package/dist/esm/{utils-243abdb4.js → utils-d9e90399.js} +7 -1
- package/dist/esm/webcomponents.js +1 -1
- package/dist/module/Business.js +56 -3
- package/dist/module/SubAccount.js +1 -1
- package/dist/module/business-additional-questions-form-step.js +7 -4
- package/dist/module/business-additional-questions-schema.js +16 -7
- package/dist/module/business-address-schema.js +50 -14
- package/dist/module/business-core-info-form-step.js +3 -1
- package/dist/module/business-core-info-schema.js +24 -12
- package/dist/module/business-details-core2.js +8 -3
- package/dist/module/business-form-types.js +8 -1
- package/dist/module/business-identity-schema.js +30 -35
- package/dist/module/business-owners-form-step.js +13 -8
- package/dist/module/business-representative-form-step.js +11 -11
- package/dist/module/business-representative.js +4 -7
- package/dist/module/checkout-core.js +4 -4
- package/dist/module/form-control-datepart2.js +37 -33
- package/dist/module/form-control-monetary2.js +20 -18
- package/dist/module/form-control-number2.js +1 -0
- package/dist/module/form-control-select2.js +3 -1
- package/dist/module/form-control-text2.js +6 -1
- package/dist/module/gross-payment-chart-core2.js +8 -2
- package/dist/module/helpers.js +4 -0
- package/dist/module/{business-address-form.js → identity-address-form.js} +17 -20
- package/dist/module/justifi-business-details.js +21 -4
- package/dist/module/justifi-business-form.js +65 -56
- package/dist/module/justifi-gross-payment-chart.js +28 -4
- package/dist/module/justifi-identity-address-form.d.ts +11 -0
- package/dist/module/justifi-identity-address-form.js +6 -0
- package/dist/module/justifi-payment-balance-transactions.js +1 -1
- package/dist/module/justifi-payment-details.js +26 -5
- package/dist/module/justifi-payment-form.js +18 -4
- package/dist/module/justifi-payment-provisioning.d.ts +11 -0
- package/dist/module/{justifi-business-form-stepped.js → justifi-payment-provisioning.js} +32 -31
- package/dist/module/justifi-payments-list.js +26 -6
- package/dist/module/justifi-payout-details.js +28 -8
- package/dist/module/justifi-payouts-list.js +27 -7
- package/dist/module/justifi-subaccount-details.js +1 -1
- package/dist/module/justifi-subaccounts-list.js +1 -1
- package/dist/module/legal-address-form-step.js +10 -12
- package/dist/module/legal-address-form.js +5 -9
- package/dist/module/owner-form.js +23 -35
- package/dist/module/payment-details-core2.js +9 -3
- package/dist/module/payment-method-form.js +1 -1
- package/dist/module/payments-list-core2.js +9 -3
- package/dist/module/payout-details-core2.js +10 -5
- package/dist/module/payouts-list-core2.js +9 -3
- package/dist/module/subaccount-merchant-details2.js +1 -1
- package/dist/module/utils2.js +7 -1
- package/dist/module/utils3.js +31 -1
- package/dist/module/utils4.js +7 -1
- package/dist/types/api/Business.d.ts +10 -3
- package/dist/types/api/ComponentError.d.ts +18 -0
- package/dist/types/api/services/utils.d.ts +2 -0
- package/dist/types/api/shared.d.ts +9 -0
- package/dist/types/components/business-details/additional-questions-details/additional-questions-details.d.ts +2 -2
- package/dist/types/components/business-details/business-details-core.d.ts +3 -0
- package/dist/types/components/business-details/business-details.d.ts +3 -0
- package/dist/types/components/business-forms/business-form/business-form.d.ts +4 -2
- package/dist/types/components/business-forms/owner-form/identity-address/identity-address-form.d.ts +10 -0
- package/dist/types/components/business-forms/owner-form/owner-form.d.ts +5 -1
- package/dist/types/components/business-forms/{business-form-stepped → payment-provisioning}/additional-questions/business-additional-questions-form-step.d.ts +3 -1
- package/dist/types/components/business-forms/{business-form-stepped → payment-provisioning}/business-core-info/business-core-info-form-step.d.ts +1 -0
- package/dist/types/components/business-forms/{business-form-stepped → payment-provisioning}/business-owners/business-owners-form-step.d.ts +3 -1
- package/dist/types/components/business-forms/{business-form-stepped → payment-provisioning}/business-representative/business-representative-form-step.d.ts +3 -1
- package/dist/types/components/business-forms/{business-form-stepped → payment-provisioning}/legal-address-form/legal-address-form-step.d.ts +1 -0
- package/dist/types/components/business-forms/{business-form-stepped/business-form-stepped.d.ts → payment-provisioning/payment-provisioning.d.ts} +4 -3
- package/dist/types/components/business-forms/schemas/business-additional-questions-schema.d.ts +1 -1
- package/dist/types/components/business-forms/schemas/business-address-schema.d.ts +1 -12
- package/dist/types/components/business-forms/schemas/business-core-info-schema.d.ts +1 -1
- package/dist/types/components/business-forms/schemas/business-form-schema.d.ts +7 -3
- package/dist/types/components/business-forms/schemas/business-identity-schema.d.ts +5 -31
- package/dist/types/components/business-forms/utils/business-form-types.d.ts +10 -0
- package/dist/types/components/business-forms/utils/helpers.d.ts +2 -0
- package/dist/types/components/form/form-control-datepart.d.ts +2 -1
- package/dist/types/components/form/form-control-monetary.d.ts +2 -1
- package/dist/types/components/form/form-control-text.d.ts +2 -0
- package/dist/types/components/form/utils.d.ts +1 -0
- package/dist/types/components/gross-payment-chart/get-gross-payment-chart-data.d.ts +5 -8
- package/dist/types/components/gross-payment-chart/gross-payment-chart-core.d.ts +3 -0
- package/dist/types/components/gross-payment-chart/gross-payment-chart.d.ts +4 -0
- package/dist/types/components/payment-details/payment-details-core.d.ts +3 -0
- package/dist/types/components/payment-details/payment-details.d.ts +4 -0
- package/dist/types/components/payment-form/payment-form.d.ts +4 -1
- package/dist/types/components/payments-list/payments-list-core.d.ts +2 -0
- package/dist/types/components/payments-list/payments-list.d.ts +4 -0
- package/dist/types/components/payout-details/payout-details-core.d.ts +3 -0
- package/dist/types/components/payout-details/payout-details.d.ts +4 -0
- package/dist/types/components/payouts-list/payouts-list-core.d.ts +2 -0
- package/dist/types/components/payouts-list/payouts-list.d.ts +4 -0
- package/dist/types/components.d.ts +278 -104
- package/dist/types/utils/utils.d.ts +1 -0
- package/dist/webcomponents/p-091f9732.entry.js +1 -0
- package/dist/webcomponents/p-0b76c770.entry.js +1 -0
- package/dist/webcomponents/p-0d81883d.entry.js +1 -0
- package/dist/webcomponents/p-102b593a.entry.js +1 -0
- package/dist/webcomponents/p-221b9504.entry.js +1 -0
- package/dist/webcomponents/p-28cd23c8.entry.js +1 -0
- package/dist/webcomponents/p-2b8368d2.js +1 -0
- package/dist/webcomponents/p-2df32b4a.entry.js +1 -0
- package/dist/webcomponents/p-3d4aaa4a.entry.js +1 -0
- package/dist/webcomponents/p-436d27b9.entry.js +1 -0
- package/dist/webcomponents/p-448063ba.entry.js +1 -0
- package/dist/webcomponents/p-5341321d.entry.js +1 -0
- package/dist/webcomponents/{p-0399f02b.entry.js → p-5b262705.entry.js} +1 -1
- package/dist/webcomponents/p-5e503d7d.entry.js +1 -0
- package/dist/webcomponents/p-6047b960.entry.js +1 -0
- package/dist/webcomponents/p-60b2344a.js +1 -0
- package/dist/webcomponents/p-6d39b8bc.entry.js +1 -0
- package/dist/webcomponents/p-6f294d5d.js +1 -0
- package/dist/webcomponents/p-7294eb89.entry.js +1 -0
- package/dist/webcomponents/p-746bfba6.entry.js +1 -0
- package/dist/webcomponents/p-7c6a355f.entry.js +1 -0
- package/dist/webcomponents/p-817211f2.entry.js +1 -0
- package/dist/webcomponents/{p-65510838.js → p-8482c23f.js} +1 -1
- package/dist/webcomponents/p-935d6f55.js +1 -0
- package/dist/webcomponents/{p-e924f2e1.entry.js → p-959250e3.entry.js} +1 -1
- package/dist/webcomponents/p-a130a884.entry.js +1 -0
- package/dist/webcomponents/p-a4122c35.entry.js +1 -0
- package/dist/webcomponents/p-ac670a3e.js +1 -0
- package/dist/webcomponents/p-ae21ed6f.entry.js +19 -0
- package/dist/webcomponents/p-c071d8c1.entry.js +1 -0
- package/dist/webcomponents/p-c340b60f.js +1 -0
- package/dist/webcomponents/p-d5aab6b5.entry.js +1 -0
- package/dist/webcomponents/p-d5c80489.entry.js +1 -0
- package/dist/webcomponents/p-d776fe10.entry.js +1 -0
- package/dist/webcomponents/p-d8679fad.entry.js +1 -0
- package/dist/webcomponents/p-e84b3616.entry.js +1 -0
- package/dist/webcomponents/p-ea03b424.entry.js +1 -0
- package/dist/webcomponents/p-ea2cca2a.js +1 -0
- package/dist/webcomponents/p-ec230480.entry.js +1 -0
- package/dist/webcomponents/webcomponents.esm.js +1 -1
- package/package.json +1 -1
- package/dist/cjs/Identity-b6364aee.js +0 -27
- package/dist/cjs/business-additional-questions-schema-cbac27f2.js +0 -26
- package/dist/cjs/justifi-business-address-form-step.cjs.entry.js +0 -35
- package/dist/cjs/payload-parsers-25ed3936.js +0 -98
- package/dist/cjs/utils-f5d82f21.js +0 -10
- package/dist/collection/api/mockData/MockOnboardingData.js +0 -117
- package/dist/collection/api/mockData/MockPayments.js +0 -243
- package/dist/collection/api/mockData/MockSubAccount.js +0 -102
- package/dist/collection/api/mockData/mockGrossVolumeReport.js +0 -125
- package/dist/collection/components/business-forms/business-form/business-address/business-address-form.css +0 -2536
- package/dist/collection/components/business-forms/business-form/business-address/business-address-form.js +0 -97
- package/dist/collection/components/business-forms/business-form/business-address/test/business-address.e2e.js +0 -9
- package/dist/collection/components/business-forms/business-form-stepped/business-address/test/business-address-form-step.spec.js +0 -97
- package/dist/collection/components/business-forms/business-form-stepped/test/business-form-stepped.spec.js +0 -61
- package/dist/collection/components/business-forms/schemas/business-owners-schema.js +0 -16
- package/dist/collection/components/card-form/test/card-form.e2e.js +0 -13
- package/dist/esm/Identity-774788c0.js +0 -25
- package/dist/esm/business-additional-questions-schema-2cb80f70.js +0 -23
- package/dist/esm/justifi-business-address-form-step.entry.js +0 -31
- package/dist/esm/payload-parsers-1dd7474f.js +0 -90
- package/dist/esm/utils-546ca6aa.js +0 -8
- package/dist/module/justifi-business-address-form-step.d.ts +0 -11
- package/dist/module/justifi-business-address-form-step.js +0 -75
- package/dist/module/justifi-business-address-form.d.ts +0 -11
- package/dist/module/justifi-business-address-form.js +0 -6
- package/dist/module/justifi-business-form-stepped.d.ts +0 -11
- package/dist/types/api/mockData/MockOnboardingData.d.ts +0 -8
- package/dist/types/api/mockData/MockPayments.d.ts +0 -3
- package/dist/types/api/mockData/MockSubAccount.d.ts +0 -3
- package/dist/types/components/business-forms/business-form/business-address/business-address-form.d.ts +0 -9
- package/dist/types/components/business-forms/business-form-stepped/business-address/business-address-form-step.d.ts +0 -9
- package/dist/types/components/business-forms/schemas/business-owners-schema.d.ts +0 -33
- package/dist/webcomponents/p-04a98c63.js +0 -1
- package/dist/webcomponents/p-06888c2e.entry.js +0 -1
- package/dist/webcomponents/p-0811bc77.entry.js +0 -1
- package/dist/webcomponents/p-17d72f4a.js +0 -1
- package/dist/webcomponents/p-17f64853.entry.js +0 -1
- package/dist/webcomponents/p-22085999.entry.js +0 -1
- package/dist/webcomponents/p-252835df.entry.js +0 -1
- package/dist/webcomponents/p-28b38699.js +0 -1
- package/dist/webcomponents/p-374c44e6.entry.js +0 -1
- package/dist/webcomponents/p-4697ccfa.entry.js +0 -1
- package/dist/webcomponents/p-4781cd06.js +0 -1
- package/dist/webcomponents/p-4d806131.entry.js +0 -1
- package/dist/webcomponents/p-4e0b3206.entry.js +0 -1
- package/dist/webcomponents/p-583dd5a2.entry.js +0 -1
- package/dist/webcomponents/p-5be4e217.entry.js +0 -1
- package/dist/webcomponents/p-5da4fbe7.entry.js +0 -1
- package/dist/webcomponents/p-6103c20d.entry.js +0 -1
- package/dist/webcomponents/p-6ed680e9.js +0 -1
- package/dist/webcomponents/p-7654c70d.entry.js +0 -1
- package/dist/webcomponents/p-847441ce.entry.js +0 -1
- package/dist/webcomponents/p-861ba3fc.entry.js +0 -1
- package/dist/webcomponents/p-9207ccb2.entry.js +0 -1
- package/dist/webcomponents/p-9ce8d98c.entry.js +0 -1
- package/dist/webcomponents/p-9e4b81ad.entry.js +0 -1
- package/dist/webcomponents/p-a141c531.js +0 -1
- package/dist/webcomponents/p-a2dbe90f.entry.js +0 -1
- package/dist/webcomponents/p-a98eea84.entry.js +0 -1
- package/dist/webcomponents/p-b1bc23af.entry.js +0 -1
- package/dist/webcomponents/p-b27c9b0d.entry.js +0 -1
- package/dist/webcomponents/p-b8f22856.js +0 -1
- package/dist/webcomponents/p-c8d62072.entry.js +0 -1
- package/dist/webcomponents/p-e3748ea4.entry.js +0 -1
- package/dist/webcomponents/p-eef5ed19.entry.js +0 -1
- package/dist/webcomponents/p-efc7025c.entry.js +0 -1
- package/dist/webcomponents/p-f3453ca2.js +0 -1
- package/dist/webcomponents/p-f3ca6fda.entry.js +0 -1
- package/dist/webcomponents/p-fe2af0cf.entry.js +0 -19
- package/dist/webcomponents/p-fe8a94c1.entry.js +0 -1
- /package/dist/cjs/{state-options-96d05a98.js → state-options-4fbcb48a.js} +0 -0
- /package/dist/collection/components/business-forms/{business-form-stepped/business-address/business-address-form-step.css → owner-form/identity-address/identity-address-form.css} +0 -0
- /package/dist/collection/components/business-forms/{business-form-stepped → payment-provisioning}/additional-questions/test/business-additional-questions-form-step.spec.js +0 -0
- /package/dist/collection/components/business-forms/{business-form-stepped → payment-provisioning}/business-core-info/business-core-info-form-step.css +0 -0
- /package/dist/collection/components/business-forms/{business-form-stepped → payment-provisioning}/business-core-info/test/business-core-info-form-step.spec.js +0 -0
- /package/dist/collection/components/business-forms/{business-form-stepped → payment-provisioning}/business-owners/business-owners-form-step.css +0 -0
- /package/dist/collection/components/business-forms/{business-form-stepped → payment-provisioning}/business-owners/test/business-owners-form-step.spec.js +0 -0
- /package/dist/collection/components/business-forms/{business-form-stepped → payment-provisioning}/business-representative/business-representative-form-step.css +0 -0
- /package/dist/collection/components/business-forms/{business-form-stepped → payment-provisioning}/business-representative/test/business-representative-form-step.spec.js +0 -0
- /package/dist/collection/components/business-forms/{business-form-stepped → payment-provisioning}/legal-address-form/legal-address-form-step.css +0 -0
- /package/dist/collection/components/business-forms/{business-form-stepped/business-form-stepped.css → payment-provisioning/payment-provisioning.css} +0 -0
- /package/dist/collection/{components/billing-form → utils}/state-options.js +0 -0
- /package/dist/esm/{state-options-fc1daf67.js → state-options-a356fb11.js} +0 -0
- /package/dist/types/{api → home/runner/work/web-component-library/web-component-library/packages/webcomponents/.stencil}/mockData/mockGrossVolumeReport.d.ts +0 -0
- /package/dist/types/home/runner/work/web-component-library/web-component-library/packages/webcomponents/.stencil/{config.d.ts → packages/webcomponents/config.d.ts} +0 -0
- /package/dist/types/{components/billing-form → utils}/state-options.d.ts +0 -0
- /package/dist/webcomponents/{p-8e2a88a8.js → p-6078a370.js} +0 -0
|
@@ -1,13 +1,17 @@
|
|
|
1
|
+
import { h } from "@stencil/core";
|
|
1
2
|
import { newSpecPage } from "@stencil/core/testing";
|
|
2
3
|
import { PaymentDetails } from "../payment-details";
|
|
3
4
|
import { PaymentDetailsCore } from "../payment-details-core";
|
|
4
5
|
import { Details } from "../../details/details";
|
|
6
|
+
import { PaymentService } from "../../../api/services/payment.service";
|
|
7
|
+
import { API_NOT_AUTHENTICATED_ERROR } from "../../../api/shared";
|
|
8
|
+
jest.mock('../../../api/services/payment.service');
|
|
5
9
|
describe('payment-details', () => {
|
|
6
10
|
const components = [PaymentDetails, PaymentDetailsCore, Details];
|
|
7
11
|
it('renders an error message when paymentId and authToken are not provided', async () => {
|
|
8
12
|
const page = await newSpecPage({
|
|
9
13
|
components,
|
|
10
|
-
|
|
14
|
+
template: () => h("justifi-payment-details", null),
|
|
11
15
|
});
|
|
12
16
|
await page.waitForChanges();
|
|
13
17
|
expect(page.root).toMatchSnapshot();
|
|
@@ -15,7 +19,7 @@ describe('payment-details', () => {
|
|
|
15
19
|
it('renders an error message when paymentId is not provided', async () => {
|
|
16
20
|
const page = await newSpecPage({
|
|
17
21
|
components,
|
|
18
|
-
|
|
22
|
+
template: () => h("justifi-payment-details", { "auth-token": "abc" }),
|
|
19
23
|
});
|
|
20
24
|
await page.waitForChanges();
|
|
21
25
|
expect(page.root).toMatchSnapshot();
|
|
@@ -23,9 +27,71 @@ describe('payment-details', () => {
|
|
|
23
27
|
it('renders an error message when authToken is not provided', async () => {
|
|
24
28
|
const page = await newSpecPage({
|
|
25
29
|
components,
|
|
26
|
-
|
|
30
|
+
template: () => h("justifi-payment-details", { "payment-id": "abc" }),
|
|
27
31
|
});
|
|
28
32
|
await page.waitForChanges();
|
|
29
33
|
expect(page.root).toMatchSnapshot();
|
|
30
34
|
});
|
|
35
|
+
it('emits an error event when there is no auth token', async () => {
|
|
36
|
+
const errorSpy = jest.fn();
|
|
37
|
+
const page = await newSpecPage({
|
|
38
|
+
components,
|
|
39
|
+
template: () => h("justifi-payment-details", { "payment-id": "abc", "onError-event": errorSpy }),
|
|
40
|
+
});
|
|
41
|
+
await page.waitForChanges();
|
|
42
|
+
expect(errorSpy).toHaveBeenCalledWith(expect.objectContaining({
|
|
43
|
+
detail: {
|
|
44
|
+
message: 'Payment ID and Auth Token are required',
|
|
45
|
+
errorCode: 'missing-props',
|
|
46
|
+
severity: 'error'
|
|
47
|
+
}
|
|
48
|
+
}));
|
|
49
|
+
});
|
|
50
|
+
it('emits an error event when there is no payment-id', async () => {
|
|
51
|
+
const errorSpy = jest.fn();
|
|
52
|
+
const page = await newSpecPage({
|
|
53
|
+
components,
|
|
54
|
+
template: () => h("justifi-payment-details", { "auth-token": "abc", "onError-event": errorSpy }),
|
|
55
|
+
});
|
|
56
|
+
await page.waitForChanges();
|
|
57
|
+
expect(errorSpy).toHaveBeenCalledWith(expect.objectContaining({
|
|
58
|
+
detail: {
|
|
59
|
+
message: 'Payment ID and Auth Token are required',
|
|
60
|
+
errorCode: 'missing-props',
|
|
61
|
+
severity: 'error'
|
|
62
|
+
}
|
|
63
|
+
}));
|
|
64
|
+
});
|
|
65
|
+
it('emits an error event when fetch fails', async () => {
|
|
66
|
+
PaymentService.prototype.fetchPayment = jest.fn().mockRejectedValue(new Error('Fetch error'));
|
|
67
|
+
const errorSpy = jest.fn();
|
|
68
|
+
const page = await newSpecPage({
|
|
69
|
+
components,
|
|
70
|
+
template: () => h("justifi-payment-details", { "payment-id": "abc", "auth-token": "abc", "onError-event": errorSpy }),
|
|
71
|
+
});
|
|
72
|
+
await page.waitForChanges();
|
|
73
|
+
expect(errorSpy).toHaveBeenCalledWith(expect.objectContaining({
|
|
74
|
+
detail: {
|
|
75
|
+
message: 'Fetch error',
|
|
76
|
+
errorCode: 'fetch-error',
|
|
77
|
+
severity: 'error'
|
|
78
|
+
}
|
|
79
|
+
}));
|
|
80
|
+
});
|
|
81
|
+
it('emits an error event when API returns an error', async () => {
|
|
82
|
+
PaymentService.prototype.fetchPayment = jest.fn().mockResolvedValue(API_NOT_AUTHENTICATED_ERROR);
|
|
83
|
+
const errorSpy = jest.fn();
|
|
84
|
+
const page = await newSpecPage({
|
|
85
|
+
components,
|
|
86
|
+
template: () => h("justifi-payment-details", { "payment-id": "abc", "auth-token": "abc", "onError-event": errorSpy }),
|
|
87
|
+
});
|
|
88
|
+
await page.waitForChanges();
|
|
89
|
+
expect(errorSpy).toHaveBeenCalledWith(expect.objectContaining({
|
|
90
|
+
detail: {
|
|
91
|
+
message: 'Not Authenticated',
|
|
92
|
+
errorCode: 'not-authenticated',
|
|
93
|
+
severity: 'error'
|
|
94
|
+
}
|
|
95
|
+
}));
|
|
96
|
+
});
|
|
31
97
|
});
|
|
@@ -2,6 +2,8 @@ import { h, Host } from "@stencil/core";
|
|
|
2
2
|
import { PaymentMethodTypes } from "../../api";
|
|
3
3
|
import { loadFontsOnParent } from "../../utils/utils";
|
|
4
4
|
import { config } from "../../../config";
|
|
5
|
+
import { ComponentErrorCodes, ComponentErrorSeverity } from "../../api/ComponentError";
|
|
6
|
+
import { getErrorMessage } from "../../api/services/utils";
|
|
5
7
|
export class PaymentForm {
|
|
6
8
|
constructor() {
|
|
7
9
|
this.bankAccount = undefined;
|
|
@@ -23,6 +25,9 @@ export class PaymentForm {
|
|
|
23
25
|
async enableSubmitButton() {
|
|
24
26
|
this.submitButtonEnabled = true;
|
|
25
27
|
}
|
|
28
|
+
async disableSubmitButton() {
|
|
29
|
+
this.submitButtonEnabled = false;
|
|
30
|
+
}
|
|
26
31
|
paymentMethodSelectedHandler(event) {
|
|
27
32
|
const paymentMethodType = event.detail;
|
|
28
33
|
this.selectedPaymentMethodType = paymentMethodType;
|
|
@@ -41,12 +46,20 @@ export class PaymentForm {
|
|
|
41
46
|
const paymentMethodData = Object.assign({ email: this.email }, billingFormFieldValues);
|
|
42
47
|
const tokenizeResponse = await this.paymentMethodFormRef.tokenize(this.clientId, paymentMethodData, this.accountId);
|
|
43
48
|
if (tokenizeResponse.error) {
|
|
44
|
-
|
|
49
|
+
this.errorEvent.emit({
|
|
50
|
+
errorCode: ComponentErrorCodes.TOKENIZE_ERROR,
|
|
51
|
+
message: tokenizeResponse.error.message,
|
|
52
|
+
severity: ComponentErrorSeverity.ERROR
|
|
53
|
+
});
|
|
45
54
|
}
|
|
46
55
|
this.submitted.emit(tokenizeResponse);
|
|
47
56
|
}
|
|
48
57
|
catch (error) {
|
|
49
|
-
|
|
58
|
+
this.errorEvent.emit({
|
|
59
|
+
errorCode: ComponentErrorCodes.UNKNOWN_ERROR,
|
|
60
|
+
message: getErrorMessage(error),
|
|
61
|
+
severity: ComponentErrorSeverity.ERROR
|
|
62
|
+
});
|
|
50
63
|
}
|
|
51
64
|
finally {
|
|
52
65
|
this.isLoading = false;
|
|
@@ -61,7 +74,7 @@ export class PaymentForm {
|
|
|
61
74
|
if (el) {
|
|
62
75
|
this.billingFormRef = el;
|
|
63
76
|
}
|
|
64
|
-
} })), h("slot", { name: 'insurance' }), h("div", { class: "col-12" }, h("button", { type: "submit", onClick: event => this.submit(event), disabled: !this.submitButtonEnabled || this.isLoading, class: `btn btn-primary jfi-submit-button${this.isLoading ? ' jfi-submit-button-loading' : ''}` }, this.isLoading ?
|
|
77
|
+
} })), h("slot", { name: 'insurance' }), h("div", { class: "col-12" }, h("button", { "data-testid": "submit-button", type: "submit", onClick: event => this.submit(event), disabled: !this.submitButtonEnabled || this.isLoading, class: `btn btn-primary jfi-submit-button${this.isLoading ? ' jfi-submit-button-loading' : ''}` }, this.isLoading ?
|
|
65
78
|
h("div", { class: "spinner-border spinner-border-sm", role: "status" }, h("span", { class: "visually-hidden" }, "Loading...")) :
|
|
66
79
|
this.submitButtonText || 'Submit')))));
|
|
67
80
|
}
|
|
@@ -213,6 +226,27 @@ export class PaymentForm {
|
|
|
213
226
|
}
|
|
214
227
|
}
|
|
215
228
|
}
|
|
229
|
+
}, {
|
|
230
|
+
"method": "errorEvent",
|
|
231
|
+
"name": "error-event",
|
|
232
|
+
"bubbles": true,
|
|
233
|
+
"cancelable": true,
|
|
234
|
+
"composed": true,
|
|
235
|
+
"docs": {
|
|
236
|
+
"tags": [],
|
|
237
|
+
"text": ""
|
|
238
|
+
},
|
|
239
|
+
"complexType": {
|
|
240
|
+
"original": "ComponentError",
|
|
241
|
+
"resolved": "ComponentError",
|
|
242
|
+
"references": {
|
|
243
|
+
"ComponentError": {
|
|
244
|
+
"location": "import",
|
|
245
|
+
"path": "../../api/ComponentError",
|
|
246
|
+
"id": "src/api/ComponentError.ts::ComponentError"
|
|
247
|
+
}
|
|
248
|
+
}
|
|
249
|
+
}
|
|
216
250
|
}];
|
|
217
251
|
}
|
|
218
252
|
static get methods() {
|
|
@@ -259,6 +293,23 @@ export class PaymentForm {
|
|
|
259
293
|
"text": "",
|
|
260
294
|
"tags": []
|
|
261
295
|
}
|
|
296
|
+
},
|
|
297
|
+
"disableSubmitButton": {
|
|
298
|
+
"complexType": {
|
|
299
|
+
"signature": "() => Promise<void>",
|
|
300
|
+
"parameters": [],
|
|
301
|
+
"references": {
|
|
302
|
+
"Promise": {
|
|
303
|
+
"location": "global",
|
|
304
|
+
"id": "global::Promise"
|
|
305
|
+
}
|
|
306
|
+
},
|
|
307
|
+
"return": "Promise<void>"
|
|
308
|
+
},
|
|
309
|
+
"docs": {
|
|
310
|
+
"text": "",
|
|
311
|
+
"tags": []
|
|
312
|
+
}
|
|
262
313
|
}
|
|
263
314
|
};
|
|
264
315
|
}
|
|
@@ -1,7 +1,11 @@
|
|
|
1
|
+
import { h } from "@stencil/core";
|
|
1
2
|
import { newSpecPage } from "@stencil/core/testing";
|
|
2
3
|
import { PaymentForm } from "../payment-form";
|
|
3
4
|
import { PaymentMethodTypes } from "../../../api";
|
|
4
5
|
import { config } from "../../../../config";
|
|
6
|
+
import { PaymentMethodSelector } from "../payment-method-selector";
|
|
7
|
+
import { PaymentMethodForm } from "../../payment-method-form/payment-method-form";
|
|
8
|
+
import { BillingForm } from "../../billing-form/billing-form";
|
|
5
9
|
describe('justifi-payment-form', () => {
|
|
6
10
|
it('should update submitButtonEnabled state when enableSubmitButton method is called', async () => {
|
|
7
11
|
// Mock component
|
|
@@ -157,7 +161,7 @@ describe('justifi-payment-form', () => {
|
|
|
157
161
|
</div>
|
|
158
162
|
<slot name="insurance"></slot>
|
|
159
163
|
<div class="col-12">
|
|
160
|
-
<button class="btn btn-primary jfi-submit-button" type="submit">
|
|
164
|
+
<button class="btn btn-primary jfi-submit-button" data-testid="submit-button" type="submit">
|
|
161
165
|
Submit
|
|
162
166
|
</button>
|
|
163
167
|
</div>
|
|
@@ -166,4 +170,59 @@ describe('justifi-payment-form', () => {
|
|
|
166
170
|
</justifi-payment-form>
|
|
167
171
|
`);
|
|
168
172
|
});
|
|
173
|
+
it('emits error event when submit fails', async () => {
|
|
174
|
+
const clientId = 'some-client';
|
|
175
|
+
const errorSpy = jest.fn();
|
|
176
|
+
const page = await newSpecPage({
|
|
177
|
+
components: [PaymentForm, PaymentMethodSelector, PaymentMethodForm, BillingForm],
|
|
178
|
+
template: () => h("justifi-payment-form", { clientId: clientId, "onError-event": errorSpy }),
|
|
179
|
+
});
|
|
180
|
+
page.rootInstance.paymentMethodFormRef = {
|
|
181
|
+
validate: jest.fn().mockResolvedValue({ isValid: true }),
|
|
182
|
+
tokenize: jest.fn().mockRejectedValue(new Error('Tokenize error')),
|
|
183
|
+
};
|
|
184
|
+
;
|
|
185
|
+
page.rootInstance.billingFormRef = {
|
|
186
|
+
validate: jest.fn().mockResolvedValue({ isValid: true }),
|
|
187
|
+
getValues: jest.fn().mockResolvedValue({}),
|
|
188
|
+
};
|
|
189
|
+
await page.waitForChanges();
|
|
190
|
+
const submitButton = page.root.shadowRoot.querySelector('[data-testid="submit-button"]');
|
|
191
|
+
submitButton.click();
|
|
192
|
+
await page.waitForChanges();
|
|
193
|
+
expect(errorSpy).toHaveBeenCalledWith(expect.objectContaining({
|
|
194
|
+
detail: {
|
|
195
|
+
errorCode: 'unknown-error',
|
|
196
|
+
message: 'Tokenize error',
|
|
197
|
+
severity: 'error',
|
|
198
|
+
}
|
|
199
|
+
}));
|
|
200
|
+
});
|
|
201
|
+
it('emits error event when tokenize fails', async () => {
|
|
202
|
+
const clientId = 'some-client';
|
|
203
|
+
const errorSpy = jest.fn();
|
|
204
|
+
const page = await newSpecPage({
|
|
205
|
+
components: [PaymentForm, PaymentMethodSelector, PaymentMethodForm, BillingForm],
|
|
206
|
+
template: () => h("justifi-payment-form", { clientId: clientId, "onError-event": errorSpy }),
|
|
207
|
+
});
|
|
208
|
+
page.rootInstance.paymentMethodFormRef = {
|
|
209
|
+
validate: jest.fn().mockResolvedValue({ isValid: true }),
|
|
210
|
+
tokenize: jest.fn().mockResolvedValue({ error: { message: 'Tokenize error' } }),
|
|
211
|
+
};
|
|
212
|
+
page.rootInstance.billingFormRef = {
|
|
213
|
+
validate: jest.fn().mockResolvedValue({ isValid: true }),
|
|
214
|
+
getValues: jest.fn().mockResolvedValue({}),
|
|
215
|
+
};
|
|
216
|
+
await page.waitForChanges();
|
|
217
|
+
const submitButton = page.root.shadowRoot.querySelector('[data-testid="submit-button"]');
|
|
218
|
+
submitButton.click();
|
|
219
|
+
await page.waitForChanges();
|
|
220
|
+
expect(errorSpy).toHaveBeenCalledWith(expect.objectContaining({
|
|
221
|
+
detail: {
|
|
222
|
+
errorCode: 'tokenize-error',
|
|
223
|
+
message: 'Tokenize error',
|
|
224
|
+
severity: 'error',
|
|
225
|
+
}
|
|
226
|
+
}));
|
|
227
|
+
});
|
|
169
228
|
});
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { Payment } from "../../api";
|
|
2
|
-
import {
|
|
2
|
+
import { ComponentErrorSeverity } from "../../api/ComponentError";
|
|
3
|
+
import { getErrorCode, getErrorMessage } from "../../api/services/utils";
|
|
3
4
|
export const makeGetPayments = ({ id, authToken, service }) => async ({ params, onSuccess, onError }) => {
|
|
4
|
-
var _a;
|
|
5
|
+
var _a, _b;
|
|
5
6
|
try {
|
|
6
7
|
const response = await service.fetchPayments(id, authToken, params);
|
|
7
8
|
if (!response.error) {
|
|
@@ -11,10 +12,20 @@ export const makeGetPayments = ({ id, authToken, service }) => async ({ params,
|
|
|
11
12
|
}
|
|
12
13
|
else {
|
|
13
14
|
const responseError = getErrorMessage(response.error);
|
|
14
|
-
|
|
15
|
+
const code = getErrorCode((_b = response.error) === null || _b === void 0 ? void 0 : _b.code);
|
|
16
|
+
return onError({
|
|
17
|
+
error: responseError,
|
|
18
|
+
code,
|
|
19
|
+
severity: ComponentErrorSeverity.ERROR,
|
|
20
|
+
});
|
|
15
21
|
}
|
|
16
22
|
}
|
|
17
23
|
catch (error) {
|
|
18
|
-
|
|
24
|
+
const code = getErrorCode(error === null || error === void 0 ? void 0 : error.code);
|
|
25
|
+
return onError({
|
|
26
|
+
error: error.message || error,
|
|
27
|
+
code,
|
|
28
|
+
severity: ComponentErrorSeverity.ERROR,
|
|
29
|
+
});
|
|
19
30
|
}
|
|
20
31
|
};
|
|
@@ -37,8 +37,13 @@ export class PaymentsListCore {
|
|
|
37
37
|
this.paging = pagingInfo;
|
|
38
38
|
this.loading = false;
|
|
39
39
|
},
|
|
40
|
-
onError: (
|
|
41
|
-
this.errorMessage =
|
|
40
|
+
onError: ({ error, code, severity }) => {
|
|
41
|
+
this.errorMessage = error;
|
|
42
|
+
this.errorEvent.emit({
|
|
43
|
+
errorCode: code,
|
|
44
|
+
message: error,
|
|
45
|
+
severity,
|
|
46
|
+
});
|
|
42
47
|
this.loading = false;
|
|
43
48
|
},
|
|
44
49
|
});
|
|
@@ -144,6 +149,27 @@ export class PaymentsListCore {
|
|
|
144
149
|
}
|
|
145
150
|
}
|
|
146
151
|
}
|
|
152
|
+
}, {
|
|
153
|
+
"method": "errorEvent",
|
|
154
|
+
"name": "error-event",
|
|
155
|
+
"bubbles": true,
|
|
156
|
+
"cancelable": true,
|
|
157
|
+
"composed": true,
|
|
158
|
+
"docs": {
|
|
159
|
+
"tags": [],
|
|
160
|
+
"text": ""
|
|
161
|
+
},
|
|
162
|
+
"complexType": {
|
|
163
|
+
"original": "ComponentError",
|
|
164
|
+
"resolved": "ComponentError",
|
|
165
|
+
"references": {
|
|
166
|
+
"ComponentError": {
|
|
167
|
+
"location": "import",
|
|
168
|
+
"path": "../../api/ComponentError",
|
|
169
|
+
"id": "src/api/ComponentError.ts::ComponentError"
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
}
|
|
147
173
|
}];
|
|
148
174
|
}
|
|
149
175
|
static get watchers() {
|
|
@@ -2,6 +2,7 @@ import { h } from "@stencil/core";
|
|
|
2
2
|
import { PaymentService } from "../../api/services/payment.service";
|
|
3
3
|
import { makeGetPayments } from "./get-payments";
|
|
4
4
|
import { ErrorState } from "../details/utils";
|
|
5
|
+
import { ComponentErrorCodes, ComponentErrorSeverity } from "../../api/ComponentError";
|
|
5
6
|
/**
|
|
6
7
|
* @exportedPart table-head: Table head
|
|
7
8
|
* @exportedPart table-head-row: Head row
|
|
@@ -23,6 +24,10 @@ import { ErrorState } from "../details/utils";
|
|
|
23
24
|
*/
|
|
24
25
|
export class PaymentsList {
|
|
25
26
|
constructor() {
|
|
27
|
+
this.handleErrorEvent = (event) => {
|
|
28
|
+
this.errorMessage = event.detail.message;
|
|
29
|
+
this.errorEvent.emit(event.detail);
|
|
30
|
+
};
|
|
26
31
|
this.accountId = undefined;
|
|
27
32
|
this.authToken = undefined;
|
|
28
33
|
this.getPayments = undefined;
|
|
@@ -44,13 +49,18 @@ export class PaymentsList {
|
|
|
44
49
|
}
|
|
45
50
|
else {
|
|
46
51
|
this.errorMessage = 'Account ID and Auth Token are required';
|
|
52
|
+
this.errorEvent.emit({
|
|
53
|
+
errorCode: ComponentErrorCodes.MISSING_PROPS,
|
|
54
|
+
message: this.errorMessage,
|
|
55
|
+
severity: ComponentErrorSeverity.ERROR,
|
|
56
|
+
});
|
|
47
57
|
}
|
|
48
58
|
}
|
|
49
59
|
render() {
|
|
50
60
|
if (this.errorMessage) {
|
|
51
61
|
return ErrorState(this.errorMessage);
|
|
52
62
|
}
|
|
53
|
-
return (h("payments-list-core", { getPayments: this.getPayments }));
|
|
63
|
+
return (h("payments-list-core", { getPayments: this.getPayments, "onError-event": this.handleErrorEvent }));
|
|
54
64
|
}
|
|
55
65
|
static get is() { return "justifi-payments-list"; }
|
|
56
66
|
static get encapsulation() { return "shadow"; }
|
|
@@ -98,6 +108,30 @@ export class PaymentsList {
|
|
|
98
108
|
"errorMessage": {}
|
|
99
109
|
};
|
|
100
110
|
}
|
|
111
|
+
static get events() {
|
|
112
|
+
return [{
|
|
113
|
+
"method": "errorEvent",
|
|
114
|
+
"name": "error-event",
|
|
115
|
+
"bubbles": true,
|
|
116
|
+
"cancelable": true,
|
|
117
|
+
"composed": true,
|
|
118
|
+
"docs": {
|
|
119
|
+
"tags": [],
|
|
120
|
+
"text": ""
|
|
121
|
+
},
|
|
122
|
+
"complexType": {
|
|
123
|
+
"original": "ComponentError",
|
|
124
|
+
"resolved": "ComponentError",
|
|
125
|
+
"references": {
|
|
126
|
+
"ComponentError": {
|
|
127
|
+
"location": "import",
|
|
128
|
+
"path": "../../api/ComponentError",
|
|
129
|
+
"id": "src/api/ComponentError.ts::ComponentError"
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
}];
|
|
134
|
+
}
|
|
101
135
|
static get watchers() {
|
|
102
136
|
return [{
|
|
103
137
|
"propName": "accountId",
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { PaymentService } from "../../../api/services/payment.service";
|
|
2
2
|
import { makeGetPayments } from "../get-payments";
|
|
3
|
-
import mockResponse from "
|
|
3
|
+
import mockResponse from "../../../../../../mockData/mockPaymentsSuccess.json";
|
|
4
4
|
import { Payment } from "../../../api";
|
|
5
5
|
// Mock the PaymentService class
|
|
6
6
|
jest.mock('../../../api/services/payment.service');
|
|
@@ -48,7 +48,11 @@ describe('makeGetPayments', () => {
|
|
|
48
48
|
service: mockServiceInstance,
|
|
49
49
|
});
|
|
50
50
|
await getPayments({ params: mockParams, onSuccess, onError });
|
|
51
|
-
expect(onError).toHaveBeenCalledWith(
|
|
51
|
+
expect(onError).toHaveBeenCalledWith({
|
|
52
|
+
code: 'fetch-error',
|
|
53
|
+
error: 'Error fetching payments',
|
|
54
|
+
severity: 'error',
|
|
55
|
+
});
|
|
52
56
|
expect(onSuccess).not.toHaveBeenCalled();
|
|
53
57
|
});
|
|
54
58
|
it('should call onError with an exception message on fetch exception', async () => {
|
|
@@ -63,7 +67,11 @@ describe('makeGetPayments', () => {
|
|
|
63
67
|
service: mockServiceInstance,
|
|
64
68
|
});
|
|
65
69
|
await getPayments({ params: mockParams, onSuccess, onError });
|
|
66
|
-
expect(onError).toHaveBeenCalledWith(
|
|
70
|
+
expect(onError).toHaveBeenCalledWith({
|
|
71
|
+
code: 'fetch-error',
|
|
72
|
+
error: 'Network error',
|
|
73
|
+
severity: 'error',
|
|
74
|
+
});
|
|
67
75
|
expect(onSuccess).not.toHaveBeenCalled();
|
|
68
76
|
});
|
|
69
77
|
// Add more tests as needed for edge cases and different scenarios
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
+
import { h } from "@stencil/core";
|
|
1
2
|
import { newSpecPage } from "@stencil/core/testing";
|
|
2
3
|
import { PaymentsListCore } from "../payments-list-core";
|
|
3
4
|
import { Table } from "../../table/table";
|
|
4
5
|
import { PaginationMenu } from "../../pagination-menu/pagination-menu";
|
|
5
|
-
import mockSuccessResponse from "
|
|
6
|
+
import mockSuccessResponse from "../../../../../../mockData/mockPaymentsSuccess.json";
|
|
6
7
|
import { makeGetPayments } from "../get-payments";
|
|
7
8
|
const mockPaymentsResponse = mockSuccessResponse;
|
|
8
9
|
describe('payments-list-core', () => {
|
|
@@ -10,17 +11,15 @@ describe('payments-list-core', () => {
|
|
|
10
11
|
const mockPaymentsService = {
|
|
11
12
|
fetchPayments: jest.fn().mockResolvedValue(mockPaymentsResponse),
|
|
12
13
|
};
|
|
13
|
-
const
|
|
14
|
-
components: [PaymentsListCore, Table, PaginationMenu],
|
|
15
|
-
html: `<payments-list-core></payments-list-core>`,
|
|
16
|
-
});
|
|
17
|
-
page.rootInstance.componentWillLoad = () => { };
|
|
18
|
-
page.rootInstance.getPayments = makeGetPayments({
|
|
14
|
+
const getPayments = makeGetPayments({
|
|
19
15
|
id: '123',
|
|
20
16
|
authToken: '123',
|
|
21
17
|
service: mockPaymentsService
|
|
22
18
|
});
|
|
23
|
-
page
|
|
19
|
+
const page = await newSpecPage({
|
|
20
|
+
components: [PaymentsListCore, Table, PaginationMenu],
|
|
21
|
+
template: () => h("payments-list-core", { getPayments: getPayments }),
|
|
22
|
+
});
|
|
24
23
|
await page.waitForChanges();
|
|
25
24
|
const justifiTable = page.root.querySelector('justifi-table');
|
|
26
25
|
expect(page.rootInstance.payments[0]).toEqual(expect.objectContaining({ account_id: mockPaymentsResponse.data[0].account_id }));
|
|
@@ -40,11 +39,8 @@ describe('payments-list-core', () => {
|
|
|
40
39
|
});
|
|
41
40
|
const page = await newSpecPage({
|
|
42
41
|
components: [PaymentsListCore, Table, PaginationMenu],
|
|
43
|
-
|
|
42
|
+
template: () => h("payments-list-core", { getPayments: getPayments }),
|
|
44
43
|
});
|
|
45
|
-
page.rootInstance.componentWillLoad = () => { };
|
|
46
|
-
page.rootInstance.getPayments = getPayments;
|
|
47
|
-
await page.rootInstance.fetchData();
|
|
48
44
|
await page.waitForChanges();
|
|
49
45
|
expect(page.rootInstance.errorMessage).toBe('Fetch error');
|
|
50
46
|
expect(page.root).toMatchSnapshot();
|
|
@@ -53,17 +49,15 @@ describe('payments-list-core', () => {
|
|
|
53
49
|
const mockPaymentsService = {
|
|
54
50
|
fetchPayments: jest.fn().mockResolvedValue(mockPaymentsResponse),
|
|
55
51
|
};
|
|
56
|
-
const
|
|
57
|
-
components: [PaymentsListCore, Table, PaginationMenu],
|
|
58
|
-
html: `<payments-list-core></payments-list-core>`,
|
|
59
|
-
});
|
|
60
|
-
page.rootInstance.componentWillLoad = () => { };
|
|
61
|
-
page.rootInstance.getPayments = makeGetPayments({
|
|
52
|
+
const getPayments = makeGetPayments({
|
|
62
53
|
id: '123',
|
|
63
54
|
authToken: '123',
|
|
64
55
|
service: mockPaymentsService
|
|
65
56
|
});
|
|
66
|
-
page
|
|
57
|
+
const page = await newSpecPage({
|
|
58
|
+
components: [PaymentsListCore, Table, PaginationMenu],
|
|
59
|
+
template: () => h("payments-list-core", { getPayments: getPayments }),
|
|
60
|
+
});
|
|
67
61
|
await page.waitForChanges();
|
|
68
62
|
const justifiTable = page.root.querySelector('justifi-table');
|
|
69
63
|
const firstRow = justifiTable.shadowRoot.querySelector('[data-test-id="table-row"]');
|
|
@@ -77,24 +71,45 @@ describe('payments-list-core', () => {
|
|
|
77
71
|
const mockPaymentsService = {
|
|
78
72
|
fetchPayments: jest.fn().mockResolvedValue(mockPaymentsResponse),
|
|
79
73
|
};
|
|
80
|
-
const
|
|
81
|
-
components: [PaymentsListCore, Table, PaginationMenu],
|
|
82
|
-
html: `<payments-list-core></payments-list-core>`,
|
|
83
|
-
});
|
|
84
|
-
page.rootInstance.componentWillLoad = () => { };
|
|
85
|
-
page.rootInstance.getPayments = makeGetPayments({
|
|
74
|
+
const getPayments = makeGetPayments({
|
|
86
75
|
id: '123',
|
|
87
76
|
authToken: '123',
|
|
88
77
|
service: mockPaymentsService
|
|
89
78
|
});
|
|
90
|
-
page
|
|
79
|
+
const page = await newSpecPage({
|
|
80
|
+
components: [PaymentsListCore, Table, PaginationMenu],
|
|
81
|
+
template: () => h("payments-list-core", { getPayments: getPayments }),
|
|
82
|
+
});
|
|
91
83
|
await page.waitForChanges();
|
|
92
84
|
// Assuming handleClickNext is accessible and modifies `params` which triggers a re-fetch
|
|
93
85
|
page.rootInstance.handleClickNext('nextCursor');
|
|
94
86
|
await page.waitForChanges();
|
|
95
|
-
// The mock function should be called
|
|
96
|
-
expect(mockPaymentsService.fetchPayments).toHaveBeenCalledTimes(
|
|
87
|
+
// The mock function should be called 2 times: once for the initial load and later after the pagination interaction
|
|
88
|
+
expect(mockPaymentsService.fetchPayments).toHaveBeenCalledTimes(2);
|
|
97
89
|
const updatedParams = page.rootInstance.params;
|
|
98
90
|
expect(updatedParams.after_cursor).toBe('nextCursor');
|
|
99
91
|
});
|
|
92
|
+
it('emits error event on fetch error', async () => {
|
|
93
|
+
const mockService = {
|
|
94
|
+
fetchPayments: jest.fn().mockRejectedValue(new Error('Fetch error'))
|
|
95
|
+
};
|
|
96
|
+
const getPayments = makeGetPayments({
|
|
97
|
+
id: 'some-id',
|
|
98
|
+
authToken: 'some-auth',
|
|
99
|
+
service: mockService
|
|
100
|
+
});
|
|
101
|
+
const errorEvent = jest.fn();
|
|
102
|
+
const page = await newSpecPage({
|
|
103
|
+
components: [PaymentsListCore, Table, PaginationMenu],
|
|
104
|
+
template: () => h("payments-list-core", { getPayments: getPayments, "onError-event": errorEvent }),
|
|
105
|
+
});
|
|
106
|
+
await page.waitForChanges();
|
|
107
|
+
expect(errorEvent).toHaveBeenCalledWith(expect.objectContaining({
|
|
108
|
+
detail: {
|
|
109
|
+
errorCode: 'fetch-error',
|
|
110
|
+
message: 'Fetch error',
|
|
111
|
+
severity: 'error',
|
|
112
|
+
}
|
|
113
|
+
}));
|
|
114
|
+
});
|
|
100
115
|
});
|
|
@@ -1,11 +1,14 @@
|
|
|
1
|
+
import { h } from "@stencil/core";
|
|
1
2
|
import { newSpecPage } from "@stencil/core/testing";
|
|
2
3
|
import { PaymentsList } from "../payments-list";
|
|
3
4
|
import { PaymentsListCore } from "../payments-list-core";
|
|
5
|
+
import { PaymentService } from "../../../api/services/payment.service";
|
|
6
|
+
jest.mock('../../../api/services/payment.service');
|
|
4
7
|
describe('payments-list', () => {
|
|
5
8
|
it('renders an error message when accountId and authToken are not provided', async () => {
|
|
6
9
|
const page = await newSpecPage({
|
|
7
10
|
components: [PaymentsList, PaymentsListCore],
|
|
8
|
-
|
|
11
|
+
template: () => h("justifi-payments-list", null),
|
|
9
12
|
});
|
|
10
13
|
await page.waitForChanges();
|
|
11
14
|
expect(page.root).toMatchSnapshot();
|
|
@@ -13,7 +16,7 @@ describe('payments-list', () => {
|
|
|
13
16
|
it('renders an error message when accountId is not provided', async () => {
|
|
14
17
|
const page = await newSpecPage({
|
|
15
18
|
components: [PaymentsList, PaymentsListCore],
|
|
16
|
-
|
|
19
|
+
template: () => h("justifi-payments-list", { "auth-token": "abc" }),
|
|
17
20
|
});
|
|
18
21
|
await page.waitForChanges();
|
|
19
22
|
expect(page.root).toMatchSnapshot();
|
|
@@ -21,9 +24,34 @@ describe('payments-list', () => {
|
|
|
21
24
|
it('renders an error message when authToken is not provided', async () => {
|
|
22
25
|
const page = await newSpecPage({
|
|
23
26
|
components: [PaymentsList, PaymentsListCore],
|
|
24
|
-
|
|
27
|
+
template: () => h("justifi-payments-list", { "account-id": "abc" }),
|
|
25
28
|
});
|
|
26
29
|
await page.waitForChanges();
|
|
27
30
|
expect(page.root).toMatchSnapshot();
|
|
28
31
|
});
|
|
32
|
+
it('emit an error event when accountId and authToken are not provided', async () => {
|
|
33
|
+
const errorEvent = jest.fn();
|
|
34
|
+
const page = await newSpecPage({
|
|
35
|
+
components: [PaymentsList, PaymentsListCore],
|
|
36
|
+
template: () => h("justifi-payments-list", { "onError-event": errorEvent }),
|
|
37
|
+
});
|
|
38
|
+
await page.waitForChanges();
|
|
39
|
+
expect(errorEvent).toHaveBeenCalled();
|
|
40
|
+
});
|
|
41
|
+
it('emit an error event when fetch fails', async () => {
|
|
42
|
+
PaymentService.prototype.fetchPayments = jest.fn().mockRejectedValue(new Error('Fetch error'));
|
|
43
|
+
const errorEvent = jest.fn();
|
|
44
|
+
const page = await newSpecPage({
|
|
45
|
+
components: [PaymentsList, PaymentsListCore],
|
|
46
|
+
template: () => (h("justifi-payments-list", { "account-id": "abc", "auth-token": "abc", "onError-event": errorEvent })),
|
|
47
|
+
});
|
|
48
|
+
await page.waitForChanges();
|
|
49
|
+
expect(errorEvent).toHaveBeenCalledWith(expect.objectContaining({
|
|
50
|
+
detail: {
|
|
51
|
+
errorCode: 'fetch-error',
|
|
52
|
+
message: 'Fetch error',
|
|
53
|
+
severity: 'error',
|
|
54
|
+
}
|
|
55
|
+
}));
|
|
56
|
+
});
|
|
29
57
|
});
|