Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
export const DEFAULT_STYLE = {
LAYOUT: BUTTON_LAYOUT.VERTICAL,
COLOR: BUTTON_COLOR.GOLD,
SHAPE: BUTTON_SHAPE.RECT
};
export const DEFAULT_PROPS = {
LOCALE: {
country: COUNTRY.US,
lang: LANG.EN
},
COMMIT: COMMIT.TRUE,
VAULT: VAULT.FALSE,
INTENT: INTENT.CAPTURE,
ENV: ENV.PRODUCTION,
PLATFORM: PLATFORM.DESKTOP
};
// $FlowFixMe
export function normalizeButtonStyle(style : ButtonStyleInputs) : ButtonStyle {
if (!style) {
throw new Error(`Expected props.style to be set`);
}
const {
label,
layout = DEFAULT_STYLE.LAYOUT,
color = DEFAULT_STYLE.COLOR,
shape = DEFAULT_STYLE.SHAPE,
tagline = (layout === BUTTON_LAYOUT.HORIZONTAL),
height,
export const DEFAULT_STYLE = {
LAYOUT: BUTTON_LAYOUT.VERTICAL,
COLOR: BUTTON_COLOR.GOLD,
SHAPE: BUTTON_SHAPE.RECT
};
export const DEFAULT_PROPS = {
LOCALE: {
country: COUNTRY.US,
lang: LANG.EN
},
COMMIT: COMMIT.TRUE,
VAULT: VAULT.FALSE,
INTENT: INTENT.CAPTURE,
ENV: ENV.PRODUCTION,
PLATFORM: PLATFORM.DESKTOP
};
// $FlowFixMe
export function normalizeButtonStyle(style : ButtonStyleInputs) : ButtonStyle {
if (!style) {
throw new Error(`Expected props.style to be set`);
}
const {
label,
layout = DEFAULT_STYLE.LAYOUT,
color = DEFAULT_STYLE.COLOR,
shape = DEFAULT_STYLE.SHAPE,
tagline = (layout === BUTTON_LAYOUT.HORIZONTAL),
height,
},
onError: (err) => {
throw err;
}
};
},
postRobot: {
on: () => ({ cancel: noop }),
once: () => cancelablePromise(ZalgoPromise.resolve()),
send: () => cancelablePromise(ZalgoPromise.resolve())
}
};
window.xprops = {
clientID: 'xyz123',
platform: PLATFORM.DESKTOP,
intent: INTENT.CAPTURE,
currency: CURRENCY.USD,
commit: true,
env: 'test',
buttonSessionID: uniqueID(),
createOrder: mockAsyncProp(() => {
return 'XXXXXXXXXX';
}),
style: {
},
locale: {
country: 'US',
lang: 'en'
},
onInit: mockAsyncProp(noop),
value() : string {
return isDevice() ? PLATFORM.MOBILE : PLATFORM.DESKTOP;
}
},
handleClick : boolean,
colors : $ReadOnlyArray<$Values>,
secondaryColors : { [$Values] : $Values },
secondaryVaultColors : { [$Values] : $Values },
logoColors : { [$Values] : $Values },
shapes : $ReadOnlyArray<$Values>
|};
export const DEFAULT_FUNDING_CONFIG : FundingSourceConfig = {
layouts: [
BUTTON_LAYOUT.VERTICAL
],
platforms: [
PLATFORM.DESKTOP,
PLATFORM.MOBILE
],
handleClick: false,
colors: [
BUTTON_COLOR.SILVER,
BUTTON_COLOR.BLACK,
BUTTON_COLOR.WHITE
],
logoColors: {
[ BUTTON_COLOR.BLACK ]: LOGO_COLOR.WHITE
},
shapes: [