Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
/* @flow */
/** @jsx jsxDom */
/* eslint max-lines: 0 */
import { create } from 'zoid/src';
import { base64encode } from 'belter/src';
import { ENV } from '../constants';
import { getBrowserLocale, getCurrentScriptUrl } from '../lib';
import { config } from '../config';
import { containerTemplate } from '../billing/template';
export const ThreeDomainSecure = create({
tag: 'paypal-3ds',
name: '3ds',
buildUrl(props) : string {
const env = props.env || config.env;
return `${ config.inlinedCardFieldUrls[env] }/init3ds`;
},
get domain() : Object {
return {
...config.paypalDomains
};
},
scrolling: true,
INVISIBLE: 'invisible',
COMPONENT_FRAME: 'component-frame',
PRERENDER_FRAME: 'prerender-frame'
};
type ContingencyProps = {|
action : string,
cart_id : string,
flow : string,
xcomponent : string,
onContingencyResult : (err : mixed, result : Object) => void
|};
let contingencyResolveFunction;
const ContingencyComponent : ZoidComponent = create({
url: () => `${ getPayPalDomain() }/webapps/helios`,
props: {
action: {
type: 'string',
queryParam: true
},
xcomponent: {
type: 'string',
queryParam: true
},
flow: {
type: 'string',
queryParam: true
},
cart_id: {
type: 'string',
import { containerTemplate } from './template';
type BillingOptions = {|
client : {
[string] : (string | ZalgoPromise)
},
env? : string,
locale? : string,
logLevel : string,
awaitPopupBridge : Function,
meta : Object,
commit : boolean,
token : string
|};
export const BillingPage : Component = create({
tag: 'billing-page',
name: 'billing-page',
buildUrl(props) : string {
const env = props.env || config.env;
return `${ config.inlinedCardFieldUrls[env] }/billing`;
},
get domain() : Object {
return {
...config.paypalDomains,
[ ENV.LOCAL ]: /^http:\/\/localhost.paypal.com:\d+$/
};
},
scrolling: true,
return inlineMemoize(getCheckoutComponent, () => {
const component = create({
tag: 'paypal-checkout',
attributes: {
iframe: {
scrolling: 'yes'
}
},
defaultContext: supportsPopups() ? CONTEXT.POPUP : CONTEXT.IFRAME,
url: getCheckoutUrl,
domain: getPayPalDomainRegex(),
logger: getLogger(),