@melio-eng/web-sdk 1.4.0 → 1.5.0-pr.99.42a23a6
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 +4 -0
- package/dist/flows/JustPayFlow.d.ts +1 -0
- package/dist/flows/JustPayFlow.js +4 -0
- package/dist/types.d.ts +6 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -127,6 +127,10 @@ Vendor-based payment (start from a vendor rather than a specific bill).
|
|
|
127
127
|
melioSDK.openJustPayFlow(config: JustPayFlowConfig): FlowInstance
|
|
128
128
|
```
|
|
129
129
|
|
|
130
|
+
Optionally pass `defaultCurrency` (an ISO 4217 code such as `"USD"`) to set the currency on
|
|
131
|
+
synced vendors that have none in your accounting software. Vendors that already carry a
|
|
132
|
+
currency keep it. Omit it and Melio picks the default.
|
|
133
|
+
|
|
130
134
|
#### Payments Dashboard Flow
|
|
131
135
|
Let users view and manage their payments inside your product.
|
|
132
136
|
```typescript
|
|
@@ -7,6 +7,7 @@ import { Flow } from './Flow.js';
|
|
|
7
7
|
export declare class JustPayFlow extends Flow {
|
|
8
8
|
private externalVendorIds;
|
|
9
9
|
private amount?;
|
|
10
|
+
private defaultCurrency?;
|
|
10
11
|
private authCode;
|
|
11
12
|
private entryPoint?;
|
|
12
13
|
constructor(containerId: string, config: JustPayFlowConfig, partnerName: string, environment: Environment, authCode: string, branchOverride?: string);
|
|
@@ -9,6 +9,7 @@ export class JustPayFlow extends Flow {
|
|
|
9
9
|
super(containerId, config, partnerName, environment, branchOverride);
|
|
10
10
|
this.externalVendorIds = config.externalVendorIds;
|
|
11
11
|
this.amount = config.amount;
|
|
12
|
+
this.defaultCurrency = config.defaultCurrency;
|
|
12
13
|
this.authCode = authCode;
|
|
13
14
|
this.entryPoint = config.entryPoint;
|
|
14
15
|
if (isEmptyString(this.authCode)) {
|
|
@@ -25,6 +26,9 @@ export class JustPayFlow extends Flow {
|
|
|
25
26
|
if (this.amount !== undefined) {
|
|
26
27
|
target += `&amount=${this.amount}`;
|
|
27
28
|
}
|
|
29
|
+
if (this.defaultCurrency) {
|
|
30
|
+
target += `&defaultCurrency=${this.defaultCurrency}`;
|
|
31
|
+
}
|
|
28
32
|
const encodedTarget = encodeURIComponent(target);
|
|
29
33
|
return `${baseUrl}/${this.partnerName}/auth?token=${this.authCode}&redirectUrl=${encodedTarget}`;
|
|
30
34
|
}
|
package/dist/types.d.ts
CHANGED
|
@@ -106,6 +106,12 @@ export interface JustPayFlowConfig extends BaseFlowConfig {
|
|
|
106
106
|
externalVendorIds: Array<string>;
|
|
107
107
|
/** Optional amount to prefill in the payment flow */
|
|
108
108
|
amount?: number;
|
|
109
|
+
/**
|
|
110
|
+
* ISO 4217 currency code (e.g. `'USD'`) applied to the synced vendors that have no
|
|
111
|
+
* currency of their own in your accounting software. Vendors that already carry one
|
|
112
|
+
* keep it. Omit this to let Melio pick the default.
|
|
113
|
+
*/
|
|
114
|
+
defaultCurrency?: string;
|
|
109
115
|
/** Which page of your product the user came from; words the button that ends the flow. See {@link ExternalEntryPoint}. */
|
|
110
116
|
entryPoint?: ExternalEntryPoint;
|
|
111
117
|
}
|
package/package.json
CHANGED