@melio-eng/web-sdk 1.0.12 → 1.0.13-pr.28.f028e3c
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/dist/index.d.ts +3 -7
- package/dist/index.js +7 -31
- package/dist/types.d.ts +3 -22
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { InitOptions, OnboardingConfig,
|
|
1
|
+
import { InitOptions, OnboardingConfig, SettingsConfig, FlowInstance, PaymentsDashboardConfig, PayFlowConfig } from './types.js';
|
|
2
2
|
/**
|
|
3
3
|
* Main SDK implementation - now partner agnostic
|
|
4
4
|
*/
|
|
@@ -30,13 +30,9 @@ export declare class MelioSDK implements MelioSDK {
|
|
|
30
30
|
*/
|
|
31
31
|
openOnboarding(config: OnboardingConfig): FlowInstance;
|
|
32
32
|
/**
|
|
33
|
-
* Launch the
|
|
33
|
+
* Launch the pay flow
|
|
34
34
|
*/
|
|
35
|
-
|
|
36
|
-
/**
|
|
37
|
-
* Launch the batch pay flow
|
|
38
|
-
*/
|
|
39
|
-
openBatchPay(config: BatchPayConfig): FlowInstance;
|
|
35
|
+
openPayFlow(config: PayFlowConfig): FlowInstance;
|
|
40
36
|
/**
|
|
41
37
|
* Launch the settings flow
|
|
42
38
|
*/
|
package/dist/index.js
CHANGED
|
@@ -193,34 +193,18 @@ class OnboardingFlow extends Flow {
|
|
|
193
193
|
}
|
|
194
194
|
}
|
|
195
195
|
/**
|
|
196
|
-
*
|
|
196
|
+
* PayFlow subclass with custom URL construction
|
|
197
197
|
*/
|
|
198
|
-
class
|
|
199
|
-
constructor(containerId, config, partnerName, environment, branchOverride) {
|
|
200
|
-
super(containerId, config, partnerName, environment, branchOverride);
|
|
201
|
-
this.billId = config.billId;
|
|
202
|
-
}
|
|
203
|
-
/**
|
|
204
|
-
* Construct the specific flow URL for bill payment
|
|
205
|
-
*/
|
|
206
|
-
constructFlowUrl(baseUrl) {
|
|
207
|
-
return `${baseUrl}/${this.partnerName}/payment/new?billId=${this.billId}`;
|
|
208
|
-
}
|
|
209
|
-
}
|
|
210
|
-
/**
|
|
211
|
-
* BatchPayFlow subclass with custom URL construction
|
|
212
|
-
*/
|
|
213
|
-
class BatchPayFlow extends Flow {
|
|
198
|
+
class PayFlow extends Flow {
|
|
214
199
|
constructor(containerId, config, partnerName, environment, branchOverride) {
|
|
215
200
|
super(containerId, config, partnerName, environment, branchOverride);
|
|
216
201
|
this.billIds = config.billIds;
|
|
217
202
|
}
|
|
218
203
|
/**
|
|
219
|
-
* Construct the specific flow URL for
|
|
204
|
+
* Construct the specific flow URL for bill payment
|
|
220
205
|
*/
|
|
221
206
|
constructFlowUrl(baseUrl) {
|
|
222
|
-
|
|
223
|
-
return `${baseUrl}/${this.partnerName}/batch-payments/${billIds}`;
|
|
207
|
+
return `${baseUrl}/${this.partnerName}/external-entries?billIds=${this.billIds.join(',')}`;
|
|
224
208
|
}
|
|
225
209
|
}
|
|
226
210
|
/**
|
|
@@ -331,18 +315,10 @@ export class MelioSDK {
|
|
|
331
315
|
return flow;
|
|
332
316
|
}
|
|
333
317
|
/**
|
|
334
|
-
* Launch the
|
|
335
|
-
*/
|
|
336
|
-
openSinglePayFlow(config) {
|
|
337
|
-
const flow = new SinglePayFlow(config.containerId, config, this.partnerName, this.environment, this.branchOverride);
|
|
338
|
-
flow.initialize();
|
|
339
|
-
return flow;
|
|
340
|
-
}
|
|
341
|
-
/**
|
|
342
|
-
* Launch the batch pay flow
|
|
318
|
+
* Launch the pay flow
|
|
343
319
|
*/
|
|
344
|
-
|
|
345
|
-
const flow = new
|
|
320
|
+
openPayFlow(config) {
|
|
321
|
+
const flow = new PayFlow(config.containerId, config, this.partnerName, this.environment, this.branchOverride);
|
|
346
322
|
flow.initialize();
|
|
347
323
|
return flow;
|
|
348
324
|
}
|
package/dist/types.d.ts
CHANGED
|
@@ -49,17 +49,10 @@ export interface OnboardingConfig extends BaseFlowConfig {
|
|
|
49
49
|
organizationDetails?: OrganizationDetails;
|
|
50
50
|
}
|
|
51
51
|
/**
|
|
52
|
-
* Configuration for
|
|
52
|
+
* Configuration for pay flow
|
|
53
53
|
*/
|
|
54
|
-
export interface
|
|
55
|
-
/** The bill
|
|
56
|
-
billId: string;
|
|
57
|
-
}
|
|
58
|
-
/**
|
|
59
|
-
* Configuration for batch pay flow
|
|
60
|
-
*/
|
|
61
|
-
export interface BatchPayConfig extends BaseFlowConfig {
|
|
62
|
-
/** Array of bill IDs to pay */
|
|
54
|
+
export interface PayFlowConfig extends BaseFlowConfig {
|
|
55
|
+
/** The bill IDs to pay, can be a single bill ID or an array of bill IDs */
|
|
63
56
|
billIds: Array<string>;
|
|
64
57
|
}
|
|
65
58
|
/**
|
|
@@ -134,18 +127,6 @@ export interface MelioSDK {
|
|
|
134
127
|
* @returns Flow instance for event handling
|
|
135
128
|
*/
|
|
136
129
|
openOnboarding(config: OnboardingConfig): FlowInstance;
|
|
137
|
-
/**
|
|
138
|
-
* Launch the single pay flow
|
|
139
|
-
* @param config - Configuration for the single pay flow
|
|
140
|
-
* @returns Flow instance for event handling
|
|
141
|
-
*/
|
|
142
|
-
openSinglePayFlow(config: SinglePayFlowConfig): FlowInstance;
|
|
143
|
-
/**
|
|
144
|
-
* Launch the batch pay flow
|
|
145
|
-
* @param config - Configuration for the batch pay flow
|
|
146
|
-
* @returns Flow instance for event handling
|
|
147
|
-
*/
|
|
148
|
-
openBatchPay(config: BatchPayConfig): FlowInstance;
|
|
149
130
|
/**
|
|
150
131
|
* Launch the settings flow
|
|
151
132
|
* @param config - Configuration for the settings flow
|
package/package.json
CHANGED