@justifi/webcomponents 4.19.1 → 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 (190) hide show
  1. package/dist/cjs/{Analytics-f870b3ee.js → Analytics-c866f471.js} +3 -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-11ce0005.js → business-additional-questions-schema-26b0eecb.js} +1 -1
  6. package/dist/cjs/{business-form-options-26f9900c.js → business-form-options-5db0bd5e.js} +1 -1
  7. package/dist/cjs/{payload-parsers-969ab9b6.js → business-identity-schema-503ecb77.js} +1 -47
  8. package/dist/cjs/{business.service-f63650f5.js → business.service-65b0dbc8.js} +1 -1
  9. package/dist/cjs/form-alert_5.cjs.entry.js +2 -2
  10. package/dist/cjs/form-control-checkbox_9.cjs.entry.js +26 -26
  11. package/dist/cjs/{get-payout-csv-f3aee6d0.js → get-payout-csv-b98b0651.js} +1 -1
  12. package/dist/cjs/gross-payment-chart-core.cjs.entry.js +1 -1
  13. package/dist/cjs/justifi-additional-questions-form-step_10.cjs.entry.js +11 -11
  14. package/dist/cjs/justifi-bank-account-form.cjs.entry.js +3 -3
  15. package/dist/cjs/justifi-billing-form_2.cjs.entry.js +3 -3
  16. package/dist/cjs/justifi-business-details.cjs.entry.js +5 -5
  17. package/dist/cjs/justifi-business-form.cjs.entry.js +12 -12
  18. package/dist/cjs/justifi-card-form.cjs.entry.js +3 -3
  19. package/dist/cjs/justifi-checkout-core.cjs.entry.js +1 -1
  20. package/dist/cjs/justifi-checkout.cjs.entry.js +4 -4
  21. package/dist/cjs/justifi-gross-payment-chart.cjs.entry.js +3 -3
  22. package/dist/cjs/justifi-new-payment-method_4.cjs.entry.js +1 -1
  23. package/dist/cjs/justifi-owner-form_3.cjs.entry.js +11 -11
  24. package/dist/cjs/justifi-payment-details.cjs.entry.js +4 -4
  25. package/dist/cjs/justifi-payment-form.cjs.entry.js +4 -4
  26. package/dist/cjs/justifi-payment-method-form.cjs.entry.js +2 -2
  27. package/dist/cjs/justifi-payment-provisioning.cjs.entry.js +5 -5
  28. package/dist/cjs/justifi-payments-list.cjs.entry.js +4 -4
  29. package/dist/cjs/justifi-payout-details.cjs.entry.js +4 -4
  30. package/dist/cjs/justifi-payouts-list.cjs.entry.js +4 -4
  31. package/dist/cjs/justifi-refund-form.cjs.entry.js +1 -1
  32. package/dist/cjs/justifi-season-interruption-insurance-core.cjs.entry.js +1 -1
  33. package/dist/cjs/justifi-season-interruption-insurance.cjs.entry.js +5 -5
  34. package/dist/cjs/{package-1321b070.js → package-0c613220.js} +1 -1
  35. package/dist/cjs/payment-details-core.cjs.entry.js +1 -1
  36. package/dist/cjs/{payment.service-0a64f9cd.js → payment.service-33d6ac16.js} +1 -1
  37. package/dist/cjs/payments-list-core.cjs.entry.js +1 -1
  38. package/dist/cjs/payout-details-core.cjs.entry.js +1 -1
  39. package/dist/cjs/payouts-list-core.cjs.entry.js +1 -1
  40. package/dist/cjs/{schema-validations-f3db892c.js → schema-validations-0a7e46a3.js} +1 -1
  41. package/dist/cjs/{utils-89d86e29.js → utils-af1b60a9.js} +0 -16
  42. package/dist/collection/api/Api.js +3 -3
  43. package/dist/collection/api/Business.js +66 -7
  44. package/dist/collection/api/Identity.js +39 -3
  45. package/dist/collection/api/services/analytics.service.js +1 -1
  46. package/dist/collection/api/services/checkout.service.js +1 -1
  47. package/dist/collection/api/services/insurance.service.js +2 -2
  48. package/dist/collection/api/services/provision.service.js +1 -1
  49. package/dist/collection/components/business-forms/business-form/business-form.js +3 -4
  50. package/dist/collection/components/business-forms/owner-form/owner-form-core.js +4 -5
  51. package/dist/collection/components/business-forms/payment-provisioning/additional-questions/business-additional-questions-form-step-core.js +3 -3
  52. package/dist/collection/components/business-forms/payment-provisioning/bank-account/business-bank-account-form-step.js +2 -2
  53. package/dist/collection/components/business-forms/payment-provisioning/business-core-info/business-core-info-form-step-core.js +3 -5
  54. package/dist/collection/components/business-forms/payment-provisioning/business-owners/business-owners-form-step-core.js +3 -3
  55. package/dist/collection/components/business-forms/payment-provisioning/business-representative/business-representative-form-step-core.js +3 -4
  56. package/dist/collection/components/business-forms/payment-provisioning/document-uploads/business-document-upload-form-step.js +2 -2
  57. package/dist/collection/components/business-forms/payment-provisioning/legal-address-form/legal-address-form-step-core.js +3 -4
  58. package/dist/collection/components/business-forms/payment-provisioning/terms-and-conditions/business-terms-conditions-form-step.js +2 -2
  59. package/dist/docs.json +2 -2
  60. package/dist/esm/{Analytics-262cdde5.js → Analytics-3e74964a.js} +3 -3
  61. package/dist/esm/{Api-b09a2f6a.js → Api-c8abc2e0.js} +3 -3
  62. package/dist/esm/{Business-e218b4f4.js → Business-b73d5055.js} +104 -9
  63. package/dist/esm/additional-questions-details_5.entry.js +1 -1
  64. package/dist/esm/{business-additional-questions-schema-e39bc781.js → business-additional-questions-schema-a5583cf8.js} +1 -1
  65. package/dist/esm/{business-form-options-0b08e08c.js → business-form-options-d790973e.js} +1 -1
  66. package/dist/esm/{payload-parsers-62f443e1.js → business-identity-schema-9e3269fb.js} +2 -44
  67. package/dist/esm/{business.service-74bd1212.js → business.service-6f139c2b.js} +1 -1
  68. package/dist/esm/form-alert_5.entry.js +2 -2
  69. package/dist/esm/form-control-checkbox_9.entry.js +21 -21
  70. package/dist/esm/{get-payout-csv-b494abfe.js → get-payout-csv-383d96c1.js} +1 -1
  71. package/dist/esm/gross-payment-chart-core.entry.js +1 -1
  72. package/dist/esm/justifi-additional-questions-form-step_10.entry.js +11 -11
  73. package/dist/esm/justifi-bank-account-form.entry.js +3 -3
  74. package/dist/esm/justifi-billing-form_2.entry.js +3 -3
  75. package/dist/esm/justifi-business-details.entry.js +5 -5
  76. package/dist/esm/justifi-business-form.entry.js +11 -11
  77. package/dist/esm/justifi-card-form.entry.js +3 -3
  78. package/dist/esm/justifi-checkout-core.entry.js +1 -1
  79. package/dist/esm/justifi-checkout.entry.js +4 -4
  80. package/dist/esm/justifi-gross-payment-chart.entry.js +3 -3
  81. package/dist/esm/justifi-new-payment-method_4.entry.js +1 -1
  82. package/dist/esm/justifi-owner-form_3.entry.js +10 -10
  83. package/dist/esm/justifi-payment-details.entry.js +4 -4
  84. package/dist/esm/justifi-payment-form.entry.js +4 -4
  85. package/dist/esm/justifi-payment-method-form.entry.js +2 -2
  86. package/dist/esm/justifi-payment-provisioning.entry.js +5 -5
  87. package/dist/esm/justifi-payments-list.entry.js +4 -4
  88. package/dist/esm/justifi-payout-details.entry.js +4 -4
  89. package/dist/esm/justifi-payouts-list.entry.js +4 -4
  90. package/dist/esm/justifi-refund-form.entry.js +1 -1
  91. package/dist/esm/justifi-season-interruption-insurance-core.entry.js +1 -1
  92. package/dist/esm/justifi-season-interruption-insurance.entry.js +5 -5
  93. package/dist/esm/{package-d88677e9.js → package-925a0fdd.js} +1 -1
  94. package/dist/esm/payment-details-core.entry.js +1 -1
  95. package/dist/esm/{payment.service-3ca4a492.js → payment.service-e4fb5953.js} +1 -1
  96. package/dist/esm/payments-list-core.entry.js +1 -1
  97. package/dist/esm/payout-details-core.entry.js +1 -1
  98. package/dist/esm/payouts-list-core.entry.js +1 -1
  99. package/dist/esm/{schema-validations-2f4fdebb.js → schema-validations-e725d701.js} +2 -2
  100. package/dist/esm/{utils-3c1dd2fa.js → utils-e66d8bca.js} +1 -16
  101. package/dist/module/Analytics.js +1 -1
  102. package/dist/module/Api.js +3 -3
  103. package/dist/module/Business.js +104 -9
  104. package/dist/module/business-additional-questions-form-step-core.js +3 -3
  105. package/dist/module/business-bank-account-form-step.js +2 -2
  106. package/dist/module/business-core-info-form-step-core.js +3 -5
  107. package/dist/module/business-document-upload-form-step.js +2 -2
  108. package/dist/module/business-document-upload-input-group.js +1 -1
  109. package/dist/module/business-documents-on-file.js +1 -1
  110. package/dist/module/business-owners-form-step-core.js +3 -3
  111. package/dist/module/business-representative-form-step-core.js +3 -4
  112. package/dist/module/business-terms-conditions-form-step.js +2 -2
  113. package/dist/module/justifi-business-form.js +3 -4
  114. package/dist/module/justifi-checkout.js +1 -1
  115. package/dist/module/justifi-payment-provisioning.js +1 -1
  116. package/dist/module/justifi-season-interruption-insurance.js +2 -2
  117. package/dist/module/legal-address-form-step-core.js +3 -4
  118. package/dist/module/owner-form-core2.js +4 -5
  119. package/dist/module/package.js +1 -1
  120. package/dist/module/payment-details-core2.js +1 -1
  121. package/dist/module/payments-list-core2.js +1 -1
  122. package/dist/module/payout-details-core2.js +1 -1
  123. package/dist/module/payouts-list-core2.js +1 -1
  124. package/dist/module/saved-payment-method.js +1 -1
  125. package/dist/module/utils2.js +1 -16
  126. package/dist/types/api/Business.d.ts +87 -1
  127. package/dist/types/api/Identity.d.ts +45 -1
  128. package/dist/types/components/business-forms/owner-form/owner-form-core.d.ts +44 -1
  129. package/dist/types/components/business-forms/payment-provisioning/additional-questions/business-additional-questions-form-step-core.d.ts +11 -1
  130. package/dist/types/components/business-forms/payment-provisioning/business-core-info/business-core-info-form-step-core.d.ts +11 -1
  131. package/dist/types/components/business-forms/payment-provisioning/business-representative/business-representative-form-step-core.d.ts +24 -1
  132. package/dist/types/components/business-forms/payment-provisioning/legal-address-form/legal-address-form-step-core.d.ts +11 -1
  133. package/dist/webcomponents/{p-d765d638.js → p-0052db77.js} +1 -1
  134. package/dist/webcomponents/{p-60a370fc.entry.js → p-039183f1.entry.js} +1 -1
  135. package/dist/webcomponents/{p-b16dfd5d.entry.js → p-08a39a65.entry.js} +1 -1
  136. package/dist/webcomponents/{p-462dc522.entry.js → p-124c1ecd.entry.js} +1 -1
  137. package/dist/webcomponents/{p-d1c8d794.entry.js → p-1647f06b.entry.js} +1 -1
  138. package/dist/webcomponents/{p-d25c2f12.js → p-1815a43b.js} +1 -1
  139. package/dist/webcomponents/p-1cb2a51c.entry.js +1 -0
  140. package/dist/webcomponents/{p-1a43e355.entry.js → p-1eee25f3.entry.js} +1 -1
  141. package/dist/webcomponents/{p-3affadfc.entry.js → p-20cee11b.entry.js} +1 -1
  142. package/dist/webcomponents/{p-04a0dbb6.js → p-277aee05.js} +1 -1
  143. package/dist/webcomponents/{p-65b561da.entry.js → p-2a5cc4ee.entry.js} +1 -1
  144. package/dist/webcomponents/p-3b1340dc.js +1 -0
  145. package/dist/webcomponents/{p-890b3254.entry.js → p-43eff822.entry.js} +1 -1
  146. package/dist/webcomponents/p-4e01fec8.entry.js +1 -0
  147. package/dist/webcomponents/{p-241b0ed9.js → p-5022f21c.js} +1 -1
  148. package/dist/webcomponents/p-55182a59.js +1 -0
  149. package/dist/webcomponents/{p-83125497.js → p-5e2c9ec8.js} +1 -1
  150. package/dist/webcomponents/p-5e7c60d8.js +1 -0
  151. package/dist/webcomponents/p-6ac806ff.entry.js +1 -0
  152. package/dist/webcomponents/{p-198994c0.entry.js → p-6c2fc744.entry.js} +1 -1
  153. package/dist/webcomponents/{p-62b32c4c.entry.js → p-721dcf51.entry.js} +1 -1
  154. package/dist/webcomponents/p-77e55bfc.entry.js +1 -0
  155. package/dist/webcomponents/{p-29c0b182.js → p-7d3be485.js} +1 -1
  156. package/dist/webcomponents/{p-52021fa1.entry.js → p-817da23c.entry.js} +1 -1
  157. package/dist/webcomponents/p-82cff30c.js +1 -0
  158. package/dist/webcomponents/{p-8603348a.js → p-8eb10f02.js} +1 -1
  159. package/dist/webcomponents/{p-061dcb79.entry.js → p-8f9fb5c3.entry.js} +1 -1
  160. package/dist/webcomponents/p-9649b022.entry.js +1 -0
  161. package/dist/webcomponents/{p-9dc36f76.entry.js → p-9c076da2.entry.js} +1 -1
  162. package/dist/webcomponents/p-af0aeba4.entry.js +1 -0
  163. package/dist/webcomponents/p-b1408dea.entry.js +1 -0
  164. package/dist/webcomponents/{p-72c9e6b3.entry.js → p-ba95679b.entry.js} +1 -1
  165. package/dist/webcomponents/{p-1f70fa27.entry.js → p-bd2bb302.entry.js} +1 -1
  166. package/dist/webcomponents/{p-bc92235c.entry.js → p-d2af90c2.entry.js} +1 -1
  167. package/dist/webcomponents/{p-4abc17f0.entry.js → p-d76002d5.entry.js} +1 -1
  168. package/dist/webcomponents/{p-9ccfa1c9.entry.js → p-da1d174d.entry.js} +1 -1
  169. package/dist/webcomponents/{p-53e64f15.entry.js → p-e2b2213f.entry.js} +1 -1
  170. package/dist/webcomponents/{p-fe33151d.entry.js → p-eccf2e8e.entry.js} +1 -1
  171. package/dist/webcomponents/p-edab484a.entry.js +1 -0
  172. package/dist/webcomponents/{p-75b4daef.js → p-f5b5e47b.js} +1 -1
  173. package/dist/webcomponents/{p-4bac636e.entry.js → p-f844d67b.entry.js} +1 -1
  174. package/dist/webcomponents/webcomponents.esm.js +1 -1
  175. package/package.json +1 -1
  176. package/dist/collection/components/business-forms/utils/payload-parsers.js +0 -41
  177. package/dist/module/payload-parsers.js +0 -43
  178. package/dist/types/components/business-forms/utils/payload-parsers.d.ts +0 -4
  179. package/dist/webcomponents/p-2799383d.entry.js +0 -1
  180. package/dist/webcomponents/p-3d4d566d.entry.js +0 -1
  181. package/dist/webcomponents/p-3dd4c6c3.entry.js +0 -1
  182. package/dist/webcomponents/p-46f679a9.js +0 -1
  183. package/dist/webcomponents/p-48ae16e0.entry.js +0 -1
  184. package/dist/webcomponents/p-53948ff8.entry.js +0 -1
  185. package/dist/webcomponents/p-554a3c18.js +0 -1
  186. package/dist/webcomponents/p-92bb1e5f.entry.js +0 -1
  187. package/dist/webcomponents/p-ad41c8c7.entry.js +0 -1
  188. package/dist/webcomponents/p-af244664.js +0 -1
  189. package/dist/webcomponents/p-d101c5db.js +0 -1
  190. package/dist/webcomponents/p-d2a5054f.entry.js +0 -1
@@ -3,7 +3,7 @@
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  const index = require('./index-fb499e95.js');
6
- const utils$1 = require('./utils-89d86e29.js');
6
+ const utils$1 = require('./utils-af1b60a9.js');
7
7
  const utils = require('./utils-c1d2e426.js');
8
8
  const styledHost = require('./styled-host-cc053016.js');
9
9
 
@@ -6,7 +6,7 @@ const index = require('./index-fb499e95.js');
6
6
  const Pagination = require('./Pagination-0da8f095.js');
7
7
  require('./Payment-1a8a8ca6.js');
8
8
  const Payout = require('./Payout-a2dd7b01.js');
9
- const utils = require('./utils-89d86e29.js');
9
+ const utils = require('./utils-af1b60a9.js');
10
10
  const ComponentError = require('./ComponentError-233ac749.js');
11
11
  const exportedParts = require('./exported-parts-b18c68c2.js');
12
12
  const styledHost = require('./styled-host-cc053016.js');
@@ -2,7 +2,7 @@
2
2
 
3
3
  const index_esm = require('./index.esm-52757963.js');
4
4
  const stateOptions = require('./state-options-4fbcb48a.js');
5
- const businessFormOptions = require('./business-form-options-26f9900c.js');
5
+ const businessFormOptions = require('./business-form-options-5db0bd5e.js');
6
6
 
7
7
  const transformEmptyString = (value) => {
8
8
  return value === '' ? null : value;
@@ -3973,21 +3973,6 @@ function snakeToCamel(str) {
3973
3973
  return '';
3974
3974
  return str.replace(/([-_][a-z])/g, (group) => group.toUpperCase().replace('-', '').replace('_', ''));
3975
3975
  }
3976
- function flattenNestedObject(obj) {
3977
- const result = {};
3978
- for (const key in obj) {
3979
- if (typeof obj[key] === 'object' && obj[key] !== null) {
3980
- const nestedObj = flattenNestedObject(obj[key]);
3981
- for (const nestedKey in nestedObj) {
3982
- result[nestedKey] = nestedObj[nestedKey];
3983
- }
3984
- }
3985
- else {
3986
- result[key] = obj[key];
3987
- }
3988
- }
3989
- return result;
3990
- }
3991
3976
  function composeQueryParams(values) {
3992
3977
  const queryParams = values.map((value) => {
3993
3978
  if (value === values[0]) {
@@ -4029,7 +4014,6 @@ const isInRange = (num, min, max) => {
4029
4014
  exports.MapPaymentStatusToBadge = MapPaymentStatusToBadge;
4030
4015
  exports.MapPayoutStatusToBadge = MapPayoutStatusToBadge;
4031
4016
  exports.composeQueryParams = composeQueryParams;
4032
- exports.flattenNestedObject = flattenNestedObject;
4033
4017
  exports.formatCurrency = formatCurrency;
4034
4018
  exports.formatDate = formatDate;
4035
4019
  exports.formatDisplayDate = formatDisplayDate;
@@ -30,13 +30,13 @@ const Api = ({ authToken, apiOrigin }) => {
30
30
  return makeRequest(endpoint, 'GET', params, null, signal);
31
31
  }
32
32
  async function post(endpoint, body, params, signal) {
33
- return makeRequest(endpoint, 'POST', params, body, signal);
33
+ return makeRequest(endpoint, 'POST', params, JSON.stringify(body), signal);
34
34
  }
35
35
  async function put(endpoint, body, params, signal) {
36
- return makeRequest(endpoint, 'PUT', params, body, signal);
36
+ return makeRequest(endpoint, 'PUT', params, JSON.stringify(body), signal);
37
37
  }
38
38
  async function patch(endpoint, body, params, signal) {
39
- return makeRequest(endpoint, 'PATCH', params, body, signal);
39
+ return makeRequest(endpoint, 'PATCH', params, JSON.stringify(body), signal);
40
40
  }
41
41
  async function destroy(endpoint, params, signal) {
42
42
  return makeRequest(endpoint, 'DELETE', params, null, signal);
@@ -23,16 +23,42 @@ export class Address {
23
23
  this.created_at = address.created_at;
24
24
  this.updated_at = address.updated_at;
25
25
  }
26
+ get payload() {
27
+ return {
28
+ platform_account_id: this.platform_account_id || '',
29
+ line1: this.line1 || '',
30
+ line2: this.line2 || '',
31
+ postal_code: this.postal_code || '',
32
+ city: this.city || '',
33
+ state: this.state || '',
34
+ country: this.country || '',
35
+ };
36
+ }
26
37
  }
27
38
  export class AdditionalQuestions {
28
39
  constructor(additionalQuestions) {
29
40
  this.business_revenue = additionalQuestions.business_revenue;
30
41
  this.business_payment_volume = additionalQuestions.business_payment_volume;
31
- this.business_when_service_received = additionalQuestions.business_when_service_received;
32
- this.business_recurring_payments = additionalQuestions.business_recurring_payments;
33
- this.business_recurring_payments_percentage = additionalQuestions.business_recurring_payments_percentage;
42
+ this.business_when_service_received =
43
+ additionalQuestions.business_when_service_received;
44
+ this.business_recurring_payments =
45
+ additionalQuestions.business_recurring_payments;
46
+ this.business_recurring_payments_percentage =
47
+ additionalQuestions.business_recurring_payments_percentage;
34
48
  this.business_seasonal = additionalQuestions.business_seasonal;
35
- this.business_other_payment_details = additionalQuestions.business_other_payment_details;
49
+ this.business_other_payment_details =
50
+ additionalQuestions.business_other_payment_details;
51
+ }
52
+ get payload() {
53
+ return {
54
+ business_revenue: this.business_revenue || '',
55
+ business_payment_volume: this.business_payment_volume || '',
56
+ business_when_service_received: this.business_when_service_received || '',
57
+ business_recurring_payments: this.business_recurring_payments || '',
58
+ business_recurring_payments_percentage: this.business_recurring_payments_percentage || '',
59
+ business_seasonal: this.business_seasonal || '',
60
+ business_other_payment_details: this.business_other_payment_details || '',
61
+ };
36
62
  }
37
63
  }
38
64
  export class CoreBusinessInfo {
@@ -47,10 +73,23 @@ export class CoreBusinessInfo {
47
73
  this.phone = coreBusinessInfo.phone;
48
74
  this.date_of_incorporation = coreBusinessInfo.date_of_incorporation;
49
75
  }
76
+ get payload() {
77
+ return {
78
+ classification: this.classification || '',
79
+ legal_name: this.legal_name || '',
80
+ doing_business_as: this.doing_business_as || '',
81
+ industry: this.industry || '',
82
+ tax_id: this.tax_id || '',
83
+ website_url: this.website_url || '',
84
+ email: this.email || '',
85
+ phone: this.phone || '',
86
+ date_of_incorporation: this.date_of_incorporation || '',
87
+ };
88
+ }
50
89
  }
51
90
  export class Business {
52
91
  constructor(business) {
53
- this.additional_questions = Object.assign({}, new AdditionalQuestions(business.additional_questions || {}));
92
+ this.additional_questions = new AdditionalQuestions(business.additional_questions || {});
54
93
  this.associated_accounts = business.associated_accounts;
55
94
  this.classification = business.classification;
56
95
  this.bank_accounts = business.bank_accounts;
@@ -60,18 +99,38 @@ export class Business {
60
99
  this.email = business.email;
61
100
  this.id = business.id;
62
101
  this.industry = business.industry;
63
- this.legal_address = Object.assign({}, new Address(business.legal_address || {}));
102
+ this.legal_address = new Address(business.legal_address || {});
64
103
  this.legal_name = business.legal_name;
65
104
  this.metadata = business.metadata;
66
105
  this.owners = business.owners;
67
106
  this.phone = business.phone;
68
107
  this.platform_account_id = business.platform_account_id;
69
108
  this.product_categories = business.product_categories;
70
- this.representative = Object.assign({}, new Representative(business.representative || {}));
109
+ this.representative = new Representative(business.representative || {});
71
110
  this.tax_id = business.tax_id;
72
111
  this.terms_conditions_accepted = business.terms_conditions_accepted;
73
112
  this.updated_at = business.updated_at;
74
113
  this.website_url = business.website_url;
75
114
  this.date_of_incorporation = business.date_of_incorporation;
76
115
  }
116
+ get payload() {
117
+ return {
118
+ additional_questions: new AdditionalQuestions(this.additional_questions)
119
+ .payload,
120
+ classification: this.classification || '',
121
+ doing_business_as: this.doing_business_as || '',
122
+ email: this.email || '',
123
+ industry: this.industry || '',
124
+ legal_address: new Address(this.legal_address).payload,
125
+ legal_name: this.legal_name || '',
126
+ metadata: this.metadata || {},
127
+ owners: this.owners.map((owner) => ({ id: owner.id })),
128
+ phone: this.phone || '',
129
+ platform_account_id: this.platform_account_id || '',
130
+ representative: new Representative(this.representative).payload,
131
+ tax_id: this.tax_id || '',
132
+ website_url: this.website_url || '',
133
+ date_of_incorporation: this.date_of_incorporation || '',
134
+ };
135
+ }
77
136
  }
@@ -1,5 +1,5 @@
1
1
  import { Address } from "./Business";
2
- import { constructDate, filterNumber } from "../components/business-forms/utils/helpers";
2
+ import { constructDate, filterNumber, } from "../components/business-forms/utils/helpers";
3
3
  export class Owner {
4
4
  constructor(owner) {
5
5
  this.address = Object.assign({}, new Address(owner.address || {}));
@@ -7,7 +7,8 @@ export 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 @@ export 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
  export class Representative {
27
45
  constructor(representative) {
@@ -30,7 +48,8 @@ export 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,4 +64,21 @@ export 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
  }
@@ -3,6 +3,6 @@ import Api from "../Api";
3
3
  export class AnalyticsService {
4
4
  async record(body) {
5
5
  const endpoint = 'analytics';
6
- return Api({ apiOrigin: config.proxyApiOrigin }).post(endpoint, JSON.stringify(body));
6
+ return Api({ apiOrigin: config.proxyApiOrigin }).post(endpoint, body);
7
7
  }
8
8
  }
@@ -13,6 +13,6 @@ export class CheckoutService {
13
13
  if (payment.payment_token) {
14
14
  payload.payment_token = payment.payment_token;
15
15
  }
16
- return Api({ authToken, apiOrigin: config.proxyApiOrigin }).post(endpoint, JSON.stringify(payload));
16
+ return Api({ authToken, apiOrigin: config.proxyApiOrigin }).post(endpoint, payload);
17
17
  }
18
18
  }
@@ -3,10 +3,10 @@ import { config } from "../../../config";
3
3
  export class InsuranceService {
4
4
  async fetchQuote(authToken, payload) {
5
5
  const endpoint = 'insurance/quotes';
6
- return Api({ authToken, apiOrigin: config.proxyApiOrigin }).post(endpoint, JSON.stringify(payload));
6
+ return Api({ authToken, apiOrigin: config.proxyApiOrigin }).post(endpoint, payload);
7
7
  }
8
8
  async toggleCoverage(authToken, quoteId, payload) {
9
9
  const endpoint = `insurance/quotes/${quoteId}/toggle`;
10
- return Api({ authToken, apiOrigin: config.proxyApiOrigin }).post(endpoint, JSON.stringify(payload));
10
+ return Api({ authToken, apiOrigin: config.proxyApiOrigin }).post(endpoint, payload);
11
11
  }
12
12
  }
@@ -8,6 +8,6 @@ export class ProvisionService {
8
8
  business_id: businessId,
9
9
  product_category: product
10
10
  };
11
- return Api({ authToken, apiOrigin: config.proxyApiOrigin }).post(endpoint, JSON.stringify(payload));
11
+ return Api({ authToken, apiOrigin: config.proxyApiOrigin }).post(endpoint, payload);
12
12
  }
13
13
  }
@@ -2,7 +2,6 @@ import { h } from "@stencil/core";
2
2
  import { FormController } from "../../form/form";
3
3
  import { businessFormSchema } from "../schemas/business-form-schema";
4
4
  import { Api } from "../../../api";
5
- import { parseBusiness } from "../utils/payload-parsers";
6
5
  import { config } from "../../../../config";
7
6
  import { BusinessFormClickActions, BusinessFormServerErrors } from "../utils/business-form-types";
8
7
  import { Business } from "../../../api/Business";
@@ -24,8 +23,8 @@ export class BusinessForm {
24
23
  try {
25
24
  const values = this.formController.values.getValue();
26
25
  const initialValues = this.formController.getInitialValues();
27
- const payload = parseBusiness(values, initialValues);
28
- const response = await this.api.patch(this.businessEndpoint, JSON.stringify(payload));
26
+ const payload = new Business(Object.assign(Object.assign({}, initialValues), values)).payload;
27
+ const response = await this.api.patch(this.businessEndpoint, payload);
29
28
  this.handleReponse(response);
30
29
  }
31
30
  catch (error) {
@@ -97,7 +96,7 @@ export class BusinessForm {
97
96
  this.instantiateBusiness(response.data);
98
97
  }
99
98
  render() {
100
- return (h(StyledHost, { key: '60989d23631d6a02e9a25313dd7297a61063a09c', exportparts: "label,input,input-invalid" }, h("form", { key: 'd961174a3e93ed505012919a0e7e036bd61a4902', onSubmit: this.validateAndSubmit }, h("div", { key: '2be81a7f0e3b568266ee66127f2b537d57c36762', class: "row gap-3" }, h("h1", { key: 'eefc257f687ff24cebf13155a571398e3ddbcabd' }, this.title), h("form-alert", { key: '173d3ee84f5a952a51884ab5f3818c768fcc9b08', text: this.errorMessage, hideAlert: this.hideErrors }), h("div", { key: 'bfd7fd73aca630fcf56f468d912759d5a96de172', class: "col-12 mb-4" }, h("justifi-business-core-info", { key: 'dc15f46a28301c03ccd884ff09740e87d67b2e5a', formController: this.formController })), h("div", { key: 'b4cd6ba605ea28a7692cc561951bb69ad93bb8f5', class: "col-12 mb-4" }, h("justifi-legal-address-form", { key: '670f320ff6d1ba86a34f5b42dd97a5d38e96c209', formController: this.formController })), h("div", { key: '0afb9d18e6ecb951cefda4df5dd133d31359cecc', class: "col-12 mb-4" }, h("justifi-additional-questions", { key: '6953718bea9525126db35adc44a9c8754234816a', formController: this.formController })), h("div", { key: 'f88b576b9159cd43f17d5a63c26acc4b53dfa9a0', class: "col-12 mb-4" }, h("justifi-business-representative", { key: '4353116715c7f7b906c3c0eae322df04703fd8e5', formController: this.formController })), h("div", { key: 'd626b0738ce71f7529fa270d7a2c479f517e48a2', class: "col-12 d-flex flex-row-reverse" }, h("button", { key: '9469e132726c9bd02b8a1f4c4ca1a4c2a9000c1b', type: "submit", class: "btn btn-primary jfi-submit-button", disabled: this.disabledState, onClick: () => this.fireClickEvents({ name: BusinessFormClickActions.submit }) }, this.isLoading ? 'Loading...' : 'Submit'))))));
99
+ return (h(StyledHost, { key: 'e388e1e7658969f0e5687102a62345e2790da97a', exportparts: "label,input,input-invalid" }, h("form", { key: 'c22a562e57539e982a071b1906e5bf0bcc249e7d', onSubmit: this.validateAndSubmit }, h("div", { key: '44243cd965b448f5be9058880aa2deb32f4ce8dc', class: "row gap-3" }, h("h1", { key: 'd666ed8ddacc8ac05d7f42c2f4824208b92cdb3f' }, this.title), h("form-alert", { key: 'b1d4025078c4373a789609f2e14d309f0ee280fe', text: this.errorMessage, hideAlert: this.hideErrors }), h("div", { key: 'cdc1d597a5dbf9581182de302a453e4ea98bb28f', class: "col-12 mb-4" }, h("justifi-business-core-info", { key: '2333164de020eadf54da91cabdcbeb87a2fd1b75', formController: this.formController })), h("div", { key: '74eafa5c419f6d6fe2eb3eeb8521e12175f7ee3a', class: "col-12 mb-4" }, h("justifi-legal-address-form", { key: '1e5a373f95a77bf3aba1a9f3538b3a2ac3dbf716', formController: this.formController })), h("div", { key: 'ec9f6195f3674b426722463341445f0ed1746178', class: "col-12 mb-4" }, h("justifi-additional-questions", { key: '0adbc60492f4ad71e3877c446376999418b7dc15', formController: this.formController })), h("div", { key: 'cdfb8d0d40e9f888afd9c23cd97d33d861d16f62', class: "col-12 mb-4" }, h("justifi-business-representative", { key: '4d03ec95b7c2918494c9970b3e6a5826d4d69a10', formController: this.formController })), h("div", { key: '0682dba469e57a938b175499312de5d5c4f55a69', class: "col-12 d-flex flex-row-reverse" }, h("button", { key: '64791e2742ee129787094c7123e87c4262735556', type: "submit", class: "btn btn-primary jfi-submit-button", disabled: this.disabledState, onClick: () => this.fireClickEvents({ name: BusinessFormClickActions.submit }) }, this.isLoading ? 'Loading...' : 'Submit'))))));
101
100
  }
102
101
  static get is() { return "justifi-business-form"; }
103
102
  static get encapsulation() { return "shadow"; }
@@ -3,7 +3,6 @@ import { FormController } from "../../form/form";
3
3
  import { Owner } from "../../../api/Identity";
4
4
  import { BusinessFormClickActions } from "../utils/business-form-types";
5
5
  import { identitySchema } from "../schemas/business-identity-schema";
6
- import { parseIdentityInfo } from "../utils/payload-parsers";
7
6
  import { Button } from "../../../ui-components";
8
7
  export class BusinessOwnerFormCore {
9
8
  loadingWatcher() {
@@ -128,12 +127,12 @@ export class BusinessOwnerFormCore {
128
127
  }
129
128
  }
130
129
  get payload() {
131
- let formValues = parseIdentityInfo(this.formController.values.getValue());
130
+ let formValues = new Owner(this.formController.values.getValue()).payload;
132
131
  if (this.ownerId) {
133
- return JSON.stringify(formValues);
132
+ return formValues;
134
133
  }
135
134
  else {
136
- return JSON.stringify(Object.assign(Object.assign({}, formValues), { business_id: this.businessId }));
135
+ return Object.assign(Object.assign({}, formValues), { business_id: this.businessId });
137
136
  }
138
137
  }
139
138
  get formTitle() {
@@ -164,7 +163,7 @@ export class BusinessOwnerFormCore {
164
163
  this.formController.errors.subscribe(errors => (this.errors = Object.assign({}, errors)));
165
164
  }
166
165
  render() {
167
- return (h("form", { key: 'b2e2aaced859260e9d2ef59bc3f8a0763d05872c', onSubmit: this.validateAndSubmit }, h("fieldset", { key: '2a93ddb4c945be0ec081ce31d6d9eff4b302d622' }, h("legend", { key: 'ea9859e55099e3f8263024d884edfb48b3666eaa', class: "fw-semibold fs-5" }, this.formTitle), h("br", { key: 'f646c1ecc544c358d87e701aba8e151fcb96c54e' }), h("div", { key: '874bf4ebd7cef0afbdee96fa4d5679b6d683b0f0', class: "row gy-3" }, h("owner-form-inputs", { key: '866dbf0002ec1ac70d7942c6011c67f8cd144960', ownerDefaultValue: this.formController.getInitialValues(), errors: this.errors, formController: this.formController }), h("div", { key: '15d907270ecf3d16769cedea39ba279d7ffb0748', class: "d-flex gap-2 justify-content-start" }, h(Button, { key: '84c09ef594e7fa387e64a09014de81ed713cc765', variant: "secondary", type: "button", onClick: this.handleRemoveOwner, hidden: !this.showRemoveButton }, "Remove"), h(Button, { key: '1dafd97aa7b84644c9d011224a152ad7f99ce620', variant: "primary", type: "submit", onClick: this.handleAddOwner, disabled: this.isLoading }, this.submitButtonText))), h("hr", { key: 'f1f31da4d147afcd01ef96acd01d63ee9497dd6b' }))));
166
+ return (h("form", { key: '27f0d989f017bd03b84cf8c994fa96f9a65aad08', onSubmit: this.validateAndSubmit }, h("fieldset", { key: '2c793f1f8777181e5db0a4cae5b9994d9188685e' }, h("legend", { key: 'a8951fcd990c8136cf6672424869f5c96def3cef', class: "fw-semibold fs-5" }, this.formTitle), h("br", { key: 'faaf0cc27c448452a5172ad7fcfcf510ec586d2b' }), h("div", { key: '486638ad24414a05f84ada3f37a89d0cc12e7ffb', class: "row gy-3" }, h("owner-form-inputs", { key: 'bdfe7cb3305f31d93321319ef14eee3e5b331381', ownerDefaultValue: this.formController.getInitialValues(), errors: this.errors, formController: this.formController }), h("div", { key: '9e5c63e0637e0bffe5ab77a1f73c203704115479', class: "d-flex gap-2 justify-content-start" }, h(Button, { key: '85de4b69c697ebf96778f538b1535bd1fb2c43e7', variant: "secondary", type: "button", onClick: this.handleRemoveOwner, hidden: !this.showRemoveButton }, "Remove"), h(Button, { key: '1dd026432f19f84ae2142101191e511ebd62c2b3', variant: "primary", type: "submit", onClick: this.handleAddOwner, disabled: this.isLoading }, this.submitButtonText))), h("hr", { key: '2570611bbe663e2e128f03806ecb036ce750c80b' }))));
168
167
  }
169
168
  static get is() { return "owner-form-core"; }
170
169
  static get properties() {
@@ -61,8 +61,8 @@ export class AdditionalQuestionsFormStepCore {
61
61
  }
62
62
  ;
63
63
  get patchPayload() {
64
- let formValues = this.formController.values.getValue();
65
- return JSON.stringify({ additional_questions: formValues });
64
+ let formValues = new AdditionalQuestions(this.formController.values.getValue()).payload;
65
+ return { additional_questions: formValues };
66
66
  }
67
67
  componentWillLoad() {
68
68
  this.getBusiness && this.getData();
@@ -76,7 +76,7 @@ export class AdditionalQuestionsFormStepCore {
76
76
  render() {
77
77
  var _a, _b, _c, _d, _e, _f, _g;
78
78
  const additionalQuestionsDefaultValue = this.formController.getInitialValues();
79
- return (h("form", { key: 'f5a3d2826c65e84e90325000973c5cdc2922c643' }, h("fieldset", { key: '8dfecfc242e62ca523c3950b9f29e159ee8debc5' }, h("legend", { key: '192071e8d05c1d075ad79678890b47fe116577d2' }, "Additional Questions"), h("hr", { key: 'e2b7369711b4ba285522200233c5112ad5320a74' }), h("div", { key: '3ef5edae7215eb35835cfc6dd373c311ba7446a5', class: 'row gy-3' }, h("div", { key: '6af600e3612b03b505c0d2c1ddbfdb9520b9df9d', class: 'col-12 col-md-6' }, h("form-control-monetary", { key: '8afb46cdad6b2ceab63227bd6f659f7f8b2a9153', name: 'business_revenue', label: 'What is the business\u2019 estimated annual revenue from its primary business activities?', inputHandler: this.inputHandler, errorText: (_a = this.errors) === null || _a === void 0 ? void 0 : _a.business_revenue, defaultValue: additionalQuestionsDefaultValue === null || additionalQuestionsDefaultValue === void 0 ? void 0 : additionalQuestionsDefaultValue.business_revenue, maskOptions: CURRENCY_MASK.WHOLE })), h("div", { key: 'ae94caaafd45e4c46899d802337ce0a3a8d5b3aa', class: 'col-12 col-md-6' }, h("form-control-monetary", { key: '6b86e3a15934a15ecfbf7a1ac369c8ed9ee2f6a4', name: 'business_payment_volume', label: "What is the business' annual credit card & ACH volume anticipated to process?", inputHandler: this.inputHandler, errorText: (_b = this.errors) === null || _b === void 0 ? void 0 : _b.business_payment_volume, defaultValue: additionalQuestionsDefaultValue === null || additionalQuestionsDefaultValue === void 0 ? void 0 : additionalQuestionsDefaultValue.business_payment_volume, maskOptions: CURRENCY_MASK.WHOLE })), h("div", { key: '4b8fe3214082368c111183fcb1b76abf2c1ba5a1', class: 'col-12' }, h("form-control-select", { key: '88e5c2593bc1b55a797e1d67e103759c5e2e29e8', name: 'business_when_service_received', label: 'On average, how long after paying will your customers typically receive their goods or services?', inputHandler: this.inputHandler, errorText: (_c = this.errors) === null || _c === void 0 ? void 0 : _c.business_when_service_received, options: businessServiceReceivedOptions, defaultValue: additionalQuestionsDefaultValue === null || additionalQuestionsDefaultValue === void 0 ? void 0 : additionalQuestionsDefaultValue.business_when_service_received })), h("div", { key: 'a914e7114fd6fd4e44136ba8b986c20d1984dba8', class: 'col-12' }, h("form-control-select", { key: '38c9934952884a6d1dc70f4ebd61f03a87bd8091', name: 'business_recurring_payments', label: 'Does your business offer recurring payments?', inputHandler: this.inputHandler, errorText: (_d = this.errors) === null || _d === void 0 ? void 0 : _d.business_recurring_payments, options: recurringPaymentsOptions, defaultValue: additionalQuestionsDefaultValue === null || additionalQuestionsDefaultValue === void 0 ? void 0 : additionalQuestionsDefaultValue.business_recurring_payments })), h("div", { key: '7a6d2a527e7486cff7dfa1d594e2f0378e66b583', class: 'col-12' }, h("form-control-text", { key: '6e445ff593a7970967040ae5bfd3b8056e17c129', name: 'business_recurring_payments_percentage', label: 'What percent of revenue is generated from each recurring payment type offered?', inputHandler: this.inputHandler, errorText: (_e = this.errors) === null || _e === void 0 ? void 0 : _e.business_recurring_payments_percentage, defaultValue: additionalQuestionsDefaultValue === null || additionalQuestionsDefaultValue === void 0 ? void 0 : additionalQuestionsDefaultValue.business_recurring_payments_percentage })), h("div", { key: 'cf00fad8a096be8e28ef12bde563ead6f8b5ef6d', class: 'col-12' }, h("form-control-select", { key: '7cf9edd70b0ceaf25d2fd5947ecaf2760e76dd75', name: 'business_seasonal', label: 'Is this business seasonal?', inputHandler: this.inputHandler, errorText: (_f = this.errors) === null || _f === void 0 ? void 0 : _f.business_seasonal, options: seasonalBusinessOptions, defaultValue: additionalQuestionsDefaultValue === null || additionalQuestionsDefaultValue === void 0 ? void 0 : additionalQuestionsDefaultValue.business_seasonal })), h("div", { key: 'ceb6355fef7bae249330e0f39758be1812ff8cbe', class: 'col-12' }, h("form-control-text", { key: '689edc0fb02f926112c529301366e31d6d130aa6', name: 'business_other_payment_details', label: 'Is there anything else you would like us to know about how your customers pay the business?', inputHandler: this.inputHandler, errorText: (_g = this.errors) === null || _g === void 0 ? void 0 : _g.business_other_payment_details, defaultValue: additionalQuestionsDefaultValue === null || additionalQuestionsDefaultValue === void 0 ? void 0 : additionalQuestionsDefaultValue.business_other_payment_details }))))));
79
+ return (h("form", { key: '275b193388d360ab6dacfb70ea9e06d68d68cbf8' }, h("fieldset", { key: '740ce0b08ad00efa1345f69cf977e64283307533' }, h("legend", { key: '7f531cdf699ad93234bbdd5d9336ee782e770597' }, "Additional Questions"), h("hr", { key: 'cb81b0b4dc9e6a52ff9bf70571a200fee50e8146' }), h("div", { key: '9100fdb4857a5a9a2b42f0188cfac075974afbeb', class: 'row gy-3' }, h("div", { key: 'ee0885251b8e49cb33359a42897097552e9d0ff9', class: 'col-12 col-md-6' }, h("form-control-monetary", { key: '555b00e0b6728dca26a42813991f35dec41e2577', name: 'business_revenue', label: 'What is the business\u2019 estimated annual revenue from its primary business activities?', inputHandler: this.inputHandler, errorText: (_a = this.errors) === null || _a === void 0 ? void 0 : _a.business_revenue, defaultValue: additionalQuestionsDefaultValue === null || additionalQuestionsDefaultValue === void 0 ? void 0 : additionalQuestionsDefaultValue.business_revenue, maskOptions: CURRENCY_MASK.WHOLE })), h("div", { key: '689ecc46bffe9cfe7190428e191802332485f139', class: 'col-12 col-md-6' }, h("form-control-monetary", { key: '19a4269b31af12f9e07655c9dc0d9db1de46caa2', name: 'business_payment_volume', label: "What is the business' annual credit card & ACH volume anticipated to process?", inputHandler: this.inputHandler, errorText: (_b = this.errors) === null || _b === void 0 ? void 0 : _b.business_payment_volume, defaultValue: additionalQuestionsDefaultValue === null || additionalQuestionsDefaultValue === void 0 ? void 0 : additionalQuestionsDefaultValue.business_payment_volume, maskOptions: CURRENCY_MASK.WHOLE })), h("div", { key: 'f6eebbdd589cf4eb506d3d94502a027e639889d9', class: 'col-12' }, h("form-control-select", { key: '112bb7ee88335d9b8e8f9300ff190f164b750b39', name: 'business_when_service_received', label: 'On average, how long after paying will your customers typically receive their goods or services?', inputHandler: this.inputHandler, errorText: (_c = this.errors) === null || _c === void 0 ? void 0 : _c.business_when_service_received, options: businessServiceReceivedOptions, defaultValue: additionalQuestionsDefaultValue === null || additionalQuestionsDefaultValue === void 0 ? void 0 : additionalQuestionsDefaultValue.business_when_service_received })), h("div", { key: '49864b5aeca86d221cc12690e2f9976fe9ee86ef', class: 'col-12' }, h("form-control-select", { key: 'a07159d8e7e49b9b1df5bcf2dcede994d0059595', name: 'business_recurring_payments', label: 'Does your business offer recurring payments?', inputHandler: this.inputHandler, errorText: (_d = this.errors) === null || _d === void 0 ? void 0 : _d.business_recurring_payments, options: recurringPaymentsOptions, defaultValue: additionalQuestionsDefaultValue === null || additionalQuestionsDefaultValue === void 0 ? void 0 : additionalQuestionsDefaultValue.business_recurring_payments })), h("div", { key: '3a03321d7dd9202c290443d756105bb2565a3e55', class: 'col-12' }, h("form-control-text", { key: '319a5fcb7ac6e975c41cfd5b19d5de0e98504f5d', name: 'business_recurring_payments_percentage', label: 'What percent of revenue is generated from each recurring payment type offered?', inputHandler: this.inputHandler, errorText: (_e = this.errors) === null || _e === void 0 ? void 0 : _e.business_recurring_payments_percentage, defaultValue: additionalQuestionsDefaultValue === null || additionalQuestionsDefaultValue === void 0 ? void 0 : additionalQuestionsDefaultValue.business_recurring_payments_percentage })), h("div", { key: 'e108f26d04e7f9510f89ab09daab53e86f5c30e1', class: 'col-12' }, h("form-control-select", { key: '45fb9296592415ddb947b55e3c7c73d198b96fac', name: 'business_seasonal', label: 'Is this business seasonal?', inputHandler: this.inputHandler, errorText: (_f = this.errors) === null || _f === void 0 ? void 0 : _f.business_seasonal, options: seasonalBusinessOptions, defaultValue: additionalQuestionsDefaultValue === null || additionalQuestionsDefaultValue === void 0 ? void 0 : additionalQuestionsDefaultValue.business_seasonal })), h("div", { key: '0b40ac8429c07279acb3d360124853a608a01664', class: 'col-12' }, h("form-control-text", { key: '880e00acdfa51f95b643f1ecc8d6fccba1167e6c', name: 'business_other_payment_details', label: 'Is there anything else you would like us to know about how your customers pay the business?', inputHandler: this.inputHandler, errorText: (_g = this.errors) === null || _g === void 0 ? void 0 : _g.business_other_payment_details, defaultValue: additionalQuestionsDefaultValue === null || additionalQuestionsDefaultValue === void 0 ? void 0 : additionalQuestionsDefaultValue.business_other_payment_details }))))));
80
80
  }
81
81
  static get is() { return "justifi-additional-questions-form-step-core"; }
82
82
  static get properties() {
@@ -49,7 +49,7 @@ export class BusinessBankAccountFormStep {
49
49
  try {
50
50
  const formValues = this.formController.values.getValue();
51
51
  const payload = Object.assign(Object.assign({}, formValues), { business_id: this.businessId });
52
- const response = await this.api.post(this.bankAccountEndpoint, JSON.stringify(payload));
52
+ const response = await this.api.post(this.bankAccountEndpoint, payload);
53
53
  this.handleResponse(response, onSuccess);
54
54
  }
55
55
  catch (error) {
@@ -118,7 +118,7 @@ export class BusinessBankAccountFormStep {
118
118
  }
119
119
  render() {
120
120
  const bankAccountDefaultValue = this.formController.getInitialValues();
121
- return (h("form", { key: 'b2e106437693b667376fb8091117bc04899cce13' }, h("fieldset", { key: 'c6fc0e5b39278a4618abe0aeba8593b4800f23fa' }, h("legend", { key: 'f07c520e32491dd506f7ac16b03b0eb82a451035' }, "Bank Account Info"), h("hr", { key: '43845af4ec6f143653154e301a49c870c688e8cb' }), h("div", { key: '911f450a0e81a7fcf6afb8b54be910da36b068d6', class: "row gy-3" }, h("div", { key: 'afe5dd40139f1098e69736cd08f00792916657b1', class: "col-12" }, h("form-control-text", { key: 'c590065940b5ef4ab5a125962e114d3bb99161e8', name: "bank_name", label: "Bank Name", defaultValue: bankAccountDefaultValue.bank_name, errorText: this.errors.bank_name, inputHandler: this.inputHandler, disabled: this.formDisabled })), h("div", { key: 'ad7ac99fdae7bb0108675cf4ea522ae7b0c7b340', class: "col-12" }, h("form-control-text", { key: '4e69debe8b184272c788f0ba206b7e983bb6bba5', name: "nickname", label: "Nickname", defaultValue: bankAccountDefaultValue.nickname, errorText: this.errors.nickname, inputHandler: this.inputHandler, disabled: this.formDisabled })), h("div", { key: 'a478bb2330e48935b65d22a42287ab89f94b4808', class: "col-12" }, h("form-control-text", { key: 'c20531fb2c5e903eefeeb62fca5a831cf2542867', name: "account_owner_name", label: "Account Owner Name", defaultValue: bankAccountDefaultValue.account_owner_name, errorText: this.errors.account_owner_name, inputHandler: this.inputHandler, disabled: this.formDisabled })), h("div", { key: '63325c985d0341888ad9ce34fec48c623e275f55', class: "col-12" }, h("form-control-select", { key: 'b9fc86477dada5413e4a6e18b10e77de620996d9', name: "account_type", label: "Account Type", options: bankAccountTypeOptions, defaultValue: bankAccountDefaultValue.account_type, errorText: this.errors.account_type, inputHandler: this.inputHandler, disabled: this.formDisabled })), h("div", { key: '7d2849185532bb21c85cf8227749469e28fdc102', class: "col-12" }, h("form-control-text", { key: '466a38e94ed054788596ec63bed4b4ffe646dc63', name: "account_number", label: "Account Number", defaultValue: bankAccountDefaultValue.account_number, maxLength: 17, errorText: this.errors.account_number, inputHandler: this.inputHandler, keyDownHandler: numberOnlyHandler, disabled: this.formDisabled })), h("div", { key: '1162fae41dfc767cd038a37d7a7581b54dee1a1d', class: "col-12" }, h("form-control-text", { key: '47ffb34b6523d34df02739231b5764418f162fe6', name: "routing_number", label: "Routing Number", defaultValue: bankAccountDefaultValue.routing_number, maxLength: 9, errorText: this.errors.routing_number, inputHandler: this.inputHandler, keyDownHandler: numberOnlyHandler, disabled: this.formDisabled }))))));
121
+ return (h("form", { key: 'c2bdcd5ab6301d1a39e4d774df101281c41e2002' }, h("fieldset", { key: '7f6b607be5b7bc5fcd0dc1687adaa1ad00d7d2e9' }, h("legend", { key: '91b68746c65bb68f4fbd2eef151258e6915f8e35' }, "Bank Account Info"), h("hr", { key: '5eceedbf59faef10757c9e2b04d4dc4cd6b88a9b' }), h("div", { key: 'd3185db7fceb9851ccb44c1c89f8cbe5a37c24e0', class: "row gy-3" }, h("div", { key: '625caf0e9b93c244d94c69174ffff57126d39fa1', class: "col-12" }, h("form-control-text", { key: 'ddf3206b09047dfea56df850babe6c8f92ed33ee', name: "bank_name", label: "Bank Name", defaultValue: bankAccountDefaultValue.bank_name, errorText: this.errors.bank_name, inputHandler: this.inputHandler, disabled: this.formDisabled })), h("div", { key: 'd7d498353eec8e1947ce748aa35cbee63e793817', class: "col-12" }, h("form-control-text", { key: 'a80050dcd088db0209c2e5da65b310d7fc7877f5', name: "nickname", label: "Nickname", defaultValue: bankAccountDefaultValue.nickname, errorText: this.errors.nickname, inputHandler: this.inputHandler, disabled: this.formDisabled })), h("div", { key: 'ea5578470e0e4d0fd5b973807475a02c7764c9c8', class: "col-12" }, h("form-control-text", { key: 'dd8c77b43ddfca61cfd5ed39ce6e142654f18d9f', name: "account_owner_name", label: "Account Owner Name", defaultValue: bankAccountDefaultValue.account_owner_name, errorText: this.errors.account_owner_name, inputHandler: this.inputHandler, disabled: this.formDisabled })), h("div", { key: 'cb3256226c5fdfa5ff2a02c456a6c384e06d16a6', class: "col-12" }, h("form-control-select", { key: 'a865f48350a0ae6b6a2a540dc2d54de72a8af074', name: "account_type", label: "Account Type", options: bankAccountTypeOptions, defaultValue: bankAccountDefaultValue.account_type, errorText: this.errors.account_type, inputHandler: this.inputHandler, disabled: this.formDisabled })), h("div", { key: 'aa9062a25dade06db1f175d4233f2e5bb4e7ecd7', class: "col-12" }, h("form-control-text", { key: '1a87920e4df50178625446c770e4182d918664c7', name: "account_number", label: "Account Number", defaultValue: bankAccountDefaultValue.account_number, maxLength: 17, errorText: this.errors.account_number, inputHandler: this.inputHandler, keyDownHandler: numberOnlyHandler, disabled: this.formDisabled })), h("div", { key: 'c72858a29aa1289b367c0eb89d6cc0eded23346d', class: "col-12" }, h("form-control-text", { key: 'b7fb93bcf16c01689245d5aca11142b013fe6adc', name: "routing_number", label: "Routing Number", defaultValue: bankAccountDefaultValue.routing_number, maxLength: 9, errorText: this.errors.routing_number, inputHandler: this.inputHandler, keyDownHandler: numberOnlyHandler, disabled: this.formDisabled }))))));
122
122
  }
123
123
  static get is() { return "justifi-business-bank-account-form-step"; }
124
124
  static get properties() {
@@ -4,8 +4,6 @@ import { FormController } from "../../../form/form";
4
4
  import { CoreBusinessInfo } from "../../../../api/Business";
5
5
  import { businessClassificationOptions } from "../../utils/business-form-options";
6
6
  import { PHONE_MASKS } from "../../../../utils/form-input-masks";
7
- import { parseCoreInfo } from "../../utils/payload-parsers";
8
- import { flattenNestedObject } from "../../../../utils/utils";
9
7
  import { numberOnlyHandler } from "../../../form/utils";
10
8
  export class BusinessCoreInfoFormStepCore {
11
9
  constructor() {
@@ -65,8 +63,8 @@ export class BusinessCoreInfoFormStepCore {
65
63
  }
66
64
  ;
67
65
  get patchPayload() {
68
- let formValues = parseCoreInfo(flattenNestedObject(this.formController.values.getValue()));
69
- return JSON.stringify(formValues);
66
+ let formValues = new CoreBusinessInfo(this.formController.values.getValue()).payload;
67
+ return formValues;
70
68
  }
71
69
  componentWillLoad() {
72
70
  this.getBusiness && this.getData();
@@ -79,7 +77,7 @@ export class BusinessCoreInfoFormStepCore {
79
77
  }
80
78
  render() {
81
79
  const coreInfoDefaultValue = this.formController.getInitialValues();
82
- return (h("form", { key: 'c91c42a7b3d48789f2304f6f3e7b9cab228e7e86' }, h("fieldset", { key: '159f23468da4ed60e89be108c3640c3e4f19a32a' }, h("legend", { key: '7666498459afce82b88114c880dba4f697ec422e' }, "General Info"), h("hr", { key: 'f9d253d811ba1f9b7438888f5c2e9813fb6371a9' }), h("div", { key: '9bc73f86956d81ed4028cabb4ec083e7524ad973', class: 'row gy-3' }, h("div", { key: '86bc9d41f88ee46e727a11b6371ecdb7d9dac6f3', class: 'col-12' }, h("form-control-text", { key: '2f470cdd65f25993a2671f1ab1938a214acfa625', name: 'legal_name', label: 'Legal Name', defaultValue: coreInfoDefaultValue.legal_name, errorText: this.errors.legal_name, inputHandler: this.inputHandler })), h("div", { key: '38af9153a77c6f121a2f1af626a325a525b8be36', class: 'col-12' }, h("form-control-text", { key: '5912ab4555f9522f973ef67240249fb44e89bcab', name: 'doing_business_as', label: 'Doing Business As (DBA)', defaultValue: coreInfoDefaultValue.doing_business_as, errorText: this.errors.doing_business_as, inputHandler: this.inputHandler })), h("div", { key: 'a48d44f28b473c3873aa16468a01f45f46e99c5e', class: 'col-12 col-md-8' }, h("form-control-select", { key: '7fa00ac1122a43fd1645dd81c6d9fbaf6b10131d', name: 'classification', label: 'Business Classification', options: businessClassificationOptions, defaultValue: coreInfoDefaultValue.classification, errorText: this.errors.classification, inputHandler: this.inputHandler })), h("div", { key: 'cd4e235392581af33d79d0eeb7a950fe51291bb4', class: 'col-12 col-md-4' }, h("form-control-date", { key: '43f65e71b7ea53fb82f8a97d4160b3df9b1ceacf', name: 'date_of_incorporation', label: 'Date of Incorporation', defaultValue: coreInfoDefaultValue.date_of_incorporation, errorText: this.errors.date_of_incorporation, inputHandler: this.inputHandler })), h("div", { key: '37ba3bc3731eec0281ab6c4ae942649ac25e4eba', class: 'col-12 col-md-6' }, h("form-control-text", { key: 'b48172d98fd70130fe60c47f31b077e8644ed2e7', name: 'industry', label: 'Industry', defaultValue: coreInfoDefaultValue.industry, errorText: this.errors.industry, inputHandler: this.inputHandler })), h("div", { key: '3212bfe272b22b896ef6602f639b2779ace36857', class: 'col-12 col-md-6' }, h("form-control-text", { key: '523a2e4b1df12723e936f224ad1518d657acc38e', name: 'tax_id', label: 'Tax ID (EIN or SSN)', defaultValue: coreInfoDefaultValue.tax_id, errorText: this.errors.tax_id, inputHandler: this.inputHandler, keyDownHandler: numberOnlyHandler, maxLength: 9 })), h("div", { key: '4018cec1595a3c2b92d92faaec10c6c917364721', class: 'col-12' }, h("form-control-text", { key: 'f5dfb03af25b7eeeb1720191acff2fff510b8114', name: 'website_url', label: 'Website URL', defaultValue: coreInfoDefaultValue.website_url, errorText: this.errors.website_url, inputHandler: this.inputHandler })), h("div", { key: '3dbe9c55e93c35b68d6783f4dd73dab45970289b', class: 'col-12 col-md-6' }, h("form-control-text", { key: '5de21e1a7c0647b4fe6e66b51a32288c96ae82a7', name: 'email', label: 'Email Address', defaultValue: coreInfoDefaultValue.email, errorText: this.errors.email, inputHandler: this.inputHandler })), h("div", { key: '93c06e619ea76c69eb7723c3d050edfb0539635d', class: 'col-12 col-md-6' }, h("form-control-number-masked", { key: '4dc5a4ee1bb04075ee20d58e87fec1711b0683a8', name: 'phone', label: 'Phone Number', defaultValue: coreInfoDefaultValue.phone, errorText: this.errors.phone, inputHandler: this.inputHandler, mask: PHONE_MASKS.US }))))));
80
+ return (h("form", { key: 'ab0ae9821e19c2a2d1e87ce16b23cfe56bafb31b' }, h("fieldset", { key: 'eec949b50436218cee02c6410c34959a6b10ebf8' }, h("legend", { key: '34b37dddcb967275ddd3d561dd2931b74103c0ce' }, "General Info"), h("hr", { key: 'af37f3171790265c3b7d22d2328c31842c5a12ea' }), h("div", { key: 'ba4780eec04a8b34f644895913e99ea49c587f81', class: 'row gy-3' }, h("div", { key: '8109ee7485afc5a5ee3e38c947ef9387cab5daa4', class: 'col-12' }, h("form-control-text", { key: '885bc9f67fc4738cb5abc6165bf1f6f5b3382a90', name: 'legal_name', label: 'Legal Name', defaultValue: coreInfoDefaultValue.legal_name, errorText: this.errors.legal_name, inputHandler: this.inputHandler })), h("div", { key: '453b4e25b812015a50f72e76159111818d0065f5', class: 'col-12' }, h("form-control-text", { key: 'a63ec6c1e936ab1104b92e6fdd5f6a350559009c', name: 'doing_business_as', label: 'Doing Business As (DBA)', defaultValue: coreInfoDefaultValue.doing_business_as, errorText: this.errors.doing_business_as, inputHandler: this.inputHandler })), h("div", { key: '8a39b25c7d9c414569e22e73a98d7b136b0623dd', class: 'col-12 col-md-8' }, h("form-control-select", { key: '41d6d3a45431953746e86a5aea6ebb0a39674009', name: 'classification', label: 'Business Classification', options: businessClassificationOptions, defaultValue: coreInfoDefaultValue.classification, errorText: this.errors.classification, inputHandler: this.inputHandler })), h("div", { key: 'd98e5f2ee6e7d3ddc23ba5501db4f698cc88ba40', class: 'col-12 col-md-4' }, h("form-control-date", { key: '4ea36622261e3a649b934700ee676c062789c519', name: 'date_of_incorporation', label: 'Date of Incorporation', defaultValue: coreInfoDefaultValue.date_of_incorporation, errorText: this.errors.date_of_incorporation, inputHandler: this.inputHandler })), h("div", { key: '8617887e16cbc3a40b0c1ab56597d7098c7ac62f', class: 'col-12 col-md-6' }, h("form-control-text", { key: '9357ddb686194100fe705111bbc965c2956dddb4', name: 'industry', label: 'Industry', defaultValue: coreInfoDefaultValue.industry, errorText: this.errors.industry, inputHandler: this.inputHandler })), h("div", { key: '968b0f492f354279736b531295a1e4813a5de0b0', class: 'col-12 col-md-6' }, h("form-control-text", { key: 'd082445d9f876794e525839fb35457f114e89dac', name: 'tax_id', label: 'Tax ID (EIN or SSN)', defaultValue: coreInfoDefaultValue.tax_id, errorText: this.errors.tax_id, inputHandler: this.inputHandler, keyDownHandler: numberOnlyHandler, maxLength: 9 })), h("div", { key: 'a0e041bb3fa323e378d2b9730dd9055c9ecf1dfc', class: 'col-12' }, h("form-control-text", { key: '4994efe8c6cb5faf84accd0f2965b508d084144e', name: 'website_url', label: 'Website URL', defaultValue: coreInfoDefaultValue.website_url, errorText: this.errors.website_url, inputHandler: this.inputHandler })), h("div", { key: '0f7f1548e704095aaef9d4fccd7c81284ff7bbed', class: 'col-12 col-md-6' }, h("form-control-text", { key: 'e1cffd24b03e5e3655649b68900c74fcc89513c5', name: 'email', label: 'Email Address', defaultValue: coreInfoDefaultValue.email, errorText: this.errors.email, inputHandler: this.inputHandler })), h("div", { key: '1732635477c58d1f57aa5b8dc0c560ae0c215501', class: 'col-12 col-md-6' }, h("form-control-number-masked", { key: '04979d08463efc69557b782fda772702935349a7', name: 'phone', label: 'Phone Number', defaultValue: coreInfoDefaultValue.phone, errorText: this.errors.phone, inputHandler: this.inputHandler, mask: PHONE_MASKS.US }))))));
83
81
  }
84
82
  static get is() { return "justifi-business-core-info-form-step-core"; }
85
83
  static get properties() {
@@ -37,7 +37,7 @@ export class BusinessOwnersFormStepCore {
37
37
  let submittedData;
38
38
  this.formLoading.emit(true);
39
39
  this.patchBusiness({
40
- payload: JSON.stringify({ owners: this.ownersPayload }),
40
+ payload: { owners: this.ownersPayload },
41
41
  onSuccess: (response) => {
42
42
  submittedData = response;
43
43
  onSuccess();
@@ -111,9 +111,9 @@ export class BusinessOwnersFormStepCore {
111
111
  this.ownersPayload = updatedOwners;
112
112
  }
113
113
  render() {
114
- return (h("div", { key: '5958d46ae5bc3abb7a82f5c67c597be46898284e' }, h("legend", { key: 'e10085a37e93b96901187e0a926127167ca6dbc5' }, "Owners"), h("hr", { key: 'eb7f84185271c80b87397e49f2ee5c6e20faad99' }), h("div", { key: '0f791f3d3f6c7f6aa363004d0618bd90e16f185b', class: 'row gy-3' }, this.ownersPayload.map((owner) => {
114
+ return (h("div", { key: 'f2358952d2d28841fb8e6bc66e9846eb2cdcc97e' }, h("legend", { key: 'ab3f7e6758cc50760681a9fdd07f8e137da65980' }, "Owners"), h("hr", { key: '57828746f9991da89e77a1f96b51f6df2d33d666' }), h("div", { key: '4f7f58bf1b5d40079228eef118946e17b407db63', class: 'row gy-3' }, this.ownersPayload.map((owner) => {
115
115
  return (h("justifi-owner-form", { key: owner.id, authToken: this.authToken, businessId: this.businessId, ownerId: owner.id, removeOwner: this.removeOwnerForm, newFormOpen: this.newFormOpen, ownersLength: this.ownersPayload.length, allowOptionalFields: this.allowOptionalFields, ref: (ref) => this.matchRef(ref, owner.id) }));
116
- })), h("div", { key: 'd1f6414e9213d9600eaea7e9c1e033d250f8e49a', class: 'd-flex justify-content-start' }, h("div", { key: 'fd96248f6dddfa0d973744d11e3f1f121353e398', class: 'gap-2' }, h(Button, { key: '514e549632c8f11b4b51c061949b026734ae0113', variant: 'primary', onClick: () => this.addOwnerForm(true), hidden: !this.showAddOwnerButton }, "Add Owner")))));
116
+ })), h("div", { key: '88dad43cc24d7c1e1220acb6b7791c2172074d61', class: 'd-flex justify-content-start' }, h("div", { key: '9359481d78e5c3ba9599d2fce5837c5fdfe1d6f0', class: 'gap-2' }, h(Button, { key: '04ee1c49c34567b079432df8fb2b1b298fb7d7a3', variant: 'primary', onClick: () => this.addOwnerForm(true), hidden: !this.showAddOwnerButton }, "Add Owner")))));
117
117
  }
118
118
  static get is() { return "justifi-business-owners-form-step-core"; }
119
119
  static get properties() {
@@ -1,6 +1,5 @@
1
1
  import { h } from "@stencil/core";
2
2
  import { Representative } from "../../../../api/Identity";
3
- import { parseIdentityInfo } from "../../utils/payload-parsers";
4
3
  import { FormController } from "../../../form/form";
5
4
  import { identitySchema } from "../../schemas/business-identity-schema";
6
5
  export class BusinessRepresentativeFormStepCore {
@@ -56,8 +55,8 @@ export class BusinessRepresentativeFormStepCore {
56
55
  this.formController.validateAndSubmit(() => this.sendData(onSuccess));
57
56
  }
58
57
  get patchPayload() {
59
- let formValues = parseIdentityInfo(this.formController.values.getValue());
60
- return JSON.stringify({ representative: formValues });
58
+ let formValues = new Representative(this.formController.values.getValue()).payload;
59
+ return { representative: formValues };
61
60
  }
62
61
  componentWillLoad() {
63
62
  this.getBusiness && this.getData();
@@ -69,7 +68,7 @@ export class BusinessRepresentativeFormStepCore {
69
68
  });
70
69
  }
71
70
  render() {
72
- return (h("justifi-business-representative-form-inputs", { key: 'bfe9944ea9fc78fda577944f2c968ab9decf7f00', representativeDefaultValue: this.formController.getInitialValues(), errors: this.errors, formController: this.formController }));
71
+ return (h("justifi-business-representative-form-inputs", { key: '855736c2c1565b0b9e2cf57131a72298ccc889d5', representativeDefaultValue: this.formController.getInitialValues(), errors: this.errors, formController: this.formController }));
73
72
  }
74
73
  static get is() { return "justifi-business-representative-form-step-core"; }
75
74
  static get properties() {
@@ -47,7 +47,7 @@ export class BusinessDocumentFormStep {
47
47
  this.formLoading.emit(true);
48
48
  const payload = docData.record_data;
49
49
  try {
50
- const response = await this.api.post(this.documentEndpoint, JSON.stringify(payload));
50
+ const response = await this.api.post(this.documentEndpoint, payload);
51
51
  return this.handleDocRecordResponse(docData, response);
52
52
  }
53
53
  catch (error) {
@@ -179,7 +179,7 @@ export class BusinessDocumentFormStep {
179
179
  return (h("justifi-business-document-upload-input-group", { paymentVolume: this.paymentVolume, inputHandler: this.inputHandler, storeFiles: this.storeFiles, errors: this.errors }));
180
180
  }
181
181
  render() {
182
- return (h("form", { key: '8f2e1d262cd5050b315019a1947b1474eaf995de' }, h("fieldset", { key: 'd022b1c294835e456a9067fcfdbf2b93a33c8ca8' }, h("legend", { key: '522ecbab0489efa6d4294f38f792a28770010f1e' }, "Document Uploads"), h("p", { key: 'b49a6b3a4a7c79b368b20455b4ed4a943f08ec51' }, "Various file formats such as PDF, DOC, DOCX, JPEG, and others are accepted. Multiple files can be uploaded for each document category."), h("hr", { key: '3d8c2f7f5b128b99ceaa501166ae60c490b12378' }), this.documentsOnFile, h("div", { key: 'd2627185483e1be43c0b34d80b1fcfa850decd28', class: "d-flex flex-column" }, this.formInputs))));
182
+ return (h("form", { key: '38bb9070ca04f773ec092ebb14ce8ad20f33d8cf' }, h("fieldset", { key: '9c736d11200bb9c5a37c1319f3bfb349b7a5e93f' }, h("legend", { key: '92ed2fb864e85e38532af364518c25ef4bd275a5' }, "Document Uploads"), h("p", { key: 'f5803df74a5d0bc4e544c6cc968333f2a3f77385' }, "Various file formats such as PDF, DOC, DOCX, JPEG, and others are accepted. Multiple files can be uploaded for each document category."), h("hr", { key: '0c696d1bdb614bdacb3cbadeee66c95149efda68' }), this.documentsOnFile, h("div", { key: '7919205dfda677526d810a9fa1507ed8a55eafb8', class: "d-flex flex-column" }, this.formInputs))));
183
183
  }
184
184
  static get is() { return "justifi-business-document-upload-form-step"; }
185
185
  static get properties() {
@@ -3,7 +3,6 @@ import { addressSchema } from "../../schemas/business-address-schema";
3
3
  import { FormController } from "../../../form/form";
4
4
  import { Address } from "../../../../api/Business";
5
5
  import StateOptions from "../../../../utils/state-options";
6
- import { parseAddressInfo } from "../../utils/payload-parsers";
7
6
  import { numberOnlyHandler } from "../../../form/utils";
8
7
  export class LegalAddressFormStepCore {
9
8
  constructor() {
@@ -62,8 +61,8 @@ export class LegalAddressFormStepCore {
62
61
  }
63
62
  ;
64
63
  get patchPayload() {
65
- let formValues = parseAddressInfo(this.formController.values.getValue());
66
- return JSON.stringify({ legal_address: formValues });
64
+ let formValues = new Address(this.formController.values.getValue()).payload;
65
+ return { legal_address: formValues };
67
66
  }
68
67
  componentWillLoad() {
69
68
  this.getBusiness && this.getData();
@@ -77,7 +76,7 @@ export class LegalAddressFormStepCore {
77
76
  render() {
78
77
  var _a, _b, _c, _d, _e, _f;
79
78
  const legalAddressDefaultValue = this.formController.getInitialValues();
80
- return (h("form", { key: 'ef8d88ebced702b5a0b89eaddb22320f24e7081f' }, h("fieldset", { key: '9f70633b36559e6f8de8d67f39a19df365116bcd' }, h("legend", { key: '6b6b0e42fd0f00a28d24bf9d1e4818e54264ff96' }, "Business Legal Address"), h("hr", { key: '8b7b1a9f0f9448c4fd3b918f20e7b51337d3e5ee' }), h("div", { key: 'f45b643ec057356d9a6e04a19829c562ec521bd2', class: 'row gy-3' }, h("div", { key: 'f115c4e4163126d2d8c998c8de775821e7fc0e65', class: 'col-12' }, h("form-control-text", { key: '066a1ea25ef086dda05e32cde738e7e77dcbb322', name: 'line1', label: 'Legal Address', inputHandler: this.inputHandler, defaultValue: legalAddressDefaultValue === null || legalAddressDefaultValue === void 0 ? void 0 : legalAddressDefaultValue.line1, errorText: (_a = this.errors) === null || _a === void 0 ? void 0 : _a.line1 })), h("div", { key: 'e8432ea00cd5da5b08cc97efe8f3a9817a14b5b1', class: 'col-12' }, h("form-control-text", { key: '099ab7197940d5de8869682cbda41dc0d6ee0e1d', name: 'line2', label: 'Address Line 2', inputHandler: this.inputHandler, defaultValue: legalAddressDefaultValue === null || legalAddressDefaultValue === void 0 ? void 0 : legalAddressDefaultValue.line2, errorText: (_b = this.errors) === null || _b === void 0 ? void 0 : _b.line2 })), h("div", { key: '9514757f732d6a445e48eb85d3654f79cf2320db', class: 'col-12' }, h("form-control-text", { key: '37db927ef6c735699a4954ad51d43f4666eea9a0', name: 'city', label: 'City', inputHandler: this.inputHandler, defaultValue: legalAddressDefaultValue === null || legalAddressDefaultValue === void 0 ? void 0 : legalAddressDefaultValue.city, errorText: (_c = this.errors) === null || _c === void 0 ? void 0 : _c.city })), h("div", { key: 'f3c82def0d67fcc0d7e4ca03e80afc166a36ffbb', class: 'col-12' }, h("form-control-select", { key: 'cbcfafe876997e0f9181cf117eeaf465ca424c68', name: 'state', label: 'State', options: StateOptions, inputHandler: this.inputHandler, defaultValue: legalAddressDefaultValue === null || legalAddressDefaultValue === void 0 ? void 0 : legalAddressDefaultValue.state, errorText: (_d = this.errors) === null || _d === void 0 ? void 0 : _d.state })), h("div", { key: '4f32ffbe520d1fbe2406d41e7fb76a9f0f450299', class: 'col-12' }, h("form-control-text", { key: '5a2fcc4726b543e8ef6c5456e965cc479d91ce4e', name: 'postal_code', label: 'Postal Code', inputHandler: this.inputHandler, defaultValue: legalAddressDefaultValue === null || legalAddressDefaultValue === void 0 ? void 0 : legalAddressDefaultValue.postal_code, errorText: (_e = this.errors) === null || _e === void 0 ? void 0 : _e.postal_code, maxLength: 5, keyDownHandler: numberOnlyHandler })), h("div", { key: 'd4bdbfa4d3999bae59b812e84394bb4c0974d6b3', class: 'col-12' }, h("form-control-select", { key: '95eec216f50d119016c7627074bf29b9a21b1cd1', name: 'country', label: 'Country', options: [{ label: 'United States', value: 'USA' }], inputHandler: this.inputHandler, defaultValue: legalAddressDefaultValue === null || legalAddressDefaultValue === void 0 ? void 0 : legalAddressDefaultValue.country, errorText: (_f = this.errors) === null || _f === void 0 ? void 0 : _f.country,
79
+ return (h("form", { key: '5a95fe5a130deded7e160e6fe4ba1d09e6a6aabc' }, h("fieldset", { key: '2011fac5c860b7beee5eaac28e697b284067f2e6' }, h("legend", { key: 'dbe411d80d10a71bc63f18fcdb58a40b124e8eaf' }, "Business Legal Address"), h("hr", { key: '4a91dd5e67e5770778d2dd59716e1e532d644ee9' }), h("div", { key: 'cd53516a98498ab82ab347a1f7c836be262b9fdb', class: 'row gy-3' }, h("div", { key: '14cd5fee5661681ccff95eabf8cd6f2d4cff2296', class: 'col-12' }, h("form-control-text", { key: 'e4b0a5e30fc1a35e5127a76710211874fb68898b', name: 'line1', label: 'Legal Address', inputHandler: this.inputHandler, defaultValue: legalAddressDefaultValue === null || legalAddressDefaultValue === void 0 ? void 0 : legalAddressDefaultValue.line1, errorText: (_a = this.errors) === null || _a === void 0 ? void 0 : _a.line1 })), h("div", { key: '2c35da509732e73e2abb4365d6d9e2056d7ce771', class: 'col-12' }, h("form-control-text", { key: 'c8ae2a5c75d0fe8c5ddd46d9150590b8a4f99a5e', name: 'line2', label: 'Address Line 2', inputHandler: this.inputHandler, defaultValue: legalAddressDefaultValue === null || legalAddressDefaultValue === void 0 ? void 0 : legalAddressDefaultValue.line2, errorText: (_b = this.errors) === null || _b === void 0 ? void 0 : _b.line2 })), h("div", { key: '07649ebd5a848eee63398965c30e8e30fcc88354', class: 'col-12' }, h("form-control-text", { key: 'cb25047c3458124f7d837b7948e807214f1a0a0a', name: 'city', label: 'City', inputHandler: this.inputHandler, defaultValue: legalAddressDefaultValue === null || legalAddressDefaultValue === void 0 ? void 0 : legalAddressDefaultValue.city, errorText: (_c = this.errors) === null || _c === void 0 ? void 0 : _c.city })), h("div", { key: 'ce3ddc5f3639503dbc02668aea7139ffff376545', class: 'col-12' }, h("form-control-select", { key: '00d18b4af1f415828b40404888a6c69d0611d0cc', name: 'state', label: 'State', options: StateOptions, inputHandler: this.inputHandler, defaultValue: legalAddressDefaultValue === null || legalAddressDefaultValue === void 0 ? void 0 : legalAddressDefaultValue.state, errorText: (_d = this.errors) === null || _d === void 0 ? void 0 : _d.state })), h("div", { key: '1988bd739af107d9595f6fed897f257da13ac997', class: 'col-12' }, h("form-control-text", { key: '55144c39845d4cc36704170b73458f761f311d00', name: 'postal_code', label: 'Postal Code', inputHandler: this.inputHandler, defaultValue: legalAddressDefaultValue === null || legalAddressDefaultValue === void 0 ? void 0 : legalAddressDefaultValue.postal_code, errorText: (_e = this.errors) === null || _e === void 0 ? void 0 : _e.postal_code, maxLength: 5, keyDownHandler: numberOnlyHandler })), h("div", { key: 'cccba799a75280693f461f390121b13006877f35', class: 'col-12' }, h("form-control-select", { key: 'e49b21a781280fb2e9cc9f6b88ddcc6d7408c5f8', name: 'country', label: 'Country', options: [{ label: 'United States', value: 'USA' }], inputHandler: this.inputHandler, defaultValue: legalAddressDefaultValue === null || legalAddressDefaultValue === void 0 ? void 0 : legalAddressDefaultValue.country, errorText: (_f = this.errors) === null || _f === void 0 ? void 0 : _f.country,
81
80
  // just for now so we skip handling country specificities
82
81
  disabled: true }))))));
83
82
  }