Skip to content

Commit

Permalink
render zoid in parent, pass payerActionUrl prop
Browse files Browse the repository at this point in the history
  • Loading branch information
siddy2181 committed Dec 4, 2024
1 parent b768595 commit a843e7e
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 3 deletions.
2 changes: 2 additions & 0 deletions src/three-domain-secure/component.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,8 @@ export class ThreeDomainSecureComponent {
};
// $FlowFixMe
const instance = this.threeDSIframe({
payerActionUrl:
"https://te-fastlane-3ds.qa.paypal.com/webapps/helios?action=authenticate&token=30S05532XC756423E&go_to=next",
onSuccess: async (data) => {
// const { threeDSRefID, authentication_status, liability_shift } = data;
const { threeDSRefID } = data;
Expand Down
10 changes: 9 additions & 1 deletion src/three-domain-secure/interface.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,26 @@ import {
getPayPalAPIDomain,
getSDKToken,
} from "@paypal/sdk-client/src";

import { destroy as zoidDestroy, destroyComponents } from "@krakenjs/zoid/src";

Check failure on line 8 in src/three-domain-secure/interface.js

View workflow job for this annotation

GitHub Actions / main

There should be at least one empty line between import groups

Check failure on line 8 in src/three-domain-secure/interface.js

View workflow job for this annotation

GitHub Actions / main

'destroyComponents' is defined but never used
import type { LazyExport } from "../types";

import {
ThreeDomainSecureComponent,
type ThreeDomainSecureComponentInterface,
} from "./component";
import { GraphQLClient, RestClient } from "./api";
import { getFastlaneThreeDS } from "./utils";

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

export function setup() {

Check failure on line 21 in src/three-domain-secure/interface.js

View workflow job for this annotation

GitHub Actions / main

Missing return type annotation
return getFastlaneThreeDS();
}
export function destroy(err?: mixed) {
zoidDestroy(err);
}

export const ThreeDomainSecureClient: LazyExport<ThreeDomainSecureComponentInterface> =
{
__get__: () => {
Expand Down
7 changes: 5 additions & 2 deletions src/three-domain-secure/utils.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,11 @@ export type TDSProps = {|

export type TDSComponent = ZoidComponent<TDSProps>;

export function getFastlaneThreeDS(payerActionUrl: string): TDSComponent {
export function getFastlaneThreeDS(): TDSComponent {
return inlineMemoize(getFastlaneThreeDS, () => {
const component = create({
tag: "fastlane-threeds",
url: payerActionUrl,
url: ({ props }) => props.payerActionUrl,

attributes: {
iframe: {
Expand Down Expand Up @@ -67,6 +67,9 @@ export function getFastlaneThreeDS(payerActionUrl: string): TDSComponent {
// $FlowIssue
allowedParentDomains: /^https?:\/\/[a-zA-Z0-9.-]+(:[0-9]+)?(\/.*)?$/, // eslint-disable-line security/detect-unsafe-regex
props: {
payerActionUrl: {
type: "string",
},
clientID: {
type: "string",
value: getClientID,
Expand Down

0 comments on commit a843e7e

Please sign in to comment.