@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.
Files changed (185) hide show
  1. package/README.md +8 -0
  2. package/__sdk__.js +72 -76
  3. package/dist/button.js +1 -1
  4. package/globals.js +28 -30
  5. package/package.json +6 -4
  6. package/src/constants/button.js +37 -36
  7. package/src/constants/class.js +32 -30
  8. package/src/constants/index.js +3 -3
  9. package/src/constants/misc.js +14 -12
  10. package/src/declarations.js +19 -19
  11. package/src/funding/applepay/config.jsx +51 -50
  12. package/src/funding/applepay/index.js +1 -1
  13. package/src/funding/applepay/style.scoped.scss +1 -1
  14. package/src/funding/applepay/template.jsx +16 -11
  15. package/src/funding/bancontact/config.jsx +48 -37
  16. package/src/funding/bancontact/index.js +1 -2
  17. package/src/funding/blik/config.jsx +48 -37
  18. package/src/funding/blik/index.js +1 -2
  19. package/src/funding/boleto/config.jsx +50 -39
  20. package/src/funding/boleto/index.js +1 -2
  21. package/src/funding/card/amex/config.js +9 -8
  22. package/src/funding/card/amex/index.js +1 -2
  23. package/src/funding/card/config.jsx +246 -177
  24. package/src/funding/card/discover/config.js +9 -7
  25. package/src/funding/card/discover/index.js +1 -2
  26. package/src/funding/card/elo/config.js +6 -7
  27. package/src/funding/card/elo/index.js +1 -2
  28. package/src/funding/card/hiper/config.js +9 -7
  29. package/src/funding/card/hiper/index.js +1 -2
  30. package/src/funding/card/index.js +1 -1
  31. package/src/funding/card/jcb/config.js +6 -7
  32. package/src/funding/card/jcb/index.js +1 -2
  33. package/src/funding/card/mastercard/config.js +9 -7
  34. package/src/funding/card/mastercard/index.js +1 -2
  35. package/src/funding/card/visa/config.js +9 -7
  36. package/src/funding/card/visa/index.js +1 -2
  37. package/src/funding/common.jsx +242 -216
  38. package/src/funding/config.js +212 -65
  39. package/src/funding/content.jsx +1946 -337
  40. package/src/funding/credit/config.jsx +74 -57
  41. package/src/funding/credit/index.js +1 -2
  42. package/src/funding/eps/config.jsx +45 -37
  43. package/src/funding/eps/index.js +1 -2
  44. package/src/funding/funding.js +193 -100
  45. package/src/funding/giropay/config.jsx +48 -38
  46. package/src/funding/giropay/index.js +1 -2
  47. package/src/funding/ideal/config.jsx +48 -37
  48. package/src/funding/ideal/index.js +1 -2
  49. package/src/funding/index.js +2 -2
  50. package/src/funding/itau/config.jsx +41 -41
  51. package/src/funding/itau/index.js +1 -1
  52. package/src/funding/maxima/config.jsx +25 -19
  53. package/src/funding/maxima/index.js +1 -2
  54. package/src/funding/mercadopago/config.jsx +48 -37
  55. package/src/funding/mercadopago/index.js +1 -2
  56. package/src/funding/multibanco/config.jsx +50 -39
  57. package/src/funding/multibanco/index.js +1 -2
  58. package/src/funding/mybank/config.jsx +48 -37
  59. package/src/funding/mybank/index.js +1 -2
  60. package/src/funding/oxxo/config.jsx +50 -39
  61. package/src/funding/oxxo/index.js +1 -2
  62. package/src/funding/p24/config.jsx +45 -37
  63. package/src/funding/p24/index.js +1 -2
  64. package/src/funding/paidy/config.jsx +50 -39
  65. package/src/funding/paidy/index.js +1 -1
  66. package/src/funding/paylater/config.jsx +118 -111
  67. package/src/funding/paylater/index.js +1 -2
  68. package/src/funding/paypal/config.jsx +44 -46
  69. package/src/funding/paypal/index.js +1 -2
  70. package/src/funding/paypal/style.scoped.scss +80 -74
  71. package/src/funding/paypal/template.jsx +450 -354
  72. package/src/funding/payu/config.jsx +50 -39
  73. package/src/funding/payu/index.js +1 -1
  74. package/src/funding/satispay/config.jsx +50 -39
  75. package/src/funding/satispay/index.js +1 -1
  76. package/src/funding/sepa/config.jsx +19 -13
  77. package/src/funding/sepa/index.js +1 -2
  78. package/src/funding/sofort/config.jsx +48 -37
  79. package/src/funding/sofort/index.js +1 -2
  80. package/src/funding/trustly/config.jsx +50 -39
  81. package/src/funding/trustly/index.js +1 -2
  82. package/src/funding/venmo/config.jsx +80 -75
  83. package/src/funding/venmo/index.js +1 -2
  84. package/src/funding/venmo/style.scoped.scss +30 -32
  85. package/src/funding/venmo/template.jsx +56 -57
  86. package/src/funding/verkkopankki/config.jsx +50 -39
  87. package/src/funding/verkkopankki/index.js +1 -1
  88. package/src/funding/wechatpay/config.jsx +48 -37
  89. package/src/funding/wechatpay/index.js +1 -2
  90. package/src/funding/zimpler/config.jsx +19 -13
  91. package/src/funding/zimpler/index.js +1 -2
  92. package/src/interface/button.js +60 -44
  93. package/src/interface/card-fields.js +11 -8
  94. package/src/interface/fields.js +7 -4
  95. package/src/interface/marks.js +4 -4
  96. package/src/interface/payment-fields.js +7 -4
  97. package/src/interface/wallet.js +4 -4
  98. package/src/lib/errors.js +7 -7
  99. package/src/lib/index.js +5 -5
  100. package/src/lib/isRTLLanguage.js +3 -3
  101. package/src/lib/perceived-latency-instrumentation.js +54 -36
  102. package/src/lib/security.js +21 -17
  103. package/src/lib/session.js +39 -35
  104. package/src/marks/component.jsx +114 -65
  105. package/src/marks/index.js +1 -2
  106. package/src/marks/template.jsx +79 -65
  107. package/src/types.js +48 -48
  108. package/src/ui/buttons/button.jsx +311 -249
  109. package/src/ui/buttons/buttonDesigns/control.jsx +3 -5
  110. package/src/ui/buttons/buttonDesigns/divideLogoAnimation.jsx +127 -99
  111. package/src/ui/buttons/buttonDesigns/index.js +78 -75
  112. package/src/ui/buttons/buttonDesigns/inlineLogoTextDesign.jsx +102 -82
  113. package/src/ui/buttons/buttonDesigns/script.jsx +24 -18
  114. package/src/ui/buttons/buttonDesigns/types.js +6 -7
  115. package/src/ui/buttons/buttons.jsx +318 -212
  116. package/src/ui/buttons/config.js +62 -59
  117. package/src/ui/buttons/content.jsx +304 -119
  118. package/src/ui/buttons/index.js +1 -1
  119. package/src/ui/buttons/menu-button/index.js +1 -1
  120. package/src/ui/buttons/menu-button/menu-button.jsx +29 -22
  121. package/src/ui/buttons/menu-button/menu-button.scoped.scss +16 -17
  122. package/src/ui/buttons/poweredBy.jsx +23 -23
  123. package/src/ui/buttons/props.js +680 -529
  124. package/src/ui/buttons/script.jsx +182 -160
  125. package/src/ui/buttons/spinner.jsx +4 -6
  126. package/src/ui/buttons/style.jsx +15 -14
  127. package/src/ui/buttons/styles/base.js +24 -16
  128. package/src/ui/buttons/styles/button.js +24 -22
  129. package/src/ui/buttons/styles/color.js +118 -118
  130. package/src/ui/buttons/styles/custom.js +30 -24
  131. package/src/ui/buttons/styles/index.js +1 -1
  132. package/src/ui/buttons/styles/labels.js +17 -13
  133. package/src/ui/buttons/styles/page.js +3 -3
  134. package/src/ui/buttons/styles/responsive.js +226 -118
  135. package/src/ui/buttons/tagline.jsx +53 -54
  136. package/src/ui/chevron.jsx +27 -16
  137. package/src/ui/index.js +3 -3
  138. package/src/ui/loading.jsx +25 -18
  139. package/src/ui/text/index.js +1 -1
  140. package/src/ui/text/style.scoped.scss +25 -26
  141. package/src/ui/text/text.jsx +42 -20
  142. package/src/ui/tracking.jsx +18 -11
  143. package/src/zoid/buttons/component.jsx +836 -684
  144. package/src/zoid/buttons/container.jsx +140 -107
  145. package/src/zoid/buttons/index.js +1 -1
  146. package/src/zoid/buttons/prerender.jsx +84 -64
  147. package/src/zoid/buttons/util.js +355 -254
  148. package/src/zoid/card-fields/component.jsx +581 -549
  149. package/src/zoid/card-fields/index.js +1 -1
  150. package/src/zoid/card-fields/prerender.jsx +20 -17
  151. package/src/zoid/card-form/component.js +155 -141
  152. package/src/zoid/card-form/index.js +1 -1
  153. package/src/zoid/checkout/component.jsx +314 -282
  154. package/src/zoid/checkout/config.js +2 -2
  155. package/src/zoid/checkout/content.js +190 -154
  156. package/src/zoid/checkout/hacks.js +31 -28
  157. package/src/zoid/checkout/index.js +2 -2
  158. package/src/zoid/checkout/props.js +27 -33
  159. package/src/zoid/installments/component.jsx +83 -70
  160. package/src/zoid/installments/index.js +1 -1
  161. package/src/zoid/installments/props.js +1 -1
  162. package/src/zoid/menu/component.jsx +53 -48
  163. package/src/zoid/menu/index.js +1 -1
  164. package/src/zoid/menu/props.js +1 -3
  165. package/src/zoid/modal/component.jsx +119 -106
  166. package/src/zoid/modal/index.js +1 -1
  167. package/src/zoid/modal/props.js +1 -3
  168. package/src/zoid/payment-fields/component.jsx +215 -191
  169. package/src/zoid/payment-fields/container.jsx +73 -64
  170. package/src/zoid/payment-fields/index.js +1 -1
  171. package/src/zoid/payment-fields/prerender.jsx +16 -14
  172. package/src/zoid/payment-fields/props.js +6 -6
  173. package/src/zoid/qr-code/component.jsx +131 -115
  174. package/src/zoid/qr-code/container.jsx +74 -68
  175. package/src/zoid/qr-code/index.js +1 -1
  176. package/src/zoid/qr-code/prerender.jsx +17 -12
  177. package/src/zoid/qr-code/types.js +2 -2
  178. package/src/zoid/wallet/component.jsx +298 -260
  179. package/src/zoid/wallet/container.jsx +73 -64
  180. package/src/zoid/wallet/index.js +1 -1
  181. package/src/zoid/wallet/prerender.jsx +14 -14
  182. package/src/zoid/wallet/props.js +4 -4
  183. package/src/actions/save/index.js +0 -40
  184. package/src/interface/actions.js +0 -14
  185. 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('@krakenjs/post-robot/globals');
4
- const zoidGlobals = require('@krakenjs/zoid/globals');
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
- __ZOID__: {
9
- ...zoidGlobals.__ZOID__,
10
- __DEFAULT_CONTAINER__: true,
11
- __DEFAULT_PRERENDER__: true,
12
- __FRAMEWORK_SUPPORT__: true,
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.256",
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.3"
114
+ "@paypal/sdk-logos": "^2.2.6"
113
115
  },
114
116
  "lint-staged": {
115
- "*.sh": "prettier --write"
117
+ "**/{src,test,scripts}/**/*.{js,jsx,json,sh}": "prettier --write"
116
118
  }
117
119
  }
@@ -1,67 +1,68 @@
1
1
  /* @flow */
2
2
 
3
3
  export const BUTTON_LABEL = {
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')
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
- 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')
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
- BLACK: ('black' : 'black'),
26
- WHITE: ('white' : 'white'),
27
- DEFAULT: ('default' : 'default')
25
+ BLACK: ("black": "black"),
26
+ WHITE: ("white": "white"),
27
+ DEFAULT: ("default": "default"),
28
28
  };
29
29
 
30
30
  export const BUTTON_SIZE = {
31
- TINY: ('tiny' : 'tiny'),
32
- SMALL: ('small' : 'small'),
33
- MEDIUM: ('medium' : 'medium'),
34
- LARGE: ('large' : 'large'),
35
- HUGE: ('huge' : 'huge'),
36
- RESPONSIVE: ('responsive' : 'responsive')
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
- PILL: ('pill' : 'pill'),
41
- RECT: ('rect' : 'rect')
40
+ PILL: ("pill": "pill"),
41
+ RECT: ("rect": "rect"),
42
42
  };
43
43
 
44
44
  export const BUTTON_LAYOUT = {
45
- HORIZONTAL: ('horizontal' : 'horizontal'),
46
- VERTICAL: ('vertical' : 'vertical')
45
+ HORIZONTAL: ("horizontal": "horizontal"),
46
+ VERTICAL: ("vertical": "vertical"),
47
47
  };
48
48
 
49
49
  export const BUTTON_NUMBER = {
50
- SINGLE: ('single' : 'single'),
51
- MULTIPLE: ('multiple' : 'multiple')
50
+ SINGLE: ("single": "single"),
51
+ MULTIPLE: ("multiple": "multiple"),
52
52
  };
53
53
 
54
54
  export const BUTTON_FLOW = {
55
- PURCHASE: ('purchase' : 'purchase'),
56
- BILLING_SETUP: ('billing_setup' : 'billing_setup'),
57
- SUBSCRIPTION_SETUP: ('subscription_setup' : 'subscription_setup')
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
- ABOVE: ('above' : 'above'),
62
- BELOW: ('below' : 'below')
62
+ ABOVE: ("above": "above"),
63
+ BELOW: ("below": "below"),
63
64
  };
64
65
 
65
66
  export const EXPERIENCE = {
66
- INLINE: ('inline' : 'inline')
67
+ INLINE: ("inline": "inline"),
67
68
  };
@@ -1,44 +1,46 @@
1
1
  /* @flow */
2
2
 
3
3
  export const CLASS = {
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: ('paypal-button-label-container' : 'paypal-button-label-container'),
8
- LOGO_PP: ('paypal-logo-pp' : 'paypal-logo-pp'),
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
- LABEL: ('paypal-button-label' : 'paypal-button-label'),
11
- COLOR: ('paypal-button-color' : 'paypal-button-color'),
12
- TEXT_COLOR: ('paypal-button-text-color' : 'paypal-button-text-color'),
13
- SHAPE: ('paypal-button-shape' : 'paypal-button-shape'),
14
- LAYOUT: ('paypal-button-layout' : 'paypal-button-layout'),
15
- NUMBER: ('paypal-button-number' : 'paypal-button-number'),
16
- ENV: ('paypal-button-env' : 'paypal-button-env'),
17
- WALLET: ('paypal-button-wallet' : 'paypal-button-wallet'),
18
- WALLET_MENU: ('paypal-button-wallet-menu' : 'paypal-button-wallet-menu'),
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
- LOADING: ('paypal-button-loading' : 'paypal-button-loading'),
21
- SPINNER: ('paypal-button-spinner' : 'paypal-button-spinner'),
21
+ LOADING: ("paypal-button-loading": "paypal-button-loading"),
22
+ SPINNER: ("paypal-button-spinner": "paypal-button-spinner"),
22
23
 
23
- TAGLINE: ('paypal-button-tagline' : 'paypal-button-tagline'),
24
- POWERED_BY: ('paypal-powered-by' : 'paypal-powered-by'),
24
+ TAGLINE: ("paypal-button-tagline": "paypal-button-tagline"),
25
+ POWERED_BY: ("paypal-powered-by": "paypal-powered-by"),
25
26
 
26
- TEXT: ('paypal-button-text' : 'paypal-button-text'),
27
- SPACE: ('paypal-button-space' : 'paypal-button-space'),
28
- CARD: ('paypal-button-card' : 'paypal-button-card'),
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
- PERSONALIZATION_TEXT: ('paypal-personalization-text' : 'paypal-personalization-text'),
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
- SEPARATOR: ('paypal-separator' : 'paypal-separator'),
34
+ VAULT_LABEL: ("paypal-vault-label": "paypal-vault-label"),
35
+ VAULT_HEADER: ("paypal-vault-header": "paypal-vault-header"),
36
36
 
37
- DOM_READY: ('dom-ready' : 'dom-ready'),
37
+ SEPARATOR: ("paypal-separator": "paypal-separator"),
38
38
 
39
- HIDDEN: ('hidden' : 'hidden'),
39
+ DOM_READY: ("dom-ready": "dom-ready"),
40
40
 
41
- IMMEDIATE: ('immediate' : 'immediate'),
41
+ HIDDEN: ("hidden": "hidden"),
42
42
 
43
- CUSTOM: ('custom' : 'custom')
43
+ IMMEDIATE: ("immediate": "immediate"),
44
+
45
+ CUSTOM: ("custom": "custom"),
44
46
  };
@@ -1,5 +1,5 @@
1
1
  /* @flow */
2
2
 
3
- export * from './button';
4
- export * from './misc';
5
- export * from './class';
3
+ export * from "./button";
4
+ export * from "./misc";
5
+ export * from "./class";
@@ -1,17 +1,19 @@
1
1
  /* @flow */
2
2
 
3
3
  export const ATTRIBUTE = {
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: ('data-secondary-instrument-type' : 'data-secondary-instrument-type'),
10
- VERSION: ('data-paypal-smart-button-version' : 'data-paypal-smart-button-version'),
11
- CARD: ('data-card' : 'data-card'),
12
- MENU: ('data-menu' : 'data-menu'),
13
- OPTIONAL: ('optional' : 'optional'),
14
- PAY_NOW: ('data-pay-now' : 'data-pay-now')
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 = ('default' : 'default');
19
+ export const DEFAULT = ("default": "default");
@@ -2,28 +2,28 @@
2
2
  /* eslint import/unambiguous: 0 */
3
3
 
4
4
  // $FlowFixMe[toplevel-library-import]
5
- import { FUNDING } from '@paypal/sdk-constants/src';
5
+ import { FUNDING } from "@paypal/sdk-constants/src";
6
6
 
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
- |}
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
- eligible : boolean,
25
- ineligibilityReason : string
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 '@paypal/sdk-constants/src';
5
- import { ApplePayLogo, LOGO_COLOR } from '@paypal/sdk-logos/src';
6
-
7
- import { BUTTON_COLOR, BUTTON_LAYOUT } from '../../constants';
8
- import { enableLogoCDNExperiment } from '../../lib/getLogoCDNExperiment';
9
- import { DEFAULT_FUNDING_CONFIG, type FundingSourceConfig } from '../common';
10
-
11
- import { Mark } from './template';
12
-
13
- export function getApplePayConfig() : FundingSourceConfig {
14
- return {
15
- ...DEFAULT_FUNDING_CONFIG,
16
-
17
- requires: () => {
18
- return {
19
- applepay: true
20
- };
21
- },
22
- eligible: ({components}) => {
23
- /** If the JS SDK Script Includes Standalone ApplePay Component the Exclude the ApplePay Button From the Vertical Stack
24
- * https://paypal.atlassian.net/browse/DTALTPAY-1232
25
- */
26
- return !components?.includes(FUNDING.APPLEPAY);
27
- },
28
-
29
- platforms: [
30
- PLATFORM.DESKTOP,
31
- PLATFORM.MOBILE
32
- ],
33
-
34
- layouts: [
35
- BUTTON_LAYOUT.HORIZONTAL,
36
- BUTTON_LAYOUT.VERTICAL
37
- ],
38
-
39
- Logo: ({ logoColor, optional }) => enableLogoCDNExperiment(ApplePayLogo, { logoColor, optional }),
40
- Mark: ({ ...props }) => Mark({ ...props }),
41
-
42
- colors: [
43
- BUTTON_COLOR.BLACK,
44
- BUTTON_COLOR.WHITE
45
- ],
46
-
47
- logoColors: {
48
- [ BUTTON_COLOR.BLACK ]: LOGO_COLOR.WHITE,
49
- [ BUTTON_COLOR.WHITE ]: LOGO_COLOR.BLACK
50
- },
51
-
52
- shippingChange: true
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,3 +1,3 @@
1
1
  /* @flow */
2
2
 
3
- export * from './config';
3
+ export * from "./config";
@@ -1,3 +1,3 @@
1
1
  .paypal-mark .paypal-logo-applepay {
2
- height: 30px;
2
+ height: 30px;
3
3
  }
@@ -1,17 +1,22 @@
1
1
  /* @flow */
2
2
  /** @jsx node */
3
3
 
4
- import { node, Style, type ChildType } from '@krakenjs/jsx-pragmatic/src';
5
- import { ApplePayMark } from '@paypal/sdk-logos/src';
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 { enableLogoCDNExperiment } from '../../lib/getLogoCDNExperiment';
10
+ import css from "./style.scoped.scss";
8
11
 
9
- import css from './style.scoped.scss';
10
-
11
- export function Mark({ ...props } : {||}) : ChildType {
12
- return (
13
- <Style css={ css }>
14
- {enableLogoCDNExperiment(ApplePayMark, props )}
15
- </Style>
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 { BancontactLogo } from '@paypal/sdk-logos/src';
5
- import { Fragment, node } from '@krakenjs/jsx-pragmatic/src';
6
-
7
- import { BUTTON_LAYOUT } from '../../constants';
8
- import { DEFAULT_APM_FUNDING_CONFIG, type FundingSourceConfig, BasicLabel } from '../common';
9
- import { Text, Space } from '../../ui/text';
10
- import { enableLogoCDNExperiment } from '../../lib/getLogoCDNExperiment';
11
-
12
- export function getBancontactConfig() : FundingSourceConfig {
13
- return {
14
- ...DEFAULT_APM_FUNDING_CONFIG,
15
-
16
- shippingChange: false,
17
-
18
- layouts: [
19
- BUTTON_LAYOUT.VERTICAL
20
- ],
21
-
22
- Logo: ({ logoColor, optional }) => enableLogoCDNExperiment(BancontactLogo, { logoColor, optional }),
23
-
24
- Label: ({ logo, ...opts }) => {
25
- if (__WEB__) {
26
- return logo;
27
- }
28
-
29
- const apmLogo = (
30
- <Fragment>
31
- { logo }<Space /><Text animate optional>Bancontact</Text>
32
- </Fragment>
33
- );
34
-
35
- return (<BasicLabel
36
- { ...opts }
37
- logo={ apmLogo }
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
  }