@paypal/checkout-components 5.0.235 → 5.0.237
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -1,101 +1,103 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
"
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
"
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
"
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
"
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
"
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
"
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
"
|
|
99
|
-
|
|
100
|
-
|
|
2
|
+
"name": "@paypal/checkout-components",
|
|
3
|
+
"version": "5.0.237",
|
|
4
|
+
"description": "PayPal Checkout components, for integrating checkout products.",
|
|
5
|
+
"main": "index.js",
|
|
6
|
+
"scripts": {
|
|
7
|
+
"all-ci": "npm run check-node-version && npm run lint && npm run typecheck && npm run test",
|
|
8
|
+
"build": "npm run webpack",
|
|
9
|
+
"check-node-version": "node scripts/check-node-version.js",
|
|
10
|
+
"check-size": "npm run webpack-size && bundlemon && npm run delete-size",
|
|
11
|
+
"clean": "rimraf dist coverage",
|
|
12
|
+
"debug": "cross-env NODE_ENV=debug",
|
|
13
|
+
"delete-size": "rm dist/size.* dist/report.html",
|
|
14
|
+
"demo": "serve ./demo -l 1337",
|
|
15
|
+
"dev": "npm run check-node-version && babel-node $(npm bin)/webpack-dev-server --config webpack.config.dev.js --port 9001 --host localhost.paypal.com --open-page demo/dev/index.htm --https --hot=false --inline=false",
|
|
16
|
+
"eslint-find-rules": "eslint-find-rules --current .eslintrc.js --unused --plugin",
|
|
17
|
+
"flow": "flow",
|
|
18
|
+
"flow-typed": "rm -rf flow-typed && flow-typed install && rm flow-typed/npm/puppeteer_*",
|
|
19
|
+
"jest-e2e": "rm -f ./test/e2e/screenshots/*.png && jest test/e2e",
|
|
20
|
+
"jest-screenshot": "jest test/screenshot --env=node --no-cache",
|
|
21
|
+
"jest-ssr": "jest test/ssr --env=node --no-cache --collectCoverage --collectCoverageFrom='src/' --coverageDirectory='coverage/jest'",
|
|
22
|
+
"karma": "cross-env NODE_ENV=test babel-node $(npm bin)/karma start",
|
|
23
|
+
"lint": "eslint --ext .js --ext .jsx src/ test/ *.js",
|
|
24
|
+
"postversion": "./scripts/postversion.sh",
|
|
25
|
+
"preversion": "./scripts/preversion.sh",
|
|
26
|
+
"reinstall": "rimraf flow-typed && rimraf node_modules && npm install && flow-typed install",
|
|
27
|
+
"release": "./scripts/publish.sh",
|
|
28
|
+
"test": "npm run jest-ssr && npm run karma && npm run jest-screenshot",
|
|
29
|
+
"typecheck": "npm run flow-typed && npm run flow",
|
|
30
|
+
"version": "./scripts/version.sh",
|
|
31
|
+
"webpack": "babel-node $(npm bin)/webpack --progress",
|
|
32
|
+
"webpack-size": "babel-node $(npm bin)/webpack --progress --config webpack.config.size",
|
|
33
|
+
"prepare": "husky install"
|
|
34
|
+
},
|
|
35
|
+
"files": [
|
|
36
|
+
"src/",
|
|
37
|
+
"dist/",
|
|
38
|
+
"__sdk__.js",
|
|
39
|
+
"globals.js"
|
|
40
|
+
],
|
|
41
|
+
"browserslist": [
|
|
42
|
+
"IE >= 9",
|
|
43
|
+
"chrome >= 27",
|
|
44
|
+
"firefox >= 30",
|
|
45
|
+
"safari >= 5",
|
|
46
|
+
"opera >= 23"
|
|
47
|
+
],
|
|
48
|
+
"repository": {
|
|
49
|
+
"type": "git",
|
|
50
|
+
"url": "https://github.com/paypal/paypal-checkout-components.git"
|
|
51
|
+
},
|
|
52
|
+
"homepage": "https://developer.paypal.com/",
|
|
53
|
+
"keywords": [
|
|
54
|
+
"cross-domain",
|
|
55
|
+
"cross domain",
|
|
56
|
+
"components",
|
|
57
|
+
"component",
|
|
58
|
+
"krakenjs",
|
|
59
|
+
"kraken"
|
|
60
|
+
],
|
|
61
|
+
"license": "Apache-2.0",
|
|
62
|
+
"readmeFilename": "README.md",
|
|
63
|
+
"devDependencies": {
|
|
64
|
+
"@krakenjs/grumbler-scripts": "^7.0.0",
|
|
65
|
+
"@krakenjs/sync-browser-mocks": "^3.0.0",
|
|
66
|
+
"babel-core": "^7.0.0-bridge.0",
|
|
67
|
+
"bundlemon": "^1.1.0",
|
|
68
|
+
"conventional-changelog-cli": "^2.0.34",
|
|
69
|
+
"flow-bin": "0.155.0",
|
|
70
|
+
"fs-extra": "^10.0.0",
|
|
71
|
+
"husky": "^7.0.4",
|
|
72
|
+
"imagemagick": "^0.1.3",
|
|
73
|
+
"imgur": "^0.3.1",
|
|
74
|
+
"karma": "^6.0.0",
|
|
75
|
+
"karma-coverage": "^2.0.3",
|
|
76
|
+
"lint-staged": "^12.3.4",
|
|
77
|
+
"memory-fs": "^0.5.0",
|
|
78
|
+
"mocha": "^4.1.0",
|
|
79
|
+
"mocketeer": "^0.3.1",
|
|
80
|
+
"pixelmatch": "^5.2.1",
|
|
81
|
+
"pngjs": "^6.0.0",
|
|
82
|
+
"prettier": "^2.5.1",
|
|
83
|
+
"prettier-plugin-sh": "^0.10.0",
|
|
84
|
+
"puppeteer": "^1.20.0",
|
|
85
|
+
"serve": "^13.0.0"
|
|
86
|
+
},
|
|
87
|
+
"dependencies": {
|
|
88
|
+
"@krakenjs/belter": "^2.0.0",
|
|
89
|
+
"@krakenjs/cross-domain-utils": "^3.0.0",
|
|
90
|
+
"@krakenjs/jsx-pragmatic": "^3",
|
|
91
|
+
"@krakenjs/post-robot": "^11.0.0",
|
|
92
|
+
"@krakenjs/zalgo-promise": "^2.0.0",
|
|
93
|
+
"@krakenjs/zoid": "^10.0.0",
|
|
94
|
+
"@paypal/common-components": "^1.0.27",
|
|
95
|
+
"@paypal/funding-components": "^1.0.27",
|
|
96
|
+
"@paypal/sdk-client": "^4.0.166",
|
|
97
|
+
"@paypal/sdk-constants": "^1.0.123",
|
|
98
|
+
"@paypal/sdk-logos": "^1.0.45"
|
|
99
|
+
},
|
|
100
|
+
"lint-staged": {
|
|
101
|
+
"*.sh": "prettier --write"
|
|
102
|
+
}
|
|
101
103
|
}
|
package/src/interface/button.js
CHANGED
|
@@ -8,6 +8,7 @@ import { allowIframe as _allowIframe } from '../lib';
|
|
|
8
8
|
import { getCheckoutComponent, type CheckoutComponent } from '../zoid/checkout';
|
|
9
9
|
import { getButtonsComponent, type ButtonsComponent } from '../zoid/buttons';
|
|
10
10
|
import { getCardFormComponent, type CardFormComponent } from '../zoid/card-form';
|
|
11
|
+
import { getPaymentFieldsComponent, type PaymentFieldsComponent } from '../zoid/payment-fields';
|
|
11
12
|
import { getMenuComponent, type MenuComponent } from '../zoid/menu';
|
|
12
13
|
import { getInstallmentsComponent, type InstallmentsComponent } from '../zoid/installments';
|
|
13
14
|
import { Buttons as _ButtonsTemplate } from '../ui/buttons';
|
|
@@ -32,6 +33,10 @@ export const CardForm : LazyProtectedExport<CardFormComponent> = {
|
|
|
32
33
|
__get__: () => protectedExport(getCardFormComponent())
|
|
33
34
|
};
|
|
34
35
|
|
|
36
|
+
export const PaymentFields : LazyProtectedExport<PaymentFieldsComponent> = {
|
|
37
|
+
__get__: () => protectedExport(getPaymentFieldsComponent())
|
|
38
|
+
};
|
|
39
|
+
|
|
35
40
|
export const Menu : LazyProtectedExport<MenuComponent> = {
|
|
36
41
|
__get__: () => protectedExport(getMenuComponent())
|
|
37
42
|
};
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
/** @jsx node */
|
|
3
3
|
|
|
4
4
|
import { node, type ElementNode } from '@krakenjs/jsx-pragmatic/src';
|
|
5
|
-
import { FUNDING, WALLET_INSTRUMENT } from '@paypal/sdk-constants/src';
|
|
5
|
+
import { FUNDING, WALLET_INSTRUMENT, APM_LIST } from '@paypal/sdk-constants/src';
|
|
6
6
|
import { noop } from '@krakenjs/belter/src';
|
|
7
7
|
|
|
8
8
|
import type { Wallet, WalletInstrument } from '../../types';
|
|
@@ -124,6 +124,10 @@ export function Buttons(props : ButtonsProps) : ElementNode {
|
|
|
124
124
|
}
|
|
125
125
|
}
|
|
126
126
|
|
|
127
|
+
const isAPM = fundingSources.some(src => {
|
|
128
|
+
return APM_LIST.includes(src);
|
|
129
|
+
});
|
|
130
|
+
|
|
127
131
|
const instruments = getWalletInstruments({ wallet, fundingSources, layout, onShippingChange, onShippingAddressChange, onShippingOptionsChange });
|
|
128
132
|
|
|
129
133
|
const isWallet = (
|
|
@@ -210,6 +214,12 @@ export function Buttons(props : ButtonsProps) : ElementNode {
|
|
|
210
214
|
: null
|
|
211
215
|
}
|
|
212
216
|
|
|
217
|
+
{
|
|
218
|
+
(isAPM)
|
|
219
|
+
? <div id="payment-fields-container" className="payment-fields-container"/>
|
|
220
|
+
: null
|
|
221
|
+
}
|
|
222
|
+
|
|
213
223
|
{
|
|
214
224
|
(layout === BUTTON_LAYOUT.VERTICAL && fundingSources.indexOf(FUNDING.CARD) !== -1 && !inlineExperience)
|
|
215
225
|
? <PoweredByPayPal
|
|
@@ -660,7 +660,7 @@ export const getButtonsComponent : () => ButtonsComponent = memoize(() => {
|
|
|
660
660
|
value: ({ props }) => {
|
|
661
661
|
const { commit, createBillingAgreement, currency, disableFunding = [], experience, fundingEligibility, onComplete, style : { custom = {}, layout }, vault } = props || {};
|
|
662
662
|
|
|
663
|
-
if (experience === '
|
|
663
|
+
if (experience === 'accelerated') {
|
|
664
664
|
return EXPERIENCE.INLINE;
|
|
665
665
|
}
|
|
666
666
|
|
|
@@ -122,6 +122,32 @@ export function getPaymentFieldsComponent() : PaymentFieldsComponent {
|
|
|
122
122
|
required: false
|
|
123
123
|
},
|
|
124
124
|
|
|
125
|
+
onError: {
|
|
126
|
+
type: 'function',
|
|
127
|
+
required: false
|
|
128
|
+
},
|
|
129
|
+
|
|
130
|
+
onContinue: {
|
|
131
|
+
type: 'function',
|
|
132
|
+
required: false
|
|
133
|
+
},
|
|
134
|
+
|
|
135
|
+
onClose: {
|
|
136
|
+
type: 'function',
|
|
137
|
+
required: false
|
|
138
|
+
},
|
|
139
|
+
|
|
140
|
+
showActionButtons: {
|
|
141
|
+
type: 'boolean',
|
|
142
|
+
queryParam: true,
|
|
143
|
+
required: false
|
|
144
|
+
},
|
|
145
|
+
|
|
146
|
+
onFieldsClose: {
|
|
147
|
+
type: 'function',
|
|
148
|
+
required: false
|
|
149
|
+
},
|
|
150
|
+
|
|
125
151
|
buyerCountry: {
|
|
126
152
|
type: 'string',
|
|
127
153
|
queryParam: true,
|