@justifi/webcomponents 4.19.1-rc-5 → 4.19.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/{Analytics-8949ea18.js → Analytics-f870b3ee.js} +3 -2
- package/dist/cjs/{business-additional-questions-schema-cf545610.js → business-additional-questions-schema-11ce0005.js} +1 -1
- package/dist/cjs/{business-form-options-582467fe.js → business-form-options-26f9900c.js} +1 -1
- package/dist/cjs/{business.service-6bb7ac82.js → business.service-f63650f5.js} +6 -5
- package/dist/cjs/config-ff2dda66.js +15 -0
- package/dist/cjs/form-alert_5.cjs.entry.js +1 -1
- package/dist/cjs/form-control-checkbox_9.cjs.entry.js +4 -4
- package/dist/cjs/{get-payout-csv-1391ff3e.js → get-payout-csv-f3aee6d0.js} +4 -3
- package/dist/cjs/justifi-additional-questions-form-step_10.cjs.entry.js +10 -9
- package/dist/cjs/justifi-bank-account-form.cjs.entry.js +5 -4
- package/dist/cjs/justifi-billing-form_2.cjs.entry.js +2 -2
- package/dist/cjs/justifi-business-details.cjs.entry.js +4 -3
- package/dist/cjs/justifi-business-form.cjs.entry.js +9 -8
- package/dist/cjs/justifi-card-form.cjs.entry.js +5 -4
- package/dist/cjs/justifi-checkout-core.cjs.entry.js +3 -3
- package/dist/cjs/justifi-checkout.cjs.entry.js +5 -4
- package/dist/cjs/justifi-gross-payment-chart.cjs.entry.js +4 -3
- package/dist/cjs/justifi-new-payment-method_4.cjs.entry.js +9 -11
- package/dist/cjs/justifi-owner-form_3.cjs.entry.js +5 -4
- package/dist/cjs/justifi-payment-details.cjs.entry.js +4 -3
- package/dist/cjs/justifi-payment-form.cjs.entry.js +6 -5
- package/dist/cjs/justifi-payment-method-form.cjs.entry.js +1 -1
- package/dist/cjs/justifi-payment-provisioning.cjs.entry.js +6 -5
- package/dist/cjs/justifi-payments-list.cjs.entry.js +4 -3
- package/dist/cjs/justifi-payout-details.cjs.entry.js +4 -3
- package/dist/cjs/justifi-payouts-list.cjs.entry.js +4 -3
- package/dist/cjs/justifi-refund-form.cjs.entry.js +3 -2
- package/dist/cjs/justifi-season-interruption-insurance.cjs.entry.js +5 -4
- package/dist/cjs/{package-a3cbc925.js → package-1321b070.js} +4 -2
- package/dist/cjs/{payload-parsers-1cbc3b57.js → payload-parsers-969ab9b6.js} +1 -1
- package/dist/cjs/{payment.service-dfcfa19b.js → payment.service-0a64f9cd.js} +3 -2
- package/dist/cjs/{schema-validations-2733de42.js → schema-validations-f3db892c.js} +1 -1
- package/dist/collection/api/services/analytics.service.js +2 -1
- package/dist/collection/api/services/business.service.js +6 -5
- package/dist/collection/api/services/checkout.service.js +3 -2
- package/dist/collection/api/services/insurance.service.js +3 -2
- package/dist/collection/api/services/payment.service.js +3 -2
- package/dist/collection/api/services/payout.service.js +4 -3
- package/dist/collection/api/services/provision.service.js +4 -2
- package/dist/collection/api/services/reports.service.js +2 -1
- package/dist/collection/components/bank-account-form/bank-account-form.js +4 -3
- package/dist/collection/components/business-forms/business-form/business-form.js +3 -2
- package/dist/collection/components/business-forms/payment-provisioning/bank-account/business-bank-account-form-step.js +3 -2
- package/dist/collection/components/business-forms/payment-provisioning/document-uploads/business-document-upload-form-step.js +3 -2
- package/dist/collection/components/business-forms/payment-provisioning/terms-and-conditions/business-terms-conditions-form-step.js +3 -2
- package/dist/collection/components/business-forms/utils/business-form-options.js +1 -1
- package/dist/collection/components/card-form/card-form.js +4 -3
- package/dist/collection/components/checkout/checkout-core.js +4 -4
- package/dist/collection/components/checkout/new-payment-method.js +4 -6
- package/dist/collection/components/checkout/payment-method-options.js +4 -3
- package/dist/collection/components/checkout/saved-payment-method.js +4 -3
- package/dist/collection/components/checkout/sezzle-payment-method.js +4 -3
- package/dist/collection/components/payment-form/payment-form.js +4 -3
- package/dist/collection/components/refund-form/refund-form.js +3 -2
- package/dist/config.js +11 -0
- package/dist/docs.json +8 -8
- package/dist/esm/{Analytics-38d3bafb.js → Analytics-262cdde5.js} +3 -2
- package/dist/esm/{business-additional-questions-schema-956e3caf.js → business-additional-questions-schema-e39bc781.js} +1 -1
- package/dist/esm/{business-form-options-7a9a74fc.js → business-form-options-0b08e08c.js} +1 -1
- package/dist/esm/{business.service-f45decfc.js → business.service-74bd1212.js} +6 -5
- package/dist/esm/config-476c7241.js +13 -0
- package/dist/esm/form-alert_5.entry.js +1 -1
- package/dist/esm/form-control-checkbox_9.entry.js +4 -4
- package/dist/esm/{get-payout-csv-e784a2ab.js → get-payout-csv-b494abfe.js} +4 -3
- package/dist/esm/justifi-additional-questions-form-step_10.entry.js +10 -9
- package/dist/esm/justifi-bank-account-form.entry.js +5 -4
- package/dist/esm/justifi-billing-form_2.entry.js +2 -2
- package/dist/esm/justifi-business-details.entry.js +4 -3
- package/dist/esm/justifi-business-form.entry.js +9 -8
- package/dist/esm/justifi-card-form.entry.js +5 -4
- package/dist/esm/justifi-checkout-core.entry.js +3 -3
- package/dist/esm/justifi-checkout.entry.js +5 -4
- package/dist/esm/justifi-gross-payment-chart.entry.js +4 -3
- package/dist/esm/justifi-new-payment-method_4.entry.js +9 -11
- package/dist/esm/justifi-owner-form_3.entry.js +5 -4
- package/dist/esm/justifi-payment-details.entry.js +4 -3
- package/dist/esm/justifi-payment-form.entry.js +6 -5
- package/dist/esm/justifi-payment-method-form.entry.js +1 -1
- package/dist/esm/justifi-payment-provisioning.entry.js +6 -5
- package/dist/esm/justifi-payments-list.entry.js +4 -3
- package/dist/esm/justifi-payout-details.entry.js +4 -3
- package/dist/esm/justifi-payouts-list.entry.js +4 -3
- package/dist/esm/justifi-refund-form.entry.js +3 -2
- package/dist/esm/justifi-season-interruption-insurance.entry.js +5 -4
- package/dist/esm/{package-89734008.js → package-d88677e9.js} +4 -2
- package/dist/esm/{payload-parsers-acb719d1.js → payload-parsers-62f443e1.js} +1 -1
- package/dist/esm/{payment.service-dad5153b.js → payment.service-3ca4a492.js} +3 -2
- package/dist/esm/{schema-validations-a83ff220.js → schema-validations-2f4fdebb.js} +1 -1
- package/dist/module/Analytics.js +2 -1
- package/dist/module/business-bank-account-form-step.js +3 -2
- package/dist/module/business-document-upload-form-step.js +3 -2
- package/dist/module/business-form-options.js +1 -1
- package/dist/module/business-terms-conditions-form-step.js +3 -2
- package/dist/module/business.service.js +6 -5
- package/dist/module/checkout-core.js +3 -3
- package/dist/module/config.js +13 -0
- package/dist/module/get-payout-csv.js +4 -3
- package/dist/module/justifi-bank-account-form.js +3 -2
- package/dist/module/justifi-business-form.js +3 -2
- package/dist/module/justifi-card-form.js +3 -2
- package/dist/module/justifi-checkout.js +3 -2
- package/dist/module/justifi-gross-payment-chart.js +2 -1
- package/dist/module/justifi-payment-form.js +4 -3
- package/dist/module/justifi-payment-provisioning.js +3 -2
- package/dist/module/justifi-refund-form.js +3 -2
- package/dist/module/justifi-season-interruption-insurance.js +3 -2
- package/dist/module/new-payment-method.js +3 -5
- package/dist/module/package.js +4 -2
- package/dist/module/payment-method-options.js +3 -2
- package/dist/module/payment.service.js +3 -2
- package/dist/module/saved-payment-method.js +3 -2
- package/dist/module/sezzle-payment-method.js +3 -2
- package/dist/types/components/checkout/new-payment-method.d.ts +0 -1
- package/dist/types/home/runner/work/web-component-library/web-component-library/packages/webcomponents/.stencil/packages/webcomponents/config.d.ts +11 -0
- package/dist/webcomponents/index.esm.js +0 -1
- package/dist/webcomponents/p-04a0dbb6.js +1 -0
- package/dist/webcomponents/p-061dcb79.entry.js +1 -0
- package/dist/webcomponents/p-07109641.entry.js +1 -0
- package/dist/webcomponents/p-08b0fb31.js +1 -41
- package/dist/webcomponents/p-0f7b9555.entry.js +1 -0
- package/dist/webcomponents/p-14c91ffd.js +1 -20
- package/dist/webcomponents/p-198994c0.entry.js +1 -0
- package/dist/webcomponents/p-1a43e355.entry.js +19 -0
- package/dist/webcomponents/p-1ad5995e.js +1 -3599
- package/dist/webcomponents/p-1f70fa27.entry.js +1 -0
- package/dist/webcomponents/p-1ff8810b.js +1 -29
- package/dist/webcomponents/p-2338affa.js +1 -213
- package/dist/webcomponents/p-241b0ed9.js +1 -0
- package/dist/webcomponents/p-2799383d.entry.js +1 -0
- package/dist/webcomponents/p-29c0b182.js +1 -114
- package/dist/webcomponents/p-2b6c9c4f.js +1 -7
- package/dist/webcomponents/p-2eab3c90.js +1 -3052
- package/dist/webcomponents/p-3affadfc.entry.js +1 -0
- package/dist/webcomponents/p-3d4d566d.entry.js +1 -0
- package/dist/webcomponents/p-3dd4c6c3.entry.js +1 -0
- package/dist/webcomponents/p-462dc522.entry.js +1 -0
- package/dist/webcomponents/p-46f679a9.js +1 -0
- package/dist/webcomponents/p-487b72a8.entry.js +1 -0
- package/dist/webcomponents/p-48ae16e0.entry.js +1 -0
- package/dist/webcomponents/p-4abc17f0.entry.js +1 -0
- package/dist/webcomponents/p-4bac636e.entry.js +1 -0
- package/dist/webcomponents/p-52021fa1.entry.js +1 -0
- package/dist/webcomponents/p-525db3e8.js +1 -22
- package/dist/webcomponents/p-53948ff8.entry.js +1 -0
- package/dist/webcomponents/p-53e64f15.entry.js +1 -0
- package/dist/webcomponents/p-554a3c18.js +1 -0
- package/dist/webcomponents/p-56f6ce4c.js +1 -10
- package/dist/webcomponents/p-5968ff8a.js +1 -178
- package/dist/webcomponents/p-6078a370.js +1 -244
- package/dist/webcomponents/p-60a370fc.entry.js +1 -0
- package/dist/webcomponents/p-62b32c4c.entry.js +1 -0
- package/dist/webcomponents/p-65b561da.entry.js +1 -0
- package/dist/webcomponents/p-72c9e6b3.entry.js +1 -0
- package/dist/webcomponents/p-75b4daef.js +1 -0
- package/dist/webcomponents/p-7d85af5c.js +1 -16
- package/dist/webcomponents/p-8115b2f4.js +1 -28
- package/dist/webcomponents/p-83125497.js +1 -4027
- package/dist/webcomponents/p-8603348a.js +1 -0
- package/dist/webcomponents/p-890b3254.entry.js +1 -0
- package/dist/webcomponents/p-8df7bde8.js +1 -27
- package/dist/webcomponents/p-92bb1e5f.entry.js +1 -0
- package/dist/webcomponents/p-9c9c7dac.js +1 -24
- package/dist/webcomponents/p-9ccfa1c9.entry.js +1 -0
- package/dist/webcomponents/p-9dc36f76.entry.js +1 -0
- package/dist/webcomponents/p-ad41c8c7.entry.js +1 -0
- package/dist/webcomponents/p-ae263544.js +1 -0
- package/dist/webcomponents/p-af244664.js +1 -126
- package/dist/webcomponents/p-b16dfd5d.entry.js +1 -0
- package/dist/webcomponents/p-ba4bae6f.js +1 -12
- package/dist/webcomponents/p-bbed6107.entry.js +1 -0
- package/dist/webcomponents/p-bc92235c.entry.js +1 -0
- package/dist/webcomponents/p-be39c802.entry.js +1 -0
- package/dist/webcomponents/p-c9f8f7ec.entry.js +1 -0
- package/dist/webcomponents/p-d101c5db.js +1 -0
- package/dist/webcomponents/p-d1c8d794.entry.js +1 -0
- package/dist/webcomponents/p-d25c2f12.js +1 -0
- package/dist/webcomponents/p-d2a5054f.entry.js +1 -0
- package/dist/webcomponents/p-d765d638.js +1 -0
- package/dist/webcomponents/p-d8355f91.entry.js +1 -0
- package/dist/webcomponents/p-d89bad72.js +1 -39
- package/dist/webcomponents/p-dce846bf.js +1 -27
- package/dist/webcomponents/p-df21aaad.js +1 -120
- package/dist/webcomponents/p-e1255160.js +1 -3
- package/dist/webcomponents/p-e2c88817.entry.js +1 -0
- package/dist/webcomponents/p-e31f0f3e.entry.js +1 -0
- package/dist/webcomponents/p-e333620e.js +1 -34
- package/dist/webcomponents/p-e3fab0e2.js +1 -43
- package/dist/webcomponents/p-f0866375.entry.js +1 -0
- package/dist/webcomponents/p-fad19d75.js +2 -1638
- package/dist/webcomponents/p-fb58feb5.entry.js +1 -0
- package/dist/webcomponents/p-fe33151d.entry.js +1 -0
- package/dist/webcomponents/webcomponents.css +4 -362
- package/dist/webcomponents/webcomponents.esm.js +1 -20
- package/package.json +4 -2
- package/dist/globals.d.ts +0 -2
- package/dist/webcomponents/p-0179fbb2.entry.js +0 -1684
- package/dist/webcomponents/p-01a404ca.entry.js +0 -44
- package/dist/webcomponents/p-03d35880.entry.js +0 -130
- package/dist/webcomponents/p-06ff0429.entry.js +0 -65
- package/dist/webcomponents/p-220fc2cc.entry.js +0 -98
- package/dist/webcomponents/p-258b1ee2.entry.js +0 -149
- package/dist/webcomponents/p-25d8cd65.entry.js +0 -102
- package/dist/webcomponents/p-2988ac56.js +0 -79
- package/dist/webcomponents/p-2e405359.entry.js +0 -73
- package/dist/webcomponents/p-3e9ef4a8.js +0 -28
- package/dist/webcomponents/p-3fd13ca3.js +0 -52
- package/dist/webcomponents/p-5482d030.entry.js +0 -21
- package/dist/webcomponents/p-576826b1.entry.js +0 -43
- package/dist/webcomponents/p-5cb3f0b2.entry.js +0 -261
- package/dist/webcomponents/p-5f835b89.entry.js +0 -606
- package/dist/webcomponents/p-6fed319e.entry.js +0 -99
- package/dist/webcomponents/p-70a2aa74.entry.js +0 -76
- package/dist/webcomponents/p-74d0d0e1.entry.js +0 -75
- package/dist/webcomponents/p-7582b554.entry.js +0 -18
- package/dist/webcomponents/p-79646550.entry.js +0 -61
- package/dist/webcomponents/p-7b0400cd.entry.js +0 -131
- package/dist/webcomponents/p-800d31fe.entry.js +0 -162
- package/dist/webcomponents/p-85fc69e5.js +0 -90
- package/dist/webcomponents/p-890088fc.entry.js +0 -298
- package/dist/webcomponents/p-89887332.js +0 -301
- package/dist/webcomponents/p-8eb774df.entry.js +0 -54
- package/dist/webcomponents/p-9f94bbb6.entry.js +0 -118
- package/dist/webcomponents/p-a2da97f2.entry.js +0 -145
- package/dist/webcomponents/p-a5a225d9.entry.js +0 -125
- package/dist/webcomponents/p-a5c5821e.entry.js +0 -101
- package/dist/webcomponents/p-a5fb51dc.entry.js +0 -131
- package/dist/webcomponents/p-a6d04afc.js +0 -44
- package/dist/webcomponents/p-ac086069.entry.js +0 -58
- package/dist/webcomponents/p-ad5cfa9d.js +0 -77
- package/dist/webcomponents/p-b82c146f.entry.js +0 -111
- package/dist/webcomponents/p-b9a41ec2.entry.js +0 -74
- package/dist/webcomponents/p-ba5fae28.js +0 -90
- package/dist/webcomponents/p-c636f563.entry.js +0 -791
- package/dist/webcomponents/p-c64abefc.entry.js +0 -117
- package/dist/webcomponents/p-cb26f708.js +0 -18
- package/dist/webcomponents/p-cbf2437a.entry.js +0 -80
- package/dist/webcomponents/p-d17aee2b.entry.js +0 -26
- package/dist/webcomponents/p-d894aed2.entry.js +0 -133
- package/dist/webcomponents/p-e356f280.entry.js +0 -29
- package/dist/webcomponents/p-e837a453.entry.js +0 -94
- package/dist/webcomponents/p-e84a2dcb.entry.js +0 -97
- package/dist/webcomponents/p-ec2bd24f.entry.js +0 -94
- package/dist/webcomponents/p-ec854a3e.entry.js +0 -11053
- package/dist/webcomponents/p-f02b75dc.entry.js +0 -96
|
@@ -1,90 +0,0 @@
|
|
|
1
|
-
import { c as create$3, a as create$6 } from './p-2eab3c90.js';
|
|
2
|
-
import { l as lineOneValidation, a as lineTwoValidation, c as cityValidation, s as stateValidation, p as postalValidation, i as identityNameValidation, b as identityTitleValidation, e as emailValidation, d as phoneValidation, f as dobValidation, g as ssnValidation } from './p-89887332.js';
|
|
3
|
-
|
|
4
|
-
const addressSchema = (allowOptionalFields) => {
|
|
5
|
-
const schema = create$3({
|
|
6
|
-
line1: lineOneValidation.required('Enter street address'),
|
|
7
|
-
line2: lineTwoValidation.nullable(),
|
|
8
|
-
city: cityValidation.required('Enter city'),
|
|
9
|
-
state: stateValidation.required('Select state'),
|
|
10
|
-
postal_code: postalValidation.required('Enter postal code'),
|
|
11
|
-
country: create$6().required('Select country')
|
|
12
|
-
});
|
|
13
|
-
const easySchema = create$3({
|
|
14
|
-
line1: lineOneValidation.nullable(),
|
|
15
|
-
line2: lineTwoValidation.nullable(),
|
|
16
|
-
city: cityValidation.nullable(),
|
|
17
|
-
state: stateValidation.nullable(),
|
|
18
|
-
postal_code: postalValidation.nullable(),
|
|
19
|
-
country: create$6().required('Select country')
|
|
20
|
-
});
|
|
21
|
-
return allowOptionalFields ? easySchema : schema;
|
|
22
|
-
};
|
|
23
|
-
|
|
24
|
-
const identitySchema = (role, allowOptionalFields) => {
|
|
25
|
-
const schema = create$3({
|
|
26
|
-
name: identityNameValidation.required(`Enter ${role} name`),
|
|
27
|
-
title: identityTitleValidation.required(`Enter ${role} title`),
|
|
28
|
-
email: emailValidation.required(`Enter ${role} email`),
|
|
29
|
-
phone: phoneValidation.required('Enter phone number'),
|
|
30
|
-
dob_full: dobValidation(role).required('Enter date of birth'),
|
|
31
|
-
ssn_last4: create$6().nullable(),
|
|
32
|
-
identification_number: ssnValidation,
|
|
33
|
-
address: addressSchema(allowOptionalFields),
|
|
34
|
-
});
|
|
35
|
-
const easySchema = create$3({
|
|
36
|
-
name: identityNameValidation.required(`Enter ${role} name`),
|
|
37
|
-
title: identityTitleValidation.nullable(),
|
|
38
|
-
email: emailValidation.nullable(),
|
|
39
|
-
phone: phoneValidation.nullable(),
|
|
40
|
-
dob_full: dobValidation(role).nullable(),
|
|
41
|
-
ssn_last4: create$6().nullable(),
|
|
42
|
-
identification_number: ssnValidation.nullable(),
|
|
43
|
-
address: addressSchema(allowOptionalFields),
|
|
44
|
-
});
|
|
45
|
-
return allowOptionalFields ? easySchema : schema;
|
|
46
|
-
};
|
|
47
|
-
|
|
48
|
-
// These props should not be sent to the server
|
|
49
|
-
// This function is for the larger business form.
|
|
50
|
-
const parseBusiness = (values, initialValues) => {
|
|
51
|
-
var _a;
|
|
52
|
-
parseCoreInfo(values);
|
|
53
|
-
parseAddressInfo(values.legal_address);
|
|
54
|
-
parseIdentityInfo(values.representative);
|
|
55
|
-
((_a = initialValues.owners) === null || _a === void 0 ? void 0 : _a.length) && delete values.owners;
|
|
56
|
-
return values;
|
|
57
|
-
};
|
|
58
|
-
// These functions are for the stepped business form.
|
|
59
|
-
const parseCoreInfo = (values) => {
|
|
60
|
-
delete values.id;
|
|
61
|
-
delete values.documents;
|
|
62
|
-
delete values.bank_accounts;
|
|
63
|
-
delete values.product_categories;
|
|
64
|
-
delete values.created_at;
|
|
65
|
-
delete values.updated_at;
|
|
66
|
-
delete values.associated_accounts;
|
|
67
|
-
delete values.terms_conditions_accepted;
|
|
68
|
-
return values;
|
|
69
|
-
};
|
|
70
|
-
const parseAddressInfo = (values) => {
|
|
71
|
-
delete values.id;
|
|
72
|
-
delete values.created_at;
|
|
73
|
-
delete values.updated_at;
|
|
74
|
-
return values;
|
|
75
|
-
};
|
|
76
|
-
const parseIdentityInfo = (values) => {
|
|
77
|
-
delete values.id;
|
|
78
|
-
delete values.documents;
|
|
79
|
-
delete values.created_at;
|
|
80
|
-
delete values.updated_at;
|
|
81
|
-
delete values.address.id;
|
|
82
|
-
delete values.address.created_at;
|
|
83
|
-
delete values.address.updated_at;
|
|
84
|
-
delete values.business_id;
|
|
85
|
-
delete values.dob_full;
|
|
86
|
-
delete values.ssn_last4;
|
|
87
|
-
return values;
|
|
88
|
-
};
|
|
89
|
-
|
|
90
|
-
export { addressSchema as a, parseCoreInfo as b, parseIdentityInfo as c, parseAddressInfo as d, identitySchema as i, parseBusiness as p };
|
|
@@ -1,298 +0,0 @@
|
|
|
1
|
-
import { r as registerInstance, c as createEvent, h, H as Host, F as Fragment } from './p-fad19d75.js';
|
|
2
|
-
import { a as PaymentMethodTypes } from './p-df21aaad.js';
|
|
3
|
-
import { g as snakeToCamel, f as formatCurrency } from './p-83125497.js';
|
|
4
|
-
|
|
5
|
-
const PaymentMethodTypeLabels = {
|
|
6
|
-
bankAccount: 'New bank account',
|
|
7
|
-
card: 'New credit or debit card',
|
|
8
|
-
};
|
|
9
|
-
const NewPaymentMethod = class {
|
|
10
|
-
constructor(hostRef) {
|
|
11
|
-
registerInstance(this, hostRef);
|
|
12
|
-
this.paymentMethodOptionSelected = createEvent(this, "paymentMethodOptionSelected", 7);
|
|
13
|
-
this.onPaymentMethodOptionClick = () => {
|
|
14
|
-
this.paymentMethodOptionSelected.emit(this.paymentMethodOption);
|
|
15
|
-
};
|
|
16
|
-
this.iframeOrigin = undefined;
|
|
17
|
-
this.authToken = undefined;
|
|
18
|
-
this.accountId = undefined;
|
|
19
|
-
this.paymentMethodOption = undefined;
|
|
20
|
-
this.paymentMethodGroupId = undefined;
|
|
21
|
-
this.isSelected = undefined;
|
|
22
|
-
this.saveNewPaymentMethodChecked = false;
|
|
23
|
-
}
|
|
24
|
-
componentWillLoad() {
|
|
25
|
-
console.log('NewPaymentMethod: componentWillLoad iframeOrigin', this, this.iframeOrigin);
|
|
26
|
-
}
|
|
27
|
-
handleCheckboxChanged(event) {
|
|
28
|
-
this.saveNewPaymentMethodChecked = event.detail;
|
|
29
|
-
}
|
|
30
|
-
async fillBillingForm(fields) {
|
|
31
|
-
this.billingFormRef.fill(fields);
|
|
32
|
-
}
|
|
33
|
-
async resolvePaymentMethod(insuranceValidation) {
|
|
34
|
-
var _a, _b;
|
|
35
|
-
if (!this.paymentMethodFormRef || !this.billingFormRef)
|
|
36
|
-
return;
|
|
37
|
-
const isValid = await this.validate();
|
|
38
|
-
if (!isValid || !insuranceValidation.isValid) {
|
|
39
|
-
return { validationError: true };
|
|
40
|
-
}
|
|
41
|
-
const tokenizeResponse = await this.tokenize();
|
|
42
|
-
if (tokenizeResponse.error) {
|
|
43
|
-
return { error: tokenizeResponse.error };
|
|
44
|
-
}
|
|
45
|
-
else {
|
|
46
|
-
const tokenizeRessponseData = tokenizeResponse.data;
|
|
47
|
-
return { token: ((_a = tokenizeRessponseData.card) === null || _a === void 0 ? void 0 : _a.token) || ((_b = tokenizeRessponseData.bank_account) === null || _b === void 0 ? void 0 : _b.token) };
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
async validate() {
|
|
51
|
-
const billingFormValidation = await this.billingFormRef.validate();
|
|
52
|
-
const paymentMethodFormValidation = await this.paymentMethodFormRef.validate();
|
|
53
|
-
return billingFormValidation.isValid && paymentMethodFormValidation.isValid;
|
|
54
|
-
}
|
|
55
|
-
async tokenize() {
|
|
56
|
-
try {
|
|
57
|
-
const billingFormFieldValues = await this.billingFormRef.getValues();
|
|
58
|
-
let paymentMethodData;
|
|
59
|
-
if (this.saveNewPaymentMethodChecked) {
|
|
60
|
-
paymentMethodData = Object.assign(Object.assign({}, billingFormFieldValues), { payment_method_group_id: this.paymentMethodGroupId });
|
|
61
|
-
}
|
|
62
|
-
else {
|
|
63
|
-
paymentMethodData = Object.assign({}, billingFormFieldValues);
|
|
64
|
-
}
|
|
65
|
-
const clientId = this.authToken;
|
|
66
|
-
const tokenizeResponse = await this.paymentMethodFormRef.tokenize(clientId, paymentMethodData, this.accountId);
|
|
67
|
-
return tokenizeResponse;
|
|
68
|
-
}
|
|
69
|
-
catch (error) {
|
|
70
|
-
return error;
|
|
71
|
-
}
|
|
72
|
-
}
|
|
73
|
-
showNewPaymentMethodForm() {
|
|
74
|
-
var _a;
|
|
75
|
-
return (h("div", { class: "mt-2 pb-4 border-bottom" }, h("div", { class: "mb-3" }, h("justifi-payment-method-form", { ref: (el) => (this.paymentMethodFormRef = el), "payment-method-form-type": (_a = this.paymentMethodOption) === null || _a === void 0 ? void 0 : _a.id, "iframe-origin": this.iframeOrigin })), h("h3", { class: "fs-6 fw-bold lh-lg mb-4" }, "Billing address"), h("justifi-billing-form", { ref: (el) => (this.billingFormRef = el) }), h("justifi-save-new-payment-method", { hidden: !this.paymentMethodGroupId })));
|
|
76
|
-
}
|
|
77
|
-
render() {
|
|
78
|
-
var _a, _b, _c, _d;
|
|
79
|
-
return (h("div", { key: 'd597ba8b0ac2a650a14a79d002a91ef3edf604a4', class: "payment-method" }, h("div", { key: 'a287f7ffd480f17f0f1093d71b9d02fe3db39e0f', class: `payment-method-header p-3`, onClick: () => this.onPaymentMethodOptionClick() }, h("input", { key: 'f53d08d048cc242414fcf6794614ad2334db81bb', type: "radio", name: "paymentMethodType", id: (_a = this.paymentMethodOption) === null || _a === void 0 ? void 0 : _a.id, value: (_b = this.paymentMethodOption) === null || _b === void 0 ? void 0 : _b.id, onClick: (event) => event.preventDefault(), checked: this.isSelected, class: "form-check-input me-2" }), h("label", { key: '01712a80a30df19a7b540434532cffb4cb3b61e8', htmlFor: (_c = this.paymentMethodOption) === null || _c === void 0 ? void 0 : _c.id, class: "form-check-label" }, PaymentMethodTypeLabels[(_d = this.paymentMethodOption) === null || _d === void 0 ? void 0 : _d.id])), this.isSelected ? this.showNewPaymentMethodForm() : null));
|
|
80
|
-
}
|
|
81
|
-
};
|
|
82
|
-
|
|
83
|
-
class PaymentMethodOption {
|
|
84
|
-
constructor(paymentMethod) {
|
|
85
|
-
this.id = paymentMethod.id;
|
|
86
|
-
this.brand = paymentMethod.brand;
|
|
87
|
-
this.acct_last_four = paymentMethod.acct_last_four;
|
|
88
|
-
this.type = snakeToCamel(paymentMethod.type);
|
|
89
|
-
}
|
|
90
|
-
}
|
|
91
|
-
var CardBrandLabels;
|
|
92
|
-
(function (CardBrandLabels) {
|
|
93
|
-
CardBrandLabels["american_express"] = "American Express";
|
|
94
|
-
CardBrandLabels["diners_club"] = "Diners Club";
|
|
95
|
-
CardBrandLabels["discover"] = "Discover";
|
|
96
|
-
CardBrandLabels["jcb"] = "JCB";
|
|
97
|
-
CardBrandLabels["mastercard"] = "Mastercard";
|
|
98
|
-
CardBrandLabels["china_unionpay"] = "UnionPay";
|
|
99
|
-
CardBrandLabels["visa"] = "Visa";
|
|
100
|
-
CardBrandLabels["unknown"] = "Unknown";
|
|
101
|
-
})(CardBrandLabels || (CardBrandLabels = {}));
|
|
102
|
-
|
|
103
|
-
const paymentMethodOptionsCss = ":host{display:block}.payment-method-header{cursor:pointer;color:var(--jfi-radio-button-group-color);background-color:var(--jfi-radio-button-group-background-color);border-bottom:var(--jfi-radio-button-group-divider)}.payment-method-header:hover{color:var(--jfi-radio-button-group-color-hover);background-color:var(--jfi-radio-button-group-background-color-hover)}";
|
|
104
|
-
const JustifiPaymentMethodOptionsStyle0 = paymentMethodOptionsCss;
|
|
105
|
-
|
|
106
|
-
const formCheckInputCss = ".form-check-input,label{cursor:pointer}.form-check-input{background-color:var(--jfi-radio-button-background-color);border-color:var(--jfi-radio-button-border-color)}.form-check-input:checked,.form-check-input:checked:focus{background-color:var(--jfi-radio-button-background-color-selected);border-color:var(--jfi-radio-button-border-color-selected)}.form-check-input:focus{border-color:var(--jfi-radio-button-border-color-focus);box-shadow:var(--jfi-radio-button-box-shadow-focus)}";
|
|
107
|
-
const JustifiPaymentMethodOptionsStyle1 = formCheckInputCss;
|
|
108
|
-
|
|
109
|
-
const PaymentMethodOptions = class {
|
|
110
|
-
constructor(hostRef) {
|
|
111
|
-
registerInstance(this, hostRef);
|
|
112
|
-
this.toggleCreatingNewPaymentMethod = createEvent(this, "toggleCreatingNewPaymentMethod", 7);
|
|
113
|
-
this.showCard = undefined;
|
|
114
|
-
this.showAch = undefined;
|
|
115
|
-
this.showBnpl = undefined;
|
|
116
|
-
this.showSavedPaymentMethods = undefined;
|
|
117
|
-
this.paymentMethodGroupId = undefined;
|
|
118
|
-
this.bnpl = undefined;
|
|
119
|
-
this.insuranceToggled = undefined;
|
|
120
|
-
this.authToken = undefined;
|
|
121
|
-
this.accountId = undefined;
|
|
122
|
-
this.iframeOrigin = undefined;
|
|
123
|
-
this.savedPaymentMethods = [];
|
|
124
|
-
this.paymentAmount = undefined;
|
|
125
|
-
this.selectedPaymentMethodId = undefined;
|
|
126
|
-
this.paymentMethodOptions = [];
|
|
127
|
-
}
|
|
128
|
-
async fillBillingForm(fields) {
|
|
129
|
-
const newPaymentMethodElement = this.selectedPaymentMethodOptionRef;
|
|
130
|
-
if (newPaymentMethodElement.fillBillingForm) {
|
|
131
|
-
newPaymentMethodElement.fillBillingForm(fields);
|
|
132
|
-
}
|
|
133
|
-
}
|
|
134
|
-
connectedCallback() {
|
|
135
|
-
this.paymentMethodsChanged();
|
|
136
|
-
}
|
|
137
|
-
paymentMethodsChanged() {
|
|
138
|
-
var _a, _b;
|
|
139
|
-
this.paymentMethodOptions = this.savedPaymentMethods
|
|
140
|
-
.map((paymentMethod) => new PaymentMethodOption(paymentMethod))
|
|
141
|
-
.filter((paymentMethod) => {
|
|
142
|
-
// Don't saved card or bank account if they are disabled
|
|
143
|
-
return ((this.showCard || paymentMethod.type !== PaymentMethodTypes.card) &&
|
|
144
|
-
(this.showAch || paymentMethod.type !== PaymentMethodTypes.bankAccount));
|
|
145
|
-
});
|
|
146
|
-
if (this.showBnpl && ((_a = this.bnpl) === null || _a === void 0 ? void 0 : _a.provider) === 'sezzle' && !this.insuranceToggled) {
|
|
147
|
-
this.paymentMethodOptions.push(new PaymentMethodOption({ id: PaymentMethodTypes.sezzle }));
|
|
148
|
-
}
|
|
149
|
-
if (this.showCard) {
|
|
150
|
-
this.paymentMethodOptions.push(new PaymentMethodOption({ id: PaymentMethodTypes.card }));
|
|
151
|
-
}
|
|
152
|
-
if (this.showAch) {
|
|
153
|
-
this.paymentMethodOptions.push(new PaymentMethodOption({ id: PaymentMethodTypes.bankAccount }));
|
|
154
|
-
}
|
|
155
|
-
if (!this.selectedPaymentMethodId) {
|
|
156
|
-
this.selectedPaymentMethodId = (_b = this.paymentMethodOptions[0]) === null || _b === void 0 ? void 0 : _b.id;
|
|
157
|
-
}
|
|
158
|
-
}
|
|
159
|
-
paymentMethodOptionSelected(event) {
|
|
160
|
-
this.selectedPaymentMethodId = event.detail.id;
|
|
161
|
-
}
|
|
162
|
-
async resolvePaymentMethod(insuranceValidation) {
|
|
163
|
-
var _a;
|
|
164
|
-
return await ((_a = this.selectedPaymentMethodOptionRef) === null || _a === void 0 ? void 0 : _a.resolvePaymentMethod(insuranceValidation));
|
|
165
|
-
}
|
|
166
|
-
render() {
|
|
167
|
-
var _a;
|
|
168
|
-
return (h(Host, { key: '7ee40a1bdc9ec15596e870b48cbe7b6bbc20537c' }, (_a = this.paymentMethodOptions) === null || _a === void 0 ? void 0 : _a.map((paymentMethodOption) => {
|
|
169
|
-
const newCard = paymentMethodOption.id === PaymentMethodTypes.card;
|
|
170
|
-
const newBankAccount = paymentMethodOption.id === PaymentMethodTypes.bankAccount;
|
|
171
|
-
const isSelected = this.selectedPaymentMethodId === paymentMethodOption.id;
|
|
172
|
-
const sezzle = paymentMethodOption.id === PaymentMethodTypes.sezzle;
|
|
173
|
-
if (newCard || newBankAccount) {
|
|
174
|
-
return (h("justifi-new-payment-method", { paymentMethodOption: paymentMethodOption, authToken: this.authToken, "account-id": this.accountId, "is-selected": isSelected, paymentMethodGroupId: this.paymentMethodGroupId, ref: (el) => {
|
|
175
|
-
if (isSelected) {
|
|
176
|
-
this.selectedPaymentMethodOptionRef = el;
|
|
177
|
-
}
|
|
178
|
-
} }));
|
|
179
|
-
}
|
|
180
|
-
else if (sezzle) {
|
|
181
|
-
return (h("justifi-sezzle-payment-method", { paymentMethodOption: paymentMethodOption, "is-selected": isSelected, paymentAmount: this.paymentAmount, bnpl: this.bnpl, ref: (el) => {
|
|
182
|
-
if (isSelected) {
|
|
183
|
-
this.selectedPaymentMethodOptionRef = el;
|
|
184
|
-
}
|
|
185
|
-
} }));
|
|
186
|
-
}
|
|
187
|
-
else if (this.showSavedPaymentMethods) {
|
|
188
|
-
return (h("justifi-saved-payment-method", { paymentMethodOption: paymentMethodOption, "is-selected": isSelected, ref: (el) => {
|
|
189
|
-
if (isSelected) {
|
|
190
|
-
this.selectedPaymentMethodOptionRef = el;
|
|
191
|
-
}
|
|
192
|
-
} }));
|
|
193
|
-
}
|
|
194
|
-
})));
|
|
195
|
-
}
|
|
196
|
-
static get watchers() { return {
|
|
197
|
-
"savedPaymentMethods": ["paymentMethodsChanged"]
|
|
198
|
-
}; }
|
|
199
|
-
};
|
|
200
|
-
PaymentMethodOptions.style = JustifiPaymentMethodOptionsStyle0 + JustifiPaymentMethodOptionsStyle1;
|
|
201
|
-
|
|
202
|
-
const SavedPaymentMethod = class {
|
|
203
|
-
constructor(hostRef) {
|
|
204
|
-
registerInstance(this, hostRef);
|
|
205
|
-
this.paymentMethodOptionSelected = createEvent(this, "paymentMethodOptionSelected", 7);
|
|
206
|
-
this.onPaymentMethodOptionClick = () => {
|
|
207
|
-
this.paymentMethodOptionSelected.emit(this.paymentMethodOption);
|
|
208
|
-
};
|
|
209
|
-
this.iframeOrigin = undefined;
|
|
210
|
-
this.paymentMethodOption = undefined;
|
|
211
|
-
this.isSelected = undefined;
|
|
212
|
-
}
|
|
213
|
-
async resolvePaymentMethod(insuranceValidation) {
|
|
214
|
-
var _a;
|
|
215
|
-
if (!insuranceValidation.isValid) {
|
|
216
|
-
return { validationError: true };
|
|
217
|
-
}
|
|
218
|
-
return { token: (_a = this.paymentMethodOption) === null || _a === void 0 ? void 0 : _a.id };
|
|
219
|
-
}
|
|
220
|
-
;
|
|
221
|
-
render() {
|
|
222
|
-
var _a, _b, _c, _d, _e;
|
|
223
|
-
return (h(Fragment, { key: '247dafc3fe4011c5f6a2202690310eedfa5422c8' }, h("div", { key: '9cfb0b6ca9c10e5cc6173832bb8211ddb1d0ae5b', class: "payment-method" }, h("div", { key: 'd247cc4cf9f7bf43d7153134c66a921b5bfc49bc', class: "payment-method-header p-3", onClick: () => this.onPaymentMethodOptionClick() }, h("input", { key: '180c3aa6c4153bccf7cb620b6df49cc288754cd2', type: "radio", name: "paymentMethodType", id: (_a = this.paymentMethodOption) === null || _a === void 0 ? void 0 : _a.id, value: (_b = this.paymentMethodOption) === null || _b === void 0 ? void 0 : _b.id, onClick: (event) => event.preventDefault(), checked: this.isSelected, class: "form-check-input me-2" }), h("label", { key: '6ec14d77e8171a1ddb37c686189878a7ebb4b4f4', htmlFor: (_c = this.paymentMethodOption) === null || _c === void 0 ? void 0 : _c.id, class: "form-check-label" }, CardBrandLabels[(_d = this.paymentMethodOption) === null || _d === void 0 ? void 0 : _d.brand], " *", (_e = this.paymentMethodOption) === null || _e === void 0 ? void 0 :
|
|
224
|
-
_e.acct_last_four)))));
|
|
225
|
-
}
|
|
226
|
-
};
|
|
227
|
-
|
|
228
|
-
const sezzleLogo = (h("img", { class: "sezzle-smart-button-logo-img", src: "https://media.sezzle.com/branding/2.0/Sezzle_Logo_FullColor.svg", alt: "Sezzle", style: {
|
|
229
|
-
display: 'inline',
|
|
230
|
-
width: '80px',
|
|
231
|
-
marginLeft: '5px',
|
|
232
|
-
marginTop: '-5px',
|
|
233
|
-
} }));
|
|
234
|
-
const SezzlePaymentMethod = class {
|
|
235
|
-
constructor(hostRef) {
|
|
236
|
-
registerInstance(this, hostRef);
|
|
237
|
-
this.paymentMethodOptionSelected = createEvent(this, "paymentMethodOptionSelected", 7);
|
|
238
|
-
this.onPaymentMethodOptionClick = () => {
|
|
239
|
-
this.paymentMethodOptionSelected.emit(this.paymentMethodOption);
|
|
240
|
-
};
|
|
241
|
-
this.initializeSezzleCheckout = () => {
|
|
242
|
-
let resolveSezzlePromise;
|
|
243
|
-
this.sezzlePromise = new Promise((resolve) => { resolveSezzlePromise = resolve; });
|
|
244
|
-
const bnpl = this.bnpl;
|
|
245
|
-
const amount = +this.paymentAmount; // convert to number
|
|
246
|
-
const Checkout = window.Checkout;
|
|
247
|
-
const checkout = new Checkout({
|
|
248
|
-
mode: 'popup',
|
|
249
|
-
publicKey: bnpl.provider_client_id,
|
|
250
|
-
apiMode: bnpl.provider_mode,
|
|
251
|
-
apiVersion: bnpl.provider_api_version,
|
|
252
|
-
});
|
|
253
|
-
checkout.sezzleButtonElement = this.sezzleButtonRef;
|
|
254
|
-
checkout.init({
|
|
255
|
-
onClick: function (event) {
|
|
256
|
-
event.preventDefault();
|
|
257
|
-
checkout.startCheckout({
|
|
258
|
-
checkout_url: bnpl.provider_checkout_url
|
|
259
|
-
});
|
|
260
|
-
},
|
|
261
|
-
onComplete: (event) => resolveSezzlePromise({ bnpl: event.data }),
|
|
262
|
-
onCancel: (event) => resolveSezzlePromise({ bnpl: event.data }),
|
|
263
|
-
onFailure: (event) => resolveSezzlePromise({ bnpl: event.data }),
|
|
264
|
-
});
|
|
265
|
-
this.sezzleCheckout = checkout;
|
|
266
|
-
this.installmentPlan = this.sezzleCheckout.getInstallmentPlan(amount);
|
|
267
|
-
};
|
|
268
|
-
this.iframeOrigin = undefined;
|
|
269
|
-
this.bnpl = undefined;
|
|
270
|
-
this.clientId = undefined;
|
|
271
|
-
this.accountId = undefined;
|
|
272
|
-
this.paymentMethodOption = undefined;
|
|
273
|
-
this.isSelected = undefined;
|
|
274
|
-
this.paymentAmount = undefined;
|
|
275
|
-
this.installmentPlan = undefined;
|
|
276
|
-
this.sezzleCheckout = undefined;
|
|
277
|
-
this.sezzlePromise = undefined;
|
|
278
|
-
}
|
|
279
|
-
componentDidRender() {
|
|
280
|
-
this.scriptRef.onload = () => {
|
|
281
|
-
this.sezzleButtonRef = document.createElement('button');
|
|
282
|
-
this.initializeSezzleCheckout();
|
|
283
|
-
};
|
|
284
|
-
}
|
|
285
|
-
async resolvePaymentMethod(insuranceValidation) {
|
|
286
|
-
if (!insuranceValidation.isValid) {
|
|
287
|
-
return { validationError: true };
|
|
288
|
-
}
|
|
289
|
-
this.sezzleButtonRef.click();
|
|
290
|
-
return this.sezzlePromise;
|
|
291
|
-
}
|
|
292
|
-
render() {
|
|
293
|
-
var _a, _b, _c, _d, _e;
|
|
294
|
-
return (h("div", { key: '1b4e4a142e1e59465e0db5515ee6b0a0b2aac146', class: "payment-method" }, h("script", { key: 'c835bc94836949e2362974eaeefca1f6a579a1a0', src: "https://checkout-sdk.sezzle.com/checkout.min.js", async: true, ref: (el) => (this.scriptRef = el) }), h("div", { key: '051a0392e6353116423f706be48eb266daf12b84', class: `payment-method-header p-3`, onClick: () => this.onPaymentMethodOptionClick() }, h("input", { key: '6dd0d61f1b8788b45b008f5ac05f8a8b6a6591f2', type: "radio", name: "paymentMethodType", id: (_a = this.paymentMethodOption) === null || _a === void 0 ? void 0 : _a.id, value: (_b = this.paymentMethodOption) === null || _b === void 0 ? void 0 : _b.id, onClick: (event) => event.preventDefault(), checked: this.isSelected, class: "form-check-input me-2" }), h("label", { key: 'caf3429bae616a016f58e141ac5c4493174cf3ef', htmlFor: (_c = this.paymentMethodOption) === null || _c === void 0 ? void 0 : _c.id, class: "form-check-label" }, h("div", { key: '0e4ea85fc6fc32a1c35fe0dac86f21ab7f86eb0a' }, "Buy now, pay later with ", sezzleLogo), this.installmentPlan && (h("small", { key: '3740565f14b87aa2e4af44b7e2b12d93d6e454c2' }, h("span", { key: 'ca9b6dff0042c41d378b101067d060092234fa7c' }, (_d = this.installmentPlan) === null || _d === void 0 ? void 0 : _d.installments.length), "\u00A0", h("span", { key: '14ab21fd2d9bd612f41d5cd3e175402593012619' }, this.installmentPlan.schedule, " payments of"), "\u00A0", h("span", { key: '25e08c1e711af0979e14bbb911aedb58f59bc180', class: "fw-bold" }, formatCurrency((_e = this.installmentPlan) === null || _e === void 0 ? void 0 : _e.installments[0].amountInCents))))))));
|
|
295
|
-
}
|
|
296
|
-
};
|
|
297
|
-
|
|
298
|
-
export { NewPaymentMethod as justifi_new_payment_method, PaymentMethodOptions as justifi_payment_method_options, SavedPaymentMethod as justifi_saved_payment_method, SezzlePaymentMethod as justifi_sezzle_payment_method };
|