@melio-eng/web-sdk 1.0.40-pr.88.ea95f3d → 1.0.40-pr.92.30fa5a1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +7 -0
- package/dist/types.d.ts +27 -33
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -135,6 +135,13 @@ Host Melio account settings within your product.
|
|
|
135
135
|
melioSDK.openSettings(config: SettingsConfig): FlowInstance
|
|
136
136
|
```
|
|
137
137
|
|
|
138
|
+
#### Entry Point (`entryPoint`)
|
|
139
|
+
|
|
140
|
+
`PayFlowConfig`, `JustPayFlowConfig` and `OnboardingConfig` accept an optional `entryPoint` — which
|
|
141
|
+
page of your product the user came from. Melio uses it to word the button that ends the flow (e.g.
|
|
142
|
+
`"bills"` → "Back to bills"); it's wording only, your app still handles navigation. See
|
|
143
|
+
[Entry point](./guides/pay-flow-integration.md#entry-point) for the full value list and an example.
|
|
144
|
+
|
|
138
145
|
### Event Handling
|
|
139
146
|
|
|
140
147
|
Each flow method returns a `FlowInstance` that allows you to register event listeners:
|
package/dist/types.d.ts
CHANGED
|
@@ -24,53 +24,44 @@ export interface BaseFlowConfig {
|
|
|
24
24
|
/** Optional authorization code for the flow */
|
|
25
25
|
authCode?: string;
|
|
26
26
|
}
|
|
27
|
-
export type BusinessType = '
|
|
28
|
-
export type TaxIdType = 'ssn' | 'itin' | 'ein';
|
|
29
|
-
/**
|
|
30
|
-
* A US mailing address used to prefill business address fields
|
|
31
|
-
*/
|
|
32
|
-
export interface Address {
|
|
33
|
-
street1?: string;
|
|
34
|
-
street2?: string;
|
|
35
|
-
city?: string;
|
|
36
|
-
state?: string;
|
|
37
|
-
zipCode?: string;
|
|
38
|
-
}
|
|
39
|
-
export interface Industry {
|
|
40
|
-
name?: string;
|
|
41
|
-
/** NAICS industry code */
|
|
42
|
-
code?: number;
|
|
43
|
-
}
|
|
27
|
+
export type BusinessType = 'partnership' | 'limitedLiabilityCompany' | 'corporation' | 'nonProfit';
|
|
44
28
|
export interface OrganizationDetails {
|
|
45
29
|
companyName?: string;
|
|
46
|
-
/** Doing-business-as name, if different from companyName */
|
|
47
|
-
dbaName?: string;
|
|
48
30
|
businessType?: BusinessType;
|
|
49
31
|
companyLegalName?: string;
|
|
50
|
-
taxIdType?: TaxIdType;
|
|
51
32
|
taxId?: string;
|
|
52
33
|
legalDateOfBirth?: string;
|
|
53
34
|
website?: string;
|
|
54
35
|
description?: string;
|
|
55
36
|
contactPhone?: string;
|
|
56
|
-
/** Physical/operating address of the business */
|
|
57
|
-
businessAddress?: Address;
|
|
58
|
-
/** Registered legal address of the business, if different from businessAddress */
|
|
59
|
-
legalAddress?: Address;
|
|
60
|
-
industry?: Industry;
|
|
61
37
|
}
|
|
62
38
|
export interface UserDetails {
|
|
63
39
|
email?: string;
|
|
64
40
|
firstName?: string;
|
|
65
41
|
lastName?: string;
|
|
66
42
|
dateOfBirth?: string;
|
|
67
|
-
phone?: string;
|
|
68
43
|
}
|
|
69
44
|
/**
|
|
70
|
-
*
|
|
71
|
-
*
|
|
72
|
-
|
|
73
|
-
|
|
45
|
+
* Which page of your product the user came from. Melio uses it to word the button that
|
|
46
|
+
* ends the flow:
|
|
47
|
+
*
|
|
48
|
+
* | `entryPoint` | return button reads |
|
|
49
|
+
* | --- | --- |
|
|
50
|
+
* | `'bills'` | "Back to bills" |
|
|
51
|
+
* | `'contacts'` | "Back to contacts" |
|
|
52
|
+
* | `'quickpayment'` | "Back to quick payment" |
|
|
53
|
+
* | `'managepayments'` | "Back to manage payments" |
|
|
54
|
+
* | `'home'` | "Back to homepage" |
|
|
55
|
+
* | `'generic'` | "Finish and return" |
|
|
56
|
+
*
|
|
57
|
+
* Use `'generic'` when your page has no single destination; omit `entryPoint` for the
|
|
58
|
+
* default wording.
|
|
59
|
+
*
|
|
60
|
+
* @remarks
|
|
61
|
+
* Wording only — it does not navigate. The `completed` event carries no destination, so your
|
|
62
|
+
* application still decides where the click lands.
|
|
63
|
+
*/
|
|
64
|
+
export type ExternalEntryPoint = 'bills' | 'contacts' | 'quickpayment' | 'managepayments' | 'home' | 'generic';
|
|
74
65
|
/**
|
|
75
66
|
* Configuration for onboarding flow
|
|
76
67
|
*/
|
|
@@ -78,7 +69,7 @@ export interface OnboardingConfig extends BaseFlowConfig {
|
|
|
78
69
|
userDetails?: UserDetails;
|
|
79
70
|
organizationDetails?: OrganizationDetails;
|
|
80
71
|
enforceOnboarding?: boolean;
|
|
81
|
-
/**
|
|
72
|
+
/** Which page of your product the user came from; words the button that ends the flow. See {@link ExternalEntryPoint}. */
|
|
82
73
|
entryPoint?: ExternalEntryPoint;
|
|
83
74
|
}
|
|
84
75
|
/**
|
|
@@ -86,7 +77,10 @@ export interface OnboardingConfig extends BaseFlowConfig {
|
|
|
86
77
|
*/
|
|
87
78
|
export interface PayFlowConfig extends BaseFlowConfig {
|
|
88
79
|
billIds: Array<string>;
|
|
89
|
-
/**
|
|
80
|
+
/**
|
|
81
|
+
* Which page of your product the user came from; words the button that ends the flow.
|
|
82
|
+
* Has no effect when `billIdType` is `'melio'`. See {@link ExternalEntryPoint}.
|
|
83
|
+
*/
|
|
90
84
|
entryPoint?: ExternalEntryPoint;
|
|
91
85
|
/**
|
|
92
86
|
* How the platform should resolve the provided `billIds`. Defaults to `'accounting'`.
|
|
@@ -107,7 +101,7 @@ export interface JustPayFlowConfig extends BaseFlowConfig {
|
|
|
107
101
|
externalVendorIds: Array<string>;
|
|
108
102
|
/** Optional amount to prefill in the payment flow */
|
|
109
103
|
amount?: number;
|
|
110
|
-
/**
|
|
104
|
+
/** Which page of your product the user came from; words the button that ends the flow. See {@link ExternalEntryPoint}. */
|
|
111
105
|
entryPoint?: ExternalEntryPoint;
|
|
112
106
|
}
|
|
113
107
|
/**
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@melio-eng/web-sdk",
|
|
3
|
-
"version": "1.0.40-pr.
|
|
3
|
+
"version": "1.0.40-pr.92.30fa5a1",
|
|
4
4
|
"description": "Melio Web SDK - Embed core Melio workflows directly into partner UI with minimal effort",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"module": "dist/index.js",
|