paypal-checkout
Advanced tools
Comparing version 4.0.315 to 4.0.316
{ | ||
"name": "paypal-checkout", | ||
"version": "4.0.315", | ||
"version": "4.0.316", | ||
"description": "PayPal Checkout components, for integrating checkout products.", | ||
@@ -85,2 +85,3 @@ "main": "index.js", | ||
"dependencies": { | ||
"@paypal/sdk-constants": "^1.0.64", | ||
"Base64": "^1.0.0", | ||
@@ -87,0 +88,0 @@ "beaver-logger": "^3.0.6", |
/* @flow */ | ||
/** @jsx jsxDom */ | ||
import { BUTTON_SIZE, BUTTON_LAYOUT } from '../../constants'; | ||
import { BUTTON_SIZE, BUTTON_LAYOUT, ATTRIBUTE } from '../../constants'; | ||
import { getButtonConfig, BUTTON_STYLE } from '../config'; | ||
@@ -49,3 +49,7 @@ import { normalizeProps } from '../props'; | ||
return ( | ||
<div id={ id } class={ `${ tag } ${ tag }-context-${ context } ${ tag }-label-${ label } ${ tag }-size-${ size } ${ tag }-layout-${ layout }` }> | ||
<div | ||
id={ id } | ||
class={ `${ tag } ${ tag }-context-${ context } ${ tag }-label-${ label } ${ tag }-size-${ size } ${ tag }-layout-${ layout }` } | ||
{ ...({ [ATTRIBUTE.SMART_BUTTON_VERSION]: __PAYPAL_CHECKOUT__.__MINOR_VERSION__ }) } | ||
> | ||
<style> | ||
@@ -52,0 +56,0 @@ {` |
@@ -149,3 +149,2 @@ /* @flow */ | ||
window.onLegacyFallback = window.watchForLegacyFallback; |
@@ -43,3 +43,4 @@ /* @flow */ | ||
PAYMENT_FLOW: 'payment_flow', | ||
BUTTON_VERSION: 'button_version' | ||
BUTTON_VERSION: 'button_version', | ||
PAGE_TYPE: 'pp_placement' | ||
}, | ||
@@ -46,0 +47,0 @@ |
@@ -38,8 +38,9 @@ /* @flow */ | ||
export const ATTRIBUTE = { | ||
BUTTON: 'data-button', | ||
FUNDING_SOURCE: 'data-funding-source', | ||
CARD: 'data-card', | ||
VERSION: 'data-version', | ||
LAYOUT: 'data-layout', | ||
SIZE: 'data-size' | ||
BUTTON: 'data-button', | ||
FUNDING_SOURCE: 'data-funding-source', | ||
CARD: 'data-card', | ||
VERSION: 'data-version', | ||
LAYOUT: 'data-layout', | ||
SIZE: 'data-size', | ||
SMART_BUTTON_VERSION: 'data-paypal-smart-button-version' | ||
}; | ||
@@ -46,0 +47,0 @@ |
@@ -11,2 +11,3 @@ /* @flow */ | ||
function shouldCreateInitialPptmScript() : boolean { | ||
// eslint-disable-next-line compat/compat | ||
const id = window.location.hostname; | ||
@@ -98,5 +99,5 @@ | ||
}); | ||
const params = { | ||
t: 'xo', | ||
// eslint-disable-next-line compat/compat | ||
id: window.location.hostname, | ||
@@ -103,0 +104,0 @@ mrid: config.merchantID, |
@@ -9,2 +9,3 @@ /* @flow */ | ||
export function getUserAgent() : string { | ||
// eslint-disable-next-line compat/compat | ||
return window.navigator.mockUserAgent || window.navigator.userAgent; | ||
@@ -29,2 +30,3 @@ } | ||
// Chrome interprets pop-up windows as standalone windows | ||
// eslint-disable-next-line compat/compat | ||
return !isInsidePopup() && (window.navigator.standalone === true || window.matchMedia('(display-mode: standalone)').matches); | ||
@@ -31,0 +33,0 @@ } |
@@ -263,2 +263,3 @@ /* @flow */ | ||
export function getBrowserLocales() : $ReadOnlyArray<string> { | ||
// eslint-disable-next-line compat/compat | ||
const nav = window.navigator; | ||
@@ -360,3 +361,3 @@ | ||
if (!window.performance || typeof window.performance.getEntries !== 'function') { // eslint-disable-line compat/compat | ||
if (!window.performance || typeof window.performance.getEntries !== 'function') { | ||
return; | ||
@@ -363,0 +364,0 @@ } |
@@ -64,3 +64,3 @@ /* @flow */ | ||
} | ||
// eslint-disable-next-line compat/compat | ||
const userAgent = window.navigator.userAgent; | ||
@@ -67,0 +67,0 @@ |
@@ -56,3 +56,2 @@ /* @flow */ | ||
// eslint-disable-next-line compat/compat | ||
if (window.opener && window.parent !== window) { | ||
@@ -81,5 +80,5 @@ warn(`window_has_opener_and_parent`); | ||
// $FlowFixMe | ||
if (Object.assign && JSON.stringify({ a: 1, b: 2, c: 3 }) !== JSON.stringify({ a: 1, b: 2, c: 3 })) { // eslint-disable-line no-self-compare, compat/compat | ||
if (Object.assign && JSON.stringify({ a: 1, b: 2, c: 3 }) !== JSON.stringify({ a: 1, b: 2, c: 3 })) { // eslint-disable-line no-self-compare | ||
warn(`object_assign_broken`); | ||
} | ||
} |
@@ -16,2 +16,3 @@ /* @flow */ | ||
import { isPayPalDomain } from './security'; | ||
import { getPageType } from './script'; | ||
@@ -101,2 +102,3 @@ function getRefererDomain() : string { | ||
[ FPTI.KEY.TOKEN ]: paymentToken, | ||
[ FPTI.KEY.PAGE_TYPE]: getPageType(), | ||
[ FPTI.KEY.REFERER ]: getRefererDomain() | ||
@@ -103,0 +105,0 @@ }; |
@@ -5,2 +5,4 @@ /* @flow */ | ||
import { getDomain } from 'cross-domain-utils/src'; | ||
import { PAGE_TYPES, SDK_SETTINGS } from '@paypal/sdk-constants/src'; | ||
import { values } from 'belter/src'; | ||
@@ -25,4 +27,4 @@ import { config } from '../config'; | ||
if (document.currentScript) { // eslint-disable-line compat/compat | ||
debug(`current_script_not_recognized`, { src: document.currentScript.src }); // eslint-disable-line compat/compat | ||
if (document.currentScript) { | ||
debug(`current_script_not_recognized`, { src: document.currentScript.src }); | ||
} | ||
@@ -79,1 +81,17 @@ }); | ||
} | ||
export function getPageType() : string { | ||
const script = getCurrentScript(); | ||
if (script && script.hasAttribute(SDK_SETTINGS.PAGE_TYPE)) { | ||
// $FlowFixMe we know that pageType will be set from hasAttribute | ||
const pageType = script.getAttribute(SDK_SETTINGS.PAGE_TYPE).toLowerCase(); | ||
const validPageType = values(PAGE_TYPES).indexOf(pageType) !== -1; | ||
if (!validPageType && pageType.length) { | ||
throw new Error(`Invalid page type, '${ pageType }'`); | ||
} | ||
return pageType; | ||
} | ||
return ''; | ||
} |
@@ -279,4 +279,4 @@ /* @flow */ | ||
if (Object.assign) { // eslint-disable-line compat/compat | ||
return Object.assign(obj, source); // eslint-disable-line compat/compat | ||
if (Object.assign) { | ||
return Object.assign(obj, source); | ||
} | ||
@@ -283,0 +283,0 @@ |
@@ -245,4 +245,4 @@ /* @flow */ | ||
if (document.currentScript) { // eslint-disable-line compat/compat | ||
debug(`current_script_not_recognized`, { src: document.currentScript.src }); // eslint-disable-line compat/compat | ||
if (document.currentScript) { | ||
debug(`current_script_not_recognized`, { src: document.currentScript.src }); | ||
} | ||
@@ -249,0 +249,0 @@ |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
3939798
58484
0
11
+ Added@paypal/sdk-constants@1.0.152(transitive)