@wf-financing/ui-sdk 2.0.1 → 2.1.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.
- package/README.md +13 -5
- package/dist/index.d.ts +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -27,12 +27,16 @@ const wayflyerUiSdk = await WayflyerUiSdk.loadSdk(companyToken);
|
|
|
27
27
|
This function mounts the CTA banner once it's called.
|
|
28
28
|
|
|
29
29
|
1. `targetId` - the `id` of the DOM element where the CTA banner should be mounted.
|
|
30
|
-
2. `partnerCallback` – a callback function that should return data of type `
|
|
30
|
+
2. `partnerCallback` – a callback function that should return data of type `StartHostedApplicationRequestType`.
|
|
31
31
|
|
|
32
32
|
```jsx
|
|
33
|
-
import { type PartnerCallbackType } from '@wf-financing/ui-sdk';
|
|
33
|
+
import { type PartnerCallbackType, type StartHostedApplicationRequestType } from '@wf-financing/ui-sdk';
|
|
34
34
|
|
|
35
|
-
const partnerCallback: PartnerCallbackType = await () => {
|
|
35
|
+
const partnerCallback: PartnerCallbackType = await () => {
|
|
36
|
+
const startHostedApplicationRequestPayload: StartHostedApplicationRequestType = {};
|
|
37
|
+
|
|
38
|
+
return startHostedApplicationRequestPayload;
|
|
39
|
+
};
|
|
36
40
|
|
|
37
41
|
wayflyerUiSdk.mountCta(targetId, partnerCallback);
|
|
38
42
|
```
|
|
@@ -42,12 +46,16 @@ wayflyerUiSdk.mountCta(targetId, partnerCallback);
|
|
|
42
46
|
To simplify the testing process, the SDK can be initialized in sandbox mode. To do so, pass the second argument of type `SdkOptionsType` with `isSandbox` flag set to `true`. In sandbox mode, the partner can simulate responses for SDK methods with the help of the additional package `@wf-financing/sandbox-ui`.
|
|
43
47
|
|
|
44
48
|
```jsx
|
|
45
|
-
import { WayflyerUiSdk, type SdkOptionsType, type PartnerCallbackType } from '@wf-financing/ui-sdk';
|
|
49
|
+
import { WayflyerUiSdk, type SdkOptionsType, type PartnerCallbackType, type StartHostedApplicationRequestType } from '@wf-financing/ui-sdk';
|
|
46
50
|
|
|
47
51
|
const options: SdkOptionsType = { isSandbox: true };
|
|
48
52
|
const wayflyerUiSdk = await WayflyerUiSdk.loadSdk(companyToken, options);
|
|
49
53
|
|
|
50
|
-
const partnerCallback: PartnerCallbackType = await () => {
|
|
54
|
+
const partnerCallback: PartnerCallbackType = await () => {
|
|
55
|
+
const startHostedApplicationRequestPayload: StartHostedApplicationRequestType = {};
|
|
56
|
+
|
|
57
|
+
return startHostedApplicationRequestPayload;
|
|
58
|
+
};
|
|
51
59
|
|
|
52
60
|
wayflyerUiSdk.mountCta(targetId, partnerCallback);
|
|
53
61
|
```
|
package/dist/index.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export type { IWayflyerUiSdk, PartnerCallbackType, SdkOptionsType } from '@wf-financing/embedded-types';
|
|
1
|
+
export type { IWayflyerUiSdk, PartnerCallbackType, StartHostedApplicationRequestType, SdkOptionsType, } from '@wf-financing/embedded-types';
|
|
2
2
|
export { WayflyerUiSdk } from './sdk';
|