@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
|
@@ -1,184 +1,253 @@
|
|
|
1
1
|
/* @flow */
|
|
2
2
|
/** @jsx node */
|
|
3
3
|
|
|
4
|
-
import { node, Fragment } from
|
|
5
|
-
import { CARD, COUNTRY, COMPONENTS, FUNDING } from
|
|
6
|
-
import {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
import {
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
import {
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
4
|
+
import { node, Fragment } from "@krakenjs/jsx-pragmatic/src";
|
|
5
|
+
import { CARD, COUNTRY, COMPONENTS, FUNDING } from "@paypal/sdk-constants/src";
|
|
6
|
+
import {
|
|
7
|
+
GlyphCardExternalImage,
|
|
8
|
+
GlyphCardInlineSVG,
|
|
9
|
+
} from "@paypal/sdk-logos/src";
|
|
10
|
+
|
|
11
|
+
import {
|
|
12
|
+
BUTTON_LAYOUT,
|
|
13
|
+
BUTTON_COLOR,
|
|
14
|
+
DEFAULT,
|
|
15
|
+
BUTTON_FLOW,
|
|
16
|
+
} from "../../constants";
|
|
17
|
+
import {
|
|
18
|
+
DEFAULT_FUNDING_CONFIG,
|
|
19
|
+
type FundingSourceConfig,
|
|
20
|
+
type CardConfig,
|
|
21
|
+
} from "../common";
|
|
22
|
+
import { Text, Space } from "../../ui/text";
|
|
23
|
+
import { isRTLLanguage } from "../../lib";
|
|
24
|
+
import { WalletLabel } from "../paypal/template";
|
|
25
|
+
|
|
26
|
+
import { getVisaConfig } from "./visa";
|
|
27
|
+
import { getMastercardConfig } from "./mastercard";
|
|
28
|
+
import { getAmexConfig } from "./amex";
|
|
29
|
+
import { getDiscoverConfig } from "./discover";
|
|
30
|
+
import { getHiperConfig } from "./hiper";
|
|
31
|
+
import { getEloConfig } from "./elo";
|
|
32
|
+
import { getJCBConfig } from "./jcb";
|
|
33
|
+
|
|
34
|
+
function getVendorConfig(): { [$Values<typeof CARD>]: ?CardConfig } {
|
|
35
|
+
return {
|
|
36
|
+
[CARD.VISA]:
|
|
37
|
+
!__TREE_SHAKE__ ||
|
|
38
|
+
(__FUNDING_ELIGIBILITY__.card &&
|
|
39
|
+
__FUNDING_ELIGIBILITY__.card.vendors &&
|
|
40
|
+
__FUNDING_ELIGIBILITY__.card.vendors.visa &&
|
|
41
|
+
__FUNDING_ELIGIBILITY__.card.vendors.visa.eligible)
|
|
42
|
+
? getVisaConfig()
|
|
43
|
+
: null,
|
|
44
|
+
[CARD.AMEX]:
|
|
45
|
+
!__TREE_SHAKE__ ||
|
|
46
|
+
(__FUNDING_ELIGIBILITY__.card &&
|
|
47
|
+
__FUNDING_ELIGIBILITY__.card.vendors &&
|
|
48
|
+
__FUNDING_ELIGIBILITY__.card.vendors.amex &&
|
|
49
|
+
__FUNDING_ELIGIBILITY__.card.vendors.amex.eligible)
|
|
50
|
+
? getAmexConfig()
|
|
51
|
+
: null,
|
|
52
|
+
[CARD.MASTERCARD]:
|
|
53
|
+
!__TREE_SHAKE__ ||
|
|
54
|
+
(__FUNDING_ELIGIBILITY__.card &&
|
|
55
|
+
__FUNDING_ELIGIBILITY__.card.vendors &&
|
|
56
|
+
__FUNDING_ELIGIBILITY__.card.vendors.mastercard &&
|
|
57
|
+
__FUNDING_ELIGIBILITY__.card.vendors.mastercard.eligible)
|
|
58
|
+
? getMastercardConfig()
|
|
59
|
+
: null,
|
|
60
|
+
[CARD.DISCOVER]:
|
|
61
|
+
!__TREE_SHAKE__ ||
|
|
62
|
+
(__FUNDING_ELIGIBILITY__.card &&
|
|
63
|
+
__FUNDING_ELIGIBILITY__.card.vendors &&
|
|
64
|
+
__FUNDING_ELIGIBILITY__.card.vendors.discover &&
|
|
65
|
+
__FUNDING_ELIGIBILITY__.card.vendors.discover.eligible)
|
|
66
|
+
? getDiscoverConfig()
|
|
67
|
+
: null,
|
|
68
|
+
[CARD.JCB]:
|
|
69
|
+
!__TREE_SHAKE__ ||
|
|
70
|
+
(__FUNDING_ELIGIBILITY__.card &&
|
|
71
|
+
__FUNDING_ELIGIBILITY__.card.vendors &&
|
|
72
|
+
__FUNDING_ELIGIBILITY__.card.vendors.jcb &&
|
|
73
|
+
__FUNDING_ELIGIBILITY__.card.vendors.jcb.eligible)
|
|
74
|
+
? getJCBConfig()
|
|
75
|
+
: null,
|
|
76
|
+
[CARD.ELO]:
|
|
77
|
+
!__TREE_SHAKE__ ||
|
|
78
|
+
(__FUNDING_ELIGIBILITY__.card &&
|
|
79
|
+
__FUNDING_ELIGIBILITY__.card.vendors &&
|
|
80
|
+
__FUNDING_ELIGIBILITY__.card.vendors.elo &&
|
|
81
|
+
__FUNDING_ELIGIBILITY__.card.vendors.elo.eligible)
|
|
82
|
+
? getEloConfig()
|
|
83
|
+
: null,
|
|
84
|
+
[CARD.HIPER]:
|
|
85
|
+
!__TREE_SHAKE__ ||
|
|
86
|
+
(__FUNDING_ELIGIBILITY__.card &&
|
|
87
|
+
__FUNDING_ELIGIBILITY__.card.vendors &&
|
|
88
|
+
__FUNDING_ELIGIBILITY__.card.vendors.hiper &&
|
|
89
|
+
__FUNDING_ELIGIBILITY__.card.vendors.hiper.eligible)
|
|
90
|
+
? getHiperConfig()
|
|
91
|
+
: null,
|
|
92
|
+
};
|
|
33
93
|
}
|
|
34
94
|
|
|
35
|
-
export function getCardConfig()
|
|
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
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
<Space />
|
|
146
|
-
</Fragment>
|
|
147
|
-
);
|
|
148
|
-
}
|
|
149
|
-
const { lang } = locale;
|
|
150
|
-
const isRTL = isRTLLanguage(lang);
|
|
151
|
-
return (
|
|
152
|
-
<Fragment>
|
|
153
|
-
{ (isRTL && !__WEB__ && content) ? (
|
|
154
|
-
<Fragment>
|
|
155
|
-
<Text animate optional>{ content.payWithDebitOrCreditCard }</Text>
|
|
156
|
-
<Space />
|
|
157
|
-
</Fragment>
|
|
158
|
-
) : null }
|
|
159
|
-
{ logo }
|
|
160
|
-
{(!isRTL && !__WEB__ && content) ? (
|
|
161
|
-
<Fragment>
|
|
162
|
-
<Space />
|
|
163
|
-
<Text animate optional>{ content.payWithDebitOrCreditCard }</Text>
|
|
164
|
-
</Fragment>
|
|
165
|
-
) : null }
|
|
166
|
-
</Fragment>
|
|
167
|
-
);
|
|
168
|
-
},
|
|
169
|
-
|
|
170
|
-
WalletLabel,
|
|
171
|
-
|
|
172
|
-
showWalletMenu: ({ instrument, userIDToken }) => {
|
|
173
|
-
if (instrument.branded) {
|
|
174
|
-
return false;
|
|
175
|
-
} else {
|
|
176
|
-
if (!instrument.tokenID?.match(/-/) && userIDToken) {
|
|
177
|
-
return false
|
|
178
|
-
}
|
|
179
|
-
|
|
180
|
-
return true;
|
|
181
|
-
}
|
|
95
|
+
export function getCardConfig(): FundingSourceConfig {
|
|
96
|
+
const vendors = getVendorConfig();
|
|
97
|
+
|
|
98
|
+
const maxCardForCountry = {
|
|
99
|
+
[COUNTRY.BR]: 5,
|
|
100
|
+
};
|
|
101
|
+
|
|
102
|
+
return {
|
|
103
|
+
...DEFAULT_FUNDING_CONFIG,
|
|
104
|
+
|
|
105
|
+
eligible: ({ components, fundingSource, fundingEligibility, wallet }) => {
|
|
106
|
+
const cardEligibility = fundingEligibility.card;
|
|
107
|
+
|
|
108
|
+
const hostedFieldsRequested = Boolean(
|
|
109
|
+
components.indexOf(COMPONENTS.HOSTED_FIELDS) !== -1
|
|
110
|
+
);
|
|
111
|
+
const cardEligible = Boolean(cardEligibility && cardEligibility.eligible);
|
|
112
|
+
const cardBranded = Boolean(cardEligibility && cardEligibility.branded);
|
|
113
|
+
const cardVaulted = Boolean(
|
|
114
|
+
wallet &&
|
|
115
|
+
wallet.card &&
|
|
116
|
+
wallet.card.instruments &&
|
|
117
|
+
wallet.card.instruments.length
|
|
118
|
+
);
|
|
119
|
+
|
|
120
|
+
// If card is not eligible, never show card buttons
|
|
121
|
+
if (!cardEligible) {
|
|
122
|
+
return false;
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
// If card is branded, always show card buttons
|
|
126
|
+
if (cardBranded) {
|
|
127
|
+
return true;
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
// If there's a vaulted card, always show card button
|
|
131
|
+
if (cardVaulted) {
|
|
132
|
+
return true;
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
// If standalone card is selected, always show card button
|
|
136
|
+
if (fundingSource === FUNDING.CARD) {
|
|
137
|
+
return true;
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
// If hosted fields is requested, do not show card buttons
|
|
141
|
+
if (hostedFieldsRequested) {
|
|
142
|
+
return false;
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
// Otherwise default to show card buttons
|
|
146
|
+
return true;
|
|
147
|
+
},
|
|
148
|
+
|
|
149
|
+
flows: [
|
|
150
|
+
BUTTON_FLOW.PURCHASE,
|
|
151
|
+
BUTTON_FLOW.BILLING_SETUP,
|
|
152
|
+
BUTTON_FLOW.SUBSCRIPTION_SETUP,
|
|
153
|
+
],
|
|
154
|
+
|
|
155
|
+
layouts: [BUTTON_LAYOUT.VERTICAL],
|
|
156
|
+
|
|
157
|
+
maxCards: maxCardForCountry,
|
|
158
|
+
|
|
159
|
+
vendors,
|
|
160
|
+
|
|
161
|
+
colors: [BUTTON_COLOR.BLACK, BUTTON_COLOR.WHITE],
|
|
162
|
+
|
|
163
|
+
secondaryColors: {
|
|
164
|
+
...DEFAULT_FUNDING_CONFIG.secondaryColors,
|
|
165
|
+
[DEFAULT]: BUTTON_COLOR.BLACK,
|
|
166
|
+
},
|
|
167
|
+
|
|
168
|
+
logoColors: {
|
|
169
|
+
[BUTTON_COLOR.WHITE]: BUTTON_COLOR.BLACK,
|
|
170
|
+
[DEFAULT]: BUTTON_COLOR.WHITE,
|
|
171
|
+
},
|
|
172
|
+
|
|
173
|
+
labelText: ({ content }) => {
|
|
174
|
+
if (!__WEB__ && content) {
|
|
175
|
+
return content.payWithDebitOrCreditCard;
|
|
176
|
+
}
|
|
177
|
+
return FUNDING.CARD;
|
|
178
|
+
},
|
|
179
|
+
|
|
180
|
+
Logo: ({ logoColor }) => {
|
|
181
|
+
return __WEB__ ? (
|
|
182
|
+
<GlyphCardExternalImage logoColor={logoColor} />
|
|
183
|
+
) : (
|
|
184
|
+
<GlyphCardInlineSVG logoColor={logoColor} />
|
|
185
|
+
);
|
|
186
|
+
},
|
|
187
|
+
|
|
188
|
+
Label: ({ logo, locale, content, custom }) => {
|
|
189
|
+
if (custom && custom.label && custom.label.length) {
|
|
190
|
+
const validLabels = {
|
|
191
|
+
buy: "Buy",
|
|
192
|
+
checkout: "Checkout",
|
|
193
|
+
pay: "Pay",
|
|
194
|
+
"buy now": "Buy Now",
|
|
195
|
+
"pay now": "Pay Now",
|
|
196
|
+
"checkout now": "Checkout Now",
|
|
197
|
+
"proceed to checkout": "Proceed to checkout",
|
|
198
|
+
};
|
|
199
|
+
|
|
200
|
+
let label = validLabels.checkout;
|
|
201
|
+
|
|
202
|
+
const lowerCaseLabel = custom.label.toLowerCase();
|
|
203
|
+
if (validLabels[lowerCaseLabel]) {
|
|
204
|
+
label = validLabels[lowerCaseLabel];
|
|
182
205
|
}
|
|
183
|
-
|
|
206
|
+
|
|
207
|
+
return (
|
|
208
|
+
<Fragment>
|
|
209
|
+
<Text>{label}</Text>
|
|
210
|
+
<Space />
|
|
211
|
+
</Fragment>
|
|
212
|
+
);
|
|
213
|
+
}
|
|
214
|
+
const { lang } = locale;
|
|
215
|
+
const isRTL = isRTLLanguage(lang);
|
|
216
|
+
return (
|
|
217
|
+
<Fragment>
|
|
218
|
+
{isRTL && !__WEB__ && content ? (
|
|
219
|
+
<Fragment>
|
|
220
|
+
<Text animate optional>
|
|
221
|
+
{content.payWithDebitOrCreditCard}
|
|
222
|
+
</Text>
|
|
223
|
+
<Space />
|
|
224
|
+
</Fragment>
|
|
225
|
+
) : null}
|
|
226
|
+
{logo}
|
|
227
|
+
{!isRTL && !__WEB__ && content ? (
|
|
228
|
+
<Fragment>
|
|
229
|
+
<Space />
|
|
230
|
+
<Text animate optional>
|
|
231
|
+
{content.payWithDebitOrCreditCard}
|
|
232
|
+
</Text>
|
|
233
|
+
</Fragment>
|
|
234
|
+
) : null}
|
|
235
|
+
</Fragment>
|
|
236
|
+
);
|
|
237
|
+
},
|
|
238
|
+
|
|
239
|
+
WalletLabel,
|
|
240
|
+
|
|
241
|
+
showWalletMenu: ({ instrument, userIDToken }) => {
|
|
242
|
+
if (instrument.branded) {
|
|
243
|
+
return false;
|
|
244
|
+
} else {
|
|
245
|
+
if (!instrument.tokenID?.match(/-/) && userIDToken) {
|
|
246
|
+
return false;
|
|
247
|
+
}
|
|
248
|
+
|
|
249
|
+
return true;
|
|
250
|
+
}
|
|
251
|
+
},
|
|
252
|
+
};
|
|
184
253
|
}
|
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
/* @flow */
|
|
2
2
|
|
|
3
|
-
import {
|
|
3
|
+
import {
|
|
4
|
+
DiscoverLogoInlineSVG,
|
|
5
|
+
DiscoverLogoExternalImage,
|
|
6
|
+
} from "@paypal/sdk-logos/src";
|
|
4
7
|
|
|
5
|
-
import type { CardConfig } from
|
|
6
|
-
import { enableLogoCDNExperiment } from '../../../lib/getLogoCDNExperiment';
|
|
8
|
+
import type { CardConfig } from "../../common";
|
|
7
9
|
|
|
8
|
-
export function getDiscoverConfig()
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
10
|
+
export function getDiscoverConfig(): CardConfig {
|
|
11
|
+
return {
|
|
12
|
+
Label: __WEB__ ? DiscoverLogoExternalImage : DiscoverLogoInlineSVG,
|
|
13
|
+
};
|
|
12
14
|
}
|
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
/* @flow */
|
|
2
2
|
|
|
3
|
-
import {
|
|
3
|
+
import { EloLogoInlineSVG, EloLogoExternalImage } from "@paypal/sdk-logos/src";
|
|
4
4
|
|
|
5
|
-
import type { CardConfig } from
|
|
6
|
-
import { enableLogoCDNExperiment } from '../../../lib/getLogoCDNExperiment';
|
|
5
|
+
import type { CardConfig } from "../../common";
|
|
7
6
|
|
|
8
|
-
export function getEloConfig()
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
7
|
+
export function getEloConfig(): CardConfig {
|
|
8
|
+
return {
|
|
9
|
+
Label: __WEB__ ? EloLogoExternalImage : EloLogoInlineSVG,
|
|
10
|
+
};
|
|
12
11
|
}
|
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
/* @flow */
|
|
2
2
|
|
|
3
|
-
import {
|
|
3
|
+
import {
|
|
4
|
+
HiperLogoInlineSVG,
|
|
5
|
+
HiperLogoExternalImage,
|
|
6
|
+
} from "@paypal/sdk-logos/src";
|
|
4
7
|
|
|
5
|
-
import type { CardConfig } from
|
|
6
|
-
import { enableLogoCDNExperiment } from '../../../lib/getLogoCDNExperiment';
|
|
8
|
+
import type { CardConfig } from "../../common";
|
|
7
9
|
|
|
8
|
-
export function getHiperConfig()
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
10
|
+
export function getHiperConfig(): CardConfig {
|
|
11
|
+
return {
|
|
12
|
+
Label: __WEB__ ? HiperLogoExternalImage : HiperLogoInlineSVG,
|
|
13
|
+
};
|
|
12
14
|
}
|
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
/* @flow */
|
|
2
2
|
|
|
3
|
-
import {
|
|
3
|
+
import { JcbLogoInlineSVG, JcbLogoExternalImage } from "@paypal/sdk-logos/src";
|
|
4
4
|
|
|
5
|
-
import type { CardConfig } from
|
|
6
|
-
import { enableLogoCDNExperiment } from '../../../lib/getLogoCDNExperiment';
|
|
5
|
+
import type { CardConfig } from "../../common";
|
|
7
6
|
|
|
8
|
-
export function getJCBConfig()
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
7
|
+
export function getJCBConfig(): CardConfig {
|
|
8
|
+
return {
|
|
9
|
+
Label: __WEB__ ? JcbLogoExternalImage : JcbLogoInlineSVG,
|
|
10
|
+
};
|
|
12
11
|
}
|
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
/* @flow */
|
|
2
2
|
|
|
3
|
-
import {
|
|
3
|
+
import {
|
|
4
|
+
MastercardLogoInlineSVG,
|
|
5
|
+
MastercardLogoExternalImage,
|
|
6
|
+
} from "@paypal/sdk-logos/src";
|
|
4
7
|
|
|
5
|
-
import type { CardConfig } from
|
|
6
|
-
import { enableLogoCDNExperiment } from '../../../lib/getLogoCDNExperiment';
|
|
8
|
+
import type { CardConfig } from "../../common";
|
|
7
9
|
|
|
8
|
-
export function getMastercardConfig()
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
10
|
+
export function getMastercardConfig(): CardConfig {
|
|
11
|
+
return {
|
|
12
|
+
Label: __WEB__ ? MastercardLogoExternalImage : MastercardLogoInlineSVG,
|
|
13
|
+
};
|
|
12
14
|
}
|
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
/* @flow */
|
|
2
2
|
|
|
3
|
-
import {
|
|
3
|
+
import {
|
|
4
|
+
VisaLogoInlineSVG,
|
|
5
|
+
VisaLogoExternalImage,
|
|
6
|
+
} from "@paypal/sdk-logos/src";
|
|
4
7
|
|
|
5
|
-
import type { CardConfig } from
|
|
6
|
-
import { enableLogoCDNExperiment } from '../../../lib/getLogoCDNExperiment';
|
|
8
|
+
import type { CardConfig } from "../../common";
|
|
7
9
|
|
|
8
|
-
export function getVisaConfig()
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
10
|
+
export function getVisaConfig(): CardConfig {
|
|
11
|
+
return {
|
|
12
|
+
Label: __WEB__ ? VisaLogoExternalImage : VisaLogoInlineSVG,
|
|
13
|
+
};
|
|
12
14
|
}
|