@justifi/webcomponents 4.19.1-rc → 4.19.1-rc-3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/{Analytics-0b3db49d.js → Analytics-1ca4e47e.js} +2 -3
- package/dist/cjs/{business.service-c384784d.js → business.service-6bb7ac82.js} +5 -6
- package/dist/cjs/{get-payout-csv-51a02be7.js → get-payout-csv-1391ff3e.js} +3 -4
- package/dist/cjs/justifi-additional-questions-form-step_10.cjs.entry.js +7 -8
- package/dist/cjs/justifi-bank-account-form.cjs.entry.js +4 -5
- package/dist/cjs/justifi-business-details.cjs.entry.js +3 -4
- package/dist/cjs/justifi-business-form.cjs.entry.js +4 -5
- package/dist/cjs/justifi-card-form.cjs.entry.js +4 -5
- package/dist/cjs/justifi-checkout-core.cjs.entry.js +3 -3
- package/dist/cjs/justifi-checkout.cjs.entry.js +4 -5
- package/dist/cjs/justifi-gross-payment-chart.cjs.entry.js +3 -4
- package/dist/cjs/justifi-new-payment-method_4.cjs.entry.js +11 -9
- package/dist/cjs/justifi-owner-form_3.cjs.entry.js +1 -2
- package/dist/cjs/justifi-payment-details.cjs.entry.js +3 -4
- package/dist/cjs/justifi-payment-form.cjs.entry.js +5 -6
- package/dist/cjs/justifi-payment-method-form.cjs.entry.js +1 -1
- package/dist/cjs/justifi-payment-provisioning.cjs.entry.js +5 -6
- package/dist/cjs/justifi-payments-list.cjs.entry.js +3 -4
- package/dist/cjs/justifi-payout-details.cjs.entry.js +3 -4
- package/dist/cjs/justifi-payouts-list.cjs.entry.js +3 -4
- package/dist/cjs/justifi-refund-form.cjs.entry.js +2 -3
- package/dist/cjs/justifi-season-interruption-insurance.cjs.entry.js +4 -5
- package/dist/cjs/{package-39dc73ed.js → package-bc2632e4.js} +2 -4
- package/dist/cjs/{payment.service-2dbfb83d.js → payment.service-dfcfa19b.js} +2 -3
- package/dist/collection/api/services/analytics.service.js +1 -2
- package/dist/collection/api/services/business.service.js +5 -6
- package/dist/collection/api/services/checkout.service.js +2 -3
- package/dist/collection/api/services/insurance.service.js +2 -3
- package/dist/collection/api/services/payment.service.js +2 -3
- package/dist/collection/api/services/payout.service.js +3 -4
- package/dist/collection/api/services/provision.service.js +2 -4
- package/dist/collection/api/services/reports.service.js +1 -2
- package/dist/collection/components/bank-account-form/bank-account-form.js +3 -4
- package/dist/collection/components/business-forms/business-form/business-form.js +2 -3
- package/dist/collection/components/business-forms/payment-provisioning/bank-account/business-bank-account-form-step.js +2 -3
- package/dist/collection/components/business-forms/payment-provisioning/document-uploads/business-document-upload-form-step.js +2 -3
- package/dist/collection/components/business-forms/payment-provisioning/terms-and-conditions/business-terms-conditions-form-step.js +2 -3
- package/dist/collection/components/card-form/card-form.js +3 -4
- package/dist/collection/components/checkout/checkout-core.js +4 -4
- package/dist/collection/components/checkout/new-payment-method.js +6 -4
- package/dist/collection/components/checkout/payment-method-options.js +3 -4
- package/dist/collection/components/checkout/saved-payment-method.js +3 -4
- package/dist/collection/components/checkout/sezzle-payment-method.js +3 -4
- package/dist/collection/components/payment-form/payment-form.js +3 -4
- package/dist/collection/components/refund-form/refund-form.js +2 -3
- package/dist/docs.json +8 -8
- package/dist/esm/{Analytics-37556050.js → Analytics-c51439be.js} +2 -3
- package/dist/esm/{business.service-eee46ab1.js → business.service-f45decfc.js} +5 -6
- package/dist/esm/{get-payout-csv-4d6b29d8.js → get-payout-csv-e784a2ab.js} +3 -4
- package/dist/esm/justifi-additional-questions-form-step_10.entry.js +7 -8
- package/dist/esm/justifi-bank-account-form.entry.js +4 -5
- package/dist/esm/justifi-business-details.entry.js +3 -4
- package/dist/esm/justifi-business-form.entry.js +4 -5
- package/dist/esm/justifi-card-form.entry.js +4 -5
- package/dist/esm/justifi-checkout-core.entry.js +3 -3
- package/dist/esm/justifi-checkout.entry.js +4 -5
- package/dist/esm/justifi-gross-payment-chart.entry.js +3 -4
- package/dist/esm/justifi-new-payment-method_4.entry.js +11 -9
- package/dist/esm/justifi-owner-form_3.entry.js +1 -2
- package/dist/esm/justifi-payment-details.entry.js +3 -4
- package/dist/esm/justifi-payment-form.entry.js +5 -6
- package/dist/esm/justifi-payment-method-form.entry.js +1 -1
- package/dist/esm/justifi-payment-provisioning.entry.js +5 -6
- package/dist/esm/justifi-payments-list.entry.js +3 -4
- package/dist/esm/justifi-payout-details.entry.js +3 -4
- package/dist/esm/justifi-payouts-list.entry.js +3 -4
- package/dist/esm/justifi-refund-form.entry.js +2 -3
- package/dist/esm/justifi-season-interruption-insurance.entry.js +4 -5
- package/dist/esm/{package-e2a7aa3f.js → package-09a354e0.js} +2 -4
- package/dist/esm/{payment.service-9005a501.js → payment.service-dad5153b.js} +2 -3
- package/dist/globals.d.ts +2 -0
- package/dist/module/Analytics.js +1 -2
- package/dist/module/business-bank-account-form-step.js +2 -3
- package/dist/module/business-document-upload-form-step.js +2 -3
- package/dist/module/business-terms-conditions-form-step.js +2 -3
- package/dist/module/business.service.js +5 -6
- package/dist/module/checkout-core.js +3 -3
- package/dist/module/get-payout-csv.js +3 -4
- package/dist/module/justifi-bank-account-form.js +2 -3
- package/dist/module/justifi-business-form.js +2 -3
- package/dist/module/justifi-card-form.js +2 -3
- package/dist/module/justifi-checkout.js +2 -3
- package/dist/module/justifi-gross-payment-chart.js +1 -2
- package/dist/module/justifi-payment-form.js +3 -4
- package/dist/module/justifi-payment-provisioning.js +2 -3
- package/dist/module/justifi-refund-form.js +2 -3
- package/dist/module/justifi-season-interruption-insurance.js +2 -3
- package/dist/module/new-payment-method.js +5 -3
- package/dist/module/package.js +2 -4
- package/dist/module/payment-method-options.js +2 -3
- package/dist/module/payment.service.js +2 -3
- package/dist/module/saved-payment-method.js +2 -3
- package/dist/module/sezzle-payment-method.js +2 -3
- package/dist/types/components/checkout/new-payment-method.d.ts +1 -0
- package/dist/webcomponents/index.esm.js +1 -0
- package/dist/webcomponents/p-01a404ca.entry.js +44 -0
- package/dist/webcomponents/p-03d35880.entry.js +130 -0
- package/dist/webcomponents/p-06ff0429.entry.js +65 -0
- package/dist/webcomponents/p-08b0fb31.js +41 -1
- package/dist/webcomponents/p-14c91ffd.js +20 -1
- package/dist/webcomponents/p-1a17ea7d.entry.js +1684 -0
- package/dist/webcomponents/p-1ad5995e.js +3599 -1
- package/dist/webcomponents/p-1ff8810b.js +29 -1
- package/dist/webcomponents/p-21aeb013.entry.js +80 -0
- package/dist/webcomponents/p-2338affa.js +213 -1
- package/dist/webcomponents/p-258b1ee2.entry.js +149 -0
- package/dist/webcomponents/p-25d8cd65.entry.js +102 -0
- package/dist/webcomponents/p-29c0b182.js +114 -1
- package/dist/webcomponents/p-2b6c9c4f.js +7 -1
- package/dist/webcomponents/p-2dabeb5a.js +79 -0
- package/dist/webcomponents/p-2eab3c90.js +3052 -1
- package/dist/webcomponents/p-33272d05.entry.js +94 -0
- package/dist/webcomponents/p-3642ad71.entry.js +145 -0
- package/dist/webcomponents/p-387450f6.js +77 -0
- package/dist/webcomponents/p-3e9ef4a8.js +28 -0
- package/dist/webcomponents/p-3fd13ca3.js +52 -1
- package/dist/webcomponents/p-41bc7c5c.entry.js +97 -0
- package/dist/webcomponents/p-4d8b45c6.entry.js +98 -0
- package/dist/webcomponents/p-525db3e8.js +22 -1
- package/dist/webcomponents/p-5482d030.entry.js +21 -0
- package/dist/webcomponents/p-56f6ce4c.js +10 -1
- package/dist/webcomponents/p-576826b1.entry.js +43 -0
- package/dist/webcomponents/p-5968ff8a.js +178 -1
- package/dist/webcomponents/p-5bd7b204.entry.js +75 -0
- package/dist/webcomponents/p-5cb3f0b2.entry.js +261 -0
- package/dist/webcomponents/p-5e70442b.entry.js +74 -0
- package/dist/webcomponents/p-5f835b89.entry.js +606 -0
- package/dist/webcomponents/p-6078a370.js +244 -1
- package/dist/webcomponents/p-68843186.entry.js +73 -0
- package/dist/webcomponents/p-70a2aa74.entry.js +76 -0
- package/dist/webcomponents/p-7582b554.entry.js +18 -0
- package/dist/webcomponents/p-79646550.entry.js +61 -0
- package/dist/webcomponents/p-7c76e67c.entry.js +117 -0
- package/dist/webcomponents/p-7d85af5c.js +16 -1
- package/dist/webcomponents/p-800d31fe.entry.js +162 -0
- package/dist/webcomponents/p-8115b2f4.js +28 -1
- package/dist/webcomponents/p-83125497.js +4027 -1
- package/dist/webcomponents/p-85fc69e5.js +90 -1
- package/dist/webcomponents/p-890088fc.entry.js +298 -0
- package/dist/webcomponents/p-89887332.js +301 -1
- package/dist/webcomponents/p-8df7bde8.js +27 -1
- package/dist/webcomponents/p-8eb774df.entry.js +54 -0
- package/dist/webcomponents/p-9c9c7dac.js +24 -1
- package/dist/webcomponents/p-9f94bbb6.entry.js +118 -0
- package/dist/webcomponents/p-a5a225d9.entry.js +125 -0
- package/dist/webcomponents/p-a5c5821e.entry.js +101 -0
- package/dist/webcomponents/p-a5fb51dc.entry.js +131 -0
- package/dist/webcomponents/p-a6d04afc.js +44 -0
- package/dist/webcomponents/p-ac086069.entry.js +58 -0
- package/dist/webcomponents/p-af244664.js +126 -1
- package/dist/webcomponents/p-b82c146f.entry.js +111 -0
- package/dist/webcomponents/p-b8a03a4b.entry.js +131 -0
- package/dist/webcomponents/p-ba4bae6f.js +12 -1
- package/dist/webcomponents/p-ba5fae28.js +90 -1
- package/dist/webcomponents/p-c636f563.entry.js +791 -0
- package/dist/webcomponents/p-c86c24d2.entry.js +94 -0
- package/dist/webcomponents/p-cb26f708.js +18 -0
- package/dist/webcomponents/p-ce733539.entry.js +99 -0
- package/dist/webcomponents/p-d17aee2b.entry.js +26 -0
- package/dist/webcomponents/p-d5095f6c.entry.js +133 -0
- package/dist/webcomponents/p-d89bad72.js +39 -1
- package/dist/webcomponents/p-dce846bf.js +27 -1
- package/dist/webcomponents/p-df21aaad.js +120 -1
- package/dist/webcomponents/p-e1255160.js +3 -1
- package/dist/webcomponents/p-e333620e.js +34 -1
- package/dist/webcomponents/p-e356f280.entry.js +29 -0
- package/dist/webcomponents/p-e3fab0e2.js +43 -1
- package/dist/webcomponents/p-ec854a3e.entry.js +11053 -0
- package/dist/webcomponents/p-f02b75dc.entry.js +96 -0
- package/dist/webcomponents/p-fad19d75.js +1638 -2
- package/dist/webcomponents/webcomponents.css +362 -4
- package/dist/webcomponents/webcomponents.esm.js +20 -1
- package/package.json +2 -4
- package/dist/cjs/config-037e67d0.js +0 -15
- package/dist/config.js +0 -11
- package/dist/esm/config-58e393e2.js +0 -13
- package/dist/module/config.js +0 -13
- package/dist/types/home/runner/work/web-component-library/web-component-library/packages/webcomponents/.stencil/packages/webcomponents/config.d.ts +0 -11
- package/dist/webcomponents/p-023779ee.entry.js +0 -1
- package/dist/webcomponents/p-037763f4.entry.js +0 -1
- package/dist/webcomponents/p-07109641.entry.js +0 -1
- package/dist/webcomponents/p-0f7b9555.entry.js +0 -1
- package/dist/webcomponents/p-17e4246f.entry.js +0 -1
- package/dist/webcomponents/p-1a43e355.entry.js +0 -19
- package/dist/webcomponents/p-1f6afff9.entry.js +0 -1
- package/dist/webcomponents/p-246a6c6a.entry.js +0 -1
- package/dist/webcomponents/p-2d3b1692.entry.js +0 -1
- package/dist/webcomponents/p-30a493cd.entry.js +0 -1
- package/dist/webcomponents/p-32286934.js +0 -1
- package/dist/webcomponents/p-3f5e7e86.js +0 -1
- package/dist/webcomponents/p-462dc522.entry.js +0 -1
- package/dist/webcomponents/p-487b72a8.entry.js +0 -1
- package/dist/webcomponents/p-4abc17f0.entry.js +0 -1
- package/dist/webcomponents/p-52021fa1.entry.js +0 -1
- package/dist/webcomponents/p-53e64f15.entry.js +0 -1
- package/dist/webcomponents/p-57e1f2fd.js +0 -1
- package/dist/webcomponents/p-5f095525.entry.js +0 -1
- package/dist/webcomponents/p-62b32c4c.entry.js +0 -1
- package/dist/webcomponents/p-69faef3f.entry.js +0 -1
- package/dist/webcomponents/p-6c078cd1.js +0 -1
- package/dist/webcomponents/p-8e541a32.entry.js +0 -1
- package/dist/webcomponents/p-8f325782.entry.js +0 -1
- package/dist/webcomponents/p-987b5de2.entry.js +0 -1
- package/dist/webcomponents/p-a63fc384.entry.js +0 -1
- package/dist/webcomponents/p-a8220709.entry.js +0 -1
- package/dist/webcomponents/p-ae530971.entry.js +0 -1
- package/dist/webcomponents/p-b7cf49f4.entry.js +0 -1
- package/dist/webcomponents/p-b87b27ba.js +0 -1
- package/dist/webcomponents/p-bbed6107.entry.js +0 -1
- package/dist/webcomponents/p-be39c802.entry.js +0 -1
- package/dist/webcomponents/p-c28db166.js +0 -1
- package/dist/webcomponents/p-c9f8f7ec.entry.js +0 -1
- package/dist/webcomponents/p-d8355f91.entry.js +0 -1
- package/dist/webcomponents/p-e2c88817.entry.js +0 -1
- package/dist/webcomponents/p-e31f0f3e.entry.js +0 -1
- package/dist/webcomponents/p-edac2b43.entry.js +0 -1
- package/dist/webcomponents/p-ef23c091.entry.js +0 -1
- package/dist/webcomponents/p-f06910aa.entry.js +0 -1
- package/dist/webcomponents/p-f0866375.entry.js +0 -1
- package/dist/webcomponents/p-f0a06884.entry.js +0 -1
- package/dist/webcomponents/p-f2f94d9f.entry.js +0 -1
- package/dist/webcomponents/p-f49b7170.entry.js +0 -1
- package/dist/webcomponents/p-fb58feb5.entry.js +0 -1
- package/dist/webcomponents/p-fe33151d.entry.js +0 -1
|
@@ -1 +1,90 @@
|
|
|
1
|
-
import{c as
|
|
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 };
|
|
@@ -0,0 +1,298 @@
|
|
|
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 };
|