@justifi/webcomponents 4.19.2-rc → 4.19.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 (240) hide show
  1. package/dist/cjs/{Analytics-66574423.js → Analytics-c866f471.js} +4 -3
  2. package/dist/cjs/{Api-3bc6e43f.js → Api-b98b256f.js} +3 -3
  3. package/dist/cjs/{Business-aacbe893.js → Business-aa799fec.js} +104 -9
  4. package/dist/cjs/additional-questions-details_5.cjs.entry.js +1 -1
  5. package/dist/cjs/{business-additional-questions-schema-cf545610.js → business-additional-questions-schema-26b0eecb.js} +1 -1
  6. package/dist/cjs/{business-form-options-582467fe.js → business-form-options-5db0bd5e.js} +2 -2
  7. package/dist/cjs/{payload-parsers-1cbc3b57.js → business-identity-schema-503ecb77.js} +1 -47
  8. package/dist/cjs/{business.service-090a21e1.js → business.service-65b0dbc8.js} +7 -6
  9. package/dist/cjs/config-ff2dda66.js +15 -0
  10. package/dist/cjs/form-alert_5.cjs.entry.js +2 -2
  11. package/dist/cjs/form-control-checkbox_9.cjs.entry.js +26 -26
  12. package/dist/cjs/{get-payout-csv-238e839a.js → get-payout-csv-b98b0651.js} +5 -4
  13. package/dist/cjs/gross-payment-chart-core.cjs.entry.js +1 -1
  14. package/dist/cjs/justifi-additional-questions-form-step_10.cjs.entry.js +15 -14
  15. package/dist/cjs/justifi-bank-account-form.cjs.entry.js +6 -5
  16. package/dist/cjs/justifi-billing-form_2.cjs.entry.js +3 -3
  17. package/dist/cjs/justifi-business-details.cjs.entry.js +6 -5
  18. package/dist/cjs/justifi-business-form.cjs.entry.js +14 -13
  19. package/dist/cjs/justifi-card-form.cjs.entry.js +6 -5
  20. package/dist/cjs/justifi-checkout-core.cjs.entry.js +4 -3
  21. package/dist/cjs/justifi-checkout.cjs.entry.js +6 -5
  22. package/dist/cjs/justifi-gross-payment-chart.cjs.entry.js +5 -4
  23. package/dist/cjs/justifi-new-payment-method_4.cjs.entry.js +10 -9
  24. package/dist/cjs/justifi-owner-form_3.cjs.entry.js +12 -11
  25. package/dist/cjs/justifi-payment-details.cjs.entry.js +5 -4
  26. package/dist/cjs/justifi-payment-form.cjs.entry.js +8 -7
  27. package/dist/cjs/justifi-payment-method-form.cjs.entry.js +2 -2
  28. package/dist/cjs/justifi-payment-provisioning.cjs.entry.js +7 -6
  29. package/dist/cjs/justifi-payments-list.cjs.entry.js +5 -4
  30. package/dist/cjs/justifi-payout-details.cjs.entry.js +5 -4
  31. package/dist/cjs/justifi-payouts-list.cjs.entry.js +5 -4
  32. package/dist/cjs/justifi-refund-form.cjs.entry.js +4 -3
  33. package/dist/cjs/justifi-season-interruption-insurance-core.cjs.entry.js +1 -1
  34. package/dist/cjs/justifi-season-interruption-insurance.cjs.entry.js +6 -5
  35. package/dist/cjs/{package-0b65a049.js → package-0c613220.js} +4 -2
  36. package/dist/cjs/payment-details-core.cjs.entry.js +1 -1
  37. package/dist/cjs/{payment.service-c92635c8.js → payment.service-33d6ac16.js} +4 -3
  38. package/dist/cjs/payments-list-core.cjs.entry.js +1 -1
  39. package/dist/cjs/payout-details-core.cjs.entry.js +1 -1
  40. package/dist/cjs/payouts-list-core.cjs.entry.js +1 -1
  41. package/dist/cjs/{schema-validations-2733de42.js → schema-validations-0a7e46a3.js} +1 -1
  42. package/dist/cjs/{utils-89d86e29.js → utils-af1b60a9.js} +0 -16
  43. package/dist/collection/api/Api.js +3 -3
  44. package/dist/collection/api/Business.js +66 -7
  45. package/dist/collection/api/Identity.js +39 -3
  46. package/dist/collection/api/services/analytics.service.js +2 -1
  47. package/dist/collection/api/services/business.service.js +6 -5
  48. package/dist/collection/api/services/checkout.service.js +3 -2
  49. package/dist/collection/api/services/insurance.service.js +3 -2
  50. package/dist/collection/api/services/payment.service.js +3 -2
  51. package/dist/collection/api/services/payout.service.js +4 -3
  52. package/dist/collection/api/services/provision.service.js +4 -2
  53. package/dist/collection/api/services/reports.service.js +2 -1
  54. package/dist/collection/components/bank-account-form/bank-account-form.js +4 -3
  55. package/dist/collection/components/business-forms/business-form/business-form.js +5 -5
  56. package/dist/collection/components/business-forms/owner-form/owner-form-core.js +4 -5
  57. package/dist/collection/components/business-forms/payment-provisioning/additional-questions/business-additional-questions-form-step-core.js +3 -3
  58. package/dist/collection/components/business-forms/payment-provisioning/bank-account/business-bank-account-form-step.js +4 -3
  59. package/dist/collection/components/business-forms/payment-provisioning/business-core-info/business-core-info-form-step-core.js +3 -5
  60. package/dist/collection/components/business-forms/payment-provisioning/business-owners/business-owners-form-step-core.js +3 -3
  61. package/dist/collection/components/business-forms/payment-provisioning/business-representative/business-representative-form-step-core.js +3 -4
  62. package/dist/collection/components/business-forms/payment-provisioning/document-uploads/business-document-upload-form-step.js +4 -3
  63. package/dist/collection/components/business-forms/payment-provisioning/legal-address-form/legal-address-form-step-core.js +3 -4
  64. package/dist/collection/components/business-forms/payment-provisioning/terms-and-conditions/business-terms-conditions-form-step.js +4 -3
  65. package/dist/collection/components/business-forms/utils/business-form-options.js +1 -1
  66. package/dist/collection/components/card-form/card-form.js +4 -3
  67. package/dist/collection/components/checkout/checkout-core.js +4 -3
  68. package/dist/collection/components/checkout/new-payment-method.js +4 -3
  69. package/dist/collection/components/checkout/payment-method-options.js +4 -3
  70. package/dist/collection/components/checkout/saved-payment-method.js +4 -3
  71. package/dist/collection/components/checkout/sezzle-payment-method.js +4 -3
  72. package/dist/collection/components/payment-form/payment-form.js +4 -3
  73. package/dist/collection/components/refund-form/refund-form.js +3 -2
  74. package/dist/config.js +11 -0
  75. package/dist/docs.json +9 -9
  76. package/dist/esm/{Analytics-6f321899.js → Analytics-3e74964a.js} +4 -3
  77. package/dist/esm/{Api-b09a2f6a.js → Api-c8abc2e0.js} +3 -3
  78. package/dist/esm/{Business-e218b4f4.js → Business-b73d5055.js} +104 -9
  79. package/dist/esm/additional-questions-details_5.entry.js +1 -1
  80. package/dist/esm/{business-additional-questions-schema-956e3caf.js → business-additional-questions-schema-a5583cf8.js} +1 -1
  81. package/dist/esm/{business-form-options-7a9a74fc.js → business-form-options-d790973e.js} +2 -2
  82. package/dist/esm/{payload-parsers-acb719d1.js → business-identity-schema-9e3269fb.js} +2 -44
  83. package/dist/esm/{business.service-37d0cc72.js → business.service-6f139c2b.js} +7 -6
  84. package/dist/esm/config-476c7241.js +13 -0
  85. package/dist/esm/form-alert_5.entry.js +2 -2
  86. package/dist/esm/form-control-checkbox_9.entry.js +21 -21
  87. package/dist/esm/{get-payout-csv-a702a0d9.js → get-payout-csv-383d96c1.js} +5 -4
  88. package/dist/esm/gross-payment-chart-core.entry.js +1 -1
  89. package/dist/esm/justifi-additional-questions-form-step_10.entry.js +15 -14
  90. package/dist/esm/justifi-bank-account-form.entry.js +6 -5
  91. package/dist/esm/justifi-billing-form_2.entry.js +3 -3
  92. package/dist/esm/justifi-business-details.entry.js +6 -5
  93. package/dist/esm/justifi-business-form.entry.js +13 -12
  94. package/dist/esm/justifi-card-form.entry.js +6 -5
  95. package/dist/esm/justifi-checkout-core.entry.js +4 -3
  96. package/dist/esm/justifi-checkout.entry.js +6 -5
  97. package/dist/esm/justifi-gross-payment-chart.entry.js +5 -4
  98. package/dist/esm/justifi-new-payment-method_4.entry.js +10 -9
  99. package/dist/esm/justifi-owner-form_3.entry.js +11 -10
  100. package/dist/esm/justifi-payment-details.entry.js +5 -4
  101. package/dist/esm/justifi-payment-form.entry.js +8 -7
  102. package/dist/esm/justifi-payment-method-form.entry.js +2 -2
  103. package/dist/esm/justifi-payment-provisioning.entry.js +7 -6
  104. package/dist/esm/justifi-payments-list.entry.js +5 -4
  105. package/dist/esm/justifi-payout-details.entry.js +5 -4
  106. package/dist/esm/justifi-payouts-list.entry.js +5 -4
  107. package/dist/esm/justifi-refund-form.entry.js +4 -3
  108. package/dist/esm/justifi-season-interruption-insurance-core.entry.js +1 -1
  109. package/dist/esm/justifi-season-interruption-insurance.entry.js +6 -5
  110. package/dist/esm/{package-9f727069.js → package-925a0fdd.js} +4 -2
  111. package/dist/esm/payment-details-core.entry.js +1 -1
  112. package/dist/esm/{payment.service-9359fe15.js → payment.service-e4fb5953.js} +4 -3
  113. package/dist/esm/payments-list-core.entry.js +1 -1
  114. package/dist/esm/payout-details-core.entry.js +1 -1
  115. package/dist/esm/payouts-list-core.entry.js +1 -1
  116. package/dist/esm/{schema-validations-a83ff220.js → schema-validations-e725d701.js} +2 -2
  117. package/dist/esm/{utils-3c1dd2fa.js → utils-e66d8bca.js} +1 -16
  118. package/dist/module/Analytics.js +2 -1
  119. package/dist/module/Api.js +3 -3
  120. package/dist/module/Business.js +104 -9
  121. package/dist/module/business-additional-questions-form-step-core.js +3 -3
  122. package/dist/module/business-bank-account-form-step.js +4 -3
  123. package/dist/module/business-core-info-form-step-core.js +3 -5
  124. package/dist/module/business-document-upload-form-step.js +4 -3
  125. package/dist/module/business-document-upload-input-group.js +1 -1
  126. package/dist/module/business-documents-on-file.js +1 -1
  127. package/dist/module/business-form-options.js +1 -1
  128. package/dist/module/business-owners-form-step-core.js +3 -3
  129. package/dist/module/business-representative-form-step-core.js +3 -4
  130. package/dist/module/business-terms-conditions-form-step.js +4 -3
  131. package/dist/module/business.service.js +6 -5
  132. package/dist/module/checkout-core.js +3 -2
  133. package/dist/module/config.js +13 -0
  134. package/dist/module/get-payout-csv.js +4 -3
  135. package/dist/module/justifi-bank-account-form.js +3 -2
  136. package/dist/module/justifi-business-form.js +5 -5
  137. package/dist/module/justifi-card-form.js +3 -2
  138. package/dist/module/justifi-checkout.js +3 -2
  139. package/dist/module/justifi-gross-payment-chart.js +2 -1
  140. package/dist/module/justifi-payment-form.js +4 -3
  141. package/dist/module/justifi-payment-provisioning.js +3 -2
  142. package/dist/module/justifi-refund-form.js +3 -2
  143. package/dist/module/justifi-season-interruption-insurance.js +3 -2
  144. package/dist/module/legal-address-form-step-core.js +3 -4
  145. package/dist/module/new-payment-method.js +3 -2
  146. package/dist/module/owner-form-core2.js +4 -5
  147. package/dist/module/package.js +4 -2
  148. package/dist/module/payment-details-core2.js +1 -1
  149. package/dist/module/payment-method-options.js +3 -2
  150. package/dist/module/payment.service.js +3 -2
  151. package/dist/module/payments-list-core2.js +1 -1
  152. package/dist/module/payout-details-core2.js +1 -1
  153. package/dist/module/payouts-list-core2.js +1 -1
  154. package/dist/module/saved-payment-method.js +4 -3
  155. package/dist/module/sezzle-payment-method.js +3 -2
  156. package/dist/module/utils2.js +1 -16
  157. package/dist/types/api/Business.d.ts +87 -1
  158. package/dist/types/api/Identity.d.ts +45 -1
  159. package/dist/types/components/business-forms/owner-form/owner-form-core.d.ts +44 -1
  160. package/dist/types/components/business-forms/payment-provisioning/additional-questions/business-additional-questions-form-step-core.d.ts +11 -1
  161. package/dist/types/components/business-forms/payment-provisioning/business-core-info/business-core-info-form-step-core.d.ts +11 -1
  162. package/dist/types/components/business-forms/payment-provisioning/business-representative/business-representative-form-step-core.d.ts +24 -1
  163. package/dist/types/components/business-forms/payment-provisioning/legal-address-form/legal-address-form-step-core.d.ts +11 -1
  164. package/dist/types/home/runner/work/web-component-library/web-component-library/packages/webcomponents/.stencil/packages/webcomponents/config.d.ts +11 -0
  165. package/dist/webcomponents/p-0052db77.js +1 -0
  166. package/dist/webcomponents/p-039183f1.entry.js +1 -0
  167. package/dist/webcomponents/p-08a39a65.entry.js +1 -0
  168. package/dist/webcomponents/{p-462dc522.entry.js → p-124c1ecd.entry.js} +1 -1
  169. package/dist/webcomponents/p-1647f06b.entry.js +1 -0
  170. package/dist/webcomponents/p-1815a43b.js +1 -0
  171. package/dist/webcomponents/p-1cb2a51c.entry.js +1 -0
  172. package/dist/webcomponents/{p-1a43e355.entry.js → p-1eee25f3.entry.js} +1 -1
  173. package/dist/webcomponents/p-20cee11b.entry.js +1 -0
  174. package/dist/webcomponents/{p-3fd13ca3.js → p-277aee05.js} +1 -1
  175. package/dist/webcomponents/p-2a5cc4ee.entry.js +1 -0
  176. package/dist/webcomponents/p-3b1340dc.js +1 -0
  177. package/dist/webcomponents/p-43eff822.entry.js +1 -0
  178. package/dist/webcomponents/p-4e01fec8.entry.js +1 -0
  179. package/dist/webcomponents/{p-89887332.js → p-5022f21c.js} +1 -1
  180. package/dist/webcomponents/p-55182a59.js +1 -0
  181. package/dist/webcomponents/{p-83125497.js → p-5e2c9ec8.js} +1 -1
  182. package/dist/webcomponents/p-5e7c60d8.js +1 -0
  183. package/dist/webcomponents/p-6ac806ff.entry.js +1 -0
  184. package/dist/webcomponents/p-6c2fc744.entry.js +1 -0
  185. package/dist/webcomponents/{p-62b32c4c.entry.js → p-721dcf51.entry.js} +1 -1
  186. package/dist/webcomponents/p-77e55bfc.entry.js +1 -0
  187. package/dist/webcomponents/{p-29c0b182.js → p-7d3be485.js} +1 -1
  188. package/dist/webcomponents/{p-52021fa1.entry.js → p-817da23c.entry.js} +1 -1
  189. package/dist/webcomponents/p-82cff30c.js +1 -0
  190. package/dist/webcomponents/p-8eb10f02.js +1 -0
  191. package/dist/webcomponents/p-8f9fb5c3.entry.js +1 -0
  192. package/dist/webcomponents/p-9649b022.entry.js +1 -0
  193. package/dist/webcomponents/p-9c076da2.entry.js +1 -0
  194. package/dist/webcomponents/p-ae263544.js +1 -0
  195. package/dist/webcomponents/p-af0aeba4.entry.js +1 -0
  196. package/dist/webcomponents/p-b1408dea.entry.js +1 -0
  197. package/dist/webcomponents/p-ba95679b.entry.js +1 -0
  198. package/dist/webcomponents/p-bd2bb302.entry.js +1 -0
  199. package/dist/webcomponents/p-d2af90c2.entry.js +1 -0
  200. package/dist/webcomponents/{p-4abc17f0.entry.js → p-d76002d5.entry.js} +1 -1
  201. package/dist/webcomponents/{p-8e541a32.entry.js → p-da1d174d.entry.js} +1 -1
  202. package/dist/webcomponents/{p-53e64f15.entry.js → p-e2b2213f.entry.js} +1 -1
  203. package/dist/webcomponents/{p-fe33151d.entry.js → p-eccf2e8e.entry.js} +1 -1
  204. package/dist/webcomponents/p-edab484a.entry.js +1 -0
  205. package/dist/webcomponents/p-f5b5e47b.js +1 -0
  206. package/dist/webcomponents/{p-d23e1960.entry.js → p-f844d67b.entry.js} +1 -1
  207. package/dist/webcomponents/webcomponents.esm.js +1 -1
  208. package/package.json +4 -2
  209. package/dist/collection/components/business-forms/utils/payload-parsers.js +0 -41
  210. package/dist/globals.d.ts +0 -2
  211. package/dist/module/payload-parsers.js +0 -43
  212. package/dist/types/components/business-forms/utils/payload-parsers.d.ts +0 -4
  213. package/dist/webcomponents/p-04a61500.entry.js +0 -1
  214. package/dist/webcomponents/p-0e1bc91e.js +0 -1
  215. package/dist/webcomponents/p-14fdc01c.entry.js +0 -1
  216. package/dist/webcomponents/p-17e4246f.entry.js +0 -1
  217. package/dist/webcomponents/p-2b79f265.entry.js +0 -1
  218. package/dist/webcomponents/p-30a493cd.entry.js +0 -1
  219. package/dist/webcomponents/p-32211b2f.entry.js +0 -1
  220. package/dist/webcomponents/p-3352353a.entry.js +0 -1
  221. package/dist/webcomponents/p-3c6a8a36.entry.js +0 -1
  222. package/dist/webcomponents/p-47d79529.js +0 -1
  223. package/dist/webcomponents/p-72d42a01.entry.js +0 -1
  224. package/dist/webcomponents/p-77cf6f75.entry.js +0 -1
  225. package/dist/webcomponents/p-7c0002c6.js +0 -1
  226. package/dist/webcomponents/p-85960c15.entry.js +0 -1
  227. package/dist/webcomponents/p-85fc69e5.js +0 -1
  228. package/dist/webcomponents/p-8a038cd9.js +0 -1
  229. package/dist/webcomponents/p-8e7d4df4.entry.js +0 -1
  230. package/dist/webcomponents/p-af244664.js +0 -1
  231. package/dist/webcomponents/p-b29f5084.entry.js +0 -1
  232. package/dist/webcomponents/p-b4b8b531.js +0 -1
  233. package/dist/webcomponents/p-ba5fae28.js +0 -1
  234. package/dist/webcomponents/p-bd2ecd23.entry.js +0 -1
  235. package/dist/webcomponents/p-c8c3a97d.entry.js +0 -1
  236. package/dist/webcomponents/p-cd37a87e.entry.js +0 -1
  237. package/dist/webcomponents/p-e14c133e.entry.js +0 -1
  238. package/dist/webcomponents/p-e789152a.entry.js +0 -1
  239. package/dist/webcomponents/p-ecdf60f6.entry.js +0 -1
  240. package/dist/webcomponents/p-f117d1d1.entry.js +0 -1
@@ -1,4 +1,5 @@
1
1
  import { h } from "@stencil/core";
2
+ import { config } from "../../../config";
2
3
  const PaymentMethodTypeLabels = {
3
4
  bankAccount: 'New bank account',
4
5
  card: 'New credit or debit card',
@@ -8,7 +9,7 @@ export class NewPaymentMethod {
8
9
  this.onPaymentMethodOptionClick = () => {
9
10
  this.paymentMethodOptionSelected.emit(this.paymentMethodOption);
10
11
  };
11
- this.iframeOrigin = IFRAME_ORIGIN;
12
+ this.iframeOrigin = config.iframeOrigin;
12
13
  this.authToken = undefined;
13
14
  this.accountId = undefined;
14
15
  this.paymentMethodOption = undefined;
@@ -68,7 +69,7 @@ export class NewPaymentMethod {
68
69
  }
69
70
  render() {
70
71
  var _a, _b, _c, _d;
71
- return (h("div", { key: '55a43467070e4981a6fda7b529f329122f33dda8', class: "payment-method" }, h("div", { key: 'b86a20d2e51883dab9f2c46e6787417d498af17e', class: `payment-method-header p-3`, onClick: () => this.onPaymentMethodOptionClick() }, h("input", { key: '900b836be24e83816d1e6c915855b11ba3b605ee', type: "radio", name: "paymentMethodType", id: (_a = this.paymentMethodOption) === null || _a === void 0 ? void 0 : _a.id, value: (_b = this.paymentMethodOption) === null || _b === void 0 ? void 0 : _b.id, onClick: (event) => event.preventDefault(), checked: this.isSelected, class: "form-check-input me-2" }), h("label", { key: 'b1976293de17845cba7671606c50698b90878bcb', htmlFor: (_c = this.paymentMethodOption) === null || _c === void 0 ? void 0 : _c.id, class: "form-check-label" }, PaymentMethodTypeLabels[(_d = this.paymentMethodOption) === null || _d === void 0 ? void 0 : _d.id])), this.isSelected ? this.showNewPaymentMethodForm() : null));
72
+ return (h("div", { key: '93c3e6d38d1e18be54006bf82cd6c8148df3518d', class: "payment-method" }, h("div", { key: '6dbb687fbd3e33a6095be7c39ec0974bcc4809b8', class: `payment-method-header p-3`, onClick: () => this.onPaymentMethodOptionClick() }, h("input", { key: '6c5be962cf5d357211c6716b53d0d8dd3fcf0bb0', type: "radio", name: "paymentMethodType", id: (_a = this.paymentMethodOption) === null || _a === void 0 ? void 0 : _a.id, value: (_b = this.paymentMethodOption) === null || _b === void 0 ? void 0 : _b.id, onClick: (event) => event.preventDefault(), checked: this.isSelected, class: "form-check-input me-2" }), h("label", { key: '796868afd192703a81d94897872dd9c0504cbc1e', htmlFor: (_c = this.paymentMethodOption) === null || _c === void 0 ? void 0 : _c.id, class: "form-check-label" }, PaymentMethodTypeLabels[(_d = this.paymentMethodOption) === null || _d === void 0 ? void 0 : _d.id])), this.isSelected ? this.showNewPaymentMethodForm() : null));
72
73
  }
73
74
  static get is() { return "justifi-new-payment-method"; }
74
75
  static get properties() {
@@ -89,7 +90,7 @@ export class NewPaymentMethod {
89
90
  },
90
91
  "attribute": "iframe-origin",
91
92
  "reflect": false,
92
- "defaultValue": "IFRAME_ORIGIN"
93
+ "defaultValue": "config.iframeOrigin"
93
94
  },
94
95
  "authToken": {
95
96
  "type": "string",
@@ -1,4 +1,5 @@
1
1
  import { h, Host } from "@stencil/core";
2
+ import { config } from "../../../config";
2
3
  import { PaymentMethodTypes } from "../../api/Payment";
3
4
  import { PaymentMethodOption } from "./payment-method-option-utils";
4
5
  export class PaymentMethodOptions {
@@ -12,7 +13,7 @@ export class PaymentMethodOptions {
12
13
  this.insuranceToggled = undefined;
13
14
  this.authToken = undefined;
14
15
  this.accountId = undefined;
15
- this.iframeOrigin = IFRAME_ORIGIN;
16
+ this.iframeOrigin = config.iframeOrigin;
16
17
  this.savedPaymentMethods = [];
17
18
  this.paymentAmount = undefined;
18
19
  this.selectedPaymentMethodId = undefined;
@@ -58,7 +59,7 @@ export class PaymentMethodOptions {
58
59
  }
59
60
  render() {
60
61
  var _a;
61
- return (h(Host, { key: '7ee40a1bdc9ec15596e870b48cbe7b6bbc20537c' }, (_a = this.paymentMethodOptions) === null || _a === void 0 ? void 0 : _a.map((paymentMethodOption) => {
62
+ return (h(Host, { key: '86e309b90ab00f530dd803b00e5aab511f92300f' }, (_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;
@@ -272,7 +273,7 @@ export class PaymentMethodOptions {
272
273
  },
273
274
  "attribute": "iframe-origin",
274
275
  "reflect": false,
275
- "defaultValue": "IFRAME_ORIGIN"
276
+ "defaultValue": "config.iframeOrigin"
276
277
  },
277
278
  "savedPaymentMethods": {
278
279
  "type": "unknown",
@@ -1,11 +1,12 @@
1
1
  import { Fragment, h } from "@stencil/core";
2
+ import { config } from "../../../config";
2
3
  import { CardBrandLabels } from "./payment-method-option-utils";
3
4
  export class SavedPaymentMethod {
4
5
  constructor() {
5
6
  this.onPaymentMethodOptionClick = () => {
6
7
  this.paymentMethodOptionSelected.emit(this.paymentMethodOption);
7
8
  };
8
- this.iframeOrigin = IFRAME_ORIGIN;
9
+ this.iframeOrigin = config.iframeOrigin;
9
10
  this.paymentMethodOption = undefined;
10
11
  this.isSelected = undefined;
11
12
  }
@@ -19,7 +20,7 @@ export class SavedPaymentMethod {
19
20
  ;
20
21
  render() {
21
22
  var _a, _b, _c, _d, _e;
22
- return (h(Fragment, { key: '247dafc3fe4011c5f6a2202690310eedfa5422c8' }, h("div", { key: '9cfb0b6ca9c10e5cc6173832bb8211ddb1d0ae5b', class: "payment-method" }, h("div", { key: 'd247cc4cf9f7bf43d7153134c66a921b5bfc49bc', class: "payment-method-header p-3", onClick: () => this.onPaymentMethodOptionClick() }, h("input", { key: '180c3aa6c4153bccf7cb620b6df49cc288754cd2', type: "radio", name: "paymentMethodType", id: (_a = this.paymentMethodOption) === null || _a === void 0 ? void 0 : _a.id, value: (_b = this.paymentMethodOption) === null || _b === void 0 ? void 0 : _b.id, onClick: (event) => event.preventDefault(), checked: this.isSelected, class: "form-check-input me-2" }), h("label", { key: '6ec14d77e8171a1ddb37c686189878a7ebb4b4f4', htmlFor: (_c = this.paymentMethodOption) === null || _c === void 0 ? void 0 : _c.id, class: "form-check-label" }, CardBrandLabels[(_d = this.paymentMethodOption) === null || _d === void 0 ? void 0 : _d.brand], " *", (_e = this.paymentMethodOption) === null || _e === void 0 ? void 0 :
23
+ return (h(Fragment, { key: '9c2174123f1675d60bc48d8109821c0bc2ad7682' }, h("div", { key: '07bffce2603110d44f38ffb2f57a60f07faddb3b', class: "payment-method" }, h("div", { key: 'f489d3a05db45c2b2581bc8f0fc093afed453d91', class: "payment-method-header p-3", onClick: () => this.onPaymentMethodOptionClick() }, h("input", { key: '70681612520aa621c39a017b72b25a7dd3211282', type: "radio", name: "paymentMethodType", id: (_a = this.paymentMethodOption) === null || _a === void 0 ? void 0 : _a.id, value: (_b = this.paymentMethodOption) === null || _b === void 0 ? void 0 : _b.id, onClick: (event) => event.preventDefault(), checked: this.isSelected, class: "form-check-input me-2" }), h("label", { key: 'a58e14ae9d199b0e0eb01b4c0a4a8bd9c8fec41d', htmlFor: (_c = this.paymentMethodOption) === null || _c === void 0 ? void 0 : _c.id, class: "form-check-label" }, CardBrandLabels[(_d = this.paymentMethodOption) === null || _d === void 0 ? void 0 : _d.brand], " *", (_e = this.paymentMethodOption) === null || _e === void 0 ? void 0 :
23
24
  _e.acct_last_four)))));
24
25
  }
25
26
  static get is() { return "justifi-saved-payment-method"; }
@@ -41,7 +42,7 @@ export class SavedPaymentMethod {
41
42
  },
42
43
  "attribute": "iframe-origin",
43
44
  "reflect": false,
44
- "defaultValue": "IFRAME_ORIGIN"
45
+ "defaultValue": "config.iframeOrigin"
45
46
  },
46
47
  "paymentMethodOption": {
47
48
  "type": "unknown",
@@ -1,4 +1,5 @@
1
1
  import { h } from "@stencil/core";
2
+ import { config } from "../../../config";
2
3
  import { formatCurrency } from "../../utils/utils";
3
4
  const sezzleLogo = (h("img", { class: "sezzle-smart-button-logo-img", src: "https://media.sezzle.com/branding/2.0/Sezzle_Logo_FullColor.svg", alt: "Sezzle", style: {
4
5
  display: 'inline',
@@ -38,7 +39,7 @@ export class SezzlePaymentMethod {
38
39
  this.sezzleCheckout = checkout;
39
40
  this.installmentPlan = this.sezzleCheckout.getInstallmentPlan(amount);
40
41
  };
41
- this.iframeOrigin = IFRAME_ORIGIN;
42
+ this.iframeOrigin = config.iframeOrigin;
42
43
  this.bnpl = undefined;
43
44
  this.clientId = undefined;
44
45
  this.accountId = undefined;
@@ -64,7 +65,7 @@ export class SezzlePaymentMethod {
64
65
  }
65
66
  render() {
66
67
  var _a, _b, _c, _d, _e;
67
- return (h("div", { key: '1b4e4a142e1e59465e0db5515ee6b0a0b2aac146', class: "payment-method" }, h("script", { key: 'c835bc94836949e2362974eaeefca1f6a579a1a0', src: "https://checkout-sdk.sezzle.com/checkout.min.js", async: true, ref: (el) => (this.scriptRef = el) }), h("div", { key: '051a0392e6353116423f706be48eb266daf12b84', class: `payment-method-header p-3`, onClick: () => this.onPaymentMethodOptionClick() }, h("input", { key: '6dd0d61f1b8788b45b008f5ac05f8a8b6a6591f2', type: "radio", name: "paymentMethodType", id: (_a = this.paymentMethodOption) === null || _a === void 0 ? void 0 : _a.id, value: (_b = this.paymentMethodOption) === null || _b === void 0 ? void 0 : _b.id, onClick: (event) => event.preventDefault(), checked: this.isSelected, class: "form-check-input me-2" }), h("label", { key: 'caf3429bae616a016f58e141ac5c4493174cf3ef', htmlFor: (_c = this.paymentMethodOption) === null || _c === void 0 ? void 0 : _c.id, class: "form-check-label" }, h("div", { key: '0e4ea85fc6fc32a1c35fe0dac86f21ab7f86eb0a' }, "Buy now, pay later with ", sezzleLogo), this.installmentPlan && (h("small", { key: '3740565f14b87aa2e4af44b7e2b12d93d6e454c2' }, h("span", { key: 'ca9b6dff0042c41d378b101067d060092234fa7c' }, (_d = this.installmentPlan) === null || _d === void 0 ? void 0 : _d.installments.length), "\u00A0", h("span", { key: '14ab21fd2d9bd612f41d5cd3e175402593012619' }, this.installmentPlan.schedule, " payments of"), "\u00A0", h("span", { key: '25e08c1e711af0979e14bbb911aedb58f59bc180', class: "fw-bold" }, formatCurrency((_e = this.installmentPlan) === null || _e === void 0 ? void 0 : _e.installments[0].amountInCents))))))));
68
+ return (h("div", { key: '4deca512311cd98d358c7099141b15538857a4e5', class: "payment-method" }, h("script", { key: '94b232291153bba85efebb101e7e6e816857da96', src: "https://checkout-sdk.sezzle.com/checkout.min.js", async: true, ref: (el) => (this.scriptRef = el) }), h("div", { key: '7cd9052ae6613fe7f187f3a51b7d6ac7087fdeb1', class: `payment-method-header p-3`, onClick: () => this.onPaymentMethodOptionClick() }, h("input", { key: '1e15e6c2ddced23b049e2559da27532f9be94fb5', type: "radio", name: "paymentMethodType", id: (_a = this.paymentMethodOption) === null || _a === void 0 ? void 0 : _a.id, value: (_b = this.paymentMethodOption) === null || _b === void 0 ? void 0 : _b.id, onClick: (event) => event.preventDefault(), checked: this.isSelected, class: "form-check-input me-2" }), h("label", { key: '0a3637002ef373c05424d6769b070d9db0e66ce8', htmlFor: (_c = this.paymentMethodOption) === null || _c === void 0 ? void 0 : _c.id, class: "form-check-label" }, h("div", { key: '6398e2f00088edf8a1a3699e149760744dda4cb1' }, "Buy now, pay later with ", sezzleLogo), this.installmentPlan && (h("small", { key: 'bfd33da875aa5e9f5b649ac8fc7aa5758393b6e8' }, h("span", { key: 'c07fd5d32fe897a45a67140e2cb81b1f4d537c4a' }, (_d = this.installmentPlan) === null || _d === void 0 ? void 0 : _d.installments.length), "\u00A0", h("span", { key: '2b11e4aa6389a4b98cd003c031aed8f01ec8a4df' }, this.installmentPlan.schedule, " payments of"), "\u00A0", h("span", { key: '90cf3bfa1f0d36c8d4719f164d436407d7fc692b', class: "fw-bold" }, formatCurrency((_e = this.installmentPlan) === null || _e === void 0 ? void 0 : _e.installments[0].amountInCents))))))));
68
69
  }
69
70
  static get is() { return "justifi-sezzle-payment-method"; }
70
71
  static get properties() {
@@ -85,7 +86,7 @@ export class SezzlePaymentMethod {
85
86
  },
86
87
  "attribute": "iframe-origin",
87
88
  "reflect": false,
88
- "defaultValue": "IFRAME_ORIGIN"
89
+ "defaultValue": "config.iframeOrigin"
89
90
  },
90
91
  "bnpl": {
91
92
  "type": "any",
@@ -1,6 +1,7 @@
1
1
  import { h } from "@stencil/core";
2
2
  import { PaymentMethodTypes } from "../../api";
3
3
  import { loadFontsOnParent } from "../../utils/utils";
4
+ import { config } from "../../../config";
4
5
  import { ComponentErrorCodes, ComponentErrorSeverity } from "../../api/ComponentError";
5
6
  import { getErrorMessage } from "../../api/services/utils";
6
7
  import JustifiAnalytics from "../../api/Analytics";
@@ -105,15 +106,15 @@ export class PaymentForm {
105
106
  }
106
107
  }
107
108
  render() {
108
- return (h(StyledHost, { key: '8cb6e3903a0045fbffed5f17dc29aacc6b57ad7f' }, h("form", { key: '4e8f00c3d29c0db0bc99fd79da46abe7c40e3e30', class: "row gy-3" }, this.showPaymentMethodTypeSelector() && (h("div", { key: '344a1356f6f482493a35015c32f8e9a9b4cc8a80', class: "col-12" }, h("justifi-payment-method-selector", { key: '36b9dd7a9bc8336b4bef0d12f56c811effbc0a0b', selectedPaymentMethodType: this.getSelectedPaymentMethodType(), onPaymentMethodSelected: event => this.paymentMethodSelectedHandler(event) }))), h("div", { key: '225a260f817f9dd02a7f0a5b25562179ab80f7de', class: "col-12" }, h("justifi-payment-method-form", { key: '52e2bf20b265cc96ab556571a323370cc27ac278', "payment-method-form-type": this.getSelectedPaymentMethodType(), iframeOrigin: IFRAME_ORIGIN, ref: el => {
109
+ return (h(StyledHost, { key: '38bd6cca38d9068fa9277a8568a98f261a4cc616' }, h("form", { key: 'fec19f5e2f11934e6783124c4c437a2d3947f596', class: "row gy-3" }, this.showPaymentMethodTypeSelector() && (h("div", { key: '18001f78e03336d01de8473a57e3e228e9fce201', class: "col-12" }, h("justifi-payment-method-selector", { key: '260ac1ade3ccfe6baf518eb856bdf4d380025620', selectedPaymentMethodType: this.getSelectedPaymentMethodType(), onPaymentMethodSelected: event => this.paymentMethodSelectedHandler(event) }))), h("div", { key: 'f6ade2336314e05f2bdce75df8577939efe33e3b', class: "col-12" }, h("justifi-payment-method-form", { key: 'ad8e5b121b8425175f7ac7f38ab24dfba1801a28', "payment-method-form-type": this.getSelectedPaymentMethodType(), iframeOrigin: config.iframeOrigin, ref: el => {
109
110
  if (el) {
110
111
  this.paymentMethodFormRef = el;
111
112
  }
112
- } })), h("div", { key: '433a8ac42c0eec9180e37da222da1dbb1112e48e', class: "col-12" }, h("justifi-billing-form", { key: '4f24f1c8b4083e2d9e5bb2272d32d20bb5cc225d', legend: "Billing Info", ref: el => {
113
+ } })), h("div", { key: '29f15f1cece3e07a569e514d08bf9996405699c6', class: "col-12" }, h("justifi-billing-form", { key: '9928924cc29bfa5c5e46ada294cb26da0c1d222b', legend: "Billing Info", ref: el => {
113
114
  if (el) {
114
115
  this.billingFormRef = el;
115
116
  }
116
- } })), h("slot", { key: '9397ae7fdd2677cd61a425fcf5818ae14fabbed0', name: 'insurance' }), h("div", { key: 'db9131f6f35165e69d3b59da7fa25b95f1e46168', class: "col-12" }, h(Button, { key: 'c280836cf6445a7132ff9202a09b6fdac8e29f77', variant: "primary", type: "submit", onClick: event => this.submit(event), disabled: !this.submitButtonEnabled || this.isLoading, isLoading: this.isLoading, "data-testid": "submit-button", style: { width: '100%' } }, this.submitButtonText || 'Submit')))));
117
+ } })), h("slot", { key: 'c36583ab34bc105b506df27aec02898455855cec', name: 'insurance' }), h("div", { key: 'cc38292ae8a59bc6f4624a8535e8b7c93e6f3a35', class: "col-12" }, h(Button, { key: 'e5fe0f50ee2322ab2a199a6229015c9daa198cc0', variant: "primary", type: "submit", onClick: event => this.submit(event), disabled: !this.submitButtonEnabled || this.isLoading, isLoading: this.isLoading, "data-testid": "submit-button", style: { width: '100%' } }, this.submitButtonText || 'Submit')))));
117
118
  }
118
119
  static get is() { return "justifi-payment-form"; }
119
120
  static get encapsulation() { return "shadow"; }
@@ -2,6 +2,7 @@ import { h, } from "@stencil/core";
2
2
  import RefundFormSchema from "./refund-form-schema";
3
3
  import { Api } from "../../api";
4
4
  import { FormController } from "../form/form";
5
+ import { config } from "../../../config";
5
6
  import { CURRENCY_MASK } from "../../utils/form-input-masks";
6
7
  import { StyledHost } from "../../ui-components";
7
8
  export class RefundForm {
@@ -70,11 +71,11 @@ export class RefundForm {
70
71
  if (!this.authToken) {
71
72
  console.warn('Warning: Missing auth-token.');
72
73
  }
73
- this.api = Api({ authToken: this.authToken, apiOrigin: PROXY_API_ORIGIN });
74
+ this.api = Api({ authToken: this.authToken, apiOrigin: config.proxyApiOrigin });
74
75
  }
75
76
  render() {
76
77
  var _a;
77
- return (h(StyledHost, { key: '8d31f1a9bf936c9e11f8eca1dc55e614b9fa5939' }, h("h1", { key: 'be589740535ee8a5ab6d4af7151d7ae026f08002' }, "Refund"), this.refundInfoText && (h("div", { key: 'b1d40507dec53bac422f99a3d62678c78c0c2038', class: "d-flex align-items-center flex-row gap-4 border-top border-bottom my-4 p-3", role: "alert" }, h("img", { key: 'cc76014eef0d826bec5ec09355dc5fc747fd2070', src: "/info-icon.svg", alt: "Information", height: "30", width: "30" }), h("p", { key: 'c2efa0f2acdf3faaa6e2974d0535f48799e3cbbd', class: "m-0", innerHTML: this.refundInfoText }))), h("form", { key: '68220114781378f6507651414c87532171bebb31', onSubmit: e => this.handleSubmit(e), class: "d-grid gap-4" }, h("div", { key: '075545e9837316fe160760e0dba9a5104654dd2b', class: "form-group" }, h("form-control-monetary", { key: 'c8ff8a822d2b74b2f80b33cd6cd2b42ceebbff11', name: "amount", label: "Refund Amount", defaultValue: ((_a = this.amount) === null || _a === void 0 ? void 0 : _a.toString()) || '', maskOptions: CURRENCY_MASK.DECIMAL, inputHandler: (name, value) => this.handleInput(name, value), errorText: this.errors.amount })), h("div", { key: '92093284e763466be5138ea6d788145d5d47bd87', class: "form-group" }, h("form-control-text", { key: 'ddf9e221d43d84ad7436261c5755e673224aa82e', name: "notes", label: "Additional Notes", inputHandler: (name, value) => this.handleInput(name, value), errorText: this.errors.notes })), this.withButton && (h("div", { key: '58abbbabce09d82da4032ef0e08e6cfac1433153', class: "form-group d-flex flex-row-reverse" }, h("button", { key: '3e703ef633e0d45ba70425dc6d58bcd2d590ce1b', type: "submit", disabled: !!this.isSubmitting, class: "btn btn-primary ml-auto" }, this.submitButtonText))))));
78
+ return (h(StyledHost, { key: 'd0d0962eaecab749aa1eb124e86701a2fb4dfd53' }, h("h1", { key: 'cb3071d89c291b1664e551fcf2808a64569ba5eb' }, "Refund"), this.refundInfoText && (h("div", { key: '01a6f4567f882d2eec492ef6d98db7d04747ecb4', class: "d-flex align-items-center flex-row gap-4 border-top border-bottom my-4 p-3", role: "alert" }, h("img", { key: '8ae5928aaf8ead35a7ad180a01bdde05ebec3d5f', src: "/info-icon.svg", alt: "Information", height: "30", width: "30" }), h("p", { key: '425a7dfe9d8b886b55fd0878f3989373733c1758', class: "m-0", innerHTML: this.refundInfoText }))), h("form", { key: '5516d2ac500611d2410b9b4c2a4d0d15e417b2d1', onSubmit: e => this.handleSubmit(e), class: "d-grid gap-4" }, h("div", { key: 'b67a7c56f070a5a25d91aa0cc77755b27d420fdc', class: "form-group" }, h("form-control-monetary", { key: '76b6cfdf2b39674434f4d880333dd5d5f603f0b6', name: "amount", label: "Refund Amount", defaultValue: ((_a = this.amount) === null || _a === void 0 ? void 0 : _a.toString()) || '', maskOptions: CURRENCY_MASK.DECIMAL, inputHandler: (name, value) => this.handleInput(name, value), errorText: this.errors.amount })), h("div", { key: '5e581cdea69d2ce9dbad774214cd904923d199b3', class: "form-group" }, h("form-control-text", { key: '926ae888676a4089d3381bd4d650e6f84f6e206a', name: "notes", label: "Additional Notes", inputHandler: (name, value) => this.handleInput(name, value), errorText: this.errors.notes })), this.withButton && (h("div", { key: 'de5df506b7b64a69a16241f117bf9bea4fd79b57', class: "form-group d-flex flex-row-reverse" }, h("button", { key: '92ad4d43677587c2c20dc03c6f03a6cf1f20ac12', type: "submit", disabled: !!this.isSubmitting, class: "btn btn-primary ml-auto" }, this.submitButtonText))))));
78
79
  }
79
80
  static get is() { return "justifi-refund-form"; }
80
81
  static get encapsulation() { return "shadow"; }
package/dist/config.js ADDED
@@ -0,0 +1,11 @@
1
+ export const config = {
2
+ iframeOrigin: 'https://js.justifi.ai/v2',
3
+ proxyApiOrigin: 'https://wc-proxy.justifi.ai',
4
+ proxyAuthToken: 'eyJraWQiOiJqdXN0aWZpLWUyNDgyMmU3ODE1MmEzZjRkMjU1IiwidHlwIjoiSldUIiwiYWxnIjoiUlMyNTYifQ.eyJpc3MiOiJodHRwczovL2F1dGguanVzdGlmaS5haS8iLCJhenAiOiJvYXNfMmlsWHBqOHQ2WVlEQ0xWU0FiVFczMiIsInN1YiI6Im9hc18yaWxYcGo4dDZZWURDTFZTQWJUVzMyQHNlc3Npb25zIiwiYXVkIjoiaHR0cHM6Ly9hcGkuanVzdGlmaS5haS92MSIsImd0eSI6ImNsaWVudC1jcmVkZW50aWFscyIsInBlcm1pc3Npb25zIjpbeyJyb2xlIjoicmVhZDphY2NvdW50IiwicmVzb3VyY2VfaWQiOiJhY2NfNUV0OWlYclNTQVpSMktTb3VRR0FXaSJ9LHsicm9sZSI6InJlYWQ6YnVzaW5lc3MiLCJyZXNvdXJjZV9pZCI6ImJpel8zYmg2OWJxMXJrM2RtWE5vQUtWb251In1dLCJleHAiOjE3MTE1NTk0MTQsImlhdCI6MTcwMzc4MzQxNCwicGxhdGZvcm1fYWNjb3VudF9pZCI6ImFjY18zcmVOYjRhTll5MmlXRFpRVmN6bXg0In0.oPOoDYxzrnpE8PRUaz-FCU4KqnSuNbFTeDkl3AtMscjUkIctP1OIFh-ZGBjbH5eVH5noXCbaiin0j92dS7jx4gLpxuYT2Q8gpZbuIsT7fa58elvGeRkUUJ-AC5ueZxlv90yPWMm0OIbyrV7XZhuwYyKbV-ZczEbl2JpvBMe40CM-LdClQV66d_-Kw9a23SabBVfYgP5V-5OsagOIESvzZoO-27tGlNkV2a-hxqddDCOZv0HvRYAtp5S7EQrmRdEBu5gCNbf1eRFG424hxZUFVr2LdetYuKQLxJjDdUjf86ZwEUecrEaDSupiN1VC3CitdOwBVf6-R_N0VpN4VLVD5g',
5
+ exampleAccountId: 'acc_5Et9iXrSSAZR2KSouQGAWi',
6
+ exampleBusinessId: 'biz_3bh69bq1rk3dmXNoAKVonu',
7
+ examplePaymentId: 'py_1NNeEnf4FbelxDCQN2RHcE',
8
+ examplePayoutId: 'po_17745yESnHyEgWNeunmhmR',
9
+ privateApiOrigin: '',
10
+ privateAuthToken: '',
11
+ };
package/dist/docs.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "timestamp": "2024-09-23T01:57:52",
2
+ "timestamp": "2024-10-03T19:21:08",
3
3
  "compiler": {
4
4
  "name": "@stencil/core",
5
5
  "version": "4.19.2",
@@ -3040,7 +3040,7 @@
3040
3040
  "reflectToAttr": false,
3041
3041
  "docs": "URL for the rendered iFrame. End-users need not use this.",
3042
3042
  "docsTags": [],
3043
- "default": "IFRAME_ORIGIN",
3043
+ "default": "config.iframeOrigin",
3044
3044
  "values": [
3045
3045
  {
3046
3046
  "type": "string"
@@ -6281,7 +6281,7 @@
6281
6281
  "reflectToAttr": false,
6282
6282
  "docs": "URL for the rendered iFrame. End-users need not use this.",
6283
6283
  "docsTags": [],
6284
- "default": "IFRAME_ORIGIN",
6284
+ "default": "config.iframeOrigin",
6285
6285
  "values": [
6286
6286
  {
6287
6287
  "type": "string"
@@ -7035,7 +7035,7 @@
7035
7035
  "reflectToAttr": false,
7036
7036
  "docs": "URL for the rendered iFrame. End-users need not use this.",
7037
7037
  "docsTags": [],
7038
- "default": "IFRAME_ORIGIN",
7038
+ "default": "config.iframeOrigin",
7039
7039
  "values": [
7040
7040
  {
7041
7041
  "type": "string"
@@ -7961,7 +7961,7 @@
7961
7961
  "reflectToAttr": false,
7962
7962
  "docs": "",
7963
7963
  "docsTags": [],
7964
- "default": "IFRAME_ORIGIN",
7964
+ "default": "config.iframeOrigin",
7965
7965
  "values": [
7966
7966
  {
7967
7967
  "type": "string"
@@ -9370,7 +9370,7 @@
9370
9370
  "reflectToAttr": false,
9371
9371
  "docs": "",
9372
9372
  "docsTags": [],
9373
- "default": "IFRAME_ORIGIN",
9373
+ "default": "config.iframeOrigin",
9374
9374
  "values": [
9375
9375
  {
9376
9376
  "type": "string"
@@ -11524,7 +11524,7 @@
11524
11524
  "reflectToAttr": false,
11525
11525
  "docs": "",
11526
11526
  "docsTags": [],
11527
- "default": "IFRAME_ORIGIN",
11527
+ "default": "config.iframeOrigin",
11528
11528
  "values": [
11529
11529
  {
11530
11530
  "type": "string"
@@ -12466,7 +12466,7 @@
12466
12466
  "reflectToAttr": false,
12467
12467
  "docs": "",
12468
12468
  "docsTags": [],
12469
- "default": "IFRAME_ORIGIN",
12469
+ "default": "config.iframeOrigin",
12470
12470
  "values": [
12471
12471
  {
12472
12472
  "type": "string"
@@ -13945,7 +13945,7 @@
13945
13945
  "path": "src/api/ComponentError.ts"
13946
13946
  },
13947
13947
  "src/api/Business.ts::IAdditionalQuestions": {
13948
- "declaration": "export interface IAdditionalQuestions {\n business_revenue?: string;\n business_payment_volume?: string;\n business_when_service_received?: string;\n business_recurring_payments?: string;\n business_recurring_payments_percentage?: string;\n business_seasonal?: string;\n business_other_payment_details?: string;\n}",
13948
+ "declaration": "export interface IAdditionalQuestions {\n business_revenue?: string;\n business_payment_volume?: string;\n business_when_service_received?: string;\n business_recurring_payments?: string;\n business_recurring_payments_percentage?: string;\n business_seasonal?: string;\n business_other_payment_details?: string;\n payload?: any;\n}",
13949
13949
  "docstring": "",
13950
13950
  "path": "src/api/Business.ts"
13951
13951
  },
@@ -1,10 +1,11 @@
1
- import { p as packageJson } from './package-9f727069.js';
2
- import { A as Api } from './Api-b09a2f6a.js';
1
+ import { p as packageJson } from './package-925a0fdd.js';
2
+ import { c as config } from './config-476c7241.js';
3
+ import { A as Api } from './Api-c8abc2e0.js';
3
4
 
4
5
  class AnalyticsService {
5
6
  async record(body) {
6
7
  const endpoint = 'analytics';
7
- return Api({ apiOrigin: "" }).post(endpoint, JSON.stringify(body));
8
+ return Api({ apiOrigin: config.proxyApiOrigin }).post(endpoint, body);
8
9
  }
9
10
  }
10
11
 
@@ -94,13 +94,13 @@ const Api = ({ authToken, apiOrigin }) => {
94
94
  return makeRequest(endpoint, 'GET', params, null, signal);
95
95
  }
96
96
  async function post(endpoint, body, params, signal) {
97
- return makeRequest(endpoint, 'POST', params, body, signal);
97
+ return makeRequest(endpoint, 'POST', params, JSON.stringify(body), signal);
98
98
  }
99
99
  async function put(endpoint, body, params, signal) {
100
- return makeRequest(endpoint, 'PUT', params, body, signal);
100
+ return makeRequest(endpoint, 'PUT', params, JSON.stringify(body), signal);
101
101
  }
102
102
  async function patch(endpoint, body, params, signal) {
103
- return makeRequest(endpoint, 'PATCH', params, body, signal);
103
+ return makeRequest(endpoint, 'PATCH', params, JSON.stringify(body), signal);
104
104
  }
105
105
  async function destroy(endpoint, params, signal) {
106
106
  return makeRequest(endpoint, 'DELETE', params, null, signal);
@@ -7,7 +7,8 @@ class Owner {
7
7
  this.dob_day = filterNumber(owner.dob_day);
8
8
  this.dob_month = filterNumber(owner.dob_month);
9
9
  this.dob_year = owner.dob_year;
10
- this.dob_full = constructDate(this.dob_year, this.dob_month, this.dob_day) || '';
10
+ this.dob_full =
11
+ constructDate(this.dob_year, this.dob_month, this.dob_day) || '';
11
12
  this.documents = owner.documents;
12
13
  this.email = owner.email;
13
14
  this.id = owner.id;
@@ -22,6 +23,23 @@ class Owner {
22
23
  this.title = owner.title;
23
24
  this.updated_at = owner.updated_at;
24
25
  }
26
+ // Getter method to return the payload in the desired shape
27
+ get payload() {
28
+ return {
29
+ address: new Address(this.address || {}).payload,
30
+ dob_day: this.dob_day || '',
31
+ dob_month: this.dob_month || '',
32
+ dob_year: this.dob_year || '',
33
+ email: this.email || '',
34
+ identification_number: this.identification_number || undefined,
35
+ is_owner: this.is_owner || false,
36
+ metadata: this.metadata || null,
37
+ name: this.name || '',
38
+ phone: this.phone || '',
39
+ platform_account_id: this.platform_account_id || null,
40
+ title: this.title || '',
41
+ };
42
+ }
25
43
  }
26
44
  class Representative {
27
45
  constructor(representative) {
@@ -30,7 +48,8 @@ class Representative {
30
48
  this.dob_day = filterNumber(representative.dob_day);
31
49
  this.dob_month = filterNumber(representative.dob_month);
32
50
  this.dob_year = representative.dob_year;
33
- this.dob_full = constructDate(this.dob_year, this.dob_month, this.dob_day) || '';
51
+ this.dob_full =
52
+ constructDate(this.dob_year, this.dob_month, this.dob_day) || '';
34
53
  this.documents = representative.documents;
35
54
  this.email = representative.email;
36
55
  this.id = representative.id;
@@ -45,6 +64,23 @@ class Representative {
45
64
  this.title = representative.title;
46
65
  this.updated_at = representative.updated_at;
47
66
  }
67
+ // Getter method to return the payload in the desired shape
68
+ get payload() {
69
+ return {
70
+ address: new Address(this.address || {}).payload,
71
+ dob_day: this.dob_day || '',
72
+ dob_month: this.dob_month || '',
73
+ dob_year: this.dob_year || '',
74
+ email: this.email || '',
75
+ is_owner: this.is_owner || false,
76
+ identification_number: this.identification_number || undefined,
77
+ metadata: this.metadata || null,
78
+ name: this.name || '',
79
+ phone: this.phone || '',
80
+ platform_account_id: this.platform_account_id || null,
81
+ title: this.title || '',
82
+ };
83
+ }
48
84
  }
49
85
 
50
86
  var BusinessClassification;
@@ -70,16 +106,42 @@ class Address {
70
106
  this.created_at = address.created_at;
71
107
  this.updated_at = address.updated_at;
72
108
  }
109
+ get payload() {
110
+ return {
111
+ platform_account_id: this.platform_account_id || '',
112
+ line1: this.line1 || '',
113
+ line2: this.line2 || '',
114
+ postal_code: this.postal_code || '',
115
+ city: this.city || '',
116
+ state: this.state || '',
117
+ country: this.country || '',
118
+ };
119
+ }
73
120
  }
74
121
  class AdditionalQuestions {
75
122
  constructor(additionalQuestions) {
76
123
  this.business_revenue = additionalQuestions.business_revenue;
77
124
  this.business_payment_volume = additionalQuestions.business_payment_volume;
78
- this.business_when_service_received = additionalQuestions.business_when_service_received;
79
- this.business_recurring_payments = additionalQuestions.business_recurring_payments;
80
- this.business_recurring_payments_percentage = additionalQuestions.business_recurring_payments_percentage;
125
+ this.business_when_service_received =
126
+ additionalQuestions.business_when_service_received;
127
+ this.business_recurring_payments =
128
+ additionalQuestions.business_recurring_payments;
129
+ this.business_recurring_payments_percentage =
130
+ additionalQuestions.business_recurring_payments_percentage;
81
131
  this.business_seasonal = additionalQuestions.business_seasonal;
82
- this.business_other_payment_details = additionalQuestions.business_other_payment_details;
132
+ this.business_other_payment_details =
133
+ additionalQuestions.business_other_payment_details;
134
+ }
135
+ get payload() {
136
+ return {
137
+ business_revenue: this.business_revenue || '',
138
+ business_payment_volume: this.business_payment_volume || '',
139
+ business_when_service_received: this.business_when_service_received || '',
140
+ business_recurring_payments: this.business_recurring_payments || '',
141
+ business_recurring_payments_percentage: this.business_recurring_payments_percentage || '',
142
+ business_seasonal: this.business_seasonal || '',
143
+ business_other_payment_details: this.business_other_payment_details || '',
144
+ };
83
145
  }
84
146
  }
85
147
  class CoreBusinessInfo {
@@ -94,10 +156,23 @@ class CoreBusinessInfo {
94
156
  this.phone = coreBusinessInfo.phone;
95
157
  this.date_of_incorporation = coreBusinessInfo.date_of_incorporation;
96
158
  }
159
+ get payload() {
160
+ return {
161
+ classification: this.classification || '',
162
+ legal_name: this.legal_name || '',
163
+ doing_business_as: this.doing_business_as || '',
164
+ industry: this.industry || '',
165
+ tax_id: this.tax_id || '',
166
+ website_url: this.website_url || '',
167
+ email: this.email || '',
168
+ phone: this.phone || '',
169
+ date_of_incorporation: this.date_of_incorporation || '',
170
+ };
171
+ }
97
172
  }
98
173
  class Business {
99
174
  constructor(business) {
100
- this.additional_questions = Object.assign({}, new AdditionalQuestions(business.additional_questions || {}));
175
+ this.additional_questions = new AdditionalQuestions(business.additional_questions || {});
101
176
  this.associated_accounts = business.associated_accounts;
102
177
  this.classification = business.classification;
103
178
  this.bank_accounts = business.bank_accounts;
@@ -107,20 +182,40 @@ class Business {
107
182
  this.email = business.email;
108
183
  this.id = business.id;
109
184
  this.industry = business.industry;
110
- this.legal_address = Object.assign({}, new Address(business.legal_address || {}));
185
+ this.legal_address = new Address(business.legal_address || {});
111
186
  this.legal_name = business.legal_name;
112
187
  this.metadata = business.metadata;
113
188
  this.owners = business.owners;
114
189
  this.phone = business.phone;
115
190
  this.platform_account_id = business.platform_account_id;
116
191
  this.product_categories = business.product_categories;
117
- this.representative = Object.assign({}, new Representative(business.representative || {}));
192
+ this.representative = new Representative(business.representative || {});
118
193
  this.tax_id = business.tax_id;
119
194
  this.terms_conditions_accepted = business.terms_conditions_accepted;
120
195
  this.updated_at = business.updated_at;
121
196
  this.website_url = business.website_url;
122
197
  this.date_of_incorporation = business.date_of_incorporation;
123
198
  }
199
+ get payload() {
200
+ return {
201
+ additional_questions: new AdditionalQuestions(this.additional_questions)
202
+ .payload,
203
+ classification: this.classification || '',
204
+ doing_business_as: this.doing_business_as || '',
205
+ email: this.email || '',
206
+ industry: this.industry || '',
207
+ legal_address: new Address(this.legal_address).payload,
208
+ legal_name: this.legal_name || '',
209
+ metadata: this.metadata || {},
210
+ owners: this.owners.map((owner) => ({ id: owner.id })),
211
+ phone: this.phone || '',
212
+ platform_account_id: this.platform_account_id || '',
213
+ representative: new Representative(this.representative).payload,
214
+ tax_id: this.tax_id || '',
215
+ website_url: this.website_url || '',
216
+ date_of_incorporation: this.date_of_incorporation || '',
217
+ };
218
+ }
124
219
  }
125
220
 
126
221
  export { AdditionalQuestions as A, Business as B, CoreBusinessInfo as C, Owner as O, Representative as R, BusinessClassification as a, Address as b };
@@ -1,6 +1,6 @@
1
1
  import { r as registerInstance, h, H as Host } from './index-57431c24.js';
2
2
  import { c as DetailItem, D as DetailSectionTitle } from './utils-01413a95.js';
3
- import { i as isEmptyObject, s as snakeCaseToHumanReadable, e as formatMediumDate } from './utils-3c1dd2fa.js';
3
+ import { i as isEmptyObject, s as snakeCaseToHumanReadable, e as formatMediumDate } from './utils-e66d8bca.js';
4
4
 
5
5
  const sharedBusinessDetailsCss$4 = ".flex-1{flex:1}";
6
6
  const AdditionalQuestionsDetailsStyle0 = sharedBusinessDetailsCss$4;
@@ -1,5 +1,5 @@
1
1
  import { c as create$3 } from './index.esm-fc4f5c0c.js';
2
- import { h as businessNameValidation, w as websiteUrlValidation, e as emailValidation, d as phoneValidation, j as doingBusinessAsValidation, k as businessClassificationValidation, m as industryValidation, t as taxIdValidation, n as dateOfIncorporationValidation, r as revenueValidation, o as paymentVolumeValidation, q as whenServiceReceivedValidation, u as recurringPaymentsValidation, v as recurringPaymentsPercentageValidation, x as seasonalBusinessValidation, y as otherPaymentDetailsValidation } from './schema-validations-a83ff220.js';
2
+ import { b as businessNameValidation, w as websiteUrlValidation, e as emailValidation, p as phoneValidation, d as doingBusinessAsValidation, a as businessClassificationValidation, i as industryValidation, t as taxIdValidation, c as dateOfIncorporationValidation, r as revenueValidation, f as paymentVolumeValidation, g as whenServiceReceivedValidation, h as recurringPaymentsValidation, j as recurringPaymentsPercentageValidation, s as seasonalBusinessValidation, o as otherPaymentDetailsValidation } from './schema-validations-e725d701.js';
3
3
 
4
4
  const businessCoreInfoSchema = (allowOptionalFields) => {
5
5
  const schema = create$3({
@@ -1,4 +1,4 @@
1
- import { a as BusinessClassification } from './Business-e218b4f4.js';
1
+ import { a as BusinessClassification } from './Business-b73d5055.js';
2
2
 
3
3
  const businessClassificationOptions = [
4
4
  {
@@ -22,7 +22,7 @@ const businessClassificationOptions = [
22
22
  value: BusinessClassification.public_company,
23
23
  },
24
24
  {
25
- label: 'Limited',
25
+ label: 'Limited Liability Company (LLC)',
26
26
  value: BusinessClassification.limited,
27
27
  },
28
28
  {
@@ -1,5 +1,5 @@
1
1
  import { c as create$3, a as create$6 } from './index.esm-fc4f5c0c.js';
2
- import { l as lineOneValidation, a as lineTwoValidation, c as cityValidation, s as stateValidation, p as postalValidation, i as identityNameValidation, b as identityTitleValidation, e as emailValidation, d as phoneValidation, f as dobValidation, g as ssnValidation } from './schema-validations-a83ff220.js';
2
+ import { l as lineOneValidation, k as lineTwoValidation, m as cityValidation, n as stateValidation, q as postalValidation, u as identityNameValidation, v as identityTitleValidation, e as emailValidation, p as phoneValidation, x as dobValidation, y as ssnValidation } from './schema-validations-e725d701.js';
3
3
 
4
4
  const addressSchema = (allowOptionalFields) => {
5
5
  const schema = create$3({
@@ -45,46 +45,4 @@ const identitySchema = (role, allowOptionalFields) => {
45
45
  return allowOptionalFields ? easySchema : schema;
46
46
  };
47
47
 
48
- // These props should not be sent to the server
49
- // This function is for the larger business form.
50
- const parseBusiness = (values, initialValues) => {
51
- var _a;
52
- parseCoreInfo(values);
53
- parseAddressInfo(values.legal_address);
54
- parseIdentityInfo(values.representative);
55
- ((_a = initialValues.owners) === null || _a === void 0 ? void 0 : _a.length) && delete values.owners;
56
- return values;
57
- };
58
- // These functions are for the stepped business form.
59
- const parseCoreInfo = (values) => {
60
- delete values.id;
61
- delete values.documents;
62
- delete values.bank_accounts;
63
- delete values.product_categories;
64
- delete values.created_at;
65
- delete values.updated_at;
66
- delete values.associated_accounts;
67
- delete values.terms_conditions_accepted;
68
- return values;
69
- };
70
- const parseAddressInfo = (values) => {
71
- delete values.id;
72
- delete values.created_at;
73
- delete values.updated_at;
74
- return values;
75
- };
76
- const parseIdentityInfo = (values) => {
77
- delete values.id;
78
- delete values.documents;
79
- delete values.created_at;
80
- delete values.updated_at;
81
- delete values.address.id;
82
- delete values.address.created_at;
83
- delete values.address.updated_at;
84
- delete values.business_id;
85
- delete values.dob_full;
86
- delete values.ssn_last4;
87
- return values;
88
- };
89
-
90
- export { addressSchema as a, parseCoreInfo as b, parseIdentityInfo as c, parseAddressInfo as d, identitySchema as i, parseBusiness as p };
48
+ export { addressSchema as a, identitySchema as i };
@@ -1,27 +1,28 @@
1
- import { A as Api } from './Api-b09a2f6a.js';
1
+ import { c as config } from './config-476c7241.js';
2
+ import { A as Api } from './Api-c8abc2e0.js';
2
3
 
3
4
  class BusinessService {
4
5
  async fetchBusiness(businessId, authToken) {
5
6
  const endpoint = `entities/business/${businessId}`;
6
- return Api({ authToken, apiOrigin: "" }).get(endpoint);
7
+ return Api({ authToken, apiOrigin: config.proxyApiOrigin }).get(endpoint);
7
8
  }
8
9
  async patchBusiness(authToken, businessId, payload) {
9
10
  const endpoint = `entities/business/${businessId}`;
10
- return Api({ authToken, apiOrigin: "" }).patch(endpoint, payload);
11
+ return Api({ authToken, apiOrigin: config.proxyApiOrigin }).patch(endpoint, payload);
11
12
  }
12
13
  }
13
14
  class IdentityService {
14
15
  async fetchIdentity(identityId, authToken) {
15
16
  const endpoint = `entities/identity/${identityId}`;
16
- return Api({ authToken, apiOrigin: "" }).get(endpoint);
17
+ return Api({ authToken, apiOrigin: config.proxyApiOrigin }).get(endpoint);
17
18
  }
18
19
  async patchIdentity(authToken, identityId, payload) {
19
20
  const endpoint = `entities/identity/${identityId}`;
20
- return Api({ authToken, apiOrigin: "" }).patch(endpoint, payload);
21
+ return Api({ authToken, apiOrigin: config.proxyApiOrigin }).patch(endpoint, payload);
21
22
  }
22
23
  async postIdentity(authToken, payload) {
23
24
  const endpoint = `entities/identity`;
24
- return Api({ authToken, apiOrigin: "" }).post(endpoint, payload);
25
+ return Api({ authToken, apiOrigin: config.proxyApiOrigin }).post(endpoint, payload);
25
26
  }
26
27
  }
27
28