@fat-zebra/sdk 1.2.6 → 1.3.0-staging
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/react/VerifyCard.js +0 -1
- package/dist/react/useFatZebra.d.ts +1 -3
- package/dist/react/useFatZebra.js +4 -2
- package/dist/sca/index.d.ts +3 -3
- package/dist/sca/index.js +0 -7
- package/dist/shared/env.d.ts +3 -3
- package/dist/shared/env.js +3 -3
- package/dist/shared/envs/env.local.d.ts +5 -0
- package/dist/shared/envs/env.local.js +5 -0
- package/dist/shared/envs/env.staging.d.ts +5 -0
- package/dist/shared/envs/env.staging.js +5 -0
- package/dist/shared/types.d.ts +1 -1
- package/package.json +4 -1
- package/yarn-error.log +5690 -0
package/dist/react/VerifyCard.js
CHANGED
|
@@ -6,7 +6,6 @@ const Frame = ({ handlers, config }) => {
|
|
|
6
6
|
const { url } = useFatZebra({
|
|
7
7
|
config,
|
|
8
8
|
handlers: handlers,
|
|
9
|
-
bridge: bridgeRef,
|
|
10
9
|
});
|
|
11
10
|
return (React.createElement("div", null,
|
|
12
11
|
React.createElement("iframe", { src: url, width: "100%", height: "700px", title: "verification-form" }),
|
|
@@ -1,11 +1,9 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
1
|
import * as FatZebra from "../shared/types";
|
|
3
2
|
type UseFatZebraProps = {
|
|
4
3
|
handlers: FatZebra.Handlers;
|
|
5
4
|
config: FatZebra.PaymentConfig;
|
|
6
|
-
bridge: React.MutableRefObject<HTMLIFrameElement>;
|
|
7
5
|
};
|
|
8
|
-
declare const useFatZebra: ({ config, handlers
|
|
6
|
+
declare const useFatZebra: ({ config, handlers }: UseFatZebraProps) => {
|
|
9
7
|
url: string;
|
|
10
8
|
};
|
|
11
9
|
export default useFatZebra;
|
|
@@ -3,13 +3,15 @@ import * as FatZebra from "../shared/types";
|
|
|
3
3
|
import { generatePaymentURL } from "./url";
|
|
4
4
|
import Sca from "../sca";
|
|
5
5
|
import GatewayClient from "../shared/api-gateway-client";
|
|
6
|
-
const useFatZebra = ({ config, handlers
|
|
6
|
+
const useFatZebra = ({ config, handlers }) => {
|
|
7
7
|
const { options, accessToken, paymentIntent, username } = config;
|
|
8
8
|
const sca = useMemo(() => {
|
|
9
9
|
const gatewayClient = new GatewayClient({ accessToken, username });
|
|
10
10
|
const successCallback = handlers[FatZebra.PublicEvent.SCA_SUCCESS];
|
|
11
11
|
const failureCallback = handlers[FatZebra.PublicEvent.SCA_ERROR];
|
|
12
|
-
|
|
12
|
+
const scaObj = new Sca({ gatewayClient, successCallback, failureCallback });
|
|
13
|
+
scaObj.loadScript();
|
|
14
|
+
return scaObj;
|
|
13
15
|
}, [config, username]);
|
|
14
16
|
const emit = (event, data) => {
|
|
15
17
|
const handler = handlers[event];
|
package/dist/sca/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as t from './types';
|
|
2
|
-
import { Customer, CustomerSnakeCase, PaymentIntent } from '../shared/types';
|
|
2
|
+
import { Callback, Customer, CustomerSnakeCase, PaymentIntent } from '../shared/types';
|
|
3
3
|
import { CardinalManager } from './cardinal';
|
|
4
4
|
import GatewayClient from '../shared/api-gateway-client';
|
|
5
5
|
export interface ScaRunProps {
|
|
@@ -11,8 +11,8 @@ export interface ScaRunProps {
|
|
|
11
11
|
}
|
|
12
12
|
export interface ScaConfig {
|
|
13
13
|
gatewayClient: GatewayClient;
|
|
14
|
-
successCallback?:
|
|
15
|
-
failureCallback?:
|
|
14
|
+
successCallback?: Callback | null;
|
|
15
|
+
failureCallback?: Callback | null;
|
|
16
16
|
}
|
|
17
17
|
declare class Sca {
|
|
18
18
|
private _cardinal;
|
package/dist/sca/index.js
CHANGED
|
@@ -16,11 +16,9 @@ import { toFzSli } from './eci-mappings';
|
|
|
16
16
|
import * as env from "../shared/env";
|
|
17
17
|
class Sca {
|
|
18
18
|
constructor({ gatewayClient, successCallback, failureCallback }) {
|
|
19
|
-
this.sessionId = null;
|
|
20
19
|
this.gatewayClient = gatewayClient;
|
|
21
20
|
this.successCallback = successCallback;
|
|
22
21
|
this.failureCallback = failureCallback;
|
|
23
|
-
this.loadScript();
|
|
24
22
|
}
|
|
25
23
|
loadScript() {
|
|
26
24
|
if (!document.getElementById("songbird-script")) {
|
|
@@ -34,9 +32,6 @@ class Sca {
|
|
|
34
32
|
};
|
|
35
33
|
document.body.appendChild(script);
|
|
36
34
|
}
|
|
37
|
-
else {
|
|
38
|
-
this._cardinal = new CardinalManager();
|
|
39
|
-
}
|
|
40
35
|
}
|
|
41
36
|
get cardinal() {
|
|
42
37
|
return this._cardinal;
|
|
@@ -62,8 +57,6 @@ class Sca {
|
|
|
62
57
|
else {
|
|
63
58
|
emit(PublicEvent.SCA_SUCCESS, { message, data });
|
|
64
59
|
}
|
|
65
|
-
const event = new CustomEvent(PublicEvent.SCA_SUCCESS, { detail: data });
|
|
66
|
-
this.successCallback(event);
|
|
67
60
|
console.log(message);
|
|
68
61
|
}
|
|
69
62
|
run(config) {
|
package/dist/shared/env.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
declare const bridgeUrl = "
|
|
2
|
-
declare const apiUrl = "
|
|
3
|
-
declare const payNowUrl = "http://paynow.
|
|
1
|
+
declare const bridgeUrl = "https://paynow.pmnts-staging.io";
|
|
2
|
+
declare const apiUrl = "https://api.pmnts-staging.io/sdk";
|
|
3
|
+
declare const payNowUrl = "http://paynow.pmnts-staging.io";
|
|
4
4
|
declare const songbirdUrl = "https://songbirdstag.cardinalcommerce.com/edge/v1/songbird.js";
|
|
5
5
|
export { bridgeUrl, apiUrl, payNowUrl, songbirdUrl };
|
package/dist/shared/env.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
const bridgeUrl = "
|
|
2
|
-
const apiUrl = "
|
|
3
|
-
const payNowUrl = "http://paynow.
|
|
1
|
+
const bridgeUrl = "https://paynow.pmnts-staging.io";
|
|
2
|
+
const apiUrl = "https://api.pmnts-staging.io/sdk";
|
|
3
|
+
const payNowUrl = "http://paynow.pmnts-staging.io";
|
|
4
4
|
const songbirdUrl = "https://songbirdstag.cardinalcommerce.com/edge/v1/songbird.js";
|
|
5
5
|
export { bridgeUrl, apiUrl, payNowUrl, songbirdUrl };
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
declare const bridgeUrl = "http://paynow.test";
|
|
2
|
+
declare const apiUrl = "http://api.test:3002/sdk";
|
|
3
|
+
declare const payNowUrl = "http://paynow.test:3004";
|
|
4
|
+
declare const songbirdUrl = "https://songbirdstag.cardinalcommerce.com/edge/v1/songbird.js";
|
|
5
|
+
export { bridgeUrl, apiUrl, payNowUrl, songbirdUrl };
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
const bridgeUrl = "http://paynow.test";
|
|
2
|
+
const apiUrl = "http://api.test:3002/sdk";
|
|
3
|
+
const payNowUrl = "http://paynow.test:3004";
|
|
4
|
+
const songbirdUrl = "https://songbirdstag.cardinalcommerce.com/edge/v1/songbird.js";
|
|
5
|
+
export { bridgeUrl, apiUrl, payNowUrl, songbirdUrl };
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
declare const bridgeUrl = "https://paynow.pmnts-staging.io";
|
|
2
|
+
declare const apiUrl = "https://api.pmnts-staging.io/sdk";
|
|
3
|
+
declare const payNowUrl = "http://paynow.pmnts-staging.io";
|
|
4
|
+
declare const songbirdUrl = "https://songbirdstag.cardinalcommerce.com/edge/v1/songbird.js";
|
|
5
|
+
export { bridgeUrl, apiUrl, payNowUrl, songbirdUrl };
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
const bridgeUrl = "https://paynow.pmnts-staging.io";
|
|
2
|
+
const apiUrl = "https://api.pmnts-staging.io/sdk";
|
|
3
|
+
const payNowUrl = "http://paynow.pmnts-staging.io";
|
|
4
|
+
const songbirdUrl = "https://songbirdstag.cardinalcommerce.com/edge/v1/songbird.js";
|
|
5
|
+
export { bridgeUrl, apiUrl, payNowUrl, songbirdUrl };
|
package/dist/shared/types.d.ts
CHANGED
|
@@ -86,7 +86,7 @@ interface ValidationResult {
|
|
|
86
86
|
valid: boolean;
|
|
87
87
|
errors: string[];
|
|
88
88
|
}
|
|
89
|
-
type Callback = (event:
|
|
89
|
+
export type Callback = (event: CustomEvent) => void;
|
|
90
90
|
type Handlers = Partial<Record<PublicEvent, Callback | null>>;
|
|
91
91
|
export type PaymentConfig = {
|
|
92
92
|
username: string;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fat-zebra/sdk",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.3.0-staging",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"scripts": {
|
|
@@ -9,6 +9,8 @@
|
|
|
9
9
|
"build:staging": "cp .env.staging .env && export ENVIRONMENT=staging && npx webpack --config webpack.config.dev.js",
|
|
10
10
|
"build:sandbox": "cp .env.sandbox .env && export ENVIRONMENT=sandbox && npx webpack --config webpack.config.prod.js",
|
|
11
11
|
"build:production": "cp .env.production .env && export ENVIRONMENT=production && npx webpack --config webpack.config.prod.js",
|
|
12
|
+
"build:package:local": "cp src/shared/envs/env.local.ts src/shared/env.ts && yarn tsc -p tsconfig.package.json",
|
|
13
|
+
"build:package:staging": "cp src/shared/envs/env.staging.ts src/shared/env.ts && yarn tsc -p tsconfig.package.json",
|
|
12
14
|
"start:local:api": "export MERCHANT_MODE=api && npm run build:local --watch && webpack serve --config webpack.config.dev.js --open 'Google Chrome'",
|
|
13
15
|
"start:local:hpp": "export MERCHANT_MODE=hpp && npm run build:local --watch && webpack serve --config webpack.config.dev.js --open 'Google Chrome'",
|
|
14
16
|
"start:local:paypal": "export MERCHANT_MODE=paypal && npm run build:local --watch && webpack serve --config webpack.config.dev.js --open 'Firefox'",
|
|
@@ -17,6 +19,7 @@
|
|
|
17
19
|
"start:staging:es5": "export MERCHANT_MODE=es5 && npm run build:staging --watch && webpack serve --config webpack.config.dev.js --open 'Google Chrome'",
|
|
18
20
|
"start:docker": "npm run build:dev --watch && webpack serve --config webpack.config.dev.js --host 0.0.0.0",
|
|
19
21
|
"generate:jwt": "node scripts/generate-access-token.js"
|
|
22
|
+
|
|
20
23
|
},
|
|
21
24
|
"keywords": [],
|
|
22
25
|
"author": "",
|