@justifi/webcomponents 5.3.0 → 5.3.2
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/{Api-b0e4be29.js → Api-089e7501.js} +1 -0
- package/dist/cjs/bank-account-form_9.cjs.entry.js +10 -6
- package/dist/cjs/billing-form_3.cjs.entry.js +2 -2
- package/dist/cjs/{business-additional-questions-schema-2f66f025.js → business-additional-questions-schema-2cc0c6f7.js} +1 -1
- package/dist/cjs/{business-identity-schema-be495474.js → business-identity-schema-7d462eb3.js} +1 -1
- package/dist/cjs/{business.service-d575b515.js → business.service-33d7c7f2.js} +1 -1
- package/dist/cjs/{check-pkg-version-1658df6f.js → check-pkg-version-fe4c6467.js} +2 -2
- package/dist/cjs/{checkout.service-057b5a7a.js → checkout.service-d9047ddb.js} +1 -1
- package/dist/cjs/{dispute.service-df9e1830.js → dispute.service-739631c7.js} +1 -1
- package/dist/cjs/{get-payout-csv-527a238c.js → get-payout-csv-bdaff21b.js} +1 -1
- package/dist/cjs/{get-subaccounts-6068c1aa.js → get-subaccounts-2db9fc01.js} +1 -1
- package/dist/cjs/justifi-additional-questions-form-step-core_6.cjs.entry.js +3 -3
- package/dist/cjs/justifi-additional-questions-form-step_9.cjs.entry.js +2 -2
- package/dist/cjs/justifi-business-details.cjs.entry.js +4 -4
- package/dist/cjs/justifi-business-form.cjs.entry.js +6 -6
- package/dist/cjs/justifi-checkout-core.cjs.entry.js +3 -2
- package/dist/cjs/justifi-checkout.cjs.entry.js +7 -6
- package/dist/cjs/justifi-checkouts-list.cjs.entry.js +5 -5
- package/dist/cjs/justifi-dispute-management.cjs.entry.js +4 -4
- package/dist/cjs/justifi-dispute-notification_3.cjs.entry.js +4 -4
- package/dist/cjs/justifi-gross-payment-chart.cjs.entry.js +3 -3
- package/dist/cjs/justifi-owner-form_3.cjs.entry.js +4 -4
- package/dist/cjs/justifi-payment-details.cjs.entry.js +4 -4
- package/dist/cjs/justifi-payment-provisioning.cjs.entry.js +4 -4
- package/dist/cjs/justifi-payments-list.cjs.entry.js +4 -4
- package/dist/cjs/justifi-payout-details.cjs.entry.js +4 -4
- package/dist/cjs/justifi-payouts-list.cjs.entry.js +5 -5
- package/dist/cjs/justifi-refund-form.cjs.entry.js +1 -1
- package/dist/cjs/justifi-season-interruption-insurance.cjs.entry.js +3 -3
- package/dist/cjs/justifi-terminals-list.cjs.entry.js +4 -4
- package/dist/cjs/justifi-tokenize-payment-method.cjs.entry.js +19 -10
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/{package-06419e54.js → package-8b04bef0.js} +1 -1
- package/dist/cjs/{payment.service-3eebfe3e.js → payment.service-87924c1a.js} +1 -1
- package/dist/cjs/{schema-validations-cc4e6071.js → schema-validations-f948158d.js} +1 -1
- package/dist/cjs/webcomponents.cjs.js +1 -1
- package/dist/collection/components/business-forms/schemas/schema-validations.js +1 -1
- package/dist/collection/components/checkout/bank-account-form/bank-account-form.js +25 -1
- package/dist/collection/components/checkout/card-form/card-form.js +25 -1
- package/dist/collection/components/checkout/checkout-core.js +20 -2
- package/dist/collection/components/checkout/checkout.js +22 -2
- package/dist/collection/components/checkout/new-payment-method.js +20 -2
- package/dist/collection/components/checkout/payment-method-options.js +20 -2
- package/dist/collection/components/tokenize-payment-method/tokenize-payment-method.js +44 -18
- package/dist/config.js +1 -0
- package/dist/docs.json +176 -20
- package/dist/esm/{Api-0cac5b8a.js → Api-97801a4b.js} +1 -0
- package/dist/esm/bank-account-form_9.entry.js +10 -6
- package/dist/esm/billing-form_3.entry.js +2 -2
- package/dist/esm/{business-additional-questions-schema-212a96ed.js → business-additional-questions-schema-60e9b76a.js} +1 -1
- package/dist/esm/{business-identity-schema-05bd2a5f.js → business-identity-schema-191d85c2.js} +1 -1
- package/dist/esm/{business.service-6a208f8f.js → business.service-45c7df3c.js} +1 -1
- package/dist/esm/{check-pkg-version-bac7eb5e.js → check-pkg-version-e2273f4f.js} +2 -2
- package/dist/esm/{checkout.service-ac067baa.js → checkout.service-36e3355e.js} +1 -1
- package/dist/esm/{dispute.service-26a788a8.js → dispute.service-9b9b87e5.js} +1 -1
- package/dist/esm/{get-payout-csv-684fece6.js → get-payout-csv-80210301.js} +1 -1
- package/dist/esm/{get-subaccounts-b1bed757.js → get-subaccounts-d3eeb85d.js} +1 -1
- package/dist/esm/justifi-additional-questions-form-step-core_6.entry.js +3 -3
- package/dist/esm/justifi-additional-questions-form-step_9.entry.js +2 -2
- package/dist/esm/justifi-business-details.entry.js +4 -4
- package/dist/esm/justifi-business-form.entry.js +6 -6
- package/dist/esm/justifi-checkout-core.entry.js +3 -2
- package/dist/esm/justifi-checkout.entry.js +7 -6
- package/dist/esm/justifi-checkouts-list.entry.js +5 -5
- package/dist/esm/justifi-dispute-management.entry.js +4 -4
- package/dist/esm/justifi-dispute-notification_3.entry.js +4 -4
- package/dist/esm/justifi-gross-payment-chart.entry.js +3 -3
- package/dist/esm/justifi-owner-form_3.entry.js +4 -4
- package/dist/esm/justifi-payment-details.entry.js +4 -4
- package/dist/esm/justifi-payment-provisioning.entry.js +4 -4
- package/dist/esm/justifi-payments-list.entry.js +4 -4
- package/dist/esm/justifi-payout-details.entry.js +4 -4
- package/dist/esm/justifi-payouts-list.entry.js +5 -5
- package/dist/esm/justifi-refund-form.entry.js +1 -1
- package/dist/esm/justifi-season-interruption-insurance.entry.js +3 -3
- package/dist/esm/justifi-terminals-list.entry.js +4 -4
- package/dist/esm/justifi-tokenize-payment-method.entry.js +19 -10
- package/dist/esm/loader.js +1 -1
- package/dist/esm/{package-90ebd343.js → package-a8e8f775.js} +1 -1
- package/dist/esm/{payment.service-2e418da1.js → payment.service-c847c1f6.js} +1 -1
- package/dist/esm/{schema-validations-ccea6a06.js → schema-validations-38e8bc7b.js} +1 -1
- package/dist/esm/webcomponents.js +1 -1
- package/dist/module/bank-account-form2.js +3 -1
- package/dist/module/card-form2.js +3 -1
- package/dist/module/checkout-core.js +4 -2
- package/dist/module/config.js +1 -0
- package/dist/module/justifi-checkout.js +5 -2
- package/dist/module/justifi-tokenize-payment-method.js +17 -8
- package/dist/module/new-payment-method.js +4 -2
- package/dist/module/package.js +1 -1
- package/dist/module/payment-method-options.js +4 -2
- package/dist/module/schema-validations.js +1 -1
- package/dist/types/components/checkout/bank-account-form/bank-account-form.d.ts +1 -0
- package/dist/types/components/checkout/card-form/card-form.d.ts +1 -0
- package/dist/types/components/checkout/checkout-core.d.ts +1 -0
- package/dist/types/components/checkout/checkout.d.ts +1 -0
- package/dist/types/components/checkout/new-payment-method.d.ts +1 -0
- package/dist/types/components/checkout/payment-method-options.d.ts +1 -0
- package/dist/types/components/tokenize-payment-method/tokenize-payment-method.d.ts +5 -3
- package/dist/types/components.d.ts +24 -12
- package/dist/types/home/runner/work/web-component-library/web-component-library/packages/webcomponents/.stencil/packages/webcomponents/config.d.ts +1 -0
- package/dist/webcomponents/p-02d36485.entry.js +1 -0
- package/dist/webcomponents/p-1820fd87.entry.js +1 -0
- package/dist/webcomponents/{p-d07c45e6.entry.js → p-1882d7d6.entry.js} +1 -1
- package/dist/webcomponents/{p-e0db920c.entry.js → p-25c9c88c.entry.js} +1 -1
- package/dist/webcomponents/{p-f5925b1e.entry.js → p-2710884e.entry.js} +1 -1
- package/dist/webcomponents/{p-de13f23c.js → p-27c8ffa2.js} +1 -1
- package/dist/webcomponents/{p-865733bc.js → p-35b00a0d.js} +1 -1
- package/dist/webcomponents/{p-c5ce98b0.entry.js → p-39696abd.entry.js} +1 -1
- package/dist/webcomponents/{p-f9728478.entry.js → p-40eabfca.entry.js} +1 -1
- package/dist/webcomponents/p-4810f227.entry.js +1 -0
- package/dist/webcomponents/{p-ed17e472.entry.js → p-485814d8.entry.js} +1 -1
- package/dist/webcomponents/p-4bad3621.js +1 -0
- package/dist/webcomponents/p-57206dc4.entry.js +1 -0
- package/dist/webcomponents/{p-3d5c8a98.entry.js → p-63a8b08f.entry.js} +1 -1
- package/dist/webcomponents/p-67b75e01.entry.js +1 -0
- package/dist/webcomponents/{p-21cf557e.entry.js → p-68bf1a1d.entry.js} +1 -1
- package/dist/webcomponents/{p-a263a3db.entry.js → p-72992c97.entry.js} +1 -1
- package/dist/webcomponents/{p-0277c1b2.js → p-849c68e5.js} +1 -1
- package/dist/webcomponents/{p-2a136295.js → p-933537ca.js} +1 -1
- package/dist/webcomponents/{p-c470a150.js → p-960a8ec2.js} +1 -1
- package/dist/webcomponents/{p-f706d70e.js → p-a2076a0e.js} +1 -1
- package/dist/webcomponents/p-a47c14cb.entry.js +1 -0
- package/dist/webcomponents/p-b01405ab.entry.js +1 -0
- package/dist/webcomponents/{p-c5c03d88.js → p-b0b40bcd.js} +1 -1
- package/dist/webcomponents/p-b15ad5df.js +1 -0
- package/dist/webcomponents/{p-42047b14.entry.js → p-b2209632.entry.js} +1 -1
- package/dist/webcomponents/{p-c845cb7a.js → p-b2edb944.js} +1 -1
- package/dist/webcomponents/{p-9235b94e.entry.js → p-c75481bf.entry.js} +1 -1
- package/dist/webcomponents/{p-cc4adf97.js → p-dd867d1f.js} +1 -1
- package/dist/webcomponents/{p-abb46c6b.entry.js → p-e22df884.entry.js} +1 -1
- package/dist/webcomponents/{p-3c0b56cd.entry.js → p-e8d0f978.entry.js} +1 -1
- package/dist/webcomponents/{p-f9ac523e.entry.js → p-fbe16023.entry.js} +1 -1
- package/dist/webcomponents/p-fdbcd486.js +1 -0
- package/dist/webcomponents/{p-f1e01bab.entry.js → p-ff955a18.entry.js} +1 -1
- package/dist/webcomponents/webcomponents.esm.js +1 -1
- package/package.json +1 -1
- package/dist/webcomponents/p-0ef9eae6.entry.js +0 -1
- package/dist/webcomponents/p-2d801915.js +0 -1
- package/dist/webcomponents/p-56addd0a.entry.js +0 -1
- package/dist/webcomponents/p-631d54a2.entry.js +0 -1
- package/dist/webcomponents/p-6b0bec46.entry.js +0 -1
- package/dist/webcomponents/p-cdb7fa19.entry.js +0 -1
- package/dist/webcomponents/p-ea105de3.js +0 -1
- package/dist/webcomponents/p-ea5cf135.entry.js +0 -1
- package/dist/webcomponents/p-f9d63d9d.js +0 -1
- package/dist/webcomponents/p-fe0d245f.entry.js +0 -1
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
import { h, Host } from "@stencil/core";
|
|
2
2
|
export class CardForm {
|
|
3
|
+
constructor() {
|
|
4
|
+
this.iframeOrigin = undefined;
|
|
5
|
+
}
|
|
3
6
|
async validate() {
|
|
4
7
|
const cardNumberIsValid = await this.cardNumberIframeElement.validate();
|
|
5
8
|
const expirationMonthIsValid = await this.expirationMonthIframeElement.validate();
|
|
@@ -11,9 +14,30 @@ export class CardForm {
|
|
|
11
14
|
return this.cardNumberIframeElement.tokenize(clientId, paymentMethodMetadata, account);
|
|
12
15
|
}
|
|
13
16
|
render() {
|
|
14
|
-
return (h(Host, { key: '
|
|
17
|
+
return (h(Host, { key: '5dfd2c79d7691744614af89d0919e58db17434b3', class: "container-fluid p-0" }, h("div", { key: '307e9a7acd80285a59369e813bb0172627395cf6', class: "mb-3" }, h("iframe-input", { key: '42de95d9e8f6b785e0dfd7a9b79b23e8c1aab4ee', inputId: "cardNumber", ref: (el) => (this.cardNumberIframeElement = el), label: "Card Number", iframeOrigin: `${this.iframeOrigin}/v2/cardNumber` })), h("div", { key: '9ab568a45c652478daa2fdd936cb49258b8bdd18', class: "row" }, h("div", { key: 'ee106aa794d4fb0bbcab36f6daada68740bb4262', class: "col-4 align-content-end" }, h("iframe-input", { key: 'c2edb5592c479763a47d399d4d0428d5468f6be5', inputId: "expirationMonth", ref: (el) => (this.expirationMonthIframeElement = el), label: "Expiration", iframeOrigin: `${this.iframeOrigin}/v2/expirationMonth` })), h("div", { key: 'e9577f47e9d3fea9be62fbbde95dc890091c47e0', class: "col-4 align-content-end" }, h("iframe-input", { key: '2f623e190959ed454c3016637f90f38c531d9062', inputId: "expirationYear", ref: (el) => (this.expirationYearIframeElement = el), label: "", iframeOrigin: `${this.iframeOrigin}/v2/expirationYear` })), h("div", { key: '4522288e5e0f1b41dc89a690830bb78063ea4df0', class: "col-4 align-content-end" }, h("iframe-input", { key: '9036d997bcd4f8c73e63daa3997111803bc99a36', inputId: "CVV", ref: (el) => (this.cvvIframeElement = el), label: "CVV", iframeOrigin: `${this.iframeOrigin}/v2/CVV` })))));
|
|
15
18
|
}
|
|
16
19
|
static get is() { return "card-form"; }
|
|
20
|
+
static get properties() {
|
|
21
|
+
return {
|
|
22
|
+
"iframeOrigin": {
|
|
23
|
+
"type": "string",
|
|
24
|
+
"mutable": false,
|
|
25
|
+
"complexType": {
|
|
26
|
+
"original": "string",
|
|
27
|
+
"resolved": "string",
|
|
28
|
+
"references": {}
|
|
29
|
+
},
|
|
30
|
+
"required": false,
|
|
31
|
+
"optional": false,
|
|
32
|
+
"docs": {
|
|
33
|
+
"tags": [],
|
|
34
|
+
"text": ""
|
|
35
|
+
},
|
|
36
|
+
"attribute": "iframe-origin",
|
|
37
|
+
"reflect": false
|
|
38
|
+
}
|
|
39
|
+
};
|
|
40
|
+
}
|
|
17
41
|
static get methods() {
|
|
18
42
|
return {
|
|
19
43
|
"validate": {
|
|
@@ -31,6 +31,7 @@ export class CheckoutCore {
|
|
|
31
31
|
this.getCheckout = undefined;
|
|
32
32
|
this.complete = undefined;
|
|
33
33
|
this.checkoutId = undefined;
|
|
34
|
+
this.iframeOrigin = undefined;
|
|
34
35
|
this.disableCreditCard = undefined;
|
|
35
36
|
this.disableBankAccount = undefined;
|
|
36
37
|
this.disableBnpl = undefined;
|
|
@@ -116,14 +117,14 @@ export class CheckoutCore {
|
|
|
116
117
|
}
|
|
117
118
|
get paymentType() {
|
|
118
119
|
var _a, _b, _c, _d, _e;
|
|
119
|
-
return (h("section", null, h("div", { class: !this.isLoading && 'visually-hidden' }, h(Skeleton, { height: "300px" })), h("div", { class: this.isLoading && 'visually-hidden' }, h("justifi-payment-method-options", { ref: (el) => (this.paymentMethodOptionsRef = el), "show-card": !this.disableCreditCard, "show-ach": !this.disableBankAccount, "show-bnpl": !this.disableBnpl, paymentMethodGroupId: (_a = this.checkout) === null || _a === void 0 ? void 0 : _a.payment_method_group_id, "show-saved-payment-methods": !this.disablePaymentMethodGroup, hideCardBillingForm: this.hideCardBillingForm, bnpl: (_b = this.checkout) === null || _b === void 0 ? void 0 : _b.bnpl, authToken: this.authToken, "account-id": (_c = this.checkout) === null || _c === void 0 ? void 0 : _c.account_id, savedPaymentMethods: ((_d = this.checkout) === null || _d === void 0 ? void 0 : _d.payment_methods) || [], paymentAmount: (_e = this.checkout) === null || _e === void 0 ? void 0 : _e.payment_amount, insuranceToggled: this.insuranceToggled }))));
|
|
120
|
+
return (h("section", null, h("div", { class: !this.isLoading && 'visually-hidden' }, h(Skeleton, { height: "300px" })), h("div", { class: this.isLoading && 'visually-hidden' }, h("justifi-payment-method-options", { ref: (el) => (this.paymentMethodOptionsRef = el), "show-card": !this.disableCreditCard, "show-ach": !this.disableBankAccount, "show-bnpl": !this.disableBnpl, paymentMethodGroupId: (_a = this.checkout) === null || _a === void 0 ? void 0 : _a.payment_method_group_id, "show-saved-payment-methods": !this.disablePaymentMethodGroup, hideCardBillingForm: this.hideCardBillingForm, bnpl: (_b = this.checkout) === null || _b === void 0 ? void 0 : _b.bnpl, authToken: this.authToken, "account-id": (_c = this.checkout) === null || _c === void 0 ? void 0 : _c.account_id, savedPaymentMethods: ((_d = this.checkout) === null || _d === void 0 ? void 0 : _d.payment_methods) || [], paymentAmount: (_e = this.checkout) === null || _e === void 0 ? void 0 : _e.payment_amount, insuranceToggled: this.insuranceToggled, iframeOrigin: this.iframeOrigin }))));
|
|
120
121
|
}
|
|
121
122
|
get summary() {
|
|
122
123
|
var _a, _b;
|
|
123
124
|
return (h("section", null, h("div", { class: !this.isLoading && 'visually-hidden' }, h(Skeleton, { height: "24px" })), h("div", { class: this.isLoading && 'visually-hidden' }, h("div", { part: text }, (_a = this.checkout) === null || _a === void 0 ? void 0 : _a.payment_description), h("div", null, h("span", { part: text }, "Total"), "\u00A0", h("span", { part: text }, formatCurrency(+((_b = this.checkout) === null || _b === void 0 ? void 0 : _b.total_amount)))))));
|
|
124
125
|
}
|
|
125
126
|
render() {
|
|
126
|
-
return (h(StyledHost, { key: '
|
|
127
|
+
return (h(StyledHost, { key: '8f7bb796cec8a51b3a871ecc6f1d040636103503' }, h("div", { key: 'f616c1705dd8d9da854b496d5b028cebb4c88ce5', class: "row gy-3 jfi-checkout-core" }, h("div", { key: 'e374110371f020c9de996f4ca3932f7535e208ee', class: "col-12", part: checkoutSummary }, h(Header2, { key: 'aa9227b3ff49dc43c6a42d1988ec0669b298cef0', text: "Summary", class: "fs-5 fw-bold pb-3" }), this.summary), h("div", { key: 'e8e9cddcc4cb11c6d7c020c1dc18d7b5bfe457c3', class: "col-12" }, h("slot", { key: '69e623e8c23aec6f49430b395f86d7134ceeddc9', name: "insurance" })), h("div", { key: 'fea072a50acb658433a36d8234b27c1fd8415dc4', class: "col-12 mt-4" }, h(Header2, { key: '9b0a5c9e5e7db31a6d6cfda87cad18786d638bd9', text: "Payment", class: "fs-5 fw-bold pb-3" }), h(Header3, { key: '2eeae1935b2b238573be4bf1edfc5d80700d9c80', text: "Select payment type", class: "fs-6 fw-bold lh-lg" }), h("div", { key: '5c9fd0558a37ff903ec7137beeb3c49d406bcd1d', class: "d-flex flex-column" }, this.paymentType)), h("div", { key: '2538670c227dc2e96c43d878ae09357a72a7e267', class: "col-12" }, h("div", { key: 'b51e39da64972578815a2cf0cf5342d292edaa45', class: "d-flex justify-content-end" }, h(Button, { key: 'abcb099a4ad152a38d05d99781e02292efd246e0', type: "submit", variant: "primary", onClick: (e) => this.submit(e), disabled: this.isLoading, isLoading: this.isLoading, style: { width: '100%' } }, "Pay"))))));
|
|
127
128
|
}
|
|
128
129
|
static get is() { return "justifi-checkout-core"; }
|
|
129
130
|
static get encapsulation() { return "shadow"; }
|
|
@@ -203,6 +204,23 @@ export class CheckoutCore {
|
|
|
203
204
|
"attribute": "checkout-id",
|
|
204
205
|
"reflect": false
|
|
205
206
|
},
|
|
207
|
+
"iframeOrigin": {
|
|
208
|
+
"type": "string",
|
|
209
|
+
"mutable": false,
|
|
210
|
+
"complexType": {
|
|
211
|
+
"original": "string",
|
|
212
|
+
"resolved": "string",
|
|
213
|
+
"references": {}
|
|
214
|
+
},
|
|
215
|
+
"required": false,
|
|
216
|
+
"optional": false,
|
|
217
|
+
"docs": {
|
|
218
|
+
"tags": [],
|
|
219
|
+
"text": ""
|
|
220
|
+
},
|
|
221
|
+
"attribute": "iframe-origin",
|
|
222
|
+
"reflect": false
|
|
223
|
+
},
|
|
206
224
|
"disableCreditCard": {
|
|
207
225
|
"type": "boolean",
|
|
208
226
|
"mutable": false,
|
|
@@ -4,6 +4,7 @@ import { CheckoutService } from "../../api/services/checkout.service";
|
|
|
4
4
|
import { ComponentErrorCodes, ComponentErrorSeverity } from "../../api/ComponentError";
|
|
5
5
|
import JustifiAnalytics from "../../api/Analytics";
|
|
6
6
|
import { checkPkgVersion } from "../../utils/check-pkg-version";
|
|
7
|
+
import { config } from "../../../config";
|
|
7
8
|
export class Checkout {
|
|
8
9
|
constructor() {
|
|
9
10
|
this.authToken = undefined;
|
|
@@ -13,6 +14,7 @@ export class Checkout {
|
|
|
13
14
|
this.disableBnpl = undefined;
|
|
14
15
|
this.disablePaymentMethodGroup = undefined;
|
|
15
16
|
this.hideCardBillingForm = undefined;
|
|
17
|
+
this.iframeOrigin = config.iFrameOrigin;
|
|
16
18
|
this.getCheckout = undefined;
|
|
17
19
|
this.complete = undefined;
|
|
18
20
|
this.errorMessage = '';
|
|
@@ -53,11 +55,11 @@ export class Checkout {
|
|
|
53
55
|
this.checkoutCoreRef.fillBillingForm(fields);
|
|
54
56
|
}
|
|
55
57
|
render() {
|
|
56
|
-
return (h("justifi-checkout-core", { key: '
|
|
58
|
+
return (h("justifi-checkout-core", { key: '911e807dc0be670c6bfe59e497cacd5399481981', getCheckout: this.getCheckout, authToken: this.authToken, complete: this.complete, disableCreditCard: this.disableCreditCard, disableBankAccount: this.disableBankAccount, disableBnpl: this.disableBnpl, disablePaymentMethodGroup: this.disablePaymentMethodGroup, hideCardBillingForm: this.hideCardBillingForm, iframeOrigin: this.iframeOrigin, ref: el => {
|
|
57
59
|
if (el) {
|
|
58
60
|
this.checkoutCoreRef = el;
|
|
59
61
|
}
|
|
60
|
-
} }, h("div", { key: '
|
|
62
|
+
} }, h("div", { key: '29bcfd776e4dac5a7686a03488d0f8dad2d01a03', slot: "insurance" }, h("slot", { key: '993b8872e8a40dd5111ccaeb586686a396eab2ff', name: "insurance" }))));
|
|
61
63
|
}
|
|
62
64
|
static get is() { return "justifi-checkout"; }
|
|
63
65
|
static get properties() {
|
|
@@ -180,6 +182,24 @@ export class Checkout {
|
|
|
180
182
|
},
|
|
181
183
|
"attribute": "hide-card-billing-form",
|
|
182
184
|
"reflect": false
|
|
185
|
+
},
|
|
186
|
+
"iframeOrigin": {
|
|
187
|
+
"type": "string",
|
|
188
|
+
"mutable": false,
|
|
189
|
+
"complexType": {
|
|
190
|
+
"original": "string",
|
|
191
|
+
"resolved": "string",
|
|
192
|
+
"references": {}
|
|
193
|
+
},
|
|
194
|
+
"required": false,
|
|
195
|
+
"optional": true,
|
|
196
|
+
"docs": {
|
|
197
|
+
"tags": [],
|
|
198
|
+
"text": ""
|
|
199
|
+
},
|
|
200
|
+
"attribute": "iframe-origin",
|
|
201
|
+
"reflect": false,
|
|
202
|
+
"defaultValue": "config.iFrameOrigin"
|
|
183
203
|
}
|
|
184
204
|
};
|
|
185
205
|
}
|
|
@@ -16,6 +16,7 @@ export class NewPaymentMethod {
|
|
|
16
16
|
this.paymentMethodGroupId = undefined;
|
|
17
17
|
this.isSelected = undefined;
|
|
18
18
|
this.hideCardBillingForm = undefined;
|
|
19
|
+
this.iframeOrigin = undefined;
|
|
19
20
|
this.saveNewPaymentMethodChecked = false;
|
|
20
21
|
}
|
|
21
22
|
handleCheckboxChanged(event) {
|
|
@@ -75,11 +76,11 @@ export class NewPaymentMethod {
|
|
|
75
76
|
showNewPaymentMethodForm() {
|
|
76
77
|
var _a;
|
|
77
78
|
const paymentMethodType = (_a = this.paymentMethodOption) === null || _a === void 0 ? void 0 : _a.id;
|
|
78
|
-
return (h("div", { class: "mt-4 pb-4
|
|
79
|
+
return (h("div", { class: "mt-4 pb-4" }, h("hidden-input", null), h("div", { class: "mb-4" }, paymentMethodType === 'card' ? (h("card-form", { ref: (el) => this.paymentMethodFormRef = el, iframeOrigin: this.iframeOrigin })) : (h("bank-account-form", { ref: (el) => this.paymentMethodFormRef = el, iframeOrigin: this.iframeOrigin }))), h("justifi-billing-form-wrapper", { ref: (el) => (this.billingFormWrapperRef = el), hideCardBillingForm: this.hideCardBillingForm, paymentMethodType: paymentMethodType }), h("justifi-save-new-payment-method", { hidden: !this.paymentMethodGroupId })));
|
|
79
80
|
}
|
|
80
81
|
render() {
|
|
81
82
|
var _a, _b;
|
|
82
|
-
return (h(Host, { key: '
|
|
83
|
+
return (h(Host, { key: '17b922ca3b03d458a0e139be895db31b33c255ed', class: "payment-method" }, h("div", { key: '5d1bb3a05e7fc0516d29ade315f13c2f64d3afaf', class: "radio-list-item p-3", part: radioListItem, onClick: this.onPaymentMethodOptionClick }, h("form-control-radio", { key: '165fd1b54a6d387be307f05ab67078e0d703f0b1', name: "paymentMethodType", value: (_a = this.paymentMethodOption) === null || _a === void 0 ? void 0 : _a.id, checked: this.isSelected, label: PaymentMethodTypeLabels[(_b = this.paymentMethodOption) === null || _b === void 0 ? void 0 : _b.id] })), this.isSelected ? this.showNewPaymentMethodForm() : null));
|
|
83
84
|
}
|
|
84
85
|
static get is() { return "justifi-new-payment-method"; }
|
|
85
86
|
static get properties() {
|
|
@@ -189,6 +190,23 @@ export class NewPaymentMethod {
|
|
|
189
190
|
},
|
|
190
191
|
"attribute": "hide-card-billing-form",
|
|
191
192
|
"reflect": false
|
|
193
|
+
},
|
|
194
|
+
"iframeOrigin": {
|
|
195
|
+
"type": "string",
|
|
196
|
+
"mutable": false,
|
|
197
|
+
"complexType": {
|
|
198
|
+
"original": "string",
|
|
199
|
+
"resolved": "string",
|
|
200
|
+
"references": {}
|
|
201
|
+
},
|
|
202
|
+
"required": false,
|
|
203
|
+
"optional": false,
|
|
204
|
+
"docs": {
|
|
205
|
+
"tags": [],
|
|
206
|
+
"text": ""
|
|
207
|
+
},
|
|
208
|
+
"attribute": "iframe-origin",
|
|
209
|
+
"reflect": false
|
|
192
210
|
}
|
|
193
211
|
};
|
|
194
212
|
}
|
|
@@ -15,6 +15,7 @@ export class PaymentMethodOptions {
|
|
|
15
15
|
this.savedPaymentMethods = [];
|
|
16
16
|
this.paymentAmount = undefined;
|
|
17
17
|
this.hideCardBillingForm = undefined;
|
|
18
|
+
this.iframeOrigin = undefined;
|
|
18
19
|
this.selectedPaymentMethodId = undefined;
|
|
19
20
|
this.paymentMethodOptions = [];
|
|
20
21
|
}
|
|
@@ -58,13 +59,13 @@ export class PaymentMethodOptions {
|
|
|
58
59
|
}
|
|
59
60
|
render() {
|
|
60
61
|
var _a;
|
|
61
|
-
return (h(Host, { key: '
|
|
62
|
+
return (h(Host, { key: '24e7d418958eb61f9582317e615502e77b4090d0' }, (_a = this.paymentMethodOptions) === null || _a === void 0 ? void 0 : _a.map((paymentMethodOption) => {
|
|
62
63
|
const newCard = paymentMethodOption.id === PaymentMethodTypes.card;
|
|
63
64
|
const newBankAccount = paymentMethodOption.id === PaymentMethodTypes.bankAccount;
|
|
64
65
|
const isSelected = this.selectedPaymentMethodId === paymentMethodOption.id;
|
|
65
66
|
const sezzle = paymentMethodOption.id === PaymentMethodTypes.sezzle;
|
|
66
67
|
if (newCard || newBankAccount) {
|
|
67
|
-
return (h("justifi-new-payment-method", { paymentMethodOption: paymentMethodOption, authToken: this.authToken, "account-id": this.accountId, "is-selected": isSelected, paymentMethodGroupId: this.paymentMethodGroupId, hideCardBillingForm: this.hideCardBillingForm, ref: (el) => {
|
|
68
|
+
return (h("justifi-new-payment-method", { paymentMethodOption: paymentMethodOption, authToken: this.authToken, "account-id": this.accountId, "is-selected": isSelected, paymentMethodGroupId: this.paymentMethodGroupId, hideCardBillingForm: this.hideCardBillingForm, iframeOrigin: this.iframeOrigin, ref: (el) => {
|
|
68
69
|
if (isSelected) {
|
|
69
70
|
this.selectedPaymentMethodOptionRef = el;
|
|
70
71
|
}
|
|
@@ -295,6 +296,23 @@ export class PaymentMethodOptions {
|
|
|
295
296
|
},
|
|
296
297
|
"attribute": "hide-card-billing-form",
|
|
297
298
|
"reflect": false
|
|
299
|
+
},
|
|
300
|
+
"iframeOrigin": {
|
|
301
|
+
"type": "string",
|
|
302
|
+
"mutable": false,
|
|
303
|
+
"complexType": {
|
|
304
|
+
"original": "string",
|
|
305
|
+
"resolved": "string",
|
|
306
|
+
"references": {}
|
|
307
|
+
},
|
|
308
|
+
"required": false,
|
|
309
|
+
"optional": false,
|
|
310
|
+
"docs": {
|
|
311
|
+
"tags": [],
|
|
312
|
+
"text": ""
|
|
313
|
+
},
|
|
314
|
+
"attribute": "iframe-origin",
|
|
315
|
+
"reflect": false
|
|
298
316
|
}
|
|
299
317
|
};
|
|
300
318
|
}
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { h } from "@stencil/core";
|
|
2
2
|
import { Button, StyledHost } from "../../ui-components";
|
|
3
|
-
import { ComponentErrorCodes, ComponentErrorSeverity } from "../../api/ComponentError";
|
|
4
3
|
import { checkPkgVersion } from "../../utils/check-pkg-version";
|
|
5
4
|
import JustifiAnalytics from "../../api/Analytics";
|
|
5
|
+
import { config } from "../../../config";
|
|
6
|
+
import { ComponentErrorCodes, ComponentErrorSeverity } from "../../api";
|
|
6
7
|
export class TokenizePaymentMethod {
|
|
7
8
|
constructor() {
|
|
8
9
|
this.authToken = undefined;
|
|
@@ -13,6 +14,7 @@ export class TokenizePaymentMethod {
|
|
|
13
14
|
this.disableBankAccount = undefined;
|
|
14
15
|
this.hideSubmitButton = undefined;
|
|
15
16
|
this.hideCardBillingForm = undefined;
|
|
17
|
+
this.iframeOrigin = config.iFrameOrigin;
|
|
16
18
|
this.isLoading = false;
|
|
17
19
|
}
|
|
18
20
|
componentWillLoad() {
|
|
@@ -22,8 +24,9 @@ export class TokenizePaymentMethod {
|
|
|
22
24
|
async tokenizePaymentMethod(event) {
|
|
23
25
|
event && event.preventDefault();
|
|
24
26
|
this.isLoading = true;
|
|
27
|
+
let tokenizeResponse;
|
|
25
28
|
try {
|
|
26
|
-
|
|
29
|
+
tokenizeResponse = await this.paymentMethodOptionsRef.resolvePaymentMethod({ isValid: true });
|
|
27
30
|
if (tokenizeResponse.error) {
|
|
28
31
|
this.errorEvent.emit({
|
|
29
32
|
errorCode: tokenizeResponse.error.code,
|
|
@@ -31,26 +34,26 @@ export class TokenizePaymentMethod {
|
|
|
31
34
|
severity: ComponentErrorSeverity.ERROR,
|
|
32
35
|
});
|
|
33
36
|
}
|
|
34
|
-
else if (tokenizeResponse.token) {
|
|
35
|
-
this.submitEvent.emit({ response: tokenizeResponse });
|
|
36
|
-
}
|
|
37
37
|
}
|
|
38
38
|
catch (error) {
|
|
39
|
-
|
|
39
|
+
const errorData = {
|
|
40
40
|
errorCode: ComponentErrorCodes.TOKENIZE_ERROR,
|
|
41
41
|
message: error.message,
|
|
42
42
|
severity: ComponentErrorSeverity.ERROR,
|
|
43
|
-
}
|
|
43
|
+
};
|
|
44
|
+
this.errorEvent.emit(errorData);
|
|
44
45
|
}
|
|
45
46
|
finally {
|
|
47
|
+
this.submitEvent.emit({ response: tokenizeResponse });
|
|
46
48
|
this.isLoading = false;
|
|
49
|
+
return tokenizeResponse;
|
|
47
50
|
}
|
|
48
51
|
}
|
|
49
52
|
async fillBillingForm(fields) {
|
|
50
53
|
this.paymentMethodOptionsRef.fillBillingForm(fields);
|
|
51
54
|
}
|
|
52
55
|
render() {
|
|
53
|
-
return (h(StyledHost, { key: '
|
|
56
|
+
return (h(StyledHost, { key: 'f0efb2ab8f051b0b5dafcb608c9c1b561f6f21bc' }, h("form", { key: 'b511a1af4e15175d7bec45c66dc030e693820563' }, h("fieldset", { key: '53b78e28371b6ed69140774b6b47afcee3cb7edd' }, h("div", { key: 'e37c7cb04912fac8bf24bae88cfd06fb00d22325', class: "row gy-3" }, h("div", { key: '103ef1da7228ab3d74065ca64ea070e1520799ff', class: "col-12" }, h("justifi-payment-method-options", { key: '58d614390f0dce90d1ca85b88ce888b841457753', ref: (el) => (this.paymentMethodOptionsRef = el), "show-card": !this.disableCreditCard, "show-ach": !this.disableBankAccount, "show-bnpl": false, paymentMethodGroupId: this.paymentMethodGroupId, "show-saved-payment-methods": false, hideCardBillingForm: this.hideCardBillingForm, authToken: this.authToken, "account-id": this.accountId, iframeOrigin: this.iframeOrigin })), h("div", { key: '727317ff2fafaace929f6667934a649994fe037d', class: "col-12" }, h(Button, { key: '999ec3e29e37ce5027f6d1c4d75bae31beba6ab1', variant: "primary", type: "submit", onClick: event => this.tokenizePaymentMethod(event), isLoading: this.isLoading, "data-testid": "submit-button", hidden: this.hideSubmitButton }, this.submitButtonText || 'Submit')))))));
|
|
54
57
|
}
|
|
55
58
|
static get is() { return "justifi-tokenize-payment-method"; }
|
|
56
59
|
static get encapsulation() { return "shadow"; }
|
|
@@ -191,6 +194,24 @@ export class TokenizePaymentMethod {
|
|
|
191
194
|
},
|
|
192
195
|
"attribute": "hide-card-billing-form",
|
|
193
196
|
"reflect": false
|
|
197
|
+
},
|
|
198
|
+
"iframeOrigin": {
|
|
199
|
+
"type": "string",
|
|
200
|
+
"mutable": false,
|
|
201
|
+
"complexType": {
|
|
202
|
+
"original": "string",
|
|
203
|
+
"resolved": "string",
|
|
204
|
+
"references": {}
|
|
205
|
+
},
|
|
206
|
+
"required": false,
|
|
207
|
+
"optional": true,
|
|
208
|
+
"docs": {
|
|
209
|
+
"tags": [],
|
|
210
|
+
"text": ""
|
|
211
|
+
},
|
|
212
|
+
"attribute": "iframe-origin",
|
|
213
|
+
"reflect": false,
|
|
214
|
+
"defaultValue": "config.iFrameOrigin"
|
|
194
215
|
}
|
|
195
216
|
};
|
|
196
217
|
}
|
|
@@ -216,8 +237,8 @@ export class TokenizePaymentMethod {
|
|
|
216
237
|
"references": {
|
|
217
238
|
"ComponentErrorEvent": {
|
|
218
239
|
"location": "import",
|
|
219
|
-
"path": "../../api
|
|
220
|
-
"id": "src/api/
|
|
240
|
+
"path": "../../api",
|
|
241
|
+
"id": "src/api/index.ts::ComponentErrorEvent"
|
|
221
242
|
}
|
|
222
243
|
}
|
|
223
244
|
}
|
|
@@ -237,8 +258,8 @@ export class TokenizePaymentMethod {
|
|
|
237
258
|
"references": {
|
|
238
259
|
"ComponentSubmitEvent": {
|
|
239
260
|
"location": "import",
|
|
240
|
-
"path": "../../api
|
|
241
|
-
"id": "src/api/
|
|
261
|
+
"path": "../../api",
|
|
262
|
+
"id": "src/api/index.ts::ComponentSubmitEvent"
|
|
242
263
|
}
|
|
243
264
|
}
|
|
244
265
|
}
|
|
@@ -248,7 +269,7 @@ export class TokenizePaymentMethod {
|
|
|
248
269
|
return {
|
|
249
270
|
"tokenizePaymentMethod": {
|
|
250
271
|
"complexType": {
|
|
251
|
-
"signature": "(event?: CustomEvent) => Promise<
|
|
272
|
+
"signature": "(event?: CustomEvent) => Promise<PaymentMethodPayload>",
|
|
252
273
|
"parameters": [{
|
|
253
274
|
"name": "event",
|
|
254
275
|
"type": "CustomEvent<any>",
|
|
@@ -259,17 +280,22 @@ export class TokenizePaymentMethod {
|
|
|
259
280
|
"location": "global",
|
|
260
281
|
"id": "global::Promise"
|
|
261
282
|
},
|
|
283
|
+
"PaymentMethodPayload": {
|
|
284
|
+
"location": "import",
|
|
285
|
+
"path": "../checkout/payment-method-payload",
|
|
286
|
+
"id": "src/components/checkout/payment-method-payload.ts::PaymentMethodPayload"
|
|
287
|
+
},
|
|
262
288
|
"CustomEvent": {
|
|
263
289
|
"location": "global",
|
|
264
290
|
"id": "global::CustomEvent"
|
|
265
291
|
},
|
|
266
292
|
"ComponentErrorCodes": {
|
|
267
293
|
"location": "import",
|
|
268
|
-
"path": "../../api
|
|
269
|
-
"id": "src/api/
|
|
294
|
+
"path": "../../api",
|
|
295
|
+
"id": "src/api/index.ts::ComponentErrorCodes"
|
|
270
296
|
}
|
|
271
297
|
},
|
|
272
|
-
"return": "Promise<
|
|
298
|
+
"return": "Promise<PaymentMethodPayload>"
|
|
273
299
|
},
|
|
274
300
|
"docs": {
|
|
275
301
|
"text": "",
|
|
@@ -291,8 +317,8 @@ export class TokenizePaymentMethod {
|
|
|
291
317
|
},
|
|
292
318
|
"BillingFormFields": {
|
|
293
319
|
"location": "import",
|
|
294
|
-
"path": "
|
|
295
|
-
"id": "src/components.
|
|
320
|
+
"path": "../billing-forms/billing-form-schema",
|
|
321
|
+
"id": "src/components/billing-forms/billing-form-schema.ts::BillingFormFields"
|
|
296
322
|
}
|
|
297
323
|
},
|
|
298
324
|
"return": "Promise<void>"
|
package/dist/config.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
export const config = {
|
|
2
2
|
proxyApiOrigin: PROXY_API_ORIGIN,
|
|
3
|
+
iFrameOrigin: IFRAME_ORIGIN,
|
|
3
4
|
proxyAuthToken: 'eyJraWQiOiJqdXN0aWZpLWUyNDgyMmU3ODE1MmEzZjRkMjU1IiwidHlwIjoiSldUIiwiYWxnIjoiUlMyNTYifQ.eyJpc3MiOiJodHRwczovL2F1dGguanVzdGlmaS5haS8iLCJhenAiOiJvYXNfMmlsWHBqOHQ2WVlEQ0xWU0FiVFczMiIsInN1YiI6Im9hc18yaWxYcGo4dDZZWURDTFZTQWJUVzMyQHNlc3Npb25zIiwiYXVkIjoiaHR0cHM6Ly9hcGkuanVzdGlmaS5haS92MSIsImd0eSI6ImNsaWVudC1jcmVkZW50aWFscyIsInBlcm1pc3Npb25zIjpbeyJyb2xlIjoicmVhZDphY2NvdW50IiwicmVzb3VyY2VfaWQiOiJhY2NfNUV0OWlYclNTQVpSMktTb3VRR0FXaSJ9LHsicm9sZSI6InJlYWQ6YnVzaW5lc3MiLCJyZXNvdXJjZV9pZCI6ImJpel8zYmg2OWJxMXJrM2RtWE5vQUtWb251In1dLCJleHAiOjE3MTE1NTk0MTQsImlhdCI6MTcwMzc4MzQxNCwicGxhdGZvcm1fYWNjb3VudF9pZCI6ImFjY18zcmVOYjRhTll5MmlXRFpRVmN6bXg0In0.oPOoDYxzrnpE8PRUaz-FCU4KqnSuNbFTeDkl3AtMscjUkIctP1OIFh-ZGBjbH5eVH5noXCbaiin0j92dS7jx4gLpxuYT2Q8gpZbuIsT7fa58elvGeRkUUJ-AC5ueZxlv90yPWMm0OIbyrV7XZhuwYyKbV-ZczEbl2JpvBMe40CM-LdClQV66d_-Kw9a23SabBVfYgP5V-5OsagOIESvzZoO-27tGlNkV2a-hxqddDCOZv0HvRYAtp5S7EQrmRdEBu5gCNbf1eRFG424hxZUFVr2LdetYuKQLxJjDdUjf86ZwEUecrEaDSupiN1VC3CitdOwBVf6-R_N0VpN4VLVD5g',
|
|
4
5
|
exampleAccountId: 'acc_5Et9iXrSSAZR2KSouQGAWi',
|
|
5
6
|
exampleBusinessId: 'biz_3bh69bq1rk3dmXNoAKVonu',
|