Skip to content

Commit 487dab4

Browse files
committed
update component name, fix success state response
1 parent 915822c commit 487dab4

File tree

6 files changed

+13
-13
lines changed

6 files changed

+13
-13
lines changed

Diff for: src/three-domain-secure/component.jsx

+3-3
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ import type {
1717
ThreeDSResponse,
1818
TDSProps,
1919
} from "./types";
20-
import { getFastlaneThreeDS } from "./utils";
20+
import { getThreeDS } from "./utils";
2121
import type { GraphQLClient, RestClient } from "./api";
2222

2323
const parseSdkConfig = ({ sdkConfig, logger }): SdkConfig => {
@@ -110,7 +110,7 @@ export class ThreeDomainSecureComponent {
110110
(link) => link.rel === "payer-action"
111111
).href;
112112
responseStatus = true;
113-
this.threeDSIframe = getFastlaneThreeDS();
113+
this.threeDSIframe = getThreeDS();
114114
}
115115
return responseStatus;
116116
} catch (error) {
@@ -151,7 +151,7 @@ export class ThreeDomainSecureComponent {
151151
// Helios returns a boolen parameter: "success"
152152
// It will be true for all cases where liability is shifted to merchant
153153
// and false for downstream failures and errors
154-
authenticationState = success ? "success" : "errored";
154+
authenticationState = success ? "succeeded" : "errored";
155155
liabilityShift = liability_shift ? liability_shift : "false";
156156

157157
// call BT mutation to update fastlaneNonce with 3ds data

Diff for: src/three-domain-secure/component.test.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ const defaultSdkConfig = {
1212
authenticationToken: "sdk-client-token",
1313
};
1414
vi.mock("./utils", () => ({
15-
getFastlaneThreeDS: vi.fn(() => {
15+
getThreeDS: vi.fn(() => {
1616
return vi.fn(() => ({
1717
render: vi.fn().mockResolvedValue({}),
1818
close: vi.fn(),

Diff for: src/three-domain-secure/interface.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,13 @@ import {
1616
type ThreeDomainSecureComponentInterface,
1717
} from "./component";
1818
import { GraphQLClient, RestClient } from "./api";
19-
import { getFastlaneThreeDS } from "./utils";
19+
import { getThreeDS } from "./utils";
2020

2121
const BRAINTREE_PROD = "https://payments.braintree-api.com";
2222
const BRAINTREE_SANDBOX = "https://payments.sandbox.braintree-api.com";
2323

2424
export function setup() {
25-
getFastlaneThreeDS();
25+
getThreeDS();
2626
}
2727
export function destroy(err?: mixed) {
2828
zoidDestroy(err);

Diff for: src/three-domain-secure/interface.test.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import { destroy as zoidDestroy } from "@krakenjs/zoid/src";
1111

1212
import { ThreeDomainSecureComponent } from "./component";
1313
import { GraphQLClient, RestClient } from "./api";
14-
import { getFastlaneThreeDS } from "./utils";
14+
import { getThreeDS } from "./utils";
1515
import { setup, destroy, ThreeDomainSecureClient } from "./interface";
1616

1717
vi.mock("@paypal/sdk-client/src");
@@ -23,7 +23,7 @@ vi.mock("./utils");
2323
describe("ThreeDomainSecure interface", () => {
2424
it("should setup and destroy", () => {
2525
setup();
26-
expect(getFastlaneThreeDS).toHaveBeenCalledTimes(1);
26+
expect(getThreeDS).toHaveBeenCalledTimes(1);
2727

2828
const err = new Error("test error");
2929
destroy(err);

Diff for: src/three-domain-secure/utils.jsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@ import type { TDSProps } from "./types";
1818

1919
export type TDSComponent = ZoidComponent<TDSProps>;
2020

21-
export function getFastlaneThreeDS(): TDSComponent {
22-
return inlineMemoize(getFastlaneThreeDS, () => {
21+
export function getThreeDS(): TDSComponent {
22+
return inlineMemoize(getThreeDS, () => {
2323
const component = create({
2424
tag: "fastlane-threeds",
2525
url: ({ props }) => props.payerActionUrl,

Diff for: src/three-domain-secure/utils.test.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import { noop } from "@krakenjs/belter/src";
66
import { describe, expect, vi } from "vitest";
77
import { getEnv } from "@paypal/sdk-client/src";
88

9-
import { getFastlaneThreeDS } from "./utils";
9+
import { getThreeDS } from "./utils";
1010

1111
vi.mock("@paypal/sdk-client/src");
1212

@@ -27,7 +27,7 @@ describe("Three Domain Secure Utils", () => {
2727
type: "zoidComponent",
2828
}));
2929

30-
const fastlaneComponent = getFastlaneThreeDS();
30+
const fastlaneComponent = getThreeDS();
3131
expect(fastlaneComponent).toBeDefined();
3232
// expect(createMock).toHaveBeenCalledTimes(1);
3333
});
@@ -43,7 +43,7 @@ describe("Three Domain Secure Utils", () => {
4343
type: "zoidComponent",
4444
}));
4545

46-
getFastlaneThreeDS();
46+
getThreeDS();
4747

4848
expect(window.xchild).toBeDefined();
4949
expect(window.xchild).toEqual({

0 commit comments

Comments
 (0)