Skip to content

Commit

Permalink
update parameters supporting AXO modifications
Browse files Browse the repository at this point in the history
  • Loading branch information
siddy2181 committed Nov 14, 2023
1 parent 97a6a06 commit 743e2ce
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
7 changes: 4 additions & 3 deletions src/connect/component.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,16 +17,17 @@ export const getConnectComponent = async (merchantProps) => {
// TODO: Sort out integration specifics for inputs
try {
const loadResult = await loadAxo({
client: { getVersion: () => "3.97.3-connect-alpha.6.1" }, // this is currently supported for BT
sdkVersion: "", // PPCP proposal: string instead of function
// client: { getVersion: () => "3.97.3-connect-alpha.6.1" }, // this is currently supported for BT
btSdkVersion: "3.97.3-connect-alpha.6.1", // PPCP proposal: string instead of function
minified: false,
});

// FPTI: sdkversion, fraudnet info
return await window.braintree.connect.create({
...loadResult.metadata, // returns a localeURL for assets
...merchantProps, // AXO specific props
ppcp: {
platformOptions: {
platform: "PPCP",
userIdToken, // <merchant-specified-via-data-user-id-token>
clientID, // <merchant-specified-to-SDK-on-query-param>
clientMetadataID: cmid, // <merchant-specified-via-data-client-metadata-id>
Expand Down
3 changes: 1 addition & 2 deletions src/connect/component.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,7 @@ describe("getConnectComponent: returns ConnectComponent", () => {

test("loadAxo failure is handled", async () => {
const errorMessage = "Something went wrong";
// eslint-disable-next-line no-import-assign
loadAxo = vi.fn().mockRejectedValue(errorMessage);
loadAxo.mockRejectedValue(errorMessage);

const error = await getConnectComponent(mockProps);

Expand Down
2 changes: 1 addition & 1 deletion src/connect/interface.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@ import type { LazyExport } from "../types";
import { getConnectComponent, type ConnectComponent } from "./component";

export const Connect: LazyExport<ConnectComponent> = async (merchantProps) => {
return getConnectComponent(merchantProps);
return await getConnectComponent(merchantProps);
};

0 comments on commit 743e2ce

Please sign in to comment.