-
Notifications
You must be signed in to change notification settings - Fork 576
/
Copy pathinterface.js
33 lines (30 loc) · 892 Bytes
/
interface.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
/* @flow */
import {
getLogger,
getPayPalAPIDomain,
getSDKToken,
} from "@paypal/sdk-client/src";
import { callRestAPI } from "../lib";
import type { LazyExport } from "../types";
import {
ThreeDomainSecureComponent,
type ThreeDomainSecureComponentInterface,
} from "./component";
export const ThreeDomainSecureClient: LazyExport<ThreeDomainSecureComponentInterface> =
{
__get__: () => {
const threeDomainSecureInstance = new ThreeDomainSecureComponent({
logger: getLogger(),
// $FlowIssue ZalgoPromise vs Promise
request: callRestAPI,
sdkConfig: {
authenticationToken: getSDKToken(),
paypalApiDomain: getPayPalAPIDomain(),
},
});
return {
isEligible: (payload) => threeDomainSecureInstance.isEligible(payload),
show: () => threeDomainSecureInstance.show(),
};
},
};