@justifi/webcomponents 4.12.1 → 4.13.0-rc.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (173) hide show
  1. package/dist/cjs/{Business-c928bf29.js → Business-98686045.js} +27 -4
  2. package/dist/cjs/additional-questions-details_5.cjs.entry.js +4 -4
  3. package/dist/cjs/{business-additional-questions-schema-3813615c.js → business-additional-questions-schema-f8086f7a.js} +19 -9
  4. package/dist/cjs/business-form-options-fd1c0032.js +128 -0
  5. package/dist/cjs/{business-form-types-4b138bf2.js → business-form-types-29b2bad9.js} +0 -26
  6. package/dist/cjs/form-control-date_3.cjs.entry.js +2 -2
  7. package/dist/cjs/form-control-datepart_2.cjs.entry.js +1 -1
  8. package/dist/cjs/form-control-monetary.cjs.entry.js +7 -12
  9. package/dist/cjs/form-input-masks-0879c139.js +27 -0
  10. package/dist/cjs/{index-fc5339a5.js → index-d8e99b54.js} +352 -198
  11. package/dist/cjs/justifi-additional-questions-form-step_5.cjs.entry.js +10 -9
  12. package/dist/cjs/justifi-additional-questions_4.cjs.entry.js +7 -7
  13. package/dist/cjs/justifi-billing-form_4.cjs.entry.js +4 -4
  14. package/dist/cjs/justifi-business-details.cjs.entry.js +2 -2
  15. package/dist/cjs/justifi-business-form.cjs.entry.js +6 -5
  16. package/dist/cjs/justifi-business-list.cjs.entry.js +2 -2
  17. package/dist/cjs/justifi-business-owners.cjs.entry.js +1 -1
  18. package/dist/cjs/justifi-checkout-core.cjs.entry.js +9 -4
  19. package/dist/cjs/justifi-checkout.cjs.entry.js +26 -4
  20. package/dist/cjs/justifi-new-payment-method_4.cjs.entry.js +1 -1
  21. package/dist/cjs/justifi-owner-form.cjs.entry.js +6 -5
  22. package/dist/cjs/justifi-payment-provisioning.cjs.entry.js +1 -3
  23. package/dist/cjs/justifi-refund-form.cjs.entry.js +2 -1
  24. package/dist/cjs/loader.cjs.js +1 -1
  25. package/dist/cjs/{payload-parsers-58d3798e.js → payload-parsers-fe27be37.js} +65 -6
  26. package/dist/cjs/{state-options-4fbcb48a.js → state-options-4145f9b4.js} +0 -4
  27. package/dist/cjs/webcomponents.cjs.js +1 -1
  28. package/dist/collection/api/Business.js +26 -3
  29. package/dist/collection/components/business-details/additional-questions-details/additional-questions-details.js +2 -2
  30. package/dist/collection/components/business-details/generic-info-details/generic-info-details.js +2 -2
  31. package/dist/collection/components/business-forms/business-form/additional-questions/additional-questions.js +4 -2
  32. package/dist/collection/components/business-forms/business-form/business-core-info/business-core-info.js +2 -2
  33. package/dist/collection/components/business-forms/payment-provisioning/additional-questions/business-additional-questions-form-step.js +4 -2
  34. package/dist/collection/components/business-forms/payment-provisioning/business-core-info/business-core-info-form-step.js +3 -2
  35. package/dist/collection/components/business-forms/schemas/business-additional-questions-schema.js +16 -9
  36. package/dist/collection/components/business-forms/schemas/business-core-info-schema.js +5 -1
  37. package/dist/collection/components/business-forms/schemas/schema-helpers.js +3 -0
  38. package/dist/collection/components/business-forms/schemas/schema-validations.js +53 -6
  39. package/dist/collection/components/business-forms/utils/business-form-options.js +119 -0
  40. package/dist/collection/components/business-forms/utils/business-form-types.js +0 -23
  41. package/dist/collection/components/checkout/checkout-actions.js +28 -5
  42. package/dist/collection/components/checkout/checkout-core.js +30 -6
  43. package/dist/collection/components/checkout/payment-method-options.js +2 -18
  44. package/dist/collection/components/checkout/test/checkout-actions.spec.js +126 -0
  45. package/dist/collection/components/checkout/test/checkout-core.spec.js +127 -0
  46. package/dist/collection/components/checkout/test/checkout.spec.js +0 -153
  47. package/dist/collection/components/form/form-control-monetary.css +1812 -0
  48. package/dist/collection/components/form/form-control-monetary.js +24 -11
  49. package/dist/collection/components/form/test/form-control-monetary.spec.js +5 -3
  50. package/dist/collection/components/payment-method-form/payment-method-form.js +1 -1
  51. package/dist/collection/components/refund-form/refund-form.js +2 -1
  52. package/dist/collection/utils/form-input-masks.js +15 -0
  53. package/dist/collection/utils/state-options.js +0 -4
  54. package/dist/docs.json +93 -30
  55. package/dist/esm/{Business-6cb1b9c8.js → Business-6e0efa26.js} +28 -5
  56. package/dist/esm/additional-questions-details_5.entry.js +4 -4
  57. package/dist/esm/business-additional-questions-schema-8e742129.js +54 -0
  58. package/dist/esm/business-form-options-75c0a7ec.js +122 -0
  59. package/dist/esm/{business-form-types-5ba52d61.js → business-form-types-0d76133c.js} +1 -25
  60. package/dist/esm/form-control-date_3.entry.js +2 -2
  61. package/dist/esm/form-control-datepart_2.entry.js +1 -1
  62. package/dist/esm/form-control-monetary.entry.js +7 -12
  63. package/dist/esm/form-input-masks-0e18300f.js +22 -0
  64. package/dist/esm/{index-5eb05747.js → index-dc1350b1.js} +352 -198
  65. package/dist/esm/justifi-additional-questions-form-step_5.entry.js +10 -9
  66. package/dist/esm/justifi-additional-questions_4.entry.js +7 -7
  67. package/dist/esm/justifi-billing-form_4.entry.js +4 -4
  68. package/dist/esm/justifi-business-details.entry.js +2 -2
  69. package/dist/esm/justifi-business-form.entry.js +6 -5
  70. package/dist/esm/justifi-business-list.entry.js +2 -2
  71. package/dist/esm/justifi-business-owners.entry.js +1 -1
  72. package/dist/esm/justifi-checkout-core.entry.js +9 -4
  73. package/dist/esm/justifi-checkout.entry.js +27 -5
  74. package/dist/esm/justifi-new-payment-method_4.entry.js +1 -1
  75. package/dist/esm/justifi-owner-form.entry.js +6 -5
  76. package/dist/esm/justifi-payment-provisioning.entry.js +1 -3
  77. package/dist/esm/justifi-refund-form.entry.js +2 -1
  78. package/dist/esm/loader.js +1 -1
  79. package/dist/esm/{payload-parsers-3e817fe9.js → payload-parsers-73c12fa2.js} +57 -7
  80. package/dist/esm/{state-options-a356fb11.js → state-options-c0b757ad.js} +0 -4
  81. package/dist/esm/webcomponents.js +1 -1
  82. package/dist/module/Business.js +27 -4
  83. package/dist/module/additional-questions-details2.js +2 -2
  84. package/dist/module/additional-questions.js +18 -4
  85. package/dist/module/business-additional-questions-form-step.js +18 -4
  86. package/dist/module/business-additional-questions-schema.js +16 -9
  87. package/dist/module/business-address-schema.js +1 -1
  88. package/dist/module/business-core-info-form-step.js +10 -3
  89. package/dist/module/business-core-info-schema.js +5 -1
  90. package/dist/module/business-core-info.js +9 -3
  91. package/dist/module/business-form-options.js +122 -0
  92. package/dist/module/business-form-types.js +153 -24
  93. package/dist/module/business-identity-schema.js +1 -1
  94. package/dist/module/business-representative-form-step.js +1 -1
  95. package/dist/module/checkout-core.js +9 -5
  96. package/dist/module/form-control-monetary2.js +8 -12
  97. package/dist/module/form-input-masks.js +16 -1
  98. package/dist/module/generic-info-details2.js +2 -2
  99. package/dist/module/index2.js +352 -198
  100. package/dist/module/justifi-business-details.js +1 -1
  101. package/dist/module/justifi-business-form.js +3 -3
  102. package/dist/module/justifi-business-list.js +1 -1
  103. package/dist/module/justifi-checkout.js +27 -5
  104. package/dist/module/justifi-payment-provisioning.js +1 -1
  105. package/dist/module/justifi-refund-form.js +2 -1
  106. package/dist/module/legal-address-form-step.js +2 -2
  107. package/dist/module/owner-form.js +2 -2
  108. package/dist/module/payload-parsers.js +1 -104
  109. package/dist/module/payment-method-form.js +3 -3
  110. package/dist/module/payment-method-options.js +2 -2
  111. package/dist/module/state-options.js +0 -4
  112. package/dist/types/api/Business.d.ts +34 -5
  113. package/dist/types/api/services/checkout.service.d.ts +3 -3
  114. package/dist/types/components/business-forms/schemas/business-additional-questions-schema.d.ts +10 -4
  115. package/dist/types/components/business-forms/schemas/business-core-info-schema.d.ts +4 -0
  116. package/dist/types/components/business-forms/schemas/business-form-schema.d.ts +14 -4
  117. package/dist/types/components/business-forms/schemas/schema-helpers.d.ts +3 -0
  118. package/dist/types/components/business-forms/schemas/schema-validations.d.ts +9 -0
  119. package/dist/types/components/business-forms/utils/business-form-options.d.ts +21 -0
  120. package/dist/types/components/business-forms/utils/business-form-types.d.ts +0 -5
  121. package/dist/types/components/checkout/checkout-core.d.ts +3 -2
  122. package/dist/types/components/checkout/payment-method-options.d.ts +1 -1
  123. package/dist/types/components/form/form-control-monetary.d.ts +1 -0
  124. package/dist/types/components.d.ts +4 -2
  125. package/dist/types/utils/form-input-masks.d.ts +15 -0
  126. package/dist/webcomponents/{p-31e70d65.entry.js → p-19885f77.entry.js} +1 -1
  127. package/dist/webcomponents/p-2c4c5f0d.entry.js +1 -0
  128. package/dist/webcomponents/p-30b6ea06.entry.js +1 -0
  129. package/dist/webcomponents/p-31e8f29c.entry.js +1 -0
  130. package/dist/webcomponents/p-31fe7232.entry.js +1 -0
  131. package/dist/webcomponents/p-3496e37f.js +1 -0
  132. package/dist/webcomponents/{p-2fbe8823.entry.js → p-35e59bb5.entry.js} +1 -1
  133. package/dist/webcomponents/p-3917edbf.entry.js +1 -0
  134. package/dist/webcomponents/p-3934a3a8.entry.js +1 -0
  135. package/dist/webcomponents/p-3ffe6784.js +1 -0
  136. package/dist/webcomponents/p-49c349e7.js +1 -0
  137. package/dist/webcomponents/p-4d335a3d.entry.js +1 -0
  138. package/dist/webcomponents/p-4ff52695.entry.js +1 -0
  139. package/dist/webcomponents/p-525db3e8.js +1 -0
  140. package/dist/webcomponents/p-57fbd98d.js +1 -0
  141. package/dist/webcomponents/p-5a789239.entry.js +1 -0
  142. package/dist/webcomponents/{p-5f5e730c.entry.js → p-834cba99.entry.js} +1 -1
  143. package/dist/webcomponents/p-87d646c0.js +1 -0
  144. package/dist/webcomponents/{p-2bee72bd.entry.js → p-8da13f40.entry.js} +1 -1
  145. package/dist/webcomponents/p-935d6f55.js +1 -0
  146. package/dist/webcomponents/{p-71b8e2da.entry.js → p-ba454cd7.entry.js} +1 -1
  147. package/dist/webcomponents/p-ed6ca114.js +1 -0
  148. package/dist/webcomponents/p-ee68566f.entry.js +1 -0
  149. package/dist/webcomponents/{p-b9f04fb0.entry.js → p-f152d6b8.entry.js} +1 -1
  150. package/dist/webcomponents/p-f3cf3513.entry.js +1 -0
  151. package/dist/webcomponents/webcomponents.esm.js +1 -1
  152. package/package.json +2 -2
  153. package/dist/cjs/form-input-masks-efd44b8e.js +0 -11
  154. package/dist/esm/business-additional-questions-schema-228d86e0.js +0 -44
  155. package/dist/esm/form-input-masks-84875967.js +0 -7
  156. package/dist/webcomponents/p-01913426.js +0 -1
  157. package/dist/webcomponents/p-07080c01.entry.js +0 -1
  158. package/dist/webcomponents/p-0d371ff5.entry.js +0 -1
  159. package/dist/webcomponents/p-2319abaf.entry.js +0 -1
  160. package/dist/webcomponents/p-26fe62d6.entry.js +0 -1
  161. package/dist/webcomponents/p-31ccb5f0.entry.js +0 -1
  162. package/dist/webcomponents/p-4c705f56.js +0 -1
  163. package/dist/webcomponents/p-6078a370.js +0 -1
  164. package/dist/webcomponents/p-737473d8.js +0 -1
  165. package/dist/webcomponents/p-787d8f52.js +0 -1
  166. package/dist/webcomponents/p-889a83d2.js +0 -1
  167. package/dist/webcomponents/p-927150b4.entry.js +0 -1
  168. package/dist/webcomponents/p-93579716.js +0 -1
  169. package/dist/webcomponents/p-9b0e5c25.entry.js +0 -1
  170. package/dist/webcomponents/p-9e3f9e05.entry.js +0 -1
  171. package/dist/webcomponents/p-c1b92cec.entry.js +0 -1
  172. package/dist/webcomponents/p-c865cda8.entry.js +0 -1
  173. package/dist/webcomponents/p-edab5f2b.entry.js +0 -1
@@ -2,7 +2,7 @@ import { proxyCustomElement, HTMLElement, createEvent, h, Host } from '@stencil/
2
2
  import { E as ErrorState } from './utils.js';
3
3
  import { c as config } from './config.js';
4
4
  import { A as Api } from './Api.js';
5
- import { a as Business } from './Business.js';
5
+ import { b as Business } from './Business.js';
6
6
  import { C as ComponentErrorSeverity, g as getErrorMessage, a as getErrorCode, b as ComponentErrorCodes } from './utils3.js';
7
7
  import { d as defineCustomElement$7 } from './additional-questions-details2.js';
8
8
  import { d as defineCustomElement$6 } from './business-details-core2.js';
@@ -9,11 +9,11 @@ import { A as Api } from './Api.js';
9
9
  import './Pagination.js';
10
10
  import './Payment.js';
11
11
  import './Payout.js';
12
- import { f as parseBusiness } from './payload-parsers.js';
12
+ import { a as parseBusiness } from './payload-parsers.js';
13
13
  import { c as config } from './config.js';
14
14
  import { F as FormAlert } from './utils4.js';
15
- import { B as BusinessFormServerErrors, b as BusinessFormClickActions } from './business-form-types.js';
16
- import { a as Business } from './Business.js';
15
+ import { B as BusinessFormServerErrors, l as BusinessFormClickActions } from './business-form-types.js';
16
+ import { b as Business } from './Business.js';
17
17
  import { d as defineCustomElement$b } from './form-control-date2.js';
18
18
  import { d as defineCustomElement$a } from './form-control-monetary2.js';
19
19
  import { d as defineCustomElement$9 } from './form-control-number-masked2.js';
@@ -3,7 +3,7 @@ import { A as Api } from './Api.js';
3
3
  import { p as pagingDefaults } from './Pagination.js';
4
4
  import './Payment.js';
5
5
  import './Payout.js';
6
- import { a as Business } from './Business.js';
6
+ import { b as Business } from './Business.js';
7
7
  import { s as snakeCaseToHumanReadable, e as formatDate } from './utils2.js';
8
8
  import { c as config } from './config.js';
9
9
  import { d as defineCustomElement$3 } from './table.js';
@@ -1,5 +1,5 @@
1
1
  import { proxyCustomElement, HTMLElement, h } from '@stencil/core/internal/client';
2
- import { g as getErrorMessage } from './utils3.js';
2
+ import { C as ComponentErrorSeverity, g as getErrorMessage, a as getErrorCode } from './utils3.js';
3
3
  import { A as Api } from './Api.js';
4
4
  import './Pagination.js';
5
5
  import './Payment.js';
@@ -16,6 +16,7 @@ import { d as defineCustomElement$3 } from './select-input2.js';
16
16
  import { d as defineCustomElement$2 } from './text-input2.js';
17
17
 
18
18
  const makeGetCheckout = ({ authToken, checkoutId, service }) => async ({ onSuccess, onError }) => {
19
+ var _a;
19
20
  try {
20
21
  const response = await service.fetchCheckout(authToken, checkoutId);
21
22
  if (!response.error) {
@@ -24,14 +25,25 @@ const makeGetCheckout = ({ authToken, checkoutId, service }) => async ({ onSucce
24
25
  }
25
26
  else {
26
27
  const responseError = getErrorMessage(response.error);
27
- return onError(responseError);
28
+ const code = getErrorCode((_a = response.error) === null || _a === void 0 ? void 0 : _a.code);
29
+ return onError({
30
+ error: responseError,
31
+ code,
32
+ severity: ComponentErrorSeverity.ERROR,
33
+ });
28
34
  }
29
35
  }
30
36
  catch (error) {
31
- return onError(error.message || error);
37
+ const code = getErrorCode(error === null || error === void 0 ? void 0 : error.code);
38
+ return onError({
39
+ error: error.message || error,
40
+ code,
41
+ severity: ComponentErrorSeverity.ERROR,
42
+ });
32
43
  }
33
44
  };
34
45
  const makeCheckoutComplete = ({ authToken, checkoutId, service }) => async ({ payment, onSuccess, onError }) => {
46
+ var _a;
35
47
  try {
36
48
  const response = await service.complete(authToken, checkoutId, payment);
37
49
  if (!response.error) {
@@ -40,11 +52,21 @@ const makeCheckoutComplete = ({ authToken, checkoutId, service }) => async ({ pa
40
52
  }
41
53
  else {
42
54
  const responseError = getErrorMessage(response.error);
43
- return onError(responseError);
55
+ const code = getErrorCode((_a = response.error) === null || _a === void 0 ? void 0 : _a.code);
56
+ return onError({
57
+ error: responseError,
58
+ code,
59
+ severity: ComponentErrorSeverity.ERROR,
60
+ });
44
61
  }
45
62
  }
46
63
  catch (error) {
47
- return onError(error.message || error);
64
+ const code = getErrorCode(error === null || error === void 0 ? void 0 : error.code);
65
+ return onError({
66
+ error: error.message || error,
67
+ code,
68
+ severity: ComponentErrorSeverity.ERROR,
69
+ });
48
70
  }
49
71
  };
50
72
 
@@ -1,6 +1,6 @@
1
1
  import { proxyCustomElement, HTMLElement, createEvent, h, Host } from '@stencil/core/internal/client';
2
2
  import { F as FormAlert, L as LoadingSpinner } from './utils4.js';
3
- import { b as BusinessFormClickActions } from './business-form-types.js';
3
+ import { l as BusinessFormClickActions } from './business-form-types.js';
4
4
  import { d as defineCustomElement$d } from './form-control-date2.js';
5
5
  import { d as defineCustomElement$c } from './form-control-monetary2.js';
6
6
  import { d as defineCustomElement$b } from './form-control-number-masked2.js';
@@ -6,6 +6,7 @@ import './Payment.js';
6
6
  import './Payout.js';
7
7
  import { F as FormController } from './form.js';
8
8
  import { c as config } from './config.js';
9
+ import { C as CURRENCY_MASK } from './form-input-masks.js';
9
10
  import { d as defineCustomElement$3 } from './form-control-monetary2.js';
10
11
  import { d as defineCustomElement$2 } from './form-control-text2.js';
11
12
 
@@ -96,7 +97,7 @@ const RefundForm = /*@__PURE__*/ proxyCustomElement(class RefundForm extends HTM
96
97
  }
97
98
  render() {
98
99
  var _a;
99
- return (h(Host, null, h("h1", null, "Refund"), this.refundInfoText && (h("div", { class: "d-flex align-items-center flex-row gap-4 border-top border-bottom my-4 p-3", role: "alert" }, h("img", { src: "/info-icon.svg", alt: "Information", height: "30", width: "30" }), h("p", { class: "m-0", innerHTML: this.refundInfoText }))), h("form", { onSubmit: e => this.handleSubmit(e), class: "d-grid gap-4" }, h("div", { class: "form-group" }, h("form-control-monetary", { name: "amount", label: "Refund Amount", defaultValue: ((_a = this.amount) === null || _a === void 0 ? void 0 : _a.toString()) || '', inputHandler: (name, value) => this.handleInput(name, value), error: this.errors.amount })), h("div", { class: "form-group" }, h("form-control-text", { name: "notes", label: "Additional Notes", inputHandler: (name, value) => this.handleInput(name, value), error: this.errors.notes })), this.withButton && (h("div", { class: "form-group d-flex flex-row-reverse" }, h("button", { type: "submit", disabled: !!this.isSubmitting, class: "btn btn-primary ml-auto" }, this.submitButtonText))))));
100
+ return (h(Host, null, h("h1", null, "Refund"), this.refundInfoText && (h("div", { class: "d-flex align-items-center flex-row gap-4 border-top border-bottom my-4 p-3", role: "alert" }, h("img", { src: "/info-icon.svg", alt: "Information", height: "30", width: "30" }), h("p", { class: "m-0", innerHTML: this.refundInfoText }))), h("form", { onSubmit: e => this.handleSubmit(e), class: "d-grid gap-4" }, h("div", { class: "form-group" }, h("form-control-monetary", { 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), error: this.errors.amount })), h("div", { class: "form-group" }, h("form-control-text", { name: "notes", label: "Additional Notes", inputHandler: (name, value) => this.handleInput(name, value), error: this.errors.notes })), this.withButton && (h("div", { class: "form-group d-flex flex-row-reverse" }, h("button", { type: "submit", disabled: !!this.isSubmitting, class: "btn btn-primary ml-auto" }, this.submitButtonText))))));
100
101
  }
101
102
  static get style() { return refundFormCss; }
102
103
  }, [1, "justifi-refund-form", {
@@ -1,8 +1,8 @@
1
1
  import { proxyCustomElement, HTMLElement, createEvent, h, Host } from '@stencil/core/internal/client';
2
2
  import { F as FormController } from './form.js';
3
3
  import { A as Api } from './Api.js';
4
- import { b as Address } from './Business.js';
5
- import { r as parseAddressInfo } from './payload-parsers.js';
4
+ import { c as Address } from './Business.js';
5
+ import { c as parseAddressInfo } from './payload-parsers.js';
6
6
  import { a as addressSchema } from './business-address-schema.js';
7
7
  import { c as config } from './config.js';
8
8
  import { B as BusinessFormServerErrors } from './business-form-types.js';
@@ -6,12 +6,12 @@ import './Pagination.js';
6
6
  import './Payment.js';
7
7
  import './Payout.js';
8
8
  import { O as Owner } from './Business.js';
9
- import { q as parseIdentityInfo } from './payload-parsers.js';
9
+ import { b as parseIdentityInfo } from './payload-parsers.js';
10
10
  import { i as identitySchema } from './business-identity-schema.js';
11
11
  import { c as config } from './config.js';
12
12
  import { L as LoadingSpinner } from './utils4.js';
13
13
  import { d as deconstructDate } from './helpers.js';
14
- import { c as OwnerFormServerErrors, O as OwnerFormClickActions } from './business-form-types.js';
14
+ import { C as OwnerFormServerErrors, O as OwnerFormClickActions } from './business-form-types.js';
15
15
  import { d as defineCustomElement$5 } from './form-control-date2.js';
16
16
  import { d as defineCustomElement$4 } from './form-control-number-masked2.js';
17
17
  import { d as defineCustomElement$3 } from './form-control-select2.js';
@@ -1,106 +1,3 @@
1
- import { a as create$6 } from './index.esm.js';
2
- import { a as BusinessTypeOptions } from './business-form-types.js';
3
- import { S as StateOptions } from './state-options.js';
4
-
5
- const transformEmptyString = (value) => {
6
- return value === '' ? null : value;
7
- };
8
- const businessNameRegex = /^(?!^\s+$)[a-zA-Z0-9\s,&.-]*$/;
9
- const phoneRegex = /^\d{10}$/;
10
- const urlRegex = /^(?:http(s)?:\/\/)?(?:www\.)?[-a-zA-Z0-9@:%._\+~#=]{2,256}\.[a-z]{2,6}\b([-a-zA-Z0-9@:%_\+.~#?&//=]*)$/;
11
- const taxIdRegex = /^\d{9}$/;
12
- const stringLettersOnlyRegex = /^(?!^\s+$)[a-zA-Z\s]*$/;
13
- const ssnRegex = /^(?!000|666|9\d{2})\d{3}(?!00)\d{2}(?!0000)\d{4}$/;
14
-
15
- // Common Validations
16
- const emailValidation = create$6()
17
- .email('Enter valid email')
18
- .transform(transformEmptyString);
19
- const phoneValidation = create$6()
20
- .matches(phoneRegex, 'Enter valid phone number')
21
- .transform(transformEmptyString);
22
- // Core Info Validations
23
- const businessNameValidation = create$6()
24
- .min(2, 'Name must be at least 2 characters')
25
- .max(100, 'Name must be less than 100 characters')
26
- .matches(businessNameRegex, 'Enter valid business name')
27
- .transform(transformEmptyString);
28
- const doingBusinessAsValidation = create$6()
29
- .min(2, 'Name must be at least 2 characters')
30
- .max(100, 'Name must be less than 100 characters')
31
- .matches(businessNameRegex, 'Enter valid doing business as')
32
- .transform(transformEmptyString);
33
- const websiteUrlValidation = create$6()
34
- .matches(urlRegex, 'Enter valid website url')
35
- .transform(transformEmptyString);
36
- const businessTypeValidation = create$6()
37
- .oneOf(BusinessTypeOptions.map((option) => option.value), 'Select business type')
38
- .transform(transformEmptyString);
39
- const industryValidation = create$6()
40
- .min(2, 'Industry must be at least 2 characters')
41
- .max(50, 'Industry must be less than 50 characters')
42
- .matches(stringLettersOnlyRegex, 'Enter valid industry')
43
- .transform(transformEmptyString);
44
- const taxIdValidation = create$6()
45
- .matches(taxIdRegex, 'Enter valid tax id')
46
- .transform(transformEmptyString);
47
- // Identity Validations
48
- const identityNameValidation = create$6()
49
- .min(2, 'Name must be at least 2 characters')
50
- .max(100, 'Name must be less than 100 characters')
51
- .matches(stringLettersOnlyRegex, 'Enter valid name')
52
- .transform(transformEmptyString);
53
- const identityTitleValidation = create$6()
54
- .min(2, 'Title must be at least 2 characters')
55
- .max(50, 'Title must be less than 50 characters')
56
- .matches(stringLettersOnlyRegex, 'Enter valid title')
57
- .transform(transformEmptyString);
58
- const dobValidation = (role) => {
59
- return (create$6()
60
- .test('min', 'Enter a valid date', (value) => {
61
- const date = new Date(value);
62
- const minDate = new Date('1902-01-01');
63
- return date >= minDate;
64
- })
65
- .test('age', `${role} must be at least 18 years old`, (value) => {
66
- const date = new Date(value);
67
- const minAgeDate = new Date();
68
- minAgeDate.setFullYear(minAgeDate.getFullYear() - 18);
69
- return date <= minAgeDate;
70
- })
71
- .transform(transformEmptyString));
72
- };
73
- const ssnValidation = create$6()
74
- .matches(ssnRegex, 'Enter valid SSN')
75
- .test('not-repeat', 'Enter valid SSN', (value) => {
76
- return !/^(\d)\1+$/.test(value);
77
- })
78
- .test('not-seq', 'Enter valid SSN', (value) => {
79
- return value !== '123456789';
80
- })
81
- .transform(transformEmptyString);
82
- // Address Validations
83
- const lineOneValidation = create$6()
84
- .min(5, 'Address must be at least 5 characters')
85
- .max(100, 'Address must be less than 100 characters')
86
- .matches(/^(?!^\s+$)[a-zA-Z0-9\s,.'-]*$/, 'Enter valid address line 1')
87
- .transform(transformEmptyString);
88
- const lineTwoValidation = create$6()
89
- .max(100, 'Address must be less than 100 characters')
90
- .matches(/^(?!^\s+$)[a-zA-Z0-9\s,.'-]*$/, 'Enter valid address line 2')
91
- .transform(transformEmptyString);
92
- const cityValidation = create$6()
93
- .min(2, 'City must be at least 2 characters')
94
- .max(50, 'City must be less than 50 characters')
95
- .matches(/^(?!^\s+$)[a-zA-Z\s]*$/, 'Enter valid city')
96
- .transform(transformEmptyString);
97
- const stateValidation = create$6()
98
- .oneOf(StateOptions.map((option) => option.value), 'Select state')
99
- .transform(transformEmptyString);
100
- const postalValidation = create$6()
101
- .matches(/^[0-9]{5}$/, 'Enter valid postal code')
102
- .transform(transformEmptyString);
103
-
104
1
  // These props should not be sent to the server
105
2
  // This function is for the larger business form.
106
3
  const parseBusiness = (values, initialValues) => {
@@ -141,4 +38,4 @@ const parseIdentityInfo = (values) => {
141
38
  return values;
142
39
  };
143
40
 
144
- export { phoneValidation as a, businessNameValidation as b, businessTypeValidation as c, doingBusinessAsValidation as d, emailValidation as e, parseBusiness as f, identityNameValidation as g, identityTitleValidation as h, industryValidation as i, dobValidation as j, lineTwoValidation as k, lineOneValidation as l, cityValidation as m, stateValidation as n, postalValidation as o, parseCoreInfo as p, parseIdentityInfo as q, parseAddressInfo as r, ssnValidation as s, taxIdValidation as t, websiteUrlValidation as w };
41
+ export { parseBusiness as a, parseIdentityInfo as b, parseAddressInfo as c, parseCoreInfo as p };
@@ -1490,7 +1490,7 @@ const MessageEventType = {
1490
1490
  };
1491
1491
 
1492
1492
  const name = "@justifi/webcomponents";
1493
- const version = "4.12.1";
1493
+ const version = "4.13.0-rc.0";
1494
1494
  const description = "JustiFi Web Components";
1495
1495
  const main = "dist/module/index.js";
1496
1496
  const module = "dist/module/index.js";
@@ -1524,7 +1524,7 @@ const dependencies = {
1524
1524
  "date-fns": "^2.29.3",
1525
1525
  "dinero.js": "^1.9.1",
1526
1526
  "iframe-resizer": "^4.3.7",
1527
- imask: "^7.1.3",
1527
+ imask: "^7.6.0",
1528
1528
  rxjs: "^7.8.1",
1529
1529
  "ts-dedent": "^2.2.0",
1530
1530
  uuid: "^9.0.0",
@@ -1724,11 +1724,11 @@ const PaymentMethodForm = /*@__PURE__*/ proxyCustomElement(class PaymentMethodFo
1724
1724
  render() {
1725
1725
  return (h(Host, null, h("iframe", { id: `justifi-payment-method-form-${this.paymentMethodFormType}`, src: this.getIframeSrc(), ref: el => {
1726
1726
  this.iframeElement = el;
1727
+ this.initializeFrameCommunicationService();
1727
1728
  }, onLoad: () => {
1728
1729
  iframeResizer({
1729
1730
  scrollbars: false,
1730
1731
  }, this.iframeElement);
1731
- this.initializeFrameCommunicationService();
1732
1732
  this.sendStyleOverrides();
1733
1733
  } })));
1734
1734
  }
@@ -23,8 +23,8 @@ const PaymentMethodOptions = /*@__PURE__*/ proxyCustomElement(class PaymentMetho
23
23
  this.accountId = undefined;
24
24
  this.iframeOrigin = config.iframeOrigin;
25
25
  this.savedPaymentMethods = [];
26
- this.selectedPaymentMethodId = undefined;
27
26
  this.paymentAmount = undefined;
27
+ this.selectedPaymentMethodId = undefined;
28
28
  this.paymentMethodOptions = [];
29
29
  }
30
30
  paymentMethodsChanged() {
@@ -90,8 +90,8 @@ const PaymentMethodOptions = /*@__PURE__*/ proxyCustomElement(class PaymentMetho
90
90
  "accountId": [1, "account-id"],
91
91
  "iframeOrigin": [1025, "iframe-origin"],
92
92
  "savedPaymentMethods": [16],
93
- "selectedPaymentMethodId": [1, "selected-payment-method-id"],
94
93
  "paymentAmount": [1, "payment-amount"],
94
+ "selectedPaymentMethodId": [32],
95
95
  "paymentMethodOptions": [32],
96
96
  "resolvePaymentMethod": [64]
97
97
  }, [[0, "paymentMethodOptionSelected", "paymentMethodOptionSelected"]], {
@@ -1,8 +1,4 @@
1
1
  const StateOptions = [
2
- {
3
- label: 'Choose state',
4
- value: '',
5
- },
6
2
  {
7
3
  label: 'Alabama',
8
4
  value: 'AL',
@@ -6,6 +6,21 @@ export declare enum BusinessType {
6
6
  non_profit = "non_profit",
7
7
  government_entity = "government_entity"
8
8
  }
9
+ export declare enum BusinessStructure {
10
+ sole_proprietorship = "sole_proprietorship",
11
+ single_llc = "single_llc",
12
+ multi_llc = "multi_llc",
13
+ private_partnership = "private_partnership",
14
+ private_corporation = "private_corporation",
15
+ unincorporated_association = "unincorporated_association",
16
+ public_partnership = "public_partnership",
17
+ public_corporation = "public_corporation",
18
+ incorporated = "incorporated",
19
+ unincorporated = "unincorporated",
20
+ government_unit = "government_unit",
21
+ government_instrumentality = "government_instrumentality",
22
+ tax_exempt_government_instrumentality = "tax_exempt_government_instrumentality"
23
+ }
9
24
  export interface IAddress {
10
25
  id?: string;
11
26
  platform_account_id?: string;
@@ -55,18 +70,25 @@ export interface ProductCategories {
55
70
  export interface IAdditionalQuestions {
56
71
  business_revenue?: string;
57
72
  business_payment_volume?: string;
58
- business_dispute_volume?: string;
59
- business_receivable_volume?: string;
73
+ business_when_service_received?: string;
74
+ business_recurring_payments?: string;
75
+ business_recurring_payments_percentage?: string;
76
+ business_seasonal?: string;
77
+ business_other_payment_details?: string;
60
78
  }
61
79
  export declare class AdditionalQuestions implements IAdditionalQuestions {
62
80
  business_revenue?: string;
63
81
  business_payment_volume?: string;
64
- business_dispute_volume?: string;
65
- business_receivable_volume?: string;
82
+ business_when_service_received?: string;
83
+ business_recurring_payments?: string;
84
+ business_recurring_payments_percentage?: string;
85
+ business_seasonal?: string;
86
+ business_other_payment_details?: string;
66
87
  constructor(additionalQuestions: IAdditionalQuestions);
67
88
  }
68
89
  export interface ICoreBusinessInfo {
69
90
  business_type?: BusinessType;
91
+ business_structure?: BusinessStructure;
70
92
  legal_name?: string;
71
93
  doing_business_as?: string;
72
94
  industry?: string;
@@ -74,9 +96,11 @@ export interface ICoreBusinessInfo {
74
96
  website_url?: string;
75
97
  email?: string;
76
98
  phone?: string;
99
+ date_of_incorporation?: string;
77
100
  }
78
101
  export declare class CoreBusinessInfo implements ICoreBusinessInfo {
79
102
  business_type: BusinessType;
103
+ business_structure: BusinessStructure;
80
104
  legal_name: string;
81
105
  doing_business_as: string;
82
106
  industry: string;
@@ -84,11 +108,13 @@ export declare class CoreBusinessInfo implements ICoreBusinessInfo {
84
108
  website_url: string;
85
109
  email: string;
86
110
  phone: string;
111
+ date_of_incorporation: string;
87
112
  constructor(coreBusinessInfo: ICoreBusinessInfo);
88
113
  }
89
114
  export interface IBusiness {
90
115
  additional_questions: IAdditionalQuestions | {};
91
116
  business_type: BusinessType;
117
+ business_structure: BusinessStructure;
92
118
  bank_accounts: BankAccount[];
93
119
  created_at: string;
94
120
  documents: Document[];
@@ -107,10 +133,12 @@ export interface IBusiness {
107
133
  tax_id: string;
108
134
  updated_at: string;
109
135
  website_url: string;
136
+ date_of_incorporation?: string;
110
137
  }
111
138
  export declare class Business implements IBusiness {
112
- additional_questions: IAdditionalQuestions | {};
139
+ additional_questions: AdditionalQuestions | {};
113
140
  business_type: BusinessType;
141
+ business_structure: BusinessStructure;
114
142
  bank_accounts: BankAccount[];
115
143
  created_at: string;
116
144
  documents: Document[];
@@ -128,6 +156,7 @@ export declare class Business implements IBusiness {
128
156
  tax_id: string;
129
157
  updated_at: string;
130
158
  website_url: string;
159
+ date_of_incorporation?: string;
131
160
  product_categories: ProductCategories;
132
161
  constructor(business: IBusiness);
133
162
  }
@@ -1,15 +1,15 @@
1
- import { IApiResponse, ICheckout } from '..';
1
+ import { IApiResponse, ICheckout, ICheckoutCompleteResponse } from '..';
2
2
  export interface ICheckoutService {
3
3
  fetchCheckout(authToken: string, checkoutId: string): Promise<IApiResponse<ICheckout>>;
4
4
  complete(authToken: string, checkoutId: string, payment: {
5
5
  payment_mode: string;
6
6
  payment_token?: string;
7
- }): Promise<IApiResponse<ICheckout>>;
7
+ }): Promise<IApiResponse<ICheckoutCompleteResponse>>;
8
8
  }
9
9
  export declare class CheckoutService implements ICheckoutService {
10
10
  fetchCheckout(authToken: string, checkoutId: string): Promise<IApiResponse<ICheckout>>;
11
11
  complete(authToken: string, checkoutId: string, payment: {
12
12
  payment_mode: string;
13
13
  payment_token?: string;
14
- }): Promise<IApiResponse<ICheckout>>;
14
+ }): Promise<IApiResponse<ICheckoutCompleteResponse>>;
15
15
  }
@@ -1,11 +1,17 @@
1
1
  export declare const additionalQuestionsSchema: (allowOptionalFields?: boolean) => import("yup").ObjectSchema<{
2
2
  business_revenue: string;
3
3
  business_payment_volume: string;
4
- business_dispute_volume: string;
5
- business_receivable_volume: string;
4
+ business_when_service_received: string;
5
+ business_recurring_payments: string;
6
+ business_recurring_payments_percentage: string;
7
+ business_seasonal: string;
8
+ business_other_payment_details: string;
6
9
  }, import("yup").AnyObject, {
7
10
  business_revenue: undefined;
8
11
  business_payment_volume: undefined;
9
- business_dispute_volume: undefined;
10
- business_receivable_volume: undefined;
12
+ business_when_service_received: undefined;
13
+ business_recurring_payments: undefined;
14
+ business_recurring_payments_percentage: undefined;
15
+ business_seasonal: undefined;
16
+ business_other_payment_details: undefined;
11
17
  }, "">;
@@ -5,8 +5,10 @@ export declare const businessCoreInfoSchema: (allowOptionalFields?: boolean) =>
5
5
  phone: string;
6
6
  doing_business_as: string;
7
7
  business_type: string;
8
+ business_structure: string;
8
9
  industry: string;
9
10
  tax_id: string;
11
+ date_of_incorporation: string;
10
12
  }, import("yup").AnyObject, {
11
13
  legal_name: undefined;
12
14
  website_url: undefined;
@@ -14,6 +16,8 @@ export declare const businessCoreInfoSchema: (allowOptionalFields?: boolean) =>
14
16
  phone: undefined;
15
17
  doing_business_as: undefined;
16
18
  business_type: undefined;
19
+ business_structure: undefined;
17
20
  industry: undefined;
18
21
  tax_id: undefined;
22
+ date_of_incorporation: undefined;
19
23
  }, "">;
@@ -8,10 +8,13 @@ export declare const businessFormSchema: import("yup").ObjectSchema<{
8
8
  country?: string;
9
9
  };
10
10
  additional_questions: {
11
+ business_recurring_payments?: string;
11
12
  business_revenue?: string;
12
13
  business_payment_volume?: string;
13
- business_dispute_volume?: string;
14
- business_receivable_volume?: string;
14
+ business_when_service_received?: string;
15
+ business_recurring_payments_percentage?: string;
16
+ business_seasonal?: string;
17
+ business_other_payment_details?: string;
15
18
  };
16
19
  representative: {
17
20
  address?: {
@@ -35,8 +38,10 @@ export declare const businessFormSchema: import("yup").ObjectSchema<{
35
38
  phone: unknown;
36
39
  doing_business_as: unknown;
37
40
  business_type: unknown;
41
+ business_structure: unknown;
38
42
  industry: unknown;
39
43
  tax_id: unknown;
44
+ date_of_incorporation: unknown;
40
45
  }, import("yup").AnyObject, {
41
46
  legal_address: {
42
47
  line1: undefined;
@@ -49,8 +54,11 @@ export declare const businessFormSchema: import("yup").ObjectSchema<{
49
54
  additional_questions: {
50
55
  business_revenue: undefined;
51
56
  business_payment_volume: undefined;
52
- business_dispute_volume: undefined;
53
- business_receivable_volume: undefined;
57
+ business_when_service_received: undefined;
58
+ business_recurring_payments: undefined;
59
+ business_recurring_payments_percentage: undefined;
60
+ business_seasonal: undefined;
61
+ business_other_payment_details: undefined;
54
62
  };
55
63
  representative: {
56
64
  name: undefined;
@@ -74,6 +82,8 @@ export declare const businessFormSchema: import("yup").ObjectSchema<{
74
82
  phone: undefined;
75
83
  doing_business_as: undefined;
76
84
  business_type: undefined;
85
+ business_structure: undefined;
77
86
  industry: undefined;
78
87
  tax_id: undefined;
88
+ date_of_incorporation: undefined;
79
89
  }, "">;
@@ -4,4 +4,7 @@ export declare const phoneRegex: RegExp;
4
4
  export declare const urlRegex: RegExp;
5
5
  export declare const taxIdRegex: RegExp;
6
6
  export declare const stringLettersOnlyRegex: RegExp;
7
+ export declare const numbersOnlyRegex: RegExp;
7
8
  export declare const ssnRegex: RegExp;
9
+ export declare const streetAddressRegex: RegExp;
10
+ export declare const poBoxRegex: RegExp;
@@ -4,8 +4,10 @@ export declare const businessNameValidation: import("yup").StringSchema<string,
4
4
  export declare const doingBusinessAsValidation: import("yup").StringSchema<string, import("yup").AnyObject, undefined, "">;
5
5
  export declare const websiteUrlValidation: import("yup").StringSchema<string, import("yup").AnyObject, undefined, "">;
6
6
  export declare const businessTypeValidation: import("yup").StringSchema<string, import("yup").AnyObject, undefined, "">;
7
+ export declare const businessStructureValidation: import("yup").StringSchema<string, import("yup").AnyObject, undefined, "">;
7
8
  export declare const industryValidation: import("yup").StringSchema<string, import("yup").AnyObject, undefined, "">;
8
9
  export declare const taxIdValidation: import("yup").StringSchema<string, import("yup").AnyObject, undefined, "">;
10
+ export declare const dateOfIncorporationValidation: import("yup").StringSchema<string, import("yup").AnyObject, undefined, "">;
9
11
  export declare const identityNameValidation: import("yup").StringSchema<string, import("yup").AnyObject, undefined, "">;
10
12
  export declare const identityTitleValidation: import("yup").StringSchema<string, import("yup").AnyObject, undefined, "">;
11
13
  export declare const dobValidation: (role: string) => import("yup").StringSchema<string, import("yup").AnyObject, undefined, "">;
@@ -15,3 +17,10 @@ export declare const lineTwoValidation: import("yup").StringSchema<string, impor
15
17
  export declare const cityValidation: import("yup").StringSchema<string, import("yup").AnyObject, undefined, "">;
16
18
  export declare const stateValidation: import("yup").StringSchema<string, import("yup").AnyObject, undefined, "">;
17
19
  export declare const postalValidation: import("yup").StringSchema<string, import("yup").AnyObject, undefined, "">;
20
+ export declare const revenueValidation: import("yup").StringSchema<string, import("yup").AnyObject, undefined, "">;
21
+ export declare const paymentVolumeValidation: import("yup").StringSchema<string, import("yup").AnyObject, undefined, "">;
22
+ export declare const whenServiceReceivedValidation: import("yup").StringSchema<string, import("yup").AnyObject, undefined, "">;
23
+ export declare const recurringPaymentsValidation: import("yup").StringSchema<string, import("yup").AnyObject, undefined, "">;
24
+ export declare const recurringPaymentsPercentageValidation: import("yup").StringSchema<string, import("yup").AnyObject, undefined, "">;
25
+ export declare const seasonalBusinessValidation: import("yup").StringSchema<string, import("yup").AnyObject, undefined, "">;
26
+ export declare const otherPaymentDetailsValidation: import("yup").StringSchema<string, import("yup").AnyObject, undefined, "">;
@@ -0,0 +1,21 @@
1
+ import { BusinessStructure, BusinessType } from "../../../api/Business";
2
+ export declare const businessTypeOptions: {
3
+ label: string;
4
+ value: BusinessType | string;
5
+ }[];
6
+ export declare const businessStructureOptions: {
7
+ label: string;
8
+ value: BusinessStructure | string;
9
+ }[];
10
+ export declare const businessServiceReceivedOptions: {
11
+ label: string;
12
+ value: string;
13
+ }[];
14
+ export declare const recurringPaymentsOptions: {
15
+ label: string;
16
+ value: string;
17
+ }[];
18
+ export declare const seasonalBusinessOptions: {
19
+ label: string;
20
+ value: string;
21
+ }[];
@@ -1,4 +1,3 @@
1
- import { BusinessType } from "../../../api/Business";
2
1
  export interface BusinessFormSubmitEvent {
3
2
  data: any;
4
3
  metadata?: BusinessFormEventMetaData;
@@ -47,8 +46,4 @@ export declare enum OwnerFormClickActions {
47
46
  addOwnerForm = "addOwnerForm",
48
47
  updateOwner = "updateOwner"
49
48
  }
50
- export declare const BusinessTypeOptions: {
51
- label: string;
52
- value: BusinessType | string;
53
- }[];
54
49
  export {};
@@ -1,5 +1,6 @@
1
1
  import { EventEmitter } from '../../stencil-public-runtime';
2
2
  import { ICheckout, ICheckoutCompleteResponse } from '../../api/Checkout';
3
+ import { ComponentError } from '../../api/ComponentError';
3
4
  export declare class CheckoutCore {
4
5
  /**
5
6
  * URL for the rendered iFrame. End-users need not use this.
@@ -15,15 +16,15 @@ export declare class CheckoutCore {
15
16
  serverError: boolean;
16
17
  errorMessage: string;
17
18
  creatingNewPaymentMethod: boolean;
18
- selectedPaymentMethodToken: string;
19
19
  submitted: EventEmitter<ICheckoutCompleteResponse>;
20
+ errorEvent: EventEmitter<ComponentError>;
20
21
  private paymentMethodOptionsRef?;
21
22
  componentWillLoad(): void;
22
23
  connectedCallback(): void;
23
24
  fetchData(): void;
24
25
  loadFontsOnParent(): Promise<any>;
25
26
  submit(event: any): Promise<void>;
26
- onSubmitted: (data: any) => void;
27
+ onSubmitted: (data: ICheckoutCompleteResponse) => void;
27
28
  private loadingSpinner;
28
29
  render(): any;
29
30
  }