@paypal/checkout-components 5.0.252 → 5.0.253-alpha.0

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 (40) hide show
  1. package/dist/button.js +1 -1
  2. package/package.json +2 -2
  3. package/src/funding/applepay/config.jsx +1 -2
  4. package/src/funding/applepay/template.jsx +1 -3
  5. package/src/funding/bancontact/config.jsx +1 -2
  6. package/src/funding/blik/config.jsx +1 -2
  7. package/src/funding/boleto/config.jsx +1 -2
  8. package/src/funding/card/amex/config.js +1 -2
  9. package/src/funding/card/config.jsx +3 -2
  10. package/src/funding/card/discover/config.js +1 -2
  11. package/src/funding/card/elo/config.js +1 -2
  12. package/src/funding/card/hiper/config.js +1 -2
  13. package/src/funding/card/jcb/config.js +1 -2
  14. package/src/funding/card/mastercard/config.js +1 -2
  15. package/src/funding/card/visa/config.js +1 -2
  16. package/src/funding/credit/config.jsx +4 -7
  17. package/src/funding/eps/config.jsx +1 -2
  18. package/src/funding/giropay/config.jsx +1 -2
  19. package/src/funding/ideal/config.jsx +1 -2
  20. package/src/funding/itau/config.jsx +1 -2
  21. package/src/funding/maxima/config.jsx +1 -2
  22. package/src/funding/mercadopago/config.jsx +1 -2
  23. package/src/funding/multibanco/config.jsx +1 -2
  24. package/src/funding/mybank/config.jsx +1 -2
  25. package/src/funding/oxxo/config.jsx +1 -2
  26. package/src/funding/p24/config.jsx +1 -2
  27. package/src/funding/paylater/config.jsx +1 -2
  28. package/src/funding/paypal/template.jsx +13 -12
  29. package/src/funding/payu/config.jsx +1 -2
  30. package/src/funding/satispay/config.jsx +1 -2
  31. package/src/funding/sepa/config.jsx +1 -2
  32. package/src/funding/sofort/config.jsx +1 -2
  33. package/src/funding/trustly/config.jsx +1 -2
  34. package/src/funding/venmo/config.jsx +1 -3
  35. package/src/funding/venmo/template.jsx +2 -3
  36. package/src/funding/verkkopankki/config.jsx +1 -2
  37. package/src/funding/wechatpay/config.jsx +1 -2
  38. package/src/funding/zimpler/config.jsx +1 -2
  39. package/src/zoid/card-fields/component.jsx +32 -4
  40. package/src/lib/getLogoCDNExperiment.js +0 -25
@@ -9,7 +9,6 @@ import {
9
9
  BasicLabel
10
10
  } from '../common';
11
11
  import { Text, Space } from '../../ui/text';
12
- import { enableLogoCDNExperiment } from '../../lib/getLogoCDNExperiment';
13
12
 
14
13
  import css from './style.scoped.scss';
15
14
 
@@ -18,7 +17,7 @@ export function AppLabel(opts : LabelOptions) : ChildType {
18
17
 
19
18
  const AppLogo : ChildType = (
20
19
  <Style css={ css }>
21
- {enableLogoCDNExperiment(VenmoLogo, { logoColor })}
20
+ <VenmoLogo logoColor={ logoColor } />
22
21
  <Text className={ [ 'app-label' ] }>
23
22
  App
24
23
  </Text>
@@ -39,7 +38,7 @@ export function Label(opts : LabelOptions) : ChildType {
39
38
  export function WalletLabel({ ...props } : WalletLabelOptions) : ChildType {
40
39
  const { instrument, logoColor } = props;
41
40
  let label;
42
- const logo = enableLogoCDNExperiment(VenmoLogo, { logoColor });
41
+ const logo = <VenmoLogo logoColor={ logoColor } />;
43
42
 
44
43
  if (instrument && instrument.label) {
45
44
  label = instrument.label;
@@ -7,7 +7,6 @@ import { Fragment, node } from '@krakenjs/jsx-pragmatic/src';
7
7
  import { BUTTON_LAYOUT } from '../../constants';
8
8
  import { DEFAULT_APM_FUNDING_CONFIG, type FundingSourceConfig, BasicLabel } from '../common';
9
9
  import { Text, Space } from '../../ui/text';
10
- import { enableLogoCDNExperiment } from '../../lib/getLogoCDNExperiment';
11
10
 
12
11
  export function getVerkkopankkiConfig() : FundingSourceConfig {
13
12
  return {
@@ -21,7 +20,7 @@ export function getVerkkopankkiConfig() : FundingSourceConfig {
21
20
 
22
21
  shippingChange: false,
23
22
 
24
- Logo: ({ logoColor, optional }) => enableLogoCDNExperiment(VerkkopankkiLogo, { logoColor, optional }),
23
+ Logo: ({ logoColor, optional }) => VerkkopankkiLogo({ logoColor, optional }),
25
24
 
26
25
  Label: ({ logo, ...opts }) => {
27
26
  if (__WEB__) {
@@ -7,7 +7,6 @@ import { Fragment, node } from '@krakenjs/jsx-pragmatic/src';
7
7
  import { BUTTON_LAYOUT } from '../../constants';
8
8
  import { DEFAULT_APM_FUNDING_CONFIG, type FundingSourceConfig, BasicLabel } from '../common';
9
9
  import { Text, Space } from '../../ui/text';
10
- import { enableLogoCDNExperiment } from '../../lib/getLogoCDNExperiment';
11
10
 
12
11
  export function getWechatpayConfig() : FundingSourceConfig {
13
12
  return {
@@ -19,7 +18,7 @@ export function getWechatpayConfig() : FundingSourceConfig {
19
18
  BUTTON_LAYOUT.VERTICAL
20
19
  ],
21
20
 
22
- Logo: ({ logoColor, optional }) => enableLogoCDNExperiment(WechatpayLogo, { logoColor, optional }),
21
+ Logo: ({ logoColor, optional }) => WechatpayLogo({ logoColor, optional }),
23
22
 
24
23
  Label: ({ logo, ...opts }) => {
25
24
  if (__WEB__) {
@@ -4,7 +4,6 @@
4
4
  import { ZimplerLogo } from '@paypal/sdk-logos/src';
5
5
 
6
6
  import { BUTTON_LAYOUT } from '../../constants';
7
- import { enableLogoCDNExperiment } from '../../lib/getLogoCDNExperiment';
8
7
  import { DEFAULT_FUNDING_CONFIG, type FundingSourceConfig } from '../common';
9
8
 
10
9
  export function getZimplerConfig() : FundingSourceConfig {
@@ -17,6 +16,6 @@ export function getZimplerConfig() : FundingSourceConfig {
17
16
  BUTTON_LAYOUT.VERTICAL
18
17
  ],
19
18
 
20
- Logo: ({ logoColor, optional }) => enableLogoCDNExperiment(ZimplerLogo, { logoColor, optional })
19
+ Logo: ({ logoColor, optional }) => ZimplerLogo({ logoColor, optional })
21
20
  };
22
21
  }
@@ -8,7 +8,7 @@ import { create, type ZoidComponent } from '@krakenjs/zoid/src';
8
8
  import type { CrossDomainWindowType } from '@krakenjs/cross-domain-utils/src';
9
9
  import { memoize, uniqueID } from '@krakenjs/belter/src';
10
10
  import { getLocale, getEnv, getSDKMeta, getDisableCard, getPayPalDomain, getClientID, getDebug, getCurrency, getIntent,
11
- getCommit, getVault } from '@paypal/sdk-client/src';
11
+ getCommit, getVault, getUserIDToken } from '@paypal/sdk-client/src';
12
12
  import { getRefinedFundingEligibility } from '@paypal/funding-components/src';
13
13
  import { CARD, CURRENCY, INTENT, type FundingEligibilityType } from '@paypal/sdk-constants/src';
14
14
 
@@ -57,7 +57,8 @@ type CardFieldsProps = {|
57
57
  createOrder : () => ZalgoPromise<string> | string,
58
58
  onApprove : ({| returnUrl : string |}, {| redirect : (?CrossDomainWindowType, ?string) => ZalgoPromise<void> |}) => ?ZalgoPromise<void>,
59
59
  onComplete : ({| returnUrl : string |}, {| redirect : (?CrossDomainWindowType, ?string) => ZalgoPromise<void> |}) => ?ZalgoPromise<void>,
60
- onCancel ? : ({| cancelUrl : string |}, {| redirect : (? CrossDomainWindowType, ? string) => ZalgoPromise<void> |}) => ?ZalgoPromise<void>
60
+ onCancel ? : ({| cancelUrl : string |}, {| redirect : (? CrossDomainWindowType, ? string) => ZalgoPromise<void> |}) => ?ZalgoPromise<void>,
61
+ action: Object
61
62
  |};
62
63
 
63
64
  type CardFieldProps = {|
@@ -150,6 +151,17 @@ export const getCardFieldsComponent : () => CardFieldsComponent = memoize(() : C
150
151
  },
151
152
 
152
153
  props: {
154
+ action: {
155
+ type: 'object',
156
+ value: ({props}) => {
157
+ if (props.action) {
158
+ return props.action
159
+ } else {
160
+ return props.parent.props.action
161
+ }
162
+ }
163
+ },
164
+
153
165
  type: {
154
166
  type: 'string',
155
167
  value: () => type,
@@ -316,7 +328,13 @@ export const getCardFieldsComponent : () => CardFieldsComponent = memoize(() : C
316
328
  queryParam: true,
317
329
  required: false,
318
330
  value: ({ props }) => props.parent.props.branded
319
- }
331
+ },
332
+
333
+ userIDToken: {
334
+ type: 'string',
335
+ default: getUserIDToken,
336
+ required: false,
337
+ },
320
338
  }
321
339
  });
322
340
  };
@@ -400,6 +418,10 @@ export const getCardFieldsComponent : () => CardFieldsComponent = memoize(() : C
400
418
  },
401
419
 
402
420
  props: {
421
+ action: {
422
+ type: 'object',
423
+ },
424
+
403
425
  type: {
404
426
  type: 'string',
405
427
  value: () => CARD_FIELD_TYPE.SINGLE,
@@ -541,7 +563,13 @@ export const getCardFieldsComponent : () => CardFieldsComponent = memoize(() : C
541
563
  type: 'boolean',
542
564
  queryParam: true,
543
565
  required: false
544
- }
566
+ },
567
+
568
+ userIDToken: {
569
+ type: 'string',
570
+ default: getUserIDToken,
571
+ required: false,
572
+ },
545
573
  }
546
574
  });
547
575
 
@@ -1,25 +0,0 @@
1
- /* @flow */
2
-
3
- import { createExperiment } from "@paypal/sdk-client/src";
4
- import type { Experiment } from "@krakenjs/belter/src";
5
- import type { ChildType } from "@krakenjs/jsx-pragmatic/src";
6
-
7
- export function getLogoCDNExperiment(): Experiment {
8
- return createExperiment("enable_logo_cdn_experiment", 0);
9
- }
10
-
11
- export function enableLogoCDNExperiment<T>(
12
- logo: (T) => ChildType,
13
- logoOptions: T
14
- ): ChildType {
15
- // enable logo CDN experiment for first render only
16
- if (__WEB__) {
17
- const logoCDNExperiment = getLogoCDNExperiment();
18
- const loadFromCDN = logoCDNExperiment.isEnabled();
19
-
20
- return logo({ ...logoOptions, loadFromCDN });
21
- }
22
-
23
- // continue using inline svg for second render
24
- return logo(logoOptions);
25
- }