@paypal/checkout-components 5.0.256 → 5.0.258
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/README.md +8 -0
- package/__sdk__.js +72 -76
- package/dist/button.js +1 -1
- package/globals.js +28 -30
- package/package.json +6 -4
- package/src/constants/button.js +37 -36
- package/src/constants/class.js +32 -30
- package/src/constants/index.js +3 -3
- package/src/constants/misc.js +14 -12
- package/src/declarations.js +19 -19
- package/src/funding/applepay/config.jsx +51 -50
- package/src/funding/applepay/index.js +1 -1
- package/src/funding/applepay/style.scoped.scss +1 -1
- package/src/funding/applepay/template.jsx +16 -11
- package/src/funding/bancontact/config.jsx +48 -37
- package/src/funding/bancontact/index.js +1 -2
- package/src/funding/blik/config.jsx +48 -37
- package/src/funding/blik/index.js +1 -2
- package/src/funding/boleto/config.jsx +50 -39
- package/src/funding/boleto/index.js +1 -2
- package/src/funding/card/amex/config.js +9 -8
- package/src/funding/card/amex/index.js +1 -2
- package/src/funding/card/config.jsx +246 -177
- package/src/funding/card/discover/config.js +9 -7
- package/src/funding/card/discover/index.js +1 -2
- package/src/funding/card/elo/config.js +6 -7
- package/src/funding/card/elo/index.js +1 -2
- package/src/funding/card/hiper/config.js +9 -7
- package/src/funding/card/hiper/index.js +1 -2
- package/src/funding/card/index.js +1 -1
- package/src/funding/card/jcb/config.js +6 -7
- package/src/funding/card/jcb/index.js +1 -2
- package/src/funding/card/mastercard/config.js +9 -7
- package/src/funding/card/mastercard/index.js +1 -2
- package/src/funding/card/visa/config.js +9 -7
- package/src/funding/card/visa/index.js +1 -2
- package/src/funding/common.jsx +242 -216
- package/src/funding/config.js +212 -65
- package/src/funding/content.jsx +1946 -337
- package/src/funding/credit/config.jsx +74 -57
- package/src/funding/credit/index.js +1 -2
- package/src/funding/eps/config.jsx +45 -37
- package/src/funding/eps/index.js +1 -2
- package/src/funding/funding.js +193 -100
- package/src/funding/giropay/config.jsx +48 -38
- package/src/funding/giropay/index.js +1 -2
- package/src/funding/ideal/config.jsx +48 -37
- package/src/funding/ideal/index.js +1 -2
- package/src/funding/index.js +2 -2
- package/src/funding/itau/config.jsx +41 -41
- package/src/funding/itau/index.js +1 -1
- package/src/funding/maxima/config.jsx +25 -19
- package/src/funding/maxima/index.js +1 -2
- package/src/funding/mercadopago/config.jsx +48 -37
- package/src/funding/mercadopago/index.js +1 -2
- package/src/funding/multibanco/config.jsx +50 -39
- package/src/funding/multibanco/index.js +1 -2
- package/src/funding/mybank/config.jsx +48 -37
- package/src/funding/mybank/index.js +1 -2
- package/src/funding/oxxo/config.jsx +50 -39
- package/src/funding/oxxo/index.js +1 -2
- package/src/funding/p24/config.jsx +45 -37
- package/src/funding/p24/index.js +1 -2
- package/src/funding/paidy/config.jsx +50 -39
- package/src/funding/paidy/index.js +1 -1
- package/src/funding/paylater/config.jsx +118 -111
- package/src/funding/paylater/index.js +1 -2
- package/src/funding/paypal/config.jsx +44 -46
- package/src/funding/paypal/index.js +1 -2
- package/src/funding/paypal/style.scoped.scss +80 -74
- package/src/funding/paypal/template.jsx +450 -354
- package/src/funding/payu/config.jsx +50 -39
- package/src/funding/payu/index.js +1 -1
- package/src/funding/satispay/config.jsx +50 -39
- package/src/funding/satispay/index.js +1 -1
- package/src/funding/sepa/config.jsx +19 -13
- package/src/funding/sepa/index.js +1 -2
- package/src/funding/sofort/config.jsx +48 -37
- package/src/funding/sofort/index.js +1 -2
- package/src/funding/trustly/config.jsx +50 -39
- package/src/funding/trustly/index.js +1 -2
- package/src/funding/venmo/config.jsx +80 -75
- package/src/funding/venmo/index.js +1 -2
- package/src/funding/venmo/style.scoped.scss +30 -32
- package/src/funding/venmo/template.jsx +56 -57
- package/src/funding/verkkopankki/config.jsx +50 -39
- package/src/funding/verkkopankki/index.js +1 -1
- package/src/funding/wechatpay/config.jsx +48 -37
- package/src/funding/wechatpay/index.js +1 -2
- package/src/funding/zimpler/config.jsx +19 -13
- package/src/funding/zimpler/index.js +1 -2
- package/src/interface/button.js +60 -44
- package/src/interface/card-fields.js +11 -8
- package/src/interface/fields.js +7 -4
- package/src/interface/marks.js +4 -4
- package/src/interface/payment-fields.js +7 -4
- package/src/interface/wallet.js +4 -4
- package/src/lib/errors.js +7 -7
- package/src/lib/index.js +5 -5
- package/src/lib/isRTLLanguage.js +3 -3
- package/src/lib/perceived-latency-instrumentation.js +54 -36
- package/src/lib/security.js +21 -17
- package/src/lib/session.js +39 -35
- package/src/marks/component.jsx +114 -65
- package/src/marks/index.js +1 -2
- package/src/marks/template.jsx +79 -65
- package/src/types.js +48 -48
- package/src/ui/buttons/button.jsx +311 -249
- package/src/ui/buttons/buttonDesigns/control.jsx +3 -5
- package/src/ui/buttons/buttonDesigns/divideLogoAnimation.jsx +127 -99
- package/src/ui/buttons/buttonDesigns/index.js +78 -75
- package/src/ui/buttons/buttonDesigns/inlineLogoTextDesign.jsx +102 -82
- package/src/ui/buttons/buttonDesigns/script.jsx +24 -18
- package/src/ui/buttons/buttonDesigns/types.js +6 -7
- package/src/ui/buttons/buttons.jsx +318 -212
- package/src/ui/buttons/config.js +62 -59
- package/src/ui/buttons/content.jsx +304 -119
- package/src/ui/buttons/index.js +1 -1
- package/src/ui/buttons/menu-button/index.js +1 -1
- package/src/ui/buttons/menu-button/menu-button.jsx +29 -22
- package/src/ui/buttons/menu-button/menu-button.scoped.scss +16 -17
- package/src/ui/buttons/poweredBy.jsx +23 -23
- package/src/ui/buttons/props.js +680 -529
- package/src/ui/buttons/script.jsx +182 -160
- package/src/ui/buttons/spinner.jsx +4 -6
- package/src/ui/buttons/style.jsx +15 -14
- package/src/ui/buttons/styles/base.js +24 -16
- package/src/ui/buttons/styles/button.js +24 -22
- package/src/ui/buttons/styles/color.js +118 -118
- package/src/ui/buttons/styles/custom.js +30 -24
- package/src/ui/buttons/styles/index.js +1 -1
- package/src/ui/buttons/styles/labels.js +17 -13
- package/src/ui/buttons/styles/page.js +3 -3
- package/src/ui/buttons/styles/responsive.js +226 -118
- package/src/ui/buttons/tagline.jsx +53 -54
- package/src/ui/chevron.jsx +27 -16
- package/src/ui/index.js +3 -3
- package/src/ui/loading.jsx +25 -18
- package/src/ui/text/index.js +1 -1
- package/src/ui/text/style.scoped.scss +25 -26
- package/src/ui/text/text.jsx +42 -20
- package/src/ui/tracking.jsx +18 -11
- package/src/zoid/buttons/component.jsx +836 -684
- package/src/zoid/buttons/container.jsx +140 -107
- package/src/zoid/buttons/index.js +1 -1
- package/src/zoid/buttons/prerender.jsx +84 -64
- package/src/zoid/buttons/util.js +355 -254
- package/src/zoid/card-fields/component.jsx +581 -549
- package/src/zoid/card-fields/index.js +1 -1
- package/src/zoid/card-fields/prerender.jsx +20 -17
- package/src/zoid/card-form/component.js +155 -141
- package/src/zoid/card-form/index.js +1 -1
- package/src/zoid/checkout/component.jsx +314 -282
- package/src/zoid/checkout/config.js +2 -2
- package/src/zoid/checkout/content.js +190 -154
- package/src/zoid/checkout/hacks.js +31 -28
- package/src/zoid/checkout/index.js +2 -2
- package/src/zoid/checkout/props.js +27 -33
- package/src/zoid/installments/component.jsx +83 -70
- package/src/zoid/installments/index.js +1 -1
- package/src/zoid/installments/props.js +1 -1
- package/src/zoid/menu/component.jsx +53 -48
- package/src/zoid/menu/index.js +1 -1
- package/src/zoid/menu/props.js +1 -3
- package/src/zoid/modal/component.jsx +119 -106
- package/src/zoid/modal/index.js +1 -1
- package/src/zoid/modal/props.js +1 -3
- package/src/zoid/payment-fields/component.jsx +215 -191
- package/src/zoid/payment-fields/container.jsx +73 -64
- package/src/zoid/payment-fields/index.js +1 -1
- package/src/zoid/payment-fields/prerender.jsx +16 -14
- package/src/zoid/payment-fields/props.js +6 -6
- package/src/zoid/qr-code/component.jsx +131 -115
- package/src/zoid/qr-code/container.jsx +74 -68
- package/src/zoid/qr-code/index.js +1 -1
- package/src/zoid/qr-code/prerender.jsx +17 -12
- package/src/zoid/qr-code/types.js +2 -2
- package/src/zoid/wallet/component.jsx +298 -260
- package/src/zoid/wallet/container.jsx +73 -64
- package/src/zoid/wallet/index.js +1 -1
- package/src/zoid/wallet/prerender.jsx +14 -14
- package/src/zoid/wallet/props.js +4 -4
- package/src/actions/save/index.js +0 -40
- package/src/interface/actions.js +0 -14
- package/src/lib/getLogoCDNExperiment.js +0 -25
package/globals.js
CHANGED
|
@@ -1,38 +1,36 @@
|
|
|
1
1
|
/* eslint import/no-commonjs: off, flowtype/require-valid-file-annotation: off, flowtype/require-return-type: off */
|
|
2
2
|
|
|
3
|
-
const postRobotGlobals = require(
|
|
4
|
-
const zoidGlobals = require(
|
|
3
|
+
const postRobotGlobals = require("@krakenjs/post-robot/globals");
|
|
4
|
+
const zoidGlobals = require("@krakenjs/zoid/globals");
|
|
5
5
|
|
|
6
6
|
module.exports = {
|
|
7
|
+
__ZOID__: {
|
|
8
|
+
...zoidGlobals.__ZOID__,
|
|
9
|
+
__DEFAULT_CONTAINER__: true,
|
|
10
|
+
__DEFAULT_PRERENDER__: true,
|
|
11
|
+
__FRAMEWORK_SUPPORT__: true,
|
|
12
|
+
__SCRIPT_NAMESPACE__: true,
|
|
13
|
+
},
|
|
7
14
|
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
__SCRIPT_NAMESPACE__: true
|
|
15
|
+
__POST_ROBOT__: {
|
|
16
|
+
...postRobotGlobals.__POST_ROBOT__,
|
|
17
|
+
__IE_POPUP_SUPPORT__: false,
|
|
18
|
+
__SCRIPT_NAMESPACE__: true,
|
|
19
|
+
},
|
|
14
20
|
|
|
21
|
+
__PAYPAL_CHECKOUT__: {
|
|
22
|
+
__REMEMBERED_FUNDING__: [],
|
|
23
|
+
__URI__: {
|
|
24
|
+
__CHECKOUT__: "/checkoutnow",
|
|
25
|
+
__BUTTONS__: "/smart/buttons",
|
|
26
|
+
__MENU__: "/smart/menu",
|
|
27
|
+
__QRCODE__: "/smart/qrcode",
|
|
28
|
+
__INSTALLMENTS__: "/smart/installments",
|
|
29
|
+
__MODAL__: "/smart/modal",
|
|
30
|
+
__CARD_FIELDS__: "/smart/card-fields",
|
|
31
|
+
__CARD_FIELD__: "/smart/card-field",
|
|
32
|
+
__WALLET__: "/smart/wallet",
|
|
33
|
+
__PAYMENT_FIELDS__: "/altpayfields",
|
|
15
34
|
},
|
|
16
|
-
|
|
17
|
-
__POST_ROBOT__: {
|
|
18
|
-
...postRobotGlobals.__POST_ROBOT__,
|
|
19
|
-
__IE_POPUP_SUPPORT__: false,
|
|
20
|
-
__SCRIPT_NAMESPACE__: true
|
|
21
|
-
},
|
|
22
|
-
|
|
23
|
-
__PAYPAL_CHECKOUT__: {
|
|
24
|
-
__REMEMBERED_FUNDING__: [],
|
|
25
|
-
__URI__: {
|
|
26
|
-
__CHECKOUT__: '/checkoutnow',
|
|
27
|
-
__BUTTONS__: '/smart/buttons',
|
|
28
|
-
__MENU__: '/smart/menu',
|
|
29
|
-
__QRCODE__: '/smart/qrcode',
|
|
30
|
-
__INSTALLMENTS__: '/smart/installments',
|
|
31
|
-
__MODAL__: '/smart/modal',
|
|
32
|
-
__CARD_FIELDS__: '/smart/card-fields',
|
|
33
|
-
__CARD_FIELD__: '/smart/card-field',
|
|
34
|
-
__WALLET__: '/smart/wallet',
|
|
35
|
-
__PAYMENT_FIELDS__: '/altpayfields'
|
|
36
|
-
}
|
|
37
|
-
}
|
|
35
|
+
},
|
|
38
36
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@paypal/checkout-components",
|
|
3
|
-
"version": "5.0.
|
|
3
|
+
"version": "5.0.258",
|
|
4
4
|
"description": "PayPal Checkout components, for integrating checkout products.",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"scripts": {
|
|
@@ -16,6 +16,8 @@
|
|
|
16
16
|
"eslint-find-rules": "eslint-find-rules --current .eslintrc.js --unused --plugin",
|
|
17
17
|
"flow": "flow",
|
|
18
18
|
"flow-typed": "rm -rf flow-typed && flow-typed install && rm flow-typed/npm/puppeteer_*",
|
|
19
|
+
"format": "prettier --write --ignore-unknown .",
|
|
20
|
+
"format:check": "prettier --check .",
|
|
19
21
|
"jest-e2e": "rm -f ./test/e2e/screenshots/*.png && jest test/e2e",
|
|
20
22
|
"jest-screenshot": "jest test/screenshot --env=node --no-cache",
|
|
21
23
|
"jest-ssr": "jest test/ssr --env=node --no-cache --collectCoverage --collectCoverageFrom='src/' --coverageDirectory='coverage/jest'",
|
|
@@ -26,7 +28,7 @@
|
|
|
26
28
|
"reinstall": "rimraf flow-typed && rimraf node_modules && npm install && flow-typed install",
|
|
27
29
|
"release": "./scripts/publish.sh",
|
|
28
30
|
"start": "npm run webpack -- --progress --watch",
|
|
29
|
-
"test": "npm run test:unit && npm run jest-ssr && npm run karma && npm run jest-screenshot",
|
|
31
|
+
"test": "npm run format:check && npm run test:unit && npm run jest-ssr && npm run karma && npm run jest-screenshot",
|
|
30
32
|
"test:unit": "vitest",
|
|
31
33
|
"percy-screenshot": "babel-node ./test/percy/server/createButtonConfigs.js && percy exec -- playwright test --config=./test/percy/playwright.config.js --reporter=dot --pass-with-no-tests",
|
|
32
34
|
"typecheck": "npm run flow-typed && npm run flow",
|
|
@@ -109,9 +111,9 @@
|
|
|
109
111
|
"@paypal/funding-components": "^1.0.31",
|
|
110
112
|
"@paypal/sdk-client": "^4.0.166",
|
|
111
113
|
"@paypal/sdk-constants": "^1.0.128",
|
|
112
|
-
"@paypal/sdk-logos": "^2.2.
|
|
114
|
+
"@paypal/sdk-logos": "^2.2.6"
|
|
113
115
|
},
|
|
114
116
|
"lint-staged": {
|
|
115
|
-
"
|
|
117
|
+
"**/{src,test,scripts}/**/*.{js,jsx,json,sh}": "prettier --write"
|
|
116
118
|
}
|
|
117
119
|
}
|
package/src/constants/button.js
CHANGED
|
@@ -1,67 +1,68 @@
|
|
|
1
1
|
/* @flow */
|
|
2
2
|
|
|
3
3
|
export const BUTTON_LABEL = {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
4
|
+
PAYPAL: ("paypal": "paypal"),
|
|
5
|
+
CHECKOUT: ("checkout": "checkout"),
|
|
6
|
+
BUYNOW: ("buynow": "buynow"),
|
|
7
|
+
PAY: ("pay": "pay"),
|
|
8
|
+
INSTALLMENT: ("installment": "installment"),
|
|
9
|
+
SUBSCRIBE: ("subscribe": "subscribe"),
|
|
10
|
+
DONATE: ("donate": "donate"),
|
|
11
11
|
};
|
|
12
12
|
|
|
13
13
|
export const BUTTON_COLOR = {
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
14
|
+
DEFAULT: ("default": "default"),
|
|
15
|
+
GOLD: ("gold": "gold"),
|
|
16
|
+
BLUE: ("blue": "blue"),
|
|
17
|
+
SILVER: ("silver": "silver"),
|
|
18
|
+
DARKBLUE: ("darkblue": "darkblue"),
|
|
19
|
+
BLACK: ("black": "black"),
|
|
20
|
+
WHITE: ("white": "white"),
|
|
21
|
+
TRANSPARENT: ("transparent": "transparent"),
|
|
22
22
|
};
|
|
23
23
|
|
|
24
24
|
export const TEXT_COLOR = {
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
25
|
+
BLACK: ("black": "black"),
|
|
26
|
+
WHITE: ("white": "white"),
|
|
27
|
+
DEFAULT: ("default": "default"),
|
|
28
28
|
};
|
|
29
29
|
|
|
30
30
|
export const BUTTON_SIZE = {
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
31
|
+
TINY: ("tiny": "tiny"),
|
|
32
|
+
SMALL: ("small": "small"),
|
|
33
|
+
MEDIUM: ("medium": "medium"),
|
|
34
|
+
LARGE: ("large": "large"),
|
|
35
|
+
HUGE: ("huge": "huge"),
|
|
36
|
+
RESPONSIVE: ("responsive": "responsive"),
|
|
37
37
|
};
|
|
38
38
|
|
|
39
39
|
export const BUTTON_SHAPE = {
|
|
40
|
-
|
|
41
|
-
|
|
40
|
+
PILL: ("pill": "pill"),
|
|
41
|
+
RECT: ("rect": "rect"),
|
|
42
42
|
};
|
|
43
43
|
|
|
44
44
|
export const BUTTON_LAYOUT = {
|
|
45
|
-
|
|
46
|
-
|
|
45
|
+
HORIZONTAL: ("horizontal": "horizontal"),
|
|
46
|
+
VERTICAL: ("vertical": "vertical"),
|
|
47
47
|
};
|
|
48
48
|
|
|
49
49
|
export const BUTTON_NUMBER = {
|
|
50
|
-
|
|
51
|
-
|
|
50
|
+
SINGLE: ("single": "single"),
|
|
51
|
+
MULTIPLE: ("multiple": "multiple"),
|
|
52
52
|
};
|
|
53
53
|
|
|
54
54
|
export const BUTTON_FLOW = {
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
55
|
+
PURCHASE: ("purchase": "purchase"),
|
|
56
|
+
BILLING_SETUP: ("billing_setup": "billing_setup"),
|
|
57
|
+
SUBSCRIPTION_SETUP: ("subscription_setup": "subscription_setup"),
|
|
58
|
+
VAULT_WITHOUT_PURCHASE: ("vault_without_purchase": "vault_without_purchase"),
|
|
58
59
|
};
|
|
59
60
|
|
|
60
61
|
export const MENU_PLACEMENT = {
|
|
61
|
-
|
|
62
|
-
|
|
62
|
+
ABOVE: ("above": "above"),
|
|
63
|
+
BELOW: ("below": "below"),
|
|
63
64
|
};
|
|
64
65
|
|
|
65
66
|
export const EXPERIENCE = {
|
|
66
|
-
|
|
67
|
+
INLINE: ("inline": "inline"),
|
|
67
68
|
};
|
package/src/constants/class.js
CHANGED
|
@@ -1,44 +1,46 @@
|
|
|
1
1
|
/* @flow */
|
|
2
2
|
|
|
3
3
|
export const CLASS = {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
4
|
+
CONTAINER: ("paypal-button-container": "paypal-button-container"),
|
|
5
|
+
BUTTON_ROW: ("paypal-button-row": "paypal-button-row"),
|
|
6
|
+
BUTTON: ("paypal-button": "paypal-button"),
|
|
7
|
+
BUTTON_LABEL:
|
|
8
|
+
("paypal-button-label-container": "paypal-button-label-container"),
|
|
9
|
+
LOGO_PP: ("paypal-logo-pp": "paypal-logo-pp"),
|
|
9
10
|
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
11
|
+
LABEL: ("paypal-button-label": "paypal-button-label"),
|
|
12
|
+
COLOR: ("paypal-button-color": "paypal-button-color"),
|
|
13
|
+
TEXT_COLOR: ("paypal-button-text-color": "paypal-button-text-color"),
|
|
14
|
+
SHAPE: ("paypal-button-shape": "paypal-button-shape"),
|
|
15
|
+
LAYOUT: ("paypal-button-layout": "paypal-button-layout"),
|
|
16
|
+
NUMBER: ("paypal-button-number": "paypal-button-number"),
|
|
17
|
+
ENV: ("paypal-button-env": "paypal-button-env"),
|
|
18
|
+
WALLET: ("paypal-button-wallet": "paypal-button-wallet"),
|
|
19
|
+
WALLET_MENU: ("paypal-button-wallet-menu": "paypal-button-wallet-menu"),
|
|
19
20
|
|
|
20
|
-
|
|
21
|
-
|
|
21
|
+
LOADING: ("paypal-button-loading": "paypal-button-loading"),
|
|
22
|
+
SPINNER: ("paypal-button-spinner": "paypal-button-spinner"),
|
|
22
23
|
|
|
23
|
-
|
|
24
|
-
|
|
24
|
+
TAGLINE: ("paypal-button-tagline": "paypal-button-tagline"),
|
|
25
|
+
POWERED_BY: ("paypal-powered-by": "paypal-powered-by"),
|
|
25
26
|
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
27
|
+
TEXT: ("paypal-button-text": "paypal-button-text"),
|
|
28
|
+
SPACE: ("paypal-button-space": "paypal-button-space"),
|
|
29
|
+
CARD: ("paypal-button-card": "paypal-button-card"),
|
|
29
30
|
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
VAULT_LABEL: ('paypal-vault-label' : 'paypal-vault-label'),
|
|
33
|
-
VAULT_HEADER: ('paypal-vault-header' : 'paypal-vault-header'),
|
|
31
|
+
PERSONALIZATION_TEXT:
|
|
32
|
+
("paypal-personalization-text": "paypal-personalization-text"),
|
|
34
33
|
|
|
35
|
-
|
|
34
|
+
VAULT_LABEL: ("paypal-vault-label": "paypal-vault-label"),
|
|
35
|
+
VAULT_HEADER: ("paypal-vault-header": "paypal-vault-header"),
|
|
36
36
|
|
|
37
|
-
|
|
37
|
+
SEPARATOR: ("paypal-separator": "paypal-separator"),
|
|
38
38
|
|
|
39
|
-
|
|
39
|
+
DOM_READY: ("dom-ready": "dom-ready"),
|
|
40
40
|
|
|
41
|
-
|
|
41
|
+
HIDDEN: ("hidden": "hidden"),
|
|
42
42
|
|
|
43
|
-
|
|
43
|
+
IMMEDIATE: ("immediate": "immediate"),
|
|
44
|
+
|
|
45
|
+
CUSTOM: ("custom": "custom"),
|
|
44
46
|
};
|
package/src/constants/index.js
CHANGED
package/src/constants/misc.js
CHANGED
|
@@ -1,17 +1,19 @@
|
|
|
1
1
|
/* @flow */
|
|
2
2
|
|
|
3
3
|
export const ATTRIBUTE = {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
4
|
+
BUTTON: ("data-button": "data-button"),
|
|
5
|
+
FUNDING_SOURCE: ("data-funding-source": "data-funding-source"),
|
|
6
|
+
PAYMENT_METHOD_ID: ("data-payment-method-id": "data-payment-method-id"),
|
|
7
|
+
INSTRUMENT_ID: ("data-instrument-id": "data-instrument-id"),
|
|
8
|
+
INSTRUMENT_TYPE: ("data-instrument-type": "data-instrument-type"),
|
|
9
|
+
SECONDARY_INSTRUMENT_TYPE:
|
|
10
|
+
("data-secondary-instrument-type": "data-secondary-instrument-type"),
|
|
11
|
+
VERSION:
|
|
12
|
+
("data-paypal-smart-button-version": "data-paypal-smart-button-version"),
|
|
13
|
+
CARD: ("data-card": "data-card"),
|
|
14
|
+
MENU: ("data-menu": "data-menu"),
|
|
15
|
+
OPTIONAL: ("optional": "optional"),
|
|
16
|
+
PAY_NOW: ("data-pay-now": "data-pay-now"),
|
|
15
17
|
};
|
|
16
18
|
|
|
17
|
-
export const DEFAULT = (
|
|
19
|
+
export const DEFAULT = ("default": "default");
|
package/src/declarations.js
CHANGED
|
@@ -2,28 +2,28 @@
|
|
|
2
2
|
/* eslint import/unambiguous: 0 */
|
|
3
3
|
|
|
4
4
|
// $FlowFixMe[toplevel-library-import]
|
|
5
|
-
import { FUNDING } from
|
|
5
|
+
import { FUNDING } from "@paypal/sdk-constants/src";
|
|
6
6
|
|
|
7
|
-
declare var __PAYPAL_CHECKOUT__
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
7
|
+
declare var __PAYPAL_CHECKOUT__: {|
|
|
8
|
+
__REMEMBERED_FUNDING__: $ReadOnlyArray<$Values<typeof FUNDING>>,
|
|
9
|
+
__URI__: {|
|
|
10
|
+
__BUTTONS__: string,
|
|
11
|
+
__CHECKOUT__: string,
|
|
12
|
+
__CARD_FIELDS__: string,
|
|
13
|
+
__CARD_FIELD__: string,
|
|
14
|
+
__MENU__: string,
|
|
15
|
+
__INSTALLMENTS__: string,
|
|
16
|
+
__MODAL__: string,
|
|
17
|
+
__QRCODE__: string,
|
|
18
|
+
__WALLET__: string,
|
|
19
|
+
__PAYMENT_FIELDS__: string,
|
|
20
|
+
|},
|
|
21
21
|
|};
|
|
22
22
|
|
|
23
|
-
declare var __INLINE_CHECKOUT_ELIGIBILITY__
|
|
24
|
-
|
|
25
|
-
|
|
23
|
+
declare var __INLINE_CHECKOUT_ELIGIBILITY__: {|
|
|
24
|
+
eligible: boolean,
|
|
25
|
+
ineligibilityReason: string,
|
|
26
26
|
|};
|
|
27
27
|
|
|
28
28
|
declare var __WEB__: boolean;
|
|
29
|
-
declare var __TREE_SHAKE__: boolean;
|
|
29
|
+
declare var __TREE_SHAKE__: boolean;
|
|
@@ -1,54 +1,55 @@
|
|
|
1
1
|
/* @flow */
|
|
2
2
|
/** @jsx node */
|
|
3
3
|
|
|
4
|
-
import { PLATFORM, FUNDING } from
|
|
5
|
-
import {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
import {
|
|
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
|
-
|
|
4
|
+
import { PLATFORM, FUNDING } from "@paypal/sdk-constants/src";
|
|
5
|
+
import {
|
|
6
|
+
ApplePayLogoExternalImage,
|
|
7
|
+
ApplePayLogoInlineSVG,
|
|
8
|
+
LOGO_COLOR,
|
|
9
|
+
} from "@paypal/sdk-logos/src";
|
|
10
|
+
|
|
11
|
+
import { BUTTON_COLOR, BUTTON_LAYOUT } from "../../constants";
|
|
12
|
+
import { DEFAULT_FUNDING_CONFIG, type FundingSourceConfig } from "../common";
|
|
13
|
+
|
|
14
|
+
import { Mark } from "./template";
|
|
15
|
+
|
|
16
|
+
export function getApplePayConfig(): FundingSourceConfig {
|
|
17
|
+
return {
|
|
18
|
+
...DEFAULT_FUNDING_CONFIG,
|
|
19
|
+
|
|
20
|
+
requires: () => {
|
|
21
|
+
return {
|
|
22
|
+
applepay: true,
|
|
23
|
+
};
|
|
24
|
+
},
|
|
25
|
+
eligible: ({ components }) => {
|
|
26
|
+
/** If the JS SDK Script Includes Standalone ApplePay Component the Exclude the ApplePay Button From the Vertical Stack
|
|
27
|
+
* https://paypal.atlassian.net/browse/DTALTPAY-1232
|
|
28
|
+
*/
|
|
29
|
+
return !components?.includes(FUNDING.APPLEPAY);
|
|
30
|
+
},
|
|
31
|
+
|
|
32
|
+
platforms: [PLATFORM.DESKTOP, PLATFORM.MOBILE],
|
|
33
|
+
|
|
34
|
+
layouts: [BUTTON_LAYOUT.HORIZONTAL, BUTTON_LAYOUT.VERTICAL],
|
|
35
|
+
|
|
36
|
+
Logo: ({ logoColor, optional }) => {
|
|
37
|
+
if (__WEB__) {
|
|
38
|
+
return ApplePayLogoExternalImage({ logoColor, optional });
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
return ApplePayLogoInlineSVG({ logoColor, optional });
|
|
42
|
+
},
|
|
43
|
+
|
|
44
|
+
Mark: ({ ...props }) => Mark({ ...props }),
|
|
45
|
+
|
|
46
|
+
colors: [BUTTON_COLOR.BLACK, BUTTON_COLOR.WHITE],
|
|
47
|
+
|
|
48
|
+
logoColors: {
|
|
49
|
+
[BUTTON_COLOR.BLACK]: LOGO_COLOR.WHITE,
|
|
50
|
+
[BUTTON_COLOR.WHITE]: LOGO_COLOR.BLACK,
|
|
51
|
+
},
|
|
52
|
+
|
|
53
|
+
shippingChange: true,
|
|
54
|
+
};
|
|
54
55
|
}
|
|
@@ -1,17 +1,22 @@
|
|
|
1
1
|
/* @flow */
|
|
2
2
|
/** @jsx node */
|
|
3
3
|
|
|
4
|
-
import { node, Style, type ChildType } from
|
|
5
|
-
import {
|
|
4
|
+
import { node, Style, type ChildType } from "@krakenjs/jsx-pragmatic/src";
|
|
5
|
+
import {
|
|
6
|
+
ApplePayMarkExternalImage,
|
|
7
|
+
ApplePayMarkInlineSVG,
|
|
8
|
+
} from "@paypal/sdk-logos/src";
|
|
6
9
|
|
|
7
|
-
import
|
|
10
|
+
import css from "./style.scoped.scss";
|
|
8
11
|
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
<
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
12
|
+
export function Mark({ ...props }: {||}): ChildType {
|
|
13
|
+
return (
|
|
14
|
+
<Style css={css}>
|
|
15
|
+
{__WEB__ ? (
|
|
16
|
+
<ApplePayMarkExternalImage {...props} />
|
|
17
|
+
) : (
|
|
18
|
+
<ApplePayMarkInlineSVG {...props} />
|
|
19
|
+
)}
|
|
20
|
+
</Style>
|
|
21
|
+
);
|
|
17
22
|
}
|
|
@@ -1,41 +1,52 @@
|
|
|
1
1
|
/* @flow */
|
|
2
2
|
/** @jsx node */
|
|
3
3
|
|
|
4
|
-
import {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
import {
|
|
9
|
-
|
|
10
|
-
import {
|
|
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
|
-
|
|
4
|
+
import {
|
|
5
|
+
BancontactLogoInlineSVG,
|
|
6
|
+
BancontactLogoExternalImage,
|
|
7
|
+
} from "@paypal/sdk-logos/src";
|
|
8
|
+
import { Fragment, node } from "@krakenjs/jsx-pragmatic/src";
|
|
9
|
+
|
|
10
|
+
import { BUTTON_LAYOUT } from "../../constants";
|
|
11
|
+
import {
|
|
12
|
+
DEFAULT_APM_FUNDING_CONFIG,
|
|
13
|
+
type FundingSourceConfig,
|
|
14
|
+
BasicLabel,
|
|
15
|
+
} from "../common";
|
|
16
|
+
import { Text, Space } from "../../ui/text";
|
|
17
|
+
|
|
18
|
+
export function getBancontactConfig(): FundingSourceConfig {
|
|
19
|
+
return {
|
|
20
|
+
...DEFAULT_APM_FUNDING_CONFIG,
|
|
21
|
+
|
|
22
|
+
shippingChange: false,
|
|
23
|
+
|
|
24
|
+
layouts: [BUTTON_LAYOUT.VERTICAL],
|
|
25
|
+
|
|
26
|
+
Logo: ({ logoColor, optional }) => {
|
|
27
|
+
if (__WEB__) {
|
|
28
|
+
return BancontactLogoExternalImage({ logoColor, optional });
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
return BancontactLogoInlineSVG({ logoColor, optional });
|
|
32
|
+
},
|
|
33
|
+
|
|
34
|
+
Label: ({ logo, ...opts }) => {
|
|
35
|
+
if (__WEB__) {
|
|
36
|
+
return logo;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
const apmLogo = (
|
|
40
|
+
<Fragment>
|
|
41
|
+
{logo}
|
|
42
|
+
<Space />
|
|
43
|
+
<Text animate optional>
|
|
44
|
+
Bancontact
|
|
45
|
+
</Text>
|
|
46
|
+
</Fragment>
|
|
47
|
+
);
|
|
48
|
+
|
|
49
|
+
return <BasicLabel {...opts} logo={apmLogo} />;
|
|
50
|
+
},
|
|
51
|
+
};
|
|
41
52
|
}
|