@justifi/webcomponents 0.0.14 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +40 -0
- package/changelog-template.hbs +41 -0
- package/dist/cjs/{index-e1b45289.js → index-3947d225.js} +65 -1
- package/dist/cjs/justifi-bank-account-form.cjs.entry.js +59 -0
- package/dist/cjs/justifi-billing-form.cjs.entry.js +2150 -0
- package/dist/cjs/justifi-card-form.cjs.entry.js +59 -0
- package/dist/cjs/justifi-payment-method-form.cjs.entry.js +109 -0
- package/dist/cjs/{justifi-bank-account-form_4.cjs.entry.js → justifi-payments-list.cjs.entry.js} +1 -206
- package/dist/cjs/loader.cjs.js +3 -3
- package/dist/cjs/select-input_2.cjs.entry.js +59 -0
- package/dist/cjs/webcomponents.cjs.js +3 -3
- package/dist/collection/collection-manifest.json +5 -2
- package/dist/collection/components/bank-account-form/bank-account-form.js +5 -3
- package/dist/collection/components/billing-form/billing-form-schema.js +14 -0
- package/dist/collection/components/billing-form/billing-form.css +11 -0
- package/dist/collection/components/billing-form/billing-form.js +92 -0
- package/dist/collection/components/billing-form/state-options.js +243 -0
- package/dist/collection/components/card-form/card-form.js +5 -3
- package/dist/collection/components/payment-method-form/payment-method-form.js +4 -4
- package/dist/collection/components/select-input/select-input.css +7 -0
- package/dist/collection/components/select-input/select-input.js +144 -0
- package/dist/collection/components/text-input/text-input.css +7 -0
- package/dist/collection/components/text-input/text-input.js +126 -0
- package/dist/components/index.d.ts +3 -0
- package/dist/components/index.js +3 -0
- package/dist/components/justifi-bank-account-form.js +4 -2
- package/dist/components/justifi-billing-form.d.ts +11 -0
- package/dist/components/justifi-billing-form.js +2180 -0
- package/dist/components/justifi-card-form.js +4 -2
- package/dist/components/payment-method-form.js +2 -2
- package/dist/components/select-input.d.ts +11 -0
- package/dist/components/select-input.js +6 -0
- package/dist/components/select-input2.js +52 -0
- package/dist/components/text-input.d.ts +11 -0
- package/dist/components/text-input.js +6 -0
- package/dist/components/text-input2.js +48 -0
- package/dist/esm/{index-c1f569bd.js → index-0bcf33c4.js} +65 -1
- package/dist/esm/justifi-bank-account-form.entry.js +55 -0
- package/dist/esm/justifi-billing-form.entry.js +2146 -0
- package/dist/esm/justifi-card-form.entry.js +55 -0
- package/dist/esm/justifi-payment-method-form.entry.js +105 -0
- package/dist/esm/{justifi-bank-account-form_4.entry.js → justifi-payments-list.entry.js} +2 -204
- package/dist/esm/loader.js +4 -4
- package/dist/esm/select-input_2.entry.js +54 -0
- package/dist/esm/webcomponents.js +4 -4
- package/dist/types/components/billing-form/billing-form-schema.d.ts +15 -0
- package/dist/types/components/billing-form/billing-form.d.ts +17 -0
- package/dist/types/components/billing-form/state-options.d.ts +5 -0
- package/dist/types/components/payment-method-form/payment-method-form.d.ts +2 -2
- package/dist/types/components/payment-method-form/theme.d.ts +3 -1
- package/dist/types/components/select-input/select-input.d.ts +18 -0
- package/dist/types/components/text-input/text-input.d.ts +14 -0
- package/dist/types/components.d.ts +74 -5
- package/dist/webcomponents/p-0cddfd4f.entry.js +1 -0
- package/dist/webcomponents/p-17badb93.entry.js +1 -0
- package/dist/webcomponents/p-7fd07095.entry.js +1 -0
- package/dist/webcomponents/p-864e32fd.entry.js +1 -0
- package/dist/webcomponents/p-cecf0fe8.entry.js +1 -0
- package/dist/webcomponents/p-d3dc4e0a.entry.js +1 -0
- package/dist/webcomponents/p-e82c9746.js +2 -0
- package/dist/webcomponents/webcomponents.esm.js +1 -1
- package/package.json +8 -3
- package/readme.md +11 -72
- package/LICENSE +0 -21
- package/dist/webcomponents/p-1de39730.js +0 -2
- package/dist/webcomponents/p-d6caba00.entry.js +0 -1
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { r as registerInstance, c as createEvent, h } from './index-0bcf33c4.js';
|
|
2
|
+
|
|
3
|
+
const CardForm = class {
|
|
4
|
+
constructor(hostRef) {
|
|
5
|
+
registerInstance(this, hostRef);
|
|
6
|
+
this.cardFormReady = createEvent(this, "cardFormReady", 7);
|
|
7
|
+
this.cardFormTokenize = createEvent(this, "cardFormTokenize", 7);
|
|
8
|
+
this.cardFormValidate = createEvent(this, "cardFormValidate", 7);
|
|
9
|
+
this.validationStrategy = undefined;
|
|
10
|
+
this.styleOverrides = undefined;
|
|
11
|
+
this.internalStyleOverrides = undefined;
|
|
12
|
+
}
|
|
13
|
+
readyHandler(event) {
|
|
14
|
+
this.cardFormReady.emit(event);
|
|
15
|
+
}
|
|
16
|
+
tokenizeHandler(event) {
|
|
17
|
+
this.cardFormTokenize.emit(event);
|
|
18
|
+
}
|
|
19
|
+
validateHandler(event) {
|
|
20
|
+
this.cardFormValidate.emit(event);
|
|
21
|
+
}
|
|
22
|
+
componentWillLoad() {
|
|
23
|
+
this.parseStyleOverrides();
|
|
24
|
+
}
|
|
25
|
+
parseStyleOverrides() {
|
|
26
|
+
if (this.styleOverrides) {
|
|
27
|
+
const parsedStyleOverrides = JSON.parse(this.styleOverrides);
|
|
28
|
+
this.internalStyleOverrides = parsedStyleOverrides;
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
async tokenize(...args) {
|
|
32
|
+
if (!this.childRef) {
|
|
33
|
+
throw new Error('Cannot call tokenize');
|
|
34
|
+
}
|
|
35
|
+
return this.childRef.tokenize(...args);
|
|
36
|
+
}
|
|
37
|
+
async validate() {
|
|
38
|
+
if (!this.childRef) {
|
|
39
|
+
throw new Error('Cannot call validate');
|
|
40
|
+
}
|
|
41
|
+
return this.childRef.validate();
|
|
42
|
+
}
|
|
43
|
+
render() {
|
|
44
|
+
return (h("justifi-payment-method-form", { ref: el => {
|
|
45
|
+
if (el) {
|
|
46
|
+
this.childRef = el;
|
|
47
|
+
}
|
|
48
|
+
}, "payment-method-form-type": "card", "payment-method-form-ready": this.cardFormReady, "payment-method-form-tokenize": this.cardFormTokenize, "payment-method-form-validation-strategy": this.validationStrategy || 'onSubmit', paymentMethodStyleOverrides: this.internalStyleOverrides }));
|
|
49
|
+
}
|
|
50
|
+
static get watchers() { return {
|
|
51
|
+
"styleOverrides": ["parseStyleOverrides"]
|
|
52
|
+
}; }
|
|
53
|
+
};
|
|
54
|
+
|
|
55
|
+
export { CardForm as justifi_card_form };
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
import { r as registerInstance, c as createEvent, h, H as Host } from './index-0bcf33c4.js';
|
|
2
|
+
|
|
3
|
+
const MessageEventType = {
|
|
4
|
+
card: {
|
|
5
|
+
ready: 'justifi.card.ready',
|
|
6
|
+
tokenize: 'justifi.card.tokenize',
|
|
7
|
+
validate: 'justifi.card.validate',
|
|
8
|
+
resize: 'justifi.card.resize',
|
|
9
|
+
styleOverrides: 'justifi.card.styleOverrides',
|
|
10
|
+
},
|
|
11
|
+
bankAccount: {
|
|
12
|
+
ready: 'justifi.bankAccount.ready',
|
|
13
|
+
tokenize: 'justifi.bankAccount.tokenize',
|
|
14
|
+
validate: 'justifi.bankAccount.validate',
|
|
15
|
+
resize: 'justifi.bankAccount.resize',
|
|
16
|
+
styleOverrides: 'justifi.bankAccount.styleOverrides',
|
|
17
|
+
}
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
const paymentMethodFormCss = ":host{display:block}justifi-payment-method-form iframe{border:none;width:100%}";
|
|
21
|
+
|
|
22
|
+
const PaymentMethodForm = class {
|
|
23
|
+
constructor(hostRef) {
|
|
24
|
+
registerInstance(this, hostRef);
|
|
25
|
+
this.paymentMethodFormReady = createEvent(this, "paymentMethodFormReady", 7);
|
|
26
|
+
this.paymentMethodFormTokenize = createEvent(this, "paymentMethodFormTokenize", 7);
|
|
27
|
+
this.paymentMethodFormType = undefined;
|
|
28
|
+
this.paymentMethodFormValidationStrategy = undefined;
|
|
29
|
+
this.paymentMethodStyleOverrides = undefined;
|
|
30
|
+
this.height = 55;
|
|
31
|
+
}
|
|
32
|
+
connectedCallback() {
|
|
33
|
+
window.addEventListener('message', this.dispatchMessageEvent.bind(this));
|
|
34
|
+
}
|
|
35
|
+
disconnectedCallback() {
|
|
36
|
+
window.removeEventListener('message', this.dispatchMessageEvent.bind(this));
|
|
37
|
+
}
|
|
38
|
+
componentShouldUpdate() {
|
|
39
|
+
this.sendStyleOverrides();
|
|
40
|
+
}
|
|
41
|
+
sendStyleOverrides() {
|
|
42
|
+
if (this.paymentMethodStyleOverrides) {
|
|
43
|
+
this.postMessage(MessageEventType[this.paymentMethodFormType].styleOverrides, { styleOverrides: this.paymentMethodStyleOverrides });
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
dispatchMessageEvent(messageEvent) {
|
|
47
|
+
const messagePayload = messageEvent.data;
|
|
48
|
+
const messageType = messagePayload.eventType;
|
|
49
|
+
const messageData = messagePayload.data;
|
|
50
|
+
if (messageType === MessageEventType[this.paymentMethodFormType].ready) {
|
|
51
|
+
this.paymentMethodFormReady.emit(messageData);
|
|
52
|
+
}
|
|
53
|
+
if (messageType === MessageEventType[this.paymentMethodFormType].resize) {
|
|
54
|
+
this.height = messageData.height;
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
postMessage(eventType, payload) {
|
|
58
|
+
if (this.iframeElement) {
|
|
59
|
+
this.iframeElement.contentWindow.postMessage(Object.assign({ eventType: eventType }, payload), '*');
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
;
|
|
63
|
+
async postMessageWithResponseListener(eventType, payload) {
|
|
64
|
+
return new Promise((resolve) => {
|
|
65
|
+
const responseListener = (event) => {
|
|
66
|
+
if (event.data.eventType !== eventType)
|
|
67
|
+
return;
|
|
68
|
+
window.removeEventListener('message', responseListener);
|
|
69
|
+
resolve(event.data.data);
|
|
70
|
+
};
|
|
71
|
+
window.addEventListener('message', responseListener);
|
|
72
|
+
this.postMessage(eventType, payload);
|
|
73
|
+
});
|
|
74
|
+
}
|
|
75
|
+
async tokenize(clientId, paymentMethodMetadata, account) {
|
|
76
|
+
const eventType = MessageEventType[this.paymentMethodFormType].tokenize;
|
|
77
|
+
const payload = {
|
|
78
|
+
clientId: clientId,
|
|
79
|
+
paymentMethodMetadata: paymentMethodMetadata,
|
|
80
|
+
account: account
|
|
81
|
+
};
|
|
82
|
+
return this.postMessageWithResponseListener(eventType, payload);
|
|
83
|
+
}
|
|
84
|
+
;
|
|
85
|
+
async validate() {
|
|
86
|
+
return this.postMessageWithResponseListener(MessageEventType[this.paymentMethodFormType].validate);
|
|
87
|
+
}
|
|
88
|
+
;
|
|
89
|
+
getIframeSrc() {
|
|
90
|
+
let iframeSrc = `https://js.justifi.ai/v2/${this.paymentMethodFormType}`;
|
|
91
|
+
if (this.paymentMethodFormValidationStrategy) {
|
|
92
|
+
iframeSrc += `?validationStrategy=${this.paymentMethodFormValidationStrategy}`;
|
|
93
|
+
}
|
|
94
|
+
return iframeSrc;
|
|
95
|
+
}
|
|
96
|
+
render() {
|
|
97
|
+
return (h(Host, null, h("iframe", { id: `justifi-payment-method-form-${this.paymentMethodFormType}`, src: this.getIframeSrc(), ref: (el) => this.iframeElement = el, height: this.height })));
|
|
98
|
+
}
|
|
99
|
+
static get watchers() { return {
|
|
100
|
+
"paymentMethodStyleOverrides": ["sendStyleOverrides"]
|
|
101
|
+
}; }
|
|
102
|
+
};
|
|
103
|
+
PaymentMethodForm.style = paymentMethodFormCss;
|
|
104
|
+
|
|
105
|
+
export { PaymentMethodForm as justifi_payment_method_form };
|
|
@@ -1,206 +1,4 @@
|
|
|
1
|
-
import { r as registerInstance,
|
|
2
|
-
|
|
3
|
-
const BankAccountForm = class {
|
|
4
|
-
constructor(hostRef) {
|
|
5
|
-
registerInstance(this, hostRef);
|
|
6
|
-
this.bankAccountFormReady = createEvent(this, "bankAccountFormReady", 7);
|
|
7
|
-
this.bankAccountFormTokenize = createEvent(this, "bankAccountFormTokenize", 7);
|
|
8
|
-
this.bankAccountFormValidate = createEvent(this, "bankAccountFormValidate", 7);
|
|
9
|
-
this.validationStrategy = undefined;
|
|
10
|
-
this.styleOverrides = undefined;
|
|
11
|
-
this.internalStyleOverrides = undefined;
|
|
12
|
-
}
|
|
13
|
-
readyHandler(event) {
|
|
14
|
-
this.bankAccountFormReady.emit(event);
|
|
15
|
-
}
|
|
16
|
-
tokenizeHandler(event) {
|
|
17
|
-
this.bankAccountFormTokenize.emit(event);
|
|
18
|
-
}
|
|
19
|
-
validateHandler(event) {
|
|
20
|
-
this.bankAccountFormValidate.emit(event);
|
|
21
|
-
}
|
|
22
|
-
componentWillLoad() {
|
|
23
|
-
this.parseStyleOverrides();
|
|
24
|
-
}
|
|
25
|
-
parseStyleOverrides() {
|
|
26
|
-
const parsedStyleOverrides = JSON.parse(this.styleOverrides);
|
|
27
|
-
this.internalStyleOverrides = parsedStyleOverrides;
|
|
28
|
-
}
|
|
29
|
-
async tokenize(...args) {
|
|
30
|
-
if (!this.childRef) {
|
|
31
|
-
throw new Error('Cannot call tokenize');
|
|
32
|
-
}
|
|
33
|
-
return this.childRef.tokenize(...args);
|
|
34
|
-
}
|
|
35
|
-
async validate() {
|
|
36
|
-
if (!this.childRef) {
|
|
37
|
-
throw new Error('Cannot call validate');
|
|
38
|
-
}
|
|
39
|
-
return this.childRef.validate();
|
|
40
|
-
}
|
|
41
|
-
render() {
|
|
42
|
-
return (h("justifi-payment-method-form", { ref: el => {
|
|
43
|
-
if (el) {
|
|
44
|
-
this.childRef = el;
|
|
45
|
-
}
|
|
46
|
-
}, "payment-method-form-type": "bankAccount", "payment-method-form-ready": this.bankAccountFormReady, "payment-method-form-tokenize": this.bankAccountFormTokenize, "payment-method-form-validation-strategy": this.validationStrategy || 'onSubmit', paymentMethodStyleOverrides: this.internalStyleOverrides }));
|
|
47
|
-
}
|
|
48
|
-
static get watchers() { return {
|
|
49
|
-
"styleOverrides": ["parseStyleOverrides"]
|
|
50
|
-
}; }
|
|
51
|
-
};
|
|
52
|
-
|
|
53
|
-
const CardForm = class {
|
|
54
|
-
constructor(hostRef) {
|
|
55
|
-
registerInstance(this, hostRef);
|
|
56
|
-
this.cardFormReady = createEvent(this, "cardFormReady", 7);
|
|
57
|
-
this.cardFormTokenize = createEvent(this, "cardFormTokenize", 7);
|
|
58
|
-
this.cardFormValidate = createEvent(this, "cardFormValidate", 7);
|
|
59
|
-
this.validationStrategy = undefined;
|
|
60
|
-
this.styleOverrides = undefined;
|
|
61
|
-
this.internalStyleOverrides = undefined;
|
|
62
|
-
}
|
|
63
|
-
readyHandler(event) {
|
|
64
|
-
this.cardFormReady.emit(event);
|
|
65
|
-
}
|
|
66
|
-
tokenizeHandler(event) {
|
|
67
|
-
this.cardFormTokenize.emit(event);
|
|
68
|
-
}
|
|
69
|
-
validateHandler(event) {
|
|
70
|
-
this.cardFormValidate.emit(event);
|
|
71
|
-
}
|
|
72
|
-
componentWillLoad() {
|
|
73
|
-
this.parseStyleOverrides();
|
|
74
|
-
}
|
|
75
|
-
parseStyleOverrides() {
|
|
76
|
-
const parsedStyleOverrides = JSON.parse(this.styleOverrides);
|
|
77
|
-
this.internalStyleOverrides = parsedStyleOverrides;
|
|
78
|
-
}
|
|
79
|
-
async tokenize(...args) {
|
|
80
|
-
if (!this.childRef) {
|
|
81
|
-
throw new Error('Cannot call tokenize');
|
|
82
|
-
}
|
|
83
|
-
return this.childRef.tokenize(...args);
|
|
84
|
-
}
|
|
85
|
-
async validate() {
|
|
86
|
-
if (!this.childRef) {
|
|
87
|
-
throw new Error('Cannot call validate');
|
|
88
|
-
}
|
|
89
|
-
return this.childRef.validate();
|
|
90
|
-
}
|
|
91
|
-
render() {
|
|
92
|
-
return (h("justifi-payment-method-form", { ref: el => {
|
|
93
|
-
if (el) {
|
|
94
|
-
this.childRef = el;
|
|
95
|
-
}
|
|
96
|
-
}, "payment-method-form-type": "card", "payment-method-form-ready": this.cardFormReady, "payment-method-form-tokenize": this.cardFormTokenize, "payment-method-form-validation-strategy": this.validationStrategy || 'onSubmit', paymentMethodStyleOverrides: this.internalStyleOverrides }));
|
|
97
|
-
}
|
|
98
|
-
static get watchers() { return {
|
|
99
|
-
"styleOverrides": ["parseStyleOverrides"]
|
|
100
|
-
}; }
|
|
101
|
-
};
|
|
102
|
-
|
|
103
|
-
const MessageEventType = {
|
|
104
|
-
card: {
|
|
105
|
-
ready: 'justifi.card.ready',
|
|
106
|
-
tokenize: 'justifi.card.tokenize',
|
|
107
|
-
validate: 'justifi.card.validate',
|
|
108
|
-
resize: 'justifi.card.resize',
|
|
109
|
-
styleOverrides: 'justifi.card.styleOverrides',
|
|
110
|
-
},
|
|
111
|
-
bankAccount: {
|
|
112
|
-
ready: 'justifi.bankAccount.ready',
|
|
113
|
-
tokenize: 'justifi.bankAccount.tokenize',
|
|
114
|
-
validate: 'justifi.bankAccount.validate',
|
|
115
|
-
resize: 'justifi.bankAccount.resize',
|
|
116
|
-
styleOverrides: 'justifi.bankAccount.styleOverrides',
|
|
117
|
-
}
|
|
118
|
-
};
|
|
119
|
-
|
|
120
|
-
const paymentMethodFormCss = ":host{display:block}justifi-payment-method-form iframe{border:none;width:100%}";
|
|
121
|
-
|
|
122
|
-
const PaymentMethodForm = class {
|
|
123
|
-
constructor(hostRef) {
|
|
124
|
-
registerInstance(this, hostRef);
|
|
125
|
-
this.paymentMethodFormReady = createEvent(this, "paymentMethodFormReady", 7);
|
|
126
|
-
this.paymentMethodFormTokenize = createEvent(this, "paymentMethodFormTokenize", 7);
|
|
127
|
-
this.paymentMethodFormType = undefined;
|
|
128
|
-
this.paymentMethodFormValidationStrategy = undefined;
|
|
129
|
-
this.paymentMethodStyleOverrides = undefined;
|
|
130
|
-
this.height = 55;
|
|
131
|
-
}
|
|
132
|
-
connectedCallback() {
|
|
133
|
-
window.addEventListener('message', this.dispatchMessageEvent.bind(this));
|
|
134
|
-
}
|
|
135
|
-
disconnectedCallback() {
|
|
136
|
-
window.removeEventListener('message', this.dispatchMessageEvent.bind(this));
|
|
137
|
-
}
|
|
138
|
-
componentShouldUpdate() {
|
|
139
|
-
this.sendStyleOverrides();
|
|
140
|
-
}
|
|
141
|
-
sendStyleOverrides() {
|
|
142
|
-
if (this.paymentMethodStyleOverrides) {
|
|
143
|
-
this.postMessage(MessageEventType[this.paymentMethodFormType].styleOverrides, { styleOverrides: this.paymentMethodStyleOverrides });
|
|
144
|
-
}
|
|
145
|
-
}
|
|
146
|
-
dispatchMessageEvent(messageEvent) {
|
|
147
|
-
const messagePayload = messageEvent.data;
|
|
148
|
-
const messageType = messagePayload.eventType;
|
|
149
|
-
const messageData = messagePayload.data;
|
|
150
|
-
if (messageType === MessageEventType[this.paymentMethodFormType].ready) {
|
|
151
|
-
this.paymentMethodFormReady.emit(messageData);
|
|
152
|
-
}
|
|
153
|
-
if (messageType === MessageEventType[this.paymentMethodFormType].resize) {
|
|
154
|
-
this.height = messageData.height;
|
|
155
|
-
}
|
|
156
|
-
}
|
|
157
|
-
postMessage(eventType, payload) {
|
|
158
|
-
if (this.iframeElement) {
|
|
159
|
-
this.iframeElement.contentWindow.postMessage(Object.assign({ eventType: eventType }, payload), '*');
|
|
160
|
-
}
|
|
161
|
-
}
|
|
162
|
-
;
|
|
163
|
-
async postMessageWithResponseListener(eventType, payload) {
|
|
164
|
-
return new Promise((resolve) => {
|
|
165
|
-
const responseListener = (event) => {
|
|
166
|
-
if (event.data.eventType !== eventType)
|
|
167
|
-
return;
|
|
168
|
-
window.removeEventListener('message', responseListener);
|
|
169
|
-
resolve(event.data.data);
|
|
170
|
-
};
|
|
171
|
-
window.addEventListener('message', responseListener);
|
|
172
|
-
this.postMessage(eventType, payload);
|
|
173
|
-
});
|
|
174
|
-
}
|
|
175
|
-
async tokenize(clientKey, paymentMethodMetadata, account) {
|
|
176
|
-
const eventType = MessageEventType[this.paymentMethodFormType].tokenize;
|
|
177
|
-
const payload = {
|
|
178
|
-
clientKey: clientKey,
|
|
179
|
-
paymentMethodMetadata: paymentMethodMetadata,
|
|
180
|
-
account: account
|
|
181
|
-
};
|
|
182
|
-
return this.postMessageWithResponseListener(eventType, payload);
|
|
183
|
-
}
|
|
184
|
-
;
|
|
185
|
-
async validate() {
|
|
186
|
-
return this.postMessageWithResponseListener(MessageEventType[this.paymentMethodFormType].validate);
|
|
187
|
-
}
|
|
188
|
-
;
|
|
189
|
-
getIframeSrc() {
|
|
190
|
-
let iframeSrc = `https://js.justifi.ai/v2/${this.paymentMethodFormType}`;
|
|
191
|
-
if (this.paymentMethodFormValidationStrategy) {
|
|
192
|
-
iframeSrc += `?validationStrategy=${this.paymentMethodFormValidationStrategy}`;
|
|
193
|
-
}
|
|
194
|
-
return iframeSrc;
|
|
195
|
-
}
|
|
196
|
-
render() {
|
|
197
|
-
return (h(Host, null, h("iframe", { id: `justifi-payment-method-form-${this.paymentMethodFormType}`, src: this.getIframeSrc(), ref: (el) => this.iframeElement = el, height: this.height })));
|
|
198
|
-
}
|
|
199
|
-
static get watchers() { return {
|
|
200
|
-
"paymentMethodStyleOverrides": ["sendStyleOverrides"]
|
|
201
|
-
}; }
|
|
202
|
-
};
|
|
203
|
-
PaymentMethodForm.style = paymentMethodFormCss;
|
|
1
|
+
import { r as registerInstance, h, H as Host } from './index-0bcf33c4.js';
|
|
204
2
|
|
|
205
3
|
// Unique ID creation requires a high quality random # generator. In the browser we therefore
|
|
206
4
|
// require the crypto API and do not support built-in fallback to lower quality random number
|
|
@@ -4430,4 +4228,4 @@ const PaymentsList = class {
|
|
|
4430
4228
|
};
|
|
4431
4229
|
PaymentsList.style = paymentsListCss;
|
|
4432
4230
|
|
|
4433
|
-
export {
|
|
4231
|
+
export { PaymentsList as justifi_payments_list };
|
package/dist/esm/loader.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { p as promiseResolve, b as bootstrapLazy } from './index-
|
|
2
|
-
export { s as setNonce } from './index-
|
|
1
|
+
import { p as promiseResolve, b as bootstrapLazy } from './index-0bcf33c4.js';
|
|
2
|
+
export { s as setNonce } from './index-0bcf33c4.js';
|
|
3
3
|
|
|
4
4
|
/*
|
|
5
|
-
Stencil Client Patch Esm v2.22.
|
|
5
|
+
Stencil Client Patch Esm v2.22.3 | MIT Licensed | https://stenciljs.com
|
|
6
6
|
*/
|
|
7
7
|
const patchEsm = () => {
|
|
8
8
|
return promiseResolve();
|
|
@@ -11,7 +11,7 @@ const patchEsm = () => {
|
|
|
11
11
|
const defineCustomElements = (win, options) => {
|
|
12
12
|
if (typeof window === 'undefined') return Promise.resolve();
|
|
13
13
|
return patchEsm().then(() => {
|
|
14
|
-
return bootstrapLazy([["justifi-bank-account-
|
|
14
|
+
return bootstrapLazy([["justifi-billing-form",[[1,"justifi-billing-form",{"billingFields":[32],"billingFieldsErrors":[32],"validate":[64]},[[0,"fieldReceivedInput","setFormValue"]]]]],["justifi-payment-method-form",[[0,"justifi-payment-method-form",{"paymentMethodFormType":[1,"payment-method-form-type"],"paymentMethodFormValidationStrategy":[1,"payment-method-form-validation-strategy"],"paymentMethodStyleOverrides":[16],"height":[32],"tokenize":[64],"validate":[64]}]]],["justifi-bank-account-form",[[0,"justifi-bank-account-form",{"validationStrategy":[1,"validation-strategy"],"styleOverrides":[1,"style-overrides"],"internalStyleOverrides":[32],"tokenize":[64],"validate":[64]},[[0,"paymentMethodFormReady","readyHandler"],[0,"paymentMethodFormTokenize","tokenizeHandler"],[0,"paymentMethodFormValidate","validateHandler"]]]]],["justifi-card-form",[[0,"justifi-card-form",{"validationStrategy":[1,"validation-strategy"],"styleOverrides":[1,"style-overrides"],"internalStyleOverrides":[32],"tokenize":[64],"validate":[64]},[[0,"paymentMethodFormReady","readyHandler"],[0,"paymentMethodFormTokenize","tokenizeHandler"],[0,"paymentMethodFormValidate","validateHandler"]]]]],["justifi-payments-list",[[1,"justifi-payments-list",{"accountId":[1,"account-id"],"auth":[16],"payments":[32]}]]],["select-input_2",[[1,"select-input",{"name":[1],"label":[1],"defaultValue":[1,"default-value"],"error":[1],"options":[16],"internalValue":[32]}],[1,"text-input",{"name":[1],"label":[1],"defaultValue":[1,"default-value"],"error":[1],"internalValue":[32]}]]]], options);
|
|
15
15
|
});
|
|
16
16
|
};
|
|
17
17
|
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { r as registerInstance, c as createEvent, h, H as Host } from './index-0bcf33c4.js';
|
|
2
|
+
|
|
3
|
+
const selectInputCss = ":host{display:block}label{display:block}";
|
|
4
|
+
|
|
5
|
+
const SelectInput = class {
|
|
6
|
+
constructor(hostRef) {
|
|
7
|
+
registerInstance(this, hostRef);
|
|
8
|
+
this.fieldReceivedInput = createEvent(this, "fieldReceivedInput", 7);
|
|
9
|
+
this.name = undefined;
|
|
10
|
+
this.label = undefined;
|
|
11
|
+
this.defaultValue = undefined;
|
|
12
|
+
this.error = undefined;
|
|
13
|
+
this.options = undefined;
|
|
14
|
+
this.internalValue = '';
|
|
15
|
+
}
|
|
16
|
+
onInput(event) {
|
|
17
|
+
const target = event.target;
|
|
18
|
+
const name = target.getAttribute('name');
|
|
19
|
+
this.fieldReceivedInput.emit({ name: name, value: target.value });
|
|
20
|
+
}
|
|
21
|
+
;
|
|
22
|
+
render() {
|
|
23
|
+
return (h(Host, null, h("label", null, this.label), h("select", { name: this.name, onInput: (event) => this.onInput(event) }, this.options.map((option) => {
|
|
24
|
+
return (h("option", { value: option.value }, option.label));
|
|
25
|
+
})), this.error && h("div", { style: { color: 'red' } }, this.error)));
|
|
26
|
+
}
|
|
27
|
+
};
|
|
28
|
+
SelectInput.style = selectInputCss;
|
|
29
|
+
|
|
30
|
+
const textInputCss = ":host{display:block}label{display:block}";
|
|
31
|
+
|
|
32
|
+
const TextInput = class {
|
|
33
|
+
constructor(hostRef) {
|
|
34
|
+
registerInstance(this, hostRef);
|
|
35
|
+
this.fieldReceivedInput = createEvent(this, "fieldReceivedInput", 7);
|
|
36
|
+
this.name = undefined;
|
|
37
|
+
this.label = undefined;
|
|
38
|
+
this.defaultValue = undefined;
|
|
39
|
+
this.error = undefined;
|
|
40
|
+
this.internalValue = '';
|
|
41
|
+
}
|
|
42
|
+
onInput(event) {
|
|
43
|
+
const target = event.target;
|
|
44
|
+
const name = target.getAttribute('name');
|
|
45
|
+
this.fieldReceivedInput.emit({ name: name, value: target.value });
|
|
46
|
+
}
|
|
47
|
+
;
|
|
48
|
+
render() {
|
|
49
|
+
return (h(Host, null, h("label", null, this.label), h("input", { name: this.name, type: "text", onInput: (event) => this.onInput(event), value: this.internalValue || this.defaultValue }), this.error && h("div", { style: { color: 'red' } }, this.error)));
|
|
50
|
+
}
|
|
51
|
+
};
|
|
52
|
+
TextInput.style = textInputCss;
|
|
53
|
+
|
|
54
|
+
export { SelectInput as select_input, TextInput as text_input };
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { p as promiseResolve, b as bootstrapLazy } from './index-
|
|
2
|
-
export { s as setNonce } from './index-
|
|
1
|
+
import { p as promiseResolve, b as bootstrapLazy } from './index-0bcf33c4.js';
|
|
2
|
+
export { s as setNonce } from './index-0bcf33c4.js';
|
|
3
3
|
|
|
4
4
|
/*
|
|
5
|
-
Stencil Client Patch Browser v2.22.
|
|
5
|
+
Stencil Client Patch Browser v2.22.3 | MIT Licensed | https://stenciljs.com
|
|
6
6
|
*/
|
|
7
7
|
const patchBrowser = () => {
|
|
8
8
|
const importMeta = import.meta.url;
|
|
@@ -14,5 +14,5 @@ const patchBrowser = () => {
|
|
|
14
14
|
};
|
|
15
15
|
|
|
16
16
|
patchBrowser().then(options => {
|
|
17
|
-
return bootstrapLazy([["justifi-bank-account-
|
|
17
|
+
return bootstrapLazy([["justifi-billing-form",[[1,"justifi-billing-form",{"billingFields":[32],"billingFieldsErrors":[32],"validate":[64]},[[0,"fieldReceivedInput","setFormValue"]]]]],["justifi-payment-method-form",[[0,"justifi-payment-method-form",{"paymentMethodFormType":[1,"payment-method-form-type"],"paymentMethodFormValidationStrategy":[1,"payment-method-form-validation-strategy"],"paymentMethodStyleOverrides":[16],"height":[32],"tokenize":[64],"validate":[64]}]]],["justifi-bank-account-form",[[0,"justifi-bank-account-form",{"validationStrategy":[1,"validation-strategy"],"styleOverrides":[1,"style-overrides"],"internalStyleOverrides":[32],"tokenize":[64],"validate":[64]},[[0,"paymentMethodFormReady","readyHandler"],[0,"paymentMethodFormTokenize","tokenizeHandler"],[0,"paymentMethodFormValidate","validateHandler"]]]]],["justifi-card-form",[[0,"justifi-card-form",{"validationStrategy":[1,"validation-strategy"],"styleOverrides":[1,"style-overrides"],"internalStyleOverrides":[32],"tokenize":[64],"validate":[64]},[[0,"paymentMethodFormReady","readyHandler"],[0,"paymentMethodFormTokenize","tokenizeHandler"],[0,"paymentMethodFormValidate","validateHandler"]]]]],["justifi-payments-list",[[1,"justifi-payments-list",{"accountId":[1,"account-id"],"auth":[16],"payments":[32]}]]],["select-input_2",[[1,"select-input",{"name":[1],"label":[1],"defaultValue":[1,"default-value"],"error":[1],"options":[16],"internalValue":[32]}],[1,"text-input",{"name":[1],"label":[1],"defaultValue":[1,"default-value"],"error":[1],"internalValue":[32]}]]]], options);
|
|
18
18
|
});
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export declare const RegExZip: RegExp;
|
|
2
|
+
declare const BillingFormSchema: import("yup").ObjectSchema<{
|
|
3
|
+
address_line1: string;
|
|
4
|
+
address_line2: string;
|
|
5
|
+
address_city: string;
|
|
6
|
+
address_state: string;
|
|
7
|
+
address_postal_code: string;
|
|
8
|
+
}, import("yup").AnyObject, {
|
|
9
|
+
address_line1: undefined;
|
|
10
|
+
address_line2: undefined;
|
|
11
|
+
address_city: undefined;
|
|
12
|
+
address_state: undefined;
|
|
13
|
+
address_postal_code: undefined;
|
|
14
|
+
}, "">;
|
|
15
|
+
export default BillingFormSchema;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
interface BillingFormFields {
|
|
2
|
+
address_line1: string;
|
|
3
|
+
address_line2?: string;
|
|
4
|
+
address_city: string;
|
|
5
|
+
address_state: string;
|
|
6
|
+
address_postal_code: string;
|
|
7
|
+
}
|
|
8
|
+
export declare class BillingForm {
|
|
9
|
+
billingFields: BillingFormFields;
|
|
10
|
+
billingFieldsErrors: any;
|
|
11
|
+
setFormValue(event: any): void;
|
|
12
|
+
validate(): Promise<{
|
|
13
|
+
isValid: boolean;
|
|
14
|
+
}>;
|
|
15
|
+
render(): any;
|
|
16
|
+
}
|
|
17
|
+
export {};
|
|
@@ -3,7 +3,7 @@ import { Theme } from './theme';
|
|
|
3
3
|
export declare class PaymentMethodForm {
|
|
4
4
|
paymentMethodFormType: 'card' | 'bankAccount';
|
|
5
5
|
paymentMethodFormValidationStrategy: 'onChange' | 'onBlur' | 'onSubmit' | 'onTouched' | 'all';
|
|
6
|
-
paymentMethodStyleOverrides: Theme;
|
|
6
|
+
paymentMethodStyleOverrides: Theme | undefined;
|
|
7
7
|
paymentMethodFormReady: EventEmitter;
|
|
8
8
|
paymentMethodFormTokenize: EventEmitter<{
|
|
9
9
|
data: any;
|
|
@@ -17,7 +17,7 @@ export declare class PaymentMethodForm {
|
|
|
17
17
|
private dispatchMessageEvent;
|
|
18
18
|
private postMessage;
|
|
19
19
|
private postMessageWithResponseListener;
|
|
20
|
-
tokenize(
|
|
20
|
+
tokenize(clientId: string, paymentMethodMetadata: any, account?: string): Promise<any>;
|
|
21
21
|
validate(): Promise<any>;
|
|
22
22
|
private getIframeSrc;
|
|
23
23
|
render(): any;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { EventEmitter } from '../../stencil-public-runtime';
|
|
2
|
+
export declare class SelectInput {
|
|
3
|
+
name: string;
|
|
4
|
+
label: string;
|
|
5
|
+
defaultValue: string;
|
|
6
|
+
error: string;
|
|
7
|
+
options: {
|
|
8
|
+
label: string;
|
|
9
|
+
value: string;
|
|
10
|
+
}[];
|
|
11
|
+
fieldReceivedInput: EventEmitter<{
|
|
12
|
+
name: string;
|
|
13
|
+
value: string;
|
|
14
|
+
}>;
|
|
15
|
+
internalValue: string;
|
|
16
|
+
onInput(event: any): void;
|
|
17
|
+
render(): any;
|
|
18
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { EventEmitter } from '../../stencil-public-runtime';
|
|
2
|
+
export declare class TextInput {
|
|
3
|
+
name: string;
|
|
4
|
+
label: string;
|
|
5
|
+
defaultValue: string;
|
|
6
|
+
error: string;
|
|
7
|
+
fieldReceivedInput: EventEmitter<{
|
|
8
|
+
name: string;
|
|
9
|
+
value: string;
|
|
10
|
+
}>;
|
|
11
|
+
internalValue: string;
|
|
12
|
+
onInput(event: any): void;
|
|
13
|
+
render(): any;
|
|
14
|
+
}
|