@justifi/webcomponents 4.8.3 → 4.9.1
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-42d0c522.js → Business-64dffab7.js} +6 -7
- package/dist/cjs/{BusinessFormEventTypes-863f48e9.js → BusinessFormEventTypes-62990815.js} +1 -1
- package/dist/cjs/{Payout-44b49b2d.js → Payment-89a8bc21.js} +0 -43
- package/dist/cjs/Payout-a2dd7b01.js +45 -0
- package/dist/cjs/{SubAccount-2a803b22.js → SubAccount-f8144025.js} +1 -1
- package/dist/cjs/additional-questions-details_5.cjs.entry.js +24 -10
- package/dist/{webcomponents/p-4ee44c76.entry.js → cjs/business-details-core.cjs.entry.js} +55 -1
- package/dist/cjs/form-control-datepart_3.cjs.entry.js +1 -1
- package/dist/cjs/form-control-monetary.cjs.entry.js +1 -1
- package/dist/cjs/form-control-select_2.cjs.entry.js +1 -1
- package/dist/cjs/gross-payment-chart-core.cjs.entry.js +11036 -0
- package/dist/cjs/{index-55950669.js → index-07ddbad2.js} +0 -3
- package/dist/cjs/justifi-additional-questions_5.cjs.entry.js +2 -2
- package/dist/cjs/justifi-bank-account-form.cjs.entry.js +1 -1
- package/dist/cjs/{select-input_2.cjs.entry.js → justifi-billing-form_4.cjs.entry.js} +1811 -1
- package/dist/cjs/justifi-business-details.cjs.entry.js +43 -57
- package/dist/cjs/justifi-business-form-stepped.cjs.entry.js +5 -4
- package/dist/cjs/justifi-business-form.cjs.entry.js +5 -4
- package/dist/cjs/justifi-business-list.cjs.entry.js +5 -4
- package/dist/cjs/justifi-business-owners.cjs.entry.js +1 -1
- package/dist/cjs/justifi-card-form.cjs.entry.js +1 -1
- package/dist/cjs/justifi-checkout-core.cjs.entry.js +95 -0
- package/dist/cjs/justifi-checkout.cjs.entry.js +99 -0
- package/dist/cjs/justifi-details.cjs.entry.js +2 -2
- package/dist/cjs/justifi-gross-payment-chart.cjs.entry.js +39 -11008
- package/dist/cjs/justifi-new-payment-method_3.cjs.entry.js +168 -0
- package/dist/cjs/justifi-payment-balance-transactions.cjs.entry.js +5 -4
- package/dist/cjs/justifi-payment-details.cjs.entry.js +6 -5
- package/dist/cjs/justifi-payment-form.cjs.entry.js +5 -4
- package/dist/cjs/{justifi-billing-form_2.cjs.entry.js → justifi-payment-method-selector.cjs.entry.js} +4 -79
- package/dist/cjs/justifi-payments-list.cjs.entry.js +6 -5
- package/dist/cjs/justifi-payout-details.cjs.entry.js +5 -4
- package/dist/cjs/justifi-payouts-list.cjs.entry.js +5 -4
- package/dist/cjs/justifi-proceeds-list.cjs.entry.js +4 -3
- package/dist/cjs/justifi-refund-form.cjs.entry.js +3 -2
- package/dist/cjs/justifi-subaccount-details.cjs.entry.js +6 -5
- package/dist/cjs/justifi-subaccounts-list.cjs.entry.js +5 -4
- package/dist/cjs/justifi-table_2.cjs.entry.js +1 -1
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/cjs/payment-details-core.cjs.entry.js +10 -4
- package/dist/cjs/{payment.service-605896dc.js → payment.service-0b0086dc.js} +2 -1
- package/dist/cjs/payments-list-core.cjs.entry.js +4 -3
- package/dist/cjs/payout-details-core.cjs.entry.js +4 -4
- package/dist/cjs/{payout.service-b39f2739.js → payout.service-5cc3b4e9.js} +2 -1
- package/dist/cjs/payouts-list-core.cjs.entry.js +4 -3
- package/dist/cjs/subaccount-account-details_4.cjs.entry.js +7 -7
- package/dist/cjs/subaccount-bank-details.cjs.entry.js +3 -3
- package/dist/cjs/subaccount-terms-details.cjs.entry.js +3 -3
- package/dist/cjs/{utils-d126d17c.js → utils-5c3e442d.js} +5 -5
- package/dist/cjs/{utils-29a8a91d.js → utils-84208d99.js} +11 -2
- package/dist/cjs/webcomponents.cjs.js +2 -2
- package/dist/collection/api/Business.js +6 -7
- package/dist/collection/api/Checkout.js +1 -0
- package/dist/collection/api/index.js +1 -0
- package/dist/collection/api/services/business.service.js +8 -0
- package/dist/collection/api/services/checkout.service.js +12 -0
- package/dist/collection/api/services/reports.service.js +9 -0
- package/dist/collection/collection-manifest.json +7 -0
- package/dist/collection/components/billing-form/billing-form.js +1 -2
- package/dist/collection/components/business-details/additional-questions-details/additional-questions-details.js +5 -2
- package/dist/collection/components/business-details/additional-questions-details/test/additional-questions.spec.js +16 -0
- package/dist/collection/components/business-details/business-details-core.js +86 -0
- package/dist/collection/components/business-details/business-details.js +20 -65
- package/dist/collection/components/business-details/generic-info-details/generic-info-details.js +4 -2
- package/dist/collection/components/business-details/generic-info-details/test/generic-info-details.spec.js +16 -0
- package/dist/collection/components/business-details/get-business.js +17 -0
- package/dist/collection/components/business-details/legal-address-details/legal-address-details.js +5 -2
- package/dist/collection/components/business-details/legal-address-details/test/legal-address-details.spec.js +16 -0
- package/dist/collection/components/business-details/owner-details/owner-details.js +10 -12
- package/dist/collection/components/business-details/owner-details/test/owner-details.spec.js +16 -0
- package/dist/collection/components/business-details/representative-details/representative-details.js +5 -3
- package/dist/collection/components/business-details/representative-details/test/representative-details.spec.js +16 -0
- package/dist/collection/components/business-details/test/busines-details-core.spec.js +53 -0
- package/dist/collection/components/business-details/test/business-details.spec.js +40 -0
- package/dist/collection/components/business-details/test/get-business.spec.js +60 -0
- package/dist/collection/components/checkout/checkout-actions.js +33 -0
- package/dist/collection/components/checkout/checkout-core.css +2604 -0
- package/dist/collection/components/checkout/checkout-core.js +248 -0
- package/dist/collection/components/checkout/checkout.js +112 -0
- package/dist/collection/components/checkout/new-payment-method.js +188 -0
- package/dist/collection/components/checkout/payment-method-option-utils.js +19 -0
- package/dist/collection/components/checkout/payment-method-options.css +7073 -0
- package/dist/collection/components/checkout/payment-method-options.js +248 -0
- package/dist/collection/components/checkout/saved-payment-method.js +123 -0
- package/dist/collection/components/checkout/test/checkout.js +22 -0
- package/dist/collection/components/checkout/test/checkout.spec.js +166 -0
- package/dist/collection/components/checkout/test/mockCheckout.js +19 -0
- package/dist/collection/components/details/utils.js +4 -1
- package/dist/collection/components/gross-payment-chart/get-gross-payment-chart-data.js +14 -0
- package/dist/collection/components/gross-payment-chart/gross-payment-chart-core.js +119 -0
- package/dist/collection/components/gross-payment-chart/gross-payment-chart.js +25 -73
- package/dist/collection/components/gross-payment-chart/test/get-gross-payment-chart-data.spec.js +69 -0
- package/dist/collection/components/gross-payment-chart/test/gross-payment-chart-core.spec.js +64 -0
- package/dist/collection/components/gross-payment-chart/test/gross-payment-chart.spec.js +23 -8
- package/dist/collection/components/payment-details/payment-details-core.js +8 -2
- package/dist/collection/components/payment-details/payment-details.js +0 -1
- package/dist/collection/components/payment-form/payment-form.js +1 -1
- package/dist/collection/components/payment-method-form/payment-method-form.js +1 -1
- package/dist/collection/components/payout-details/payout-details-core.js +2 -2
- package/dist/collection/components/subaccount-details/subaccount-account-details/subaccount-account-details.js +2 -2
- package/dist/collection/components/subaccount-details/subaccount-bank-details/subaccount-bank-details.js +2 -2
- package/dist/collection/components/subaccount-details/subaccount-merchant-details/subaccount-merchant-details.js +2 -2
- package/dist/collection/components/subaccount-details/subaccount-owners-details/subaccount-owners-details.js +2 -2
- package/dist/collection/components/subaccount-details/subaccount-representative-details/subaccount-representative-details.js +2 -2
- package/dist/collection/components/subaccount-details/subaccount-terms-details/subaccount-terms-details.js +2 -2
- package/dist/collection/utils/utils.js +9 -3
- package/dist/docs.json +1152 -187
- package/dist/esm/{Business-e9340f6b.js → Business-9921d35f.js} +6 -7
- package/dist/esm/{BusinessFormEventTypes-989960ba.js → BusinessFormEventTypes-182e20be.js} +1 -1
- package/dist/esm/{Payout-dc5f009c.js → Payment-55886c86.js} +1 -43
- package/dist/esm/Payout-dfe15b00.js +43 -0
- package/dist/esm/{SubAccount-46b4c2b1.js → SubAccount-76f6d565.js} +1 -1
- package/dist/esm/additional-questions-details_5.entry.js +24 -10
- package/dist/esm/business-details-core.entry.js +51 -0
- package/dist/esm/form-control-datepart_3.entry.js +1 -1
- package/dist/esm/form-control-monetary.entry.js +1 -1
- package/dist/esm/form-control-select_2.entry.js +1 -1
- package/dist/esm/gross-payment-chart-core.entry.js +11032 -0
- package/dist/esm/{index-62b8aa8a.js → index-fb5ca346.js} +0 -3
- package/dist/esm/justifi-additional-questions_5.entry.js +2 -2
- package/dist/esm/justifi-bank-account-form.entry.js +1 -1
- package/dist/esm/{select-input_2.entry.js → justifi-billing-form_4.entry.js} +1810 -2
- package/dist/esm/justifi-business-details.entry.js +42 -56
- package/dist/esm/justifi-business-form-stepped.entry.js +5 -4
- package/dist/esm/justifi-business-form.entry.js +5 -4
- package/dist/esm/justifi-business-list.entry.js +5 -4
- package/dist/esm/justifi-business-owners.entry.js +1 -1
- package/dist/esm/justifi-card-form.entry.js +1 -1
- package/dist/esm/justifi-checkout-core.entry.js +91 -0
- package/dist/esm/justifi-checkout.entry.js +95 -0
- package/dist/esm/justifi-details.entry.js +2 -2
- package/dist/esm/justifi-gross-payment-chart.entry.js +39 -11008
- package/dist/esm/justifi-new-payment-method_3.entry.js +162 -0
- package/dist/esm/justifi-payment-balance-transactions.entry.js +4 -3
- package/dist/esm/justifi-payment-details.entry.js +5 -4
- package/dist/esm/justifi-payment-form.entry.js +4 -3
- package/dist/esm/{justifi-billing-form_2.entry.js → justifi-payment-method-selector.entry.js} +4 -78
- package/dist/esm/justifi-payments-list.entry.js +5 -4
- package/dist/esm/justifi-payout-details.entry.js +5 -4
- package/dist/esm/justifi-payouts-list.entry.js +5 -4
- package/dist/esm/justifi-proceeds-list.entry.js +4 -3
- package/dist/esm/justifi-refund-form.entry.js +3 -2
- package/dist/esm/justifi-subaccount-details.entry.js +6 -5
- package/dist/esm/justifi-subaccounts-list.entry.js +5 -4
- package/dist/esm/justifi-table_2.entry.js +1 -1
- package/dist/esm/loader.js +3 -3
- package/dist/esm/payment-details-core.entry.js +10 -4
- package/dist/esm/{payment.service-bea02ccf.js → payment.service-f274ef98.js} +2 -1
- package/dist/esm/payments-list-core.entry.js +4 -3
- package/dist/esm/payout-details-core.entry.js +4 -4
- package/dist/esm/{payout.service-92e56814.js → payout.service-af293f61.js} +2 -1
- package/dist/esm/payouts-list-core.entry.js +4 -3
- package/dist/esm/subaccount-account-details_4.entry.js +7 -7
- package/dist/esm/subaccount-bank-details.entry.js +3 -3
- package/dist/esm/subaccount-terms-details.entry.js +3 -3
- package/dist/esm/{utils-76a93600.js → utils-5193fcd7.js} +10 -3
- package/dist/esm/{utils-576874df.js → utils-a3e96d9f.js} +5 -5
- package/dist/esm/webcomponents.js +3 -3
- package/dist/module/Business.js +6 -7
- package/dist/module/Payment.js +138 -0
- package/dist/module/Payout.js +1 -138
- package/dist/module/SubAccount.js +1 -1
- package/dist/module/additional-questions-details2.js +5 -2
- package/dist/module/billing-form.js +1 -2
- package/dist/module/business-details-core.d.ts +11 -0
- package/dist/module/business-details-core.js +6 -0
- package/dist/module/business-details-core2.js +101 -0
- package/dist/module/checkout-core.js +163 -0
- package/dist/module/generic-info-details2.js +4 -2
- package/dist/module/gross-payment-chart-core.d.ts +11 -0
- package/dist/module/gross-payment-chart-core.js +6 -0
- package/dist/module/gross-payment-chart-core2.js +11055 -0
- package/dist/module/justifi-business-details.js +51 -60
- package/dist/module/justifi-business-form-stepped.js +1 -0
- package/dist/module/justifi-business-form.js +1 -0
- package/dist/module/justifi-business-list.js +2 -1
- package/dist/module/justifi-checkout-core.d.ts +11 -0
- package/dist/module/justifi-checkout-core.js +6 -0
- package/dist/module/justifi-checkout.d.ts +11 -0
- package/dist/module/justifi-checkout.js +172 -0
- package/dist/module/justifi-gross-payment-chart.js +49 -11016
- package/dist/module/justifi-new-payment-method.d.ts +11 -0
- package/dist/module/justifi-new-payment-method.js +6 -0
- package/dist/module/justifi-payment-balance-transactions.js +3 -2
- package/dist/module/justifi-payment-details.js +2 -1
- package/dist/module/justifi-payment-form.js +2 -1
- package/dist/module/justifi-payment-method-options.d.ts +11 -0
- package/dist/module/justifi-payment-method-options.js +6 -0
- package/dist/module/justifi-payments-list.js +2 -1
- package/dist/module/justifi-payout-details.js +2 -1
- package/dist/module/justifi-payouts-list.js +2 -1
- package/dist/module/justifi-proceeds-list.js +2 -1
- package/dist/module/justifi-refund-form.js +1 -0
- package/dist/module/justifi-saved-payment-method.d.ts +11 -0
- package/dist/module/justifi-saved-payment-method.js +6 -0
- package/dist/module/justifi-subaccount-details.js +2 -1
- package/dist/module/justifi-subaccounts-list.js +2 -1
- package/dist/module/legal-address-details2.js +5 -2
- package/dist/module/new-payment-method.js +105 -0
- package/dist/module/owner-details2.js +10 -4
- package/dist/module/payment-details-core2.js +9 -3
- package/dist/module/payment-method-form.js +4 -10
- package/dist/module/payment-method-options.js +128 -0
- package/dist/module/payment-method-selector.js +2 -1
- package/dist/module/payment.service.js +1 -0
- package/dist/module/payments-list-core2.js +2 -1
- package/dist/module/payout-details-core2.js +3 -3
- package/dist/module/payout.service.js +1 -0
- package/dist/module/payouts-list-core2.js +3 -2
- package/dist/module/representative-details2.js +5 -3
- package/dist/module/saved-payment-method.js +66 -0
- package/dist/module/subaccount-account-details2.js +2 -2
- package/dist/module/subaccount-bank-details.js +2 -2
- package/dist/module/subaccount-merchant-details2.js +3 -3
- package/dist/module/subaccount-owners-details2.js +2 -2
- package/dist/module/subaccount-representative-details2.js +2 -2
- package/dist/module/subaccount-terms-details.js +2 -2
- package/dist/module/utils.js +4 -4
- package/dist/module/utils2.js +10 -3
- package/dist/types/api/Api.d.ts +1 -1
- package/dist/types/api/Checkout.d.ts +14 -0
- package/dist/types/api/index.d.ts +1 -0
- package/dist/types/api/services/business.service.d.ts +8 -0
- package/dist/types/api/services/checkout.service.d.ts +9 -0
- package/dist/types/api/services/reports.service.d.ts +5 -0
- package/dist/types/components/billing-form/billing-form.d.ts +0 -1
- package/dist/types/components/business-details/business-details-core.d.ts +16 -0
- package/dist/types/components/business-details/business-details.d.ts +3 -13
- package/dist/types/components/business-details/get-business.d.ts +8 -0
- package/dist/types/components/business-details/owner-details/owner-details.d.ts +0 -8
- package/dist/types/components/checkout/checkout-actions.d.ts +17 -0
- package/dist/types/components/checkout/checkout-core.d.ts +28 -0
- package/dist/types/components/checkout/checkout.d.ts +12 -0
- package/dist/types/components/checkout/new-payment-method.d.ts +17 -0
- package/dist/types/components/checkout/payment-method-option-utils.d.ts +16 -0
- package/dist/types/components/checkout/payment-method-options.d.ts +18 -0
- package/dist/types/components/checkout/saved-payment-method.d.ts +11 -0
- package/dist/types/components/checkout/test/checkout.d.ts +1 -0
- package/dist/types/components/checkout/test/mockCheckout.d.ts +19 -0
- package/dist/types/components/details/utils.d.ts +1 -1
- package/dist/types/components/gross-payment-chart/get-gross-payment-chart-data.d.ts +11 -0
- package/dist/types/components/gross-payment-chart/gross-payment-chart-core.d.ts +18 -0
- package/dist/types/components/gross-payment-chart/gross-payment-chart.d.ts +4 -14
- package/dist/types/components/payment-details/payment-details.d.ts +0 -1
- package/dist/types/components/payment-method-form/payment-method-responses.d.ts +3 -9
- package/dist/types/components.d.ts +217 -32
- package/dist/types/utils/utils.d.ts +1 -0
- package/dist/webcomponents/p-018b71f5.entry.js +1 -0
- package/dist/webcomponents/p-0923e39c.js +1 -0
- package/dist/webcomponents/{p-7a1a06c0.entry.js → p-09b94d22.entry.js} +1 -1
- package/dist/webcomponents/p-1b04d091.entry.js +1 -0
- package/dist/webcomponents/{p-0a0cf2e6.entry.js → p-1bac1674.entry.js} +1 -1
- package/dist/webcomponents/p-1cbdca15.entry.js +1 -0
- package/dist/webcomponents/p-2f0653f4.entry.js +1 -0
- package/dist/webcomponents/p-3134ab82.entry.js +1 -0
- package/dist/webcomponents/{p-22c1acd6.js → p-34f9fe6b.js} +1 -1
- package/dist/webcomponents/p-3bae0ed3.entry.js +1 -0
- package/dist/webcomponents/p-41031759.entry.js +1 -0
- package/dist/webcomponents/p-41490d96.entry.js +1 -0
- package/dist/webcomponents/{p-081cf5f6.entry.js → p-4ed3a9f5.entry.js} +1 -1
- package/dist/webcomponents/{p-6478f3ca.js → p-4edd9721.js} +1 -1
- package/dist/webcomponents/p-51b0bf2a.entry.js +1 -0
- package/dist/webcomponents/p-531844f6.entry.js +1 -0
- package/dist/webcomponents/{p-4fa27a28.entry.js → p-591e29bf.entry.js} +1 -1
- package/dist/webcomponents/p-5d5d7550.entry.js +1 -0
- package/dist/webcomponents/{p-810b72b5.js → p-5ea274b8.js} +1 -1
- package/dist/webcomponents/{p-4ba2c711.entry.js → p-5f785ede.entry.js} +1 -1
- package/dist/webcomponents/p-63296409.js +1 -0
- package/dist/webcomponents/{p-4f14df36.js → p-6d05174c.js} +1 -1
- package/dist/webcomponents/p-72d1ad98.entry.js +1 -0
- package/dist/webcomponents/{p-40349ffc.entry.js → p-796cf44f.entry.js} +1 -1
- package/dist/webcomponents/p-7b2cddc7.js +1 -0
- package/dist/webcomponents/{p-7c0f91fa.entry.js → p-7cd06ada.entry.js} +1 -1
- package/dist/webcomponents/p-8f895ec3.entry.js +1 -0
- package/dist/webcomponents/p-92a55427.entry.js +1 -0
- package/dist/webcomponents/p-97c42345.entry.js +1 -0
- package/dist/webcomponents/p-99a8b7d0.entry.js +1 -0
- package/dist/webcomponents/p-9a63eec9.entry.js +1 -0
- package/dist/webcomponents/p-9c310f5c.entry.js +1 -0
- package/dist/webcomponents/p-9e3771b7.entry.js +19 -0
- package/dist/webcomponents/{p-6d0725ef.entry.js → p-a81229a5.entry.js} +1 -1
- package/dist/webcomponents/{p-234bc840.entry.js → p-adc96df1.entry.js} +1 -1
- package/dist/webcomponents/p-baafa7f5.js +1 -0
- package/dist/webcomponents/p-babd292f.entry.js +1 -0
- package/dist/webcomponents/{p-5c0310ee.js → p-bb037696.js} +1 -1
- package/dist/webcomponents/p-bb7f6095.entry.js +1 -0
- package/dist/webcomponents/p-c032b216.entry.js +1 -0
- package/dist/webcomponents/{p-08833966.entry.js → p-c2c3d5d1.entry.js} +1 -1
- package/dist/webcomponents/p-c8d51336.entry.js +1 -0
- package/dist/webcomponents/{p-4c01df65.entry.js → p-dc05b5c5.entry.js} +1 -1
- package/dist/webcomponents/p-e3fab0e2.js +1 -0
- package/dist/webcomponents/p-e536a4c1.entry.js +1 -0
- package/dist/webcomponents/p-e6939585.entry.js +1 -0
- package/dist/webcomponents/p-ec358d69.entry.js +1 -0
- package/dist/webcomponents/p-f55ac955.entry.js +1 -0
- package/dist/webcomponents/p-f64a85cf.entry.js +1 -0
- package/dist/webcomponents/webcomponents.esm.js +1 -1
- package/package.json +3 -2
- package/dist/cjs/justifi-payment-method-form.cjs.entry.js +0 -1747
- package/dist/esm/justifi-payment-method-form.entry.js +0 -1743
- package/dist/webcomponents/p-0bc8b02e.entry.js +0 -1
- package/dist/webcomponents/p-112acd3c.entry.js +0 -1
- package/dist/webcomponents/p-1555e6b1.js +0 -1
- package/dist/webcomponents/p-16f41fd0.entry.js +0 -1
- package/dist/webcomponents/p-17715325.js +0 -1
- package/dist/webcomponents/p-3a4d4869.entry.js +0 -1
- package/dist/webcomponents/p-3cb0b96d.js +0 -1
- package/dist/webcomponents/p-5422a24b.entry.js +0 -1
- package/dist/webcomponents/p-578e0a05.entry.js +0 -1
- package/dist/webcomponents/p-640d90dc.entry.js +0 -1
- package/dist/webcomponents/p-663bfe87.js +0 -1
- package/dist/webcomponents/p-696396c7.entry.js +0 -1
- package/dist/webcomponents/p-6ab67031.entry.js +0 -1
- package/dist/webcomponents/p-8516d602.entry.js +0 -1
- package/dist/webcomponents/p-894a7475.entry.js +0 -19
- package/dist/webcomponents/p-94ebfafb.entry.js +0 -1
- package/dist/webcomponents/p-9cb3ff78.entry.js +0 -1
- package/dist/webcomponents/p-9e81808f.entry.js +0 -1
- package/dist/webcomponents/p-a432110c.entry.js +0 -1
- package/dist/webcomponents/p-b1881723.entry.js +0 -1
- package/dist/webcomponents/p-b5aba473.entry.js +0 -1
- package/dist/webcomponents/p-bd099662.entry.js +0 -1
- package/dist/webcomponents/p-bfd917b8.entry.js +0 -1
- package/dist/webcomponents/p-c90fa055.entry.js +0 -1
- package/dist/webcomponents/p-ebb91944.entry.js +0 -1
- package/dist/webcomponents/p-ec4f27e7.entry.js +0 -1
- package/dist/webcomponents/p-fa495a43.entry.js +0 -1
|
@@ -1,23 +1,21 @@
|
|
|
1
1
|
import { Host, h } from "@stencil/core";
|
|
2
|
-
import {
|
|
2
|
+
import { DetailSectionTitle, DetailItem } from "../../details/utils";
|
|
3
3
|
import { formatMediumDate } from "../../../utils/utils";
|
|
4
|
-
/**
|
|
5
|
-
*
|
|
6
|
-
* @exportedPart detail-section
|
|
7
|
-
* @exportedPart detail-section-title
|
|
8
|
-
* @exportedPart detail-section-item-title
|
|
9
|
-
* @exportedPart detail-section-item-data
|
|
10
|
-
* @exportedPart detail-empty-state
|
|
11
|
-
*/
|
|
12
4
|
export class OwnerDetails {
|
|
13
5
|
constructor() {
|
|
14
6
|
this.owners = undefined;
|
|
15
7
|
}
|
|
16
8
|
render() {
|
|
17
|
-
|
|
9
|
+
var _a;
|
|
10
|
+
if (!((_a = this === null || this === void 0 ? void 0 : this.owners) === null || _a === void 0 ? void 0 : _a.length))
|
|
11
|
+
return null;
|
|
12
|
+
return (h(Host, null, !!(this === null || this === void 0 ? void 0 : this.owners.length) && (this.owners.map(owner => {
|
|
18
13
|
var _a, _b, _c, _d, _e;
|
|
19
|
-
return
|
|
20
|
-
|
|
14
|
+
return [
|
|
15
|
+
h(DetailSectionTitle, { sectionTitle: `Owner ${owner === null || owner === void 0 ? void 0 : owner.name}'s Details` }),
|
|
16
|
+
h("div", { class: "d-table gap-2 w-100" }, h(DetailItem, { title: "Name", value: owner === null || owner === void 0 ? void 0 : owner.name }), h(DetailItem, { title: "Title", value: owner === null || owner === void 0 ? void 0 : owner.title }), h(DetailItem, { title: "Email", value: owner === null || owner === void 0 ? void 0 : owner.email }), h(DetailItem, { title: "Phone", value: owner === null || owner === void 0 ? void 0 : owner.phone }), h(DetailItem, { title: "Date of Birth", value: formatMediumDate(new Date(Number(owner === null || owner === void 0 ? void 0 : owner.dob_day), Number(owner === null || owner === void 0 ? void 0 : owner.dob_month), Number(owner === null || owner === void 0 ? void 0 : owner.dob_year))) }), h(DetailItem, { title: "Identification Number", value: `********${owner === null || owner === void 0 ? void 0 : owner.ssn_last4}` }), h(DetailItem, { title: "Line 1", value: (_a = owner === null || owner === void 0 ? void 0 : owner.address) === null || _a === void 0 ? void 0 : _a.line1 }), h(DetailItem, { title: "Line 2", value: (_b = owner === null || owner === void 0 ? void 0 : owner.address) === null || _b === void 0 ? void 0 : _b.line2 }), h(DetailItem, { title: "City", value: (_c = owner === null || owner === void 0 ? void 0 : owner.address) === null || _c === void 0 ? void 0 : _c.city }), h(DetailItem, { title: "State", value: (_d = owner === null || owner === void 0 ? void 0 : owner.address) === null || _d === void 0 ? void 0 : _d.state }), h(DetailItem, { title: "Zip", value: (_e = owner === null || owner === void 0 ? void 0 : owner.address) === null || _e === void 0 ? void 0 : _e.postal_code }))
|
|
17
|
+
];
|
|
18
|
+
}))));
|
|
21
19
|
}
|
|
22
20
|
static get is() { return "owner-details"; }
|
|
23
21
|
static get encapsulation() { return "shadow"; }
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { h } from "@stencil/core";
|
|
2
|
+
import { newSpecPage } from "@stencil/core/testing";
|
|
3
|
+
import { Business } from "../../../../api/Business";
|
|
4
|
+
import mockedBusinessDetails from "../../../../api/mockData/mockBusinessDetails.json";
|
|
5
|
+
import { OwnerDetails } from "../owner-details";
|
|
6
|
+
describe('owner-details', () => {
|
|
7
|
+
it('should render owner-details', async () => {
|
|
8
|
+
const businessDetails = new Business(mockedBusinessDetails.data);
|
|
9
|
+
const page = await newSpecPage({
|
|
10
|
+
components: [OwnerDetails],
|
|
11
|
+
template: () => (h("owner-details", { owners: businessDetails.owners })),
|
|
12
|
+
});
|
|
13
|
+
await page.waitForChanges();
|
|
14
|
+
expect(page.root).toMatchSnapshot();
|
|
15
|
+
});
|
|
16
|
+
});
|
package/dist/collection/components/business-details/representative-details/representative-details.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Host, h } from "@stencil/core";
|
|
2
|
-
import {
|
|
3
|
-
import { formatMediumDate } from "../../../utils/utils";
|
|
2
|
+
import { DetailSectionTitle, DetailItem } from "../../details/utils";
|
|
3
|
+
import { formatMediumDate, isEmptyObject } from "../../../utils/utils";
|
|
4
4
|
/**
|
|
5
5
|
*
|
|
6
6
|
* @exportedPart detail-section
|
|
@@ -15,7 +15,9 @@ export class JustifiRepresentativeDetails {
|
|
|
15
15
|
}
|
|
16
16
|
render() {
|
|
17
17
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p;
|
|
18
|
-
|
|
18
|
+
if (isEmptyObject(this.representative))
|
|
19
|
+
return null;
|
|
20
|
+
return (h(Host, null, h(DetailSectionTitle, { sectionTitle: "Representative Details" }), h("div", { class: "d-table gap-2 w-100" }, h("div", { class: "row gy-3" }, h("div", { class: "col-12 col-md-6" }, h(DetailItem, { title: "Name", value: (_a = this.representative) === null || _a === void 0 ? void 0 : _a.name }), h(DetailItem, { title: "ID", value: (_b = this.representative) === null || _b === void 0 ? void 0 : _b.id }), h(DetailItem, { title: "Address", value: (_d = (_c = this.representative) === null || _c === void 0 ? void 0 : _c.address) === null || _d === void 0 ? void 0 : _d.line1 }), h(DetailItem, { title: "Created At", value: ((_e = this.representative) === null || _e === void 0 ? void 0 : _e.created_at) && formatMediumDate((_f = this.representative) === null || _f === void 0 ? void 0 : _f.created_at) })), h("div", { class: "col-12 col-md-6" }, h(DetailItem, { title: "Title", value: (_g = this.representative) === null || _g === void 0 ? void 0 : _g.title }), h(DetailItem, { title: "Is Owner?", value: (_h = this.representative) === null || _h === void 0 ? void 0 : _h.is_owner.toString() }), h(DetailItem, { title: "Date Of Birth", value: this.representative && formatMediumDate(new Date(Number((_j = this.representative) === null || _j === void 0 ? void 0 : _j.dob_year), Number((_k = this.representative) === null || _k === void 0 ? void 0 : _k.dob_month) - 1, Number((_l = this.representative) === null || _l === void 0 ? void 0 : _l.dob_day))) }), h(DetailItem, { title: "Email", value: (_m = this.representative) === null || _m === void 0 ? void 0 : _m.email }), h(DetailItem, { title: "Phone", value: (_o = this.representative) === null || _o === void 0 ? void 0 : _o.phone }), h(DetailItem, { title: "Updated At", value: this.representative && formatMediumDate((_p = this.representative) === null || _p === void 0 ? void 0 : _p.updated_at) }))))));
|
|
19
21
|
}
|
|
20
22
|
static get is() { return "representative-details"; }
|
|
21
23
|
static get encapsulation() { return "shadow"; }
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { h } from "@stencil/core";
|
|
2
|
+
import { newSpecPage } from "@stencil/core/testing";
|
|
3
|
+
import { Business } from "../../../../api/Business";
|
|
4
|
+
import mockedBusinessDetails from "../../../../api/mockData/mockBusinessDetails.json";
|
|
5
|
+
import { JustifiRepresentativeDetails } from "../representative-details";
|
|
6
|
+
describe('RepresentativeDetails', () => {
|
|
7
|
+
it('should render', async () => {
|
|
8
|
+
const businessDetails = new Business(mockedBusinessDetails.data);
|
|
9
|
+
const page = await newSpecPage({
|
|
10
|
+
components: [JustifiRepresentativeDetails],
|
|
11
|
+
template: () => (h("representative-details", { representative: businessDetails.representative })),
|
|
12
|
+
});
|
|
13
|
+
await page.waitForChanges();
|
|
14
|
+
expect(page.root).toMatchSnapshot();
|
|
15
|
+
});
|
|
16
|
+
});
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { newSpecPage } from "@stencil/core/testing";
|
|
2
|
+
import { BusinessDetailsCore } from "../business-details-core";
|
|
3
|
+
import { makeGetBusiness } from "../get-business";
|
|
4
|
+
import mockBusinessDetails from "./../../../api/mockData/mockBusinessDetails.json";
|
|
5
|
+
import { Business } from "../../../api/Business";
|
|
6
|
+
describe('BusinessDetailsCore', () => {
|
|
7
|
+
it('should display loading state correclty', async () => {
|
|
8
|
+
const page = await newSpecPage({
|
|
9
|
+
components: [BusinessDetailsCore],
|
|
10
|
+
html: '<business-details-core></business-details-core>',
|
|
11
|
+
});
|
|
12
|
+
await page.waitForChanges();
|
|
13
|
+
expect(page.root).toMatchSnapshot();
|
|
14
|
+
});
|
|
15
|
+
it('should display error state correctly', async () => {
|
|
16
|
+
const page = await newSpecPage({
|
|
17
|
+
components: [BusinessDetailsCore],
|
|
18
|
+
html: '<business-details-core></business-details-core>',
|
|
19
|
+
});
|
|
20
|
+
const getBusiness = makeGetBusiness({
|
|
21
|
+
id: '',
|
|
22
|
+
authToken: '',
|
|
23
|
+
service: {
|
|
24
|
+
fetchBusiness: async () => ({ error: 'error' }),
|
|
25
|
+
},
|
|
26
|
+
});
|
|
27
|
+
page.rootInstance.componentWillLoad = () => { };
|
|
28
|
+
page.rootInstance.getBusiness = getBusiness;
|
|
29
|
+
page.rootInstance.fetchData();
|
|
30
|
+
await page.waitForChanges();
|
|
31
|
+
expect(page.root).toMatchSnapshot();
|
|
32
|
+
});
|
|
33
|
+
it('should set business details correctly to state', async () => {
|
|
34
|
+
const page = await newSpecPage({
|
|
35
|
+
components: [BusinessDetailsCore],
|
|
36
|
+
html: '<business-details-core></business-details-core>',
|
|
37
|
+
});
|
|
38
|
+
const getBusiness = makeGetBusiness({
|
|
39
|
+
id: '',
|
|
40
|
+
authToken: '',
|
|
41
|
+
service: {
|
|
42
|
+
fetchBusiness: async () => Promise.resolve(mockBusinessDetails),
|
|
43
|
+
},
|
|
44
|
+
});
|
|
45
|
+
page.rootInstance.componentWillLoad = () => { };
|
|
46
|
+
page.rootInstance.getBusiness = getBusiness;
|
|
47
|
+
page.rootInstance.fetchData();
|
|
48
|
+
await page.waitForChanges();
|
|
49
|
+
const expectedBusiness = new Business(mockBusinessDetails.data);
|
|
50
|
+
expect(page.rootInstance.business).toEqual(expectedBusiness);
|
|
51
|
+
expect(page.root).toMatchSnapshot();
|
|
52
|
+
});
|
|
53
|
+
});
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { newSpecPage } from "@stencil/core/testing";
|
|
2
|
+
import { BusinessDetails } from "../business-details";
|
|
3
|
+
import { BusinessDetailsCore } from "../business-details-core";
|
|
4
|
+
describe('justifi-business-details', () => {
|
|
5
|
+
it('initializes getBusiness on load with valid props', async () => {
|
|
6
|
+
const page = await newSpecPage({
|
|
7
|
+
components: [BusinessDetails],
|
|
8
|
+
html: `<justifi-business-details business-id="123" auth-token="token" />`,
|
|
9
|
+
});
|
|
10
|
+
page.waitForChanges();
|
|
11
|
+
expect(page.rootInstance.getBusiness).toBeDefined();
|
|
12
|
+
expect(page.rootInstance.errorMessage).toBeUndefined();
|
|
13
|
+
});
|
|
14
|
+
it('sets an error message with invalid props', async () => {
|
|
15
|
+
const page = await newSpecPage({
|
|
16
|
+
components: [BusinessDetails],
|
|
17
|
+
html: `<justifi-business-details></justifi-business-details>`, // No props provided
|
|
18
|
+
});
|
|
19
|
+
page.waitForChanges();
|
|
20
|
+
expect(page.rootInstance.errorMessage).toBe('Invalid business id or auth token');
|
|
21
|
+
});
|
|
22
|
+
it('renders the error state when there is an error message', async () => {
|
|
23
|
+
const page = await newSpecPage({
|
|
24
|
+
components: [BusinessDetails, BusinessDetailsCore],
|
|
25
|
+
html: `<justifi-business-details />`,
|
|
26
|
+
});
|
|
27
|
+
await page.waitForChanges();
|
|
28
|
+
expect(page.rootInstance.errorMessage).toBe('Invalid business id or auth token');
|
|
29
|
+
expect(page.root).toMatchSnapshot();
|
|
30
|
+
});
|
|
31
|
+
it('renders business-details-core when there is no error message', async () => {
|
|
32
|
+
const page = await newSpecPage({
|
|
33
|
+
components: [BusinessDetails, BusinessDetailsCore],
|
|
34
|
+
html: `<justifi-business-details business-id="123" auth-token="token" />`,
|
|
35
|
+
});
|
|
36
|
+
page.waitForChanges();
|
|
37
|
+
const core = page.root.shadowRoot.querySelector('business-details-core');
|
|
38
|
+
expect(core).not.toBeNull();
|
|
39
|
+
});
|
|
40
|
+
});
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { makeGetBusiness } from "../get-business";
|
|
2
|
+
import mockResponse from "../../../api/mockData/mockBusinessDetails.json";
|
|
3
|
+
import { Business } from "../../../api/Business";
|
|
4
|
+
// Mocks
|
|
5
|
+
jest.mock('../../../api/services/utils.ts', () => ({
|
|
6
|
+
getErrorMessage: jest.fn(),
|
|
7
|
+
}));
|
|
8
|
+
const mockService = {
|
|
9
|
+
fetchBusiness: jest.fn(),
|
|
10
|
+
};
|
|
11
|
+
// Test Suite
|
|
12
|
+
describe('makeGetBusiness', () => {
|
|
13
|
+
const id = '123';
|
|
14
|
+
const authToken = 'token';
|
|
15
|
+
afterEach(() => {
|
|
16
|
+
jest.clearAllMocks();
|
|
17
|
+
});
|
|
18
|
+
it('calls onSuccess with a new Business instance on successful fetch', async () => {
|
|
19
|
+
mockService.fetchBusiness.mockResolvedValue(mockResponse);
|
|
20
|
+
const onSuccess = jest.fn();
|
|
21
|
+
const onError = jest.fn();
|
|
22
|
+
const getBusiness = makeGetBusiness({
|
|
23
|
+
id,
|
|
24
|
+
authToken,
|
|
25
|
+
service: mockService,
|
|
26
|
+
});
|
|
27
|
+
await getBusiness({ onSuccess, onError });
|
|
28
|
+
expect(onSuccess).toHaveBeenCalledWith({
|
|
29
|
+
business: new Business(mockResponse.data),
|
|
30
|
+
});
|
|
31
|
+
expect(onError).not.toHaveBeenCalled();
|
|
32
|
+
});
|
|
33
|
+
it('calls onError with an error message on fetch error', async () => {
|
|
34
|
+
const error = 'Test error';
|
|
35
|
+
const responseError = { error };
|
|
36
|
+
mockService.fetchBusiness.mockResolvedValue(responseError);
|
|
37
|
+
const onSuccess = jest.fn();
|
|
38
|
+
const onError = jest.fn();
|
|
39
|
+
const getBusiness = makeGetBusiness({
|
|
40
|
+
id,
|
|
41
|
+
authToken,
|
|
42
|
+
service: mockService,
|
|
43
|
+
});
|
|
44
|
+
await getBusiness({ onSuccess, onError });
|
|
45
|
+
expect(onError).toHaveBeenCalledWith({ error });
|
|
46
|
+
});
|
|
47
|
+
it('calls onError with an error message on fetch exception', async () => {
|
|
48
|
+
const error = new Error('Network error');
|
|
49
|
+
mockService.fetchBusiness.mockRejectedValue(error);
|
|
50
|
+
const onSuccess = jest.fn();
|
|
51
|
+
const onError = jest.fn();
|
|
52
|
+
const getBusiness = makeGetBusiness({
|
|
53
|
+
id,
|
|
54
|
+
authToken,
|
|
55
|
+
service: mockService,
|
|
56
|
+
});
|
|
57
|
+
await getBusiness({ onSuccess, onError });
|
|
58
|
+
expect(onError).toHaveBeenCalledWith({ error: error.message });
|
|
59
|
+
});
|
|
60
|
+
});
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { getErrorMessage } from "../../api/services/utils";
|
|
2
|
+
export const makeGetCheckout = ({ authToken, checkoutId, service }) => async ({ onSuccess, onError }) => {
|
|
3
|
+
try {
|
|
4
|
+
const response = await service.fetchCheckout(authToken, checkoutId);
|
|
5
|
+
if (!response.error) {
|
|
6
|
+
const checkout = response.data;
|
|
7
|
+
onSuccess({ checkout });
|
|
8
|
+
}
|
|
9
|
+
else {
|
|
10
|
+
const responseError = getErrorMessage(response.error);
|
|
11
|
+
return onError(responseError);
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
catch (error) {
|
|
15
|
+
return onError(error.message || error);
|
|
16
|
+
}
|
|
17
|
+
};
|
|
18
|
+
export const makePay = ({ authToken, checkoutId, service }) => async ({ paymentMethodToken, onSuccess, onError }) => {
|
|
19
|
+
try {
|
|
20
|
+
const response = await service.pay(authToken, checkoutId, paymentMethodToken);
|
|
21
|
+
if (!response.error) {
|
|
22
|
+
const checkout = response.data;
|
|
23
|
+
onSuccess({ checkout });
|
|
24
|
+
}
|
|
25
|
+
else {
|
|
26
|
+
const responseError = getErrorMessage(response.error);
|
|
27
|
+
return onError(responseError);
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
catch (error) {
|
|
31
|
+
return onError(error.message || error);
|
|
32
|
+
}
|
|
33
|
+
};
|