@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.
Files changed (147) hide show
  1. package/dist/cjs/{Api-b0e4be29.js → Api-089e7501.js} +1 -0
  2. package/dist/cjs/bank-account-form_9.cjs.entry.js +10 -6
  3. package/dist/cjs/billing-form_3.cjs.entry.js +2 -2
  4. package/dist/cjs/{business-additional-questions-schema-2f66f025.js → business-additional-questions-schema-2cc0c6f7.js} +1 -1
  5. package/dist/cjs/{business-identity-schema-be495474.js → business-identity-schema-7d462eb3.js} +1 -1
  6. package/dist/cjs/{business.service-d575b515.js → business.service-33d7c7f2.js} +1 -1
  7. package/dist/cjs/{check-pkg-version-1658df6f.js → check-pkg-version-fe4c6467.js} +2 -2
  8. package/dist/cjs/{checkout.service-057b5a7a.js → checkout.service-d9047ddb.js} +1 -1
  9. package/dist/cjs/{dispute.service-df9e1830.js → dispute.service-739631c7.js} +1 -1
  10. package/dist/cjs/{get-payout-csv-527a238c.js → get-payout-csv-bdaff21b.js} +1 -1
  11. package/dist/cjs/{get-subaccounts-6068c1aa.js → get-subaccounts-2db9fc01.js} +1 -1
  12. package/dist/cjs/justifi-additional-questions-form-step-core_6.cjs.entry.js +3 -3
  13. package/dist/cjs/justifi-additional-questions-form-step_9.cjs.entry.js +2 -2
  14. package/dist/cjs/justifi-business-details.cjs.entry.js +4 -4
  15. package/dist/cjs/justifi-business-form.cjs.entry.js +6 -6
  16. package/dist/cjs/justifi-checkout-core.cjs.entry.js +3 -2
  17. package/dist/cjs/justifi-checkout.cjs.entry.js +7 -6
  18. package/dist/cjs/justifi-checkouts-list.cjs.entry.js +5 -5
  19. package/dist/cjs/justifi-dispute-management.cjs.entry.js +4 -4
  20. package/dist/cjs/justifi-dispute-notification_3.cjs.entry.js +4 -4
  21. package/dist/cjs/justifi-gross-payment-chart.cjs.entry.js +3 -3
  22. package/dist/cjs/justifi-owner-form_3.cjs.entry.js +4 -4
  23. package/dist/cjs/justifi-payment-details.cjs.entry.js +4 -4
  24. package/dist/cjs/justifi-payment-provisioning.cjs.entry.js +4 -4
  25. package/dist/cjs/justifi-payments-list.cjs.entry.js +4 -4
  26. package/dist/cjs/justifi-payout-details.cjs.entry.js +4 -4
  27. package/dist/cjs/justifi-payouts-list.cjs.entry.js +5 -5
  28. package/dist/cjs/justifi-refund-form.cjs.entry.js +1 -1
  29. package/dist/cjs/justifi-season-interruption-insurance.cjs.entry.js +3 -3
  30. package/dist/cjs/justifi-terminals-list.cjs.entry.js +4 -4
  31. package/dist/cjs/justifi-tokenize-payment-method.cjs.entry.js +19 -10
  32. package/dist/cjs/loader.cjs.js +1 -1
  33. package/dist/cjs/{package-06419e54.js → package-8b04bef0.js} +1 -1
  34. package/dist/cjs/{payment.service-3eebfe3e.js → payment.service-87924c1a.js} +1 -1
  35. package/dist/cjs/{schema-validations-cc4e6071.js → schema-validations-f948158d.js} +1 -1
  36. package/dist/cjs/webcomponents.cjs.js +1 -1
  37. package/dist/collection/components/business-forms/schemas/schema-validations.js +1 -1
  38. package/dist/collection/components/checkout/bank-account-form/bank-account-form.js +25 -1
  39. package/dist/collection/components/checkout/card-form/card-form.js +25 -1
  40. package/dist/collection/components/checkout/checkout-core.js +20 -2
  41. package/dist/collection/components/checkout/checkout.js +22 -2
  42. package/dist/collection/components/checkout/new-payment-method.js +20 -2
  43. package/dist/collection/components/checkout/payment-method-options.js +20 -2
  44. package/dist/collection/components/tokenize-payment-method/tokenize-payment-method.js +44 -18
  45. package/dist/config.js +1 -0
  46. package/dist/docs.json +176 -20
  47. package/dist/esm/{Api-0cac5b8a.js → Api-97801a4b.js} +1 -0
  48. package/dist/esm/bank-account-form_9.entry.js +10 -6
  49. package/dist/esm/billing-form_3.entry.js +2 -2
  50. package/dist/esm/{business-additional-questions-schema-212a96ed.js → business-additional-questions-schema-60e9b76a.js} +1 -1
  51. package/dist/esm/{business-identity-schema-05bd2a5f.js → business-identity-schema-191d85c2.js} +1 -1
  52. package/dist/esm/{business.service-6a208f8f.js → business.service-45c7df3c.js} +1 -1
  53. package/dist/esm/{check-pkg-version-bac7eb5e.js → check-pkg-version-e2273f4f.js} +2 -2
  54. package/dist/esm/{checkout.service-ac067baa.js → checkout.service-36e3355e.js} +1 -1
  55. package/dist/esm/{dispute.service-26a788a8.js → dispute.service-9b9b87e5.js} +1 -1
  56. package/dist/esm/{get-payout-csv-684fece6.js → get-payout-csv-80210301.js} +1 -1
  57. package/dist/esm/{get-subaccounts-b1bed757.js → get-subaccounts-d3eeb85d.js} +1 -1
  58. package/dist/esm/justifi-additional-questions-form-step-core_6.entry.js +3 -3
  59. package/dist/esm/justifi-additional-questions-form-step_9.entry.js +2 -2
  60. package/dist/esm/justifi-business-details.entry.js +4 -4
  61. package/dist/esm/justifi-business-form.entry.js +6 -6
  62. package/dist/esm/justifi-checkout-core.entry.js +3 -2
  63. package/dist/esm/justifi-checkout.entry.js +7 -6
  64. package/dist/esm/justifi-checkouts-list.entry.js +5 -5
  65. package/dist/esm/justifi-dispute-management.entry.js +4 -4
  66. package/dist/esm/justifi-dispute-notification_3.entry.js +4 -4
  67. package/dist/esm/justifi-gross-payment-chart.entry.js +3 -3
  68. package/dist/esm/justifi-owner-form_3.entry.js +4 -4
  69. package/dist/esm/justifi-payment-details.entry.js +4 -4
  70. package/dist/esm/justifi-payment-provisioning.entry.js +4 -4
  71. package/dist/esm/justifi-payments-list.entry.js +4 -4
  72. package/dist/esm/justifi-payout-details.entry.js +4 -4
  73. package/dist/esm/justifi-payouts-list.entry.js +5 -5
  74. package/dist/esm/justifi-refund-form.entry.js +1 -1
  75. package/dist/esm/justifi-season-interruption-insurance.entry.js +3 -3
  76. package/dist/esm/justifi-terminals-list.entry.js +4 -4
  77. package/dist/esm/justifi-tokenize-payment-method.entry.js +19 -10
  78. package/dist/esm/loader.js +1 -1
  79. package/dist/esm/{package-90ebd343.js → package-a8e8f775.js} +1 -1
  80. package/dist/esm/{payment.service-2e418da1.js → payment.service-c847c1f6.js} +1 -1
  81. package/dist/esm/{schema-validations-ccea6a06.js → schema-validations-38e8bc7b.js} +1 -1
  82. package/dist/esm/webcomponents.js +1 -1
  83. package/dist/module/bank-account-form2.js +3 -1
  84. package/dist/module/card-form2.js +3 -1
  85. package/dist/module/checkout-core.js +4 -2
  86. package/dist/module/config.js +1 -0
  87. package/dist/module/justifi-checkout.js +5 -2
  88. package/dist/module/justifi-tokenize-payment-method.js +17 -8
  89. package/dist/module/new-payment-method.js +4 -2
  90. package/dist/module/package.js +1 -1
  91. package/dist/module/payment-method-options.js +4 -2
  92. package/dist/module/schema-validations.js +1 -1
  93. package/dist/types/components/checkout/bank-account-form/bank-account-form.d.ts +1 -0
  94. package/dist/types/components/checkout/card-form/card-form.d.ts +1 -0
  95. package/dist/types/components/checkout/checkout-core.d.ts +1 -0
  96. package/dist/types/components/checkout/checkout.d.ts +1 -0
  97. package/dist/types/components/checkout/new-payment-method.d.ts +1 -0
  98. package/dist/types/components/checkout/payment-method-options.d.ts +1 -0
  99. package/dist/types/components/tokenize-payment-method/tokenize-payment-method.d.ts +5 -3
  100. package/dist/types/components.d.ts +24 -12
  101. package/dist/types/home/runner/work/web-component-library/web-component-library/packages/webcomponents/.stencil/packages/webcomponents/config.d.ts +1 -0
  102. package/dist/webcomponents/p-02d36485.entry.js +1 -0
  103. package/dist/webcomponents/p-1820fd87.entry.js +1 -0
  104. package/dist/webcomponents/{p-d07c45e6.entry.js → p-1882d7d6.entry.js} +1 -1
  105. package/dist/webcomponents/{p-e0db920c.entry.js → p-25c9c88c.entry.js} +1 -1
  106. package/dist/webcomponents/{p-f5925b1e.entry.js → p-2710884e.entry.js} +1 -1
  107. package/dist/webcomponents/{p-de13f23c.js → p-27c8ffa2.js} +1 -1
  108. package/dist/webcomponents/{p-865733bc.js → p-35b00a0d.js} +1 -1
  109. package/dist/webcomponents/{p-c5ce98b0.entry.js → p-39696abd.entry.js} +1 -1
  110. package/dist/webcomponents/{p-f9728478.entry.js → p-40eabfca.entry.js} +1 -1
  111. package/dist/webcomponents/p-4810f227.entry.js +1 -0
  112. package/dist/webcomponents/{p-ed17e472.entry.js → p-485814d8.entry.js} +1 -1
  113. package/dist/webcomponents/p-4bad3621.js +1 -0
  114. package/dist/webcomponents/p-57206dc4.entry.js +1 -0
  115. package/dist/webcomponents/{p-3d5c8a98.entry.js → p-63a8b08f.entry.js} +1 -1
  116. package/dist/webcomponents/p-67b75e01.entry.js +1 -0
  117. package/dist/webcomponents/{p-21cf557e.entry.js → p-68bf1a1d.entry.js} +1 -1
  118. package/dist/webcomponents/{p-a263a3db.entry.js → p-72992c97.entry.js} +1 -1
  119. package/dist/webcomponents/{p-0277c1b2.js → p-849c68e5.js} +1 -1
  120. package/dist/webcomponents/{p-2a136295.js → p-933537ca.js} +1 -1
  121. package/dist/webcomponents/{p-c470a150.js → p-960a8ec2.js} +1 -1
  122. package/dist/webcomponents/{p-f706d70e.js → p-a2076a0e.js} +1 -1
  123. package/dist/webcomponents/p-a47c14cb.entry.js +1 -0
  124. package/dist/webcomponents/p-b01405ab.entry.js +1 -0
  125. package/dist/webcomponents/{p-c5c03d88.js → p-b0b40bcd.js} +1 -1
  126. package/dist/webcomponents/p-b15ad5df.js +1 -0
  127. package/dist/webcomponents/{p-42047b14.entry.js → p-b2209632.entry.js} +1 -1
  128. package/dist/webcomponents/{p-c845cb7a.js → p-b2edb944.js} +1 -1
  129. package/dist/webcomponents/{p-9235b94e.entry.js → p-c75481bf.entry.js} +1 -1
  130. package/dist/webcomponents/{p-cc4adf97.js → p-dd867d1f.js} +1 -1
  131. package/dist/webcomponents/{p-abb46c6b.entry.js → p-e22df884.entry.js} +1 -1
  132. package/dist/webcomponents/{p-3c0b56cd.entry.js → p-e8d0f978.entry.js} +1 -1
  133. package/dist/webcomponents/{p-f9ac523e.entry.js → p-fbe16023.entry.js} +1 -1
  134. package/dist/webcomponents/p-fdbcd486.js +1 -0
  135. package/dist/webcomponents/{p-f1e01bab.entry.js → p-ff955a18.entry.js} +1 -1
  136. package/dist/webcomponents/webcomponents.esm.js +1 -1
  137. package/package.json +1 -1
  138. package/dist/webcomponents/p-0ef9eae6.entry.js +0 -1
  139. package/dist/webcomponents/p-2d801915.js +0 -1
  140. package/dist/webcomponents/p-56addd0a.entry.js +0 -1
  141. package/dist/webcomponents/p-631d54a2.entry.js +0 -1
  142. package/dist/webcomponents/p-6b0bec46.entry.js +0 -1
  143. package/dist/webcomponents/p-cdb7fa19.entry.js +0 -1
  144. package/dist/webcomponents/p-ea105de3.js +0 -1
  145. package/dist/webcomponents/p-ea5cf135.entry.js +0 -1
  146. package/dist/webcomponents/p-f9d63d9d.js +0 -1
  147. 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: '279551d81ed11cde65d51e28d9dc9be9d5f0d422', class: "container-fluid p-0" }, h("div", { key: '2ab4164df7fd258243a89b02fe4a634069f31670', class: "mb-3" }, h("iframe-input", { key: '0baf4772d66bc228ef0259487c5b7be67321ebf1', inputId: "cardNumber", ref: (el) => (this.cardNumberIframeElement = el), label: "Card Number", iframeOrigin: `${IFRAME_ORIGIN}/cardNumber` })), h("div", { key: 'ba458f877d837bd8c3302f9888e3ddfba58c2024', class: "row" }, h("div", { key: '960975abed4e4db2ed5428e81bd0771b7f18aca7', class: "col-4 align-content-end" }, h("iframe-input", { key: 'b609e584b00cced44db0cb44cb8436f3daa18a2e', inputId: "expirationMonth", ref: (el) => (this.expirationMonthIframeElement = el), label: "Expiration", iframeOrigin: `${IFRAME_ORIGIN}/expirationMonth` })), h("div", { key: '42725f5223920f9185a384f88ba17ca1e3215b30', class: "col-4 align-content-end" }, h("iframe-input", { key: '9c2c8410b3344dc44b4538881965f6b9e1a0b6c9', inputId: "expirationYear", ref: (el) => (this.expirationYearIframeElement = el), label: "", iframeOrigin: `${IFRAME_ORIGIN}/expirationYear` })), h("div", { key: 'f4c3a801b0f3088b0cee30914d6088d0b140b637', class: "col-4 align-content-end" }, h("iframe-input", { key: '7bb5ebec54d900539f2bfdb85537c6d3185d3419', inputId: "CVV", ref: (el) => (this.cvvIframeElement = el), label: "CVV", iframeOrigin: `${IFRAME_ORIGIN}/CVV` })))));
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: 'a3da58e301dbb938bad9785ef93deb58c9f8bc1c' }, h("div", { key: '1e27568848b163443823e475f60f024e0574d5a1', class: "row gy-3 jfi-checkout-core" }, h("div", { key: '1626910a51278d3605d7478967bd5510f06ab0e8', class: "col-12", part: checkoutSummary }, h(Header2, { key: 'a611cc9f961758d629ef9b60a7c721e779c2e7aa', text: "Summary", class: "fs-5 fw-bold pb-3" }), this.summary), h("div", { key: '497cbf1fb357b5da2ba33355d8b216812ca462d8', class: "col-12" }, h("slot", { key: 'ee71b1f7ee82c5309c55367585be33d911d1a77a', name: "insurance" })), h("div", { key: '77f4b551f6f8caea04cedea4331dbac1b58cc2b2', class: "col-12 mt-4" }, h(Header2, { key: 'e03f34d1368468fc3712cf3adcb3254ac729ca2c', text: "Payment", class: "fs-5 fw-bold pb-3" }), h(Header3, { key: '80b7ae6d2b965532e1def898369d9e294c9efa47', text: "Select payment type", class: "fs-6 fw-bold lh-lg" }), h("div", { key: 'fbcbb06d2f706a4f317496afbb5f932c7a954285', class: "d-flex flex-column" }, this.paymentType)), h("div", { key: 'e272325743370aa22ef9973523eb47829b9504f4', class: "col-12" }, h("div", { key: '0c0cfb11564c8008dfb05d0ec48e0c18ea63c589', class: "d-flex justify-content-end" }, h(Button, { key: '85860b67adb647db23b4944cefec1bcf0ec19d92', type: "submit", variant: "primary", onClick: (e) => this.submit(e), disabled: this.isLoading, isLoading: this.isLoading, style: { width: '100%' } }, "Pay"))))));
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: 'd0f0e8bd7634b09e43d7b89fc9b62dad5a46698a', getCheckout: this.getCheckout, authToken: this.authToken, complete: this.complete, disableCreditCard: this.disableCreditCard, disableBankAccount: this.disableBankAccount, disableBnpl: this.disableBnpl, disablePaymentMethodGroup: this.disablePaymentMethodGroup, hideCardBillingForm: this.hideCardBillingForm, ref: el => {
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: 'c523d863b3c50a2a341c6afda034a847f172f64d', slot: "insurance" }, h("slot", { key: '7fc6851584286b771b300113065950fd3c36fe7b', name: "insurance" }))));
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 border-bottom" }, h("hidden-input", null), h("div", { class: "mb-4" }, paymentMethodType === 'card' ? (h("card-form", { ref: (el) => this.paymentMethodFormRef = el })) : (h("bank-account-form", { ref: (el) => this.paymentMethodFormRef = el }))), 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
+ 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: '08d8aac7f71c6f7e6f55b8e43a8987ad0e0604d2', class: "payment-method" }, h("div", { key: 'd38fb7c6591df0c552ec51137b4358a2fa5a2651', class: "radio-list-item p-3", part: radioListItem, onClick: this.onPaymentMethodOptionClick }, h("form-control-radio", { key: '90725e78617ea8dcd40981cac815601a75256f7d', 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
+ 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: 'b83f8b54a8f5a15790b263047a5eb9acc416ae2c' }, (_a = this.paymentMethodOptions) === null || _a === void 0 ? void 0 : _a.map((paymentMethodOption) => {
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
- const tokenizeResponse = await this.paymentMethodOptionsRef.resolvePaymentMethod({ isValid: true });
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
- this.errorEvent.emit({
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: 'bfeaea9cc19470d95c3c3b01d8a2f1d0686719f0' }, h("form", { key: '055830971e13041ddc826d104deaf082765736aa' }, h("fieldset", { key: '0cca44190920ef7d526bd3ddcdf72b0d1a7d82e7' }, h("div", { key: 'cb12a4423b5ddcffcc5fb4b3905f6ad37cf23c15', class: "row gy-3" }, h("div", { key: '6d1e36bb81d64d81f4440f3c1687b03a0383fbbb', class: "col-12" }, h("justifi-payment-method-options", { key: '312ad9fe09f65c2f5ec1d0c2bbe74bcf0f24aafb', 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 })), h("div", { key: 'ce18adbc0b9f868a3bff49a9f2d994b83be66b4c', class: "col-12" }, h(Button, { key: '1610a24c4ffb1a6e6ddd6eea1720b553c67a20f7', variant: "primary", type: "submit", onClick: event => this.tokenizePaymentMethod(event), isLoading: this.isLoading, "data-testid": "submit-button", hidden: this.hideSubmitButton }, this.submitButtonText || 'Submit')))))));
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/ComponentEvents",
220
- "id": "src/api/ComponentEvents.ts::ComponentErrorEvent"
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/ComponentEvents",
241
- "id": "src/api/ComponentEvents.ts::ComponentSubmitEvent"
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<void>",
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/ComponentError",
269
- "id": "src/api/ComponentError.ts::ComponentErrorCodes"
294
+ "path": "../../api",
295
+ "id": "src/api/index.ts::ComponentErrorCodes"
270
296
  }
271
297
  },
272
- "return": "Promise<void>"
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": "../../components",
295
- "id": "src/components.d.ts::BillingFormFields"
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',