Skip to content

Commit a7f7b54

Browse files
authored
feat: support US onboarding modals (#1185)
1 parent 4e9b2f3 commit a7f7b54

File tree

7 files changed

+219
-5
lines changed

7 files changed

+219
-5
lines changed
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
{
2+
"meta": {
3+
"product": "PAY_LATER_LONG_TERM",
4+
"useV5Design": "true",
5+
"v5.1": "true",
6+
"offerCountry": "US",
7+
"variables": {
8+
"transaction_amount": "${eval(transaction_amount ? transaction_amount : '-')}",
9+
"qualifying_offer": "${eval(CREDIT_OFFERS_DS.qualifying_offer ? CREDIT_OFFERS_DS.qualifying_offer : 'false')}",
10+
"financing_code": "${CREDIT_OFFERS_DS.financing_code}",
11+
"formattedPeriodicPayment": "${CREDIT_OFFERS_DS.formattedPeriodicPayment}",
12+
"total_payments": "${CREDIT_OFFERS_DS.total_payments}",
13+
"formattedMinAmount": "${CREDIT_OFFERS_DS.formattedMinAmount}",
14+
"formattedMaxAmount": "${CREDIT_OFFERS_DS.formattedMaxAmount}",
15+
"formattedTotalCost": "${CREDIT_OFFERS_DS.formattedTotalCost}",
16+
"minAmount": "${CREDIT_OFFERS_DS.minAmount}",
17+
"maxAmount": "${CREDIT_OFFERS_DS.maxAmount}",
18+
"apr": "${CREDIT_OFFERS_DS.apr}",
19+
"nominal_rate": "${CREDIT_OFFERS_DS.nominal_rate}"
20+
}
21+
},
22+
"content": {
23+
"headline": "Pay Monthly",
24+
"subheadline": "Get more time to pay, with no down payment or late fees.",
25+
"calculator": {
26+
"title": "How much is your purchase?",
27+
"inputLabel": "Purchase amount",
28+
"inputPlaceholder": "Enter amount",
29+
"genericError": "Something went wrong. Please try again later."
30+
},
31+
"genericDisclaimer": "Terms vary based on purchase amount and your credit.",
32+
"instructions": [
33+
"Create your PayPal account, then choose <strong>Pay Monthly</strong>.",
34+
"Get a decision in seconds and complete your purchase.",
35+
"Use autopay for your payments. It's easy!"
36+
],
37+
"disclosure": [
38+
"Pay Monthly is subject to consumer credit approval and eligibility. Payments may change based on shipping, taxes, updates to your purchase, or missed payments. Availability depends on the merchant and may not be available for subscriptions or recurring payments. Pay Monthly is currently not available to residents of <span aria-hidden='true'>AK, HI, or NV</span><span class='sr-only'>Alaska, Hawaii, or Nevada</span>. You must be 18 years old or older to apply. Missed payments may have an impact on your credit score. The lender for Pay Monthly is WebBank. PayPal, Inc. (NMLS #910457): <span aria-hidden='true'>CT</span><span class='sr-only'>Connecticut</span> Small Loan Licensee. <span aria-hidden='true'>RI</span><span class='sr-only'>Rhode Island</span> Loan Broker Licensee. <span aria-hidden='true'>VT</span><span class='sr-only'>Vermont</span> Loan Solicitation Licensee. <span aria-hidden='true'>VT</span><span class='sr-only'>Vermont</span> residents:",
39+
["Find more disclosures ", "https://www.paypal.com/us/digital-wallet/ways-to-pay/buy-now-pay-later"],
40+
"by going to PayPal's page on Pay Later."
41+
],
42+
"linkToProductList": "See other ways to pay over time"
43+
}
44+
}
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
{
2+
"meta": {
3+
"product": "PAY_LATER_SHORT_TERM",
4+
"useV5Design": "true",
5+
"v5.1": "true",
6+
"periodicPayment": "{formattedPeriodicPayment}",
7+
"minAmount": "{minAmount}",
8+
"maxAmount": "{maxAmount}",
9+
"qualifying": "{qualifying_offer}",
10+
"amount": "{transaction_amount}",
11+
"apr": "{apr}",
12+
"variables": {
13+
"transaction_amount": "${eval(transaction_amount ? transaction_amount : '-')}",
14+
"qualifying_offer": "${eval(CREDIT_OFFERS_DS.qualifying_offer ? CREDIT_OFFERS_DS.qualifying_offer : 'false')}",
15+
"financing_code": "${CREDIT_OFFERS_DS.financing_code}",
16+
"formattedPeriodicPayment": "${CREDIT_OFFERS_DS.formattedPeriodicPayment}",
17+
"total_payments": "${CREDIT_OFFERS_DS.total_payments}",
18+
"formattedMinAmount": "${CREDIT_OFFERS_DS.formattedMinAmount}",
19+
"formattedMaxAmount": "${CREDIT_OFFERS_DS.formattedMaxAmount}",
20+
"formattedTotalCost": "${CREDIT_OFFERS_DS.formattedTotalCost}",
21+
"minAmount": "${CREDIT_OFFERS_DS.minAmount}",
22+
"maxAmount": "${CREDIT_OFFERS_DS.maxAmount}",
23+
"apr": "${CREDIT_OFFERS_DS.apr}",
24+
"nominal_rate": "${CREDIT_OFFERS_DS.nominal_rate}"
25+
}
26+
},
27+
"content": {
28+
"headline": "Pay in 4 interest-free payments",
29+
"subheadline": "No impact on credit score and no late fees. Available for purchases of {formattedMinAmount} to {formattedMaxAmount}.",
30+
"qualifyingSubheadline": "Split your purchase of {formattedTotalCost} into {total_payments} with no impact on credit score and no late fees.",
31+
"donutTimestamps": ["Today", "2 weeks", "4 weeks", "6 weeks"],
32+
"instructions": [
33+
"Create your PayPal account, then choose <strong>Pay in 4</strong>. ",
34+
"Complete your purchase with a 25% down payment.",
35+
"Use autopay for the rest of your payments. It's easy!"
36+
],
37+
"disclosure": [
38+
"Pay in 4 is available to consumers upon approval for purchases of {formattedMinAmount} to {formattedMaxAmount}. Pay in 4 is currently not available to residents of <span aria-hidden='true'>MO, NV, or NM</span><span class='sr-only'>Missouri, Nevada, or New Mexico</span>. Offer availability depends on the merchant and also may not be available for certain recurring, subscription services.​ When applying, a soft credit check may be needed, but will not affect your credit score.​ You must be of legal age in your U.S. state of residence to use Pay in 4.​ PayPal, Inc.: Loans to <span aria-hidden='true'>CA</span><span class='sr-only'>California</span> residents are made or arranged pursuant to <span aria-hidden='true'>CA</span><span class='sr-only'>California</span> Financing Law License.​ <span aria-hidden='true'>GA</span><span class='sr-only'>Georgia</span> Installment Lender Licensee, NMLS #910457.​ <span aria-hidden='true'>RI</span><span class='sr-only'>Rhode Island</span> Small Loan Lender Licensee."
39+
],
40+
"linkToProductList": "See other ways to pay later"
41+
}
42+
}

src/components/modal/v2/parts/BodyContent.jsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@ const BodyContent = () => {
6363

6464
const useV4Design = productMeta?.useV4Design === 'true';
6565
const useV5Design = productMeta?.useV5Design === 'true';
66+
const use5Dot1Design = productMeta?.['v5.1'];
6667
const useNewCheckoutDesign = features?.includes('new-checkout-design') ? 'true' : 'false';
6768

6869
// add v4Design or v5Design class to root html to update lander specific styles to v4 or v5 respectively
@@ -154,6 +155,7 @@ const BodyContent = () => {
154155
viewName={viewName}
155156
useV4Design={useV4Design}
156157
useV5Design={useV5Design}
158+
use5Dot1Design={use5Dot1Design}
157159
/>
158160
)}
159161
<div

src/components/modal/v2/parts/Header.jsx

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@ const Header = ({
1212
closeButtonLabel = 'Close',
1313
viewName,
1414
useV4Design,
15-
useV5Design
15+
useV5Design,
16+
use5Dot1Design
1617
}) => {
1718
const { country } = useServerData();
1819
const [, handleClose] = useTransitionState();
@@ -61,14 +62,14 @@ const Header = ({
6162
// We don't need to render an 'x' button if the target is a lander since you will close via a
6263
// merchant-provided close button from their own iframe, or by closing the window in the case of a webpage.
6364
<button
64-
className="close"
65+
className={`close ${useV5Design ? 'v5Design' : ''}`}
6566
aria-label={closeButtonLabel}
6667
type="button"
6768
id="close-btn"
6869
aria-keyshortcuts="escape"
6970
onClick={() => handleClose('Close Button')}
7071
>
71-
<Icon name="close" />
72+
<Icon name={useV5Design ? 'close_v5' : 'close'} />
7273
</button>
7374
)}
7475
<div className="header__fixed-wrapper header__fixed-wrapper--front">
@@ -90,7 +91,9 @@ const Header = ({
9091
<h2
9192
// id used for aria-labelleby on modal container element
9293
id="header__headline"
93-
className={`headline-${countryClassName} ${useV5Design ? 'v5Design' : ''}`}
94+
className={`headline-${countryClassName} ${useV5Design ? 'v5Design' : ''} ${
95+
use5Dot1Design ? 'headline-new' : ''
96+
}`}
9497
// eslint-disable-next-line react/no-danger
9598
dangerouslySetInnerHTML={{ __html: headline }}
9699
/>

src/components/modal/v2/parts/Icon.jsx

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -214,6 +214,17 @@ const Icon = ({ name = '', color, content }) => {
214214
/>
215215
</svg>
216216
);
217+
case 'close_v5':
218+
return (
219+
<svg width="18" height="18" viewBox="0 0 18 18" fill="none" xmlns="http://www.w3.org/2000/svg">
220+
<path
221+
fill-rule="evenodd"
222+
clip-rule="evenodd"
223+
d="M14.7674 13.7707C14.729 13.6782 14.6728 13.5941 14.602 13.5232L10.0782 9.00012L14.602 4.47701C14.7451 4.33395 14.8254 4.13993 14.8254 3.93762C14.8254 3.73531 14.7451 3.54128 14.602 3.39823C14.459 3.25517 14.2649 3.1748 14.0626 3.1748C13.8603 3.1748 13.6663 3.25518 13.5232 3.39824L9.00012 7.92202L4.47701 3.39823C4.33395 3.25517 4.13993 3.1748 3.93762 3.1748C3.73531 3.1748 3.54128 3.25517 3.39823 3.39823C3.25517 3.54128 3.1748 3.73531 3.1748 3.93762C3.1748 4.13993 3.25518 4.33396 3.39824 4.47702L7.92202 9.00012L3.39823 13.5232C3.25517 13.6663 3.1748 13.8603 3.1748 14.0626C3.1748 14.2649 3.25517 14.459 3.39823 14.602C3.54128 14.7451 3.73531 14.8254 3.93762 14.8254C4.13993 14.8254 4.33396 14.7451 4.47702 14.602L9.00012 10.0782L13.5232 14.602C13.5941 14.6728 13.6782 14.729 13.7707 14.7674C13.8632 14.8057 13.9624 14.8254 14.0626 14.8254C14.1628 14.8254 14.262 14.8057 14.3545 14.7674C14.4471 14.729 14.5312 14.6728 14.602 14.602C14.6728 14.5312 14.729 14.4471 14.7674 14.3545C14.8057 14.262 14.8254 14.1628 14.8254 14.0626C14.8254 13.9624 14.8057 13.8632 14.7674 13.7707Z"
224+
fill="#696969"
225+
/>
226+
</svg>
227+
);
217228
case 'chevron-left':
218229
return (
219230
<svg width="24" height="24" fill="none" xmlns="http://www.w3.org/2000/svg">

src/components/modal/v2/styles/components/_header.scss

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -187,6 +187,16 @@
187187
stroke-width: 2.2;
188188
}
189189
}
190+
191+
&.v5Design {
192+
height: 50px;
193+
width: 50px;
194+
195+
svg {
196+
height: 30px;
197+
width: 30px;
198+
}
199+
}
190200
}
191201

192202
&.checkout {
@@ -323,7 +333,8 @@
323333
}
324334

325335
&.v5Design {
326-
&.headline-gb {
336+
&.headline-gb,
337+
&.headline-new {
327338
font-family: $paypal-pro;
328339
font-weight: bold;
329340
font-size: 32px;

utils/devServerProxy/config/US/index.js

Lines changed: 101 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -244,6 +244,43 @@ export default {
244244
]
245245
}
246246
},
247+
DEV_US_SHORT_TERM_ONBOARDING: {
248+
country: 'US',
249+
modalViews: [
250+
{
251+
template: 'v2_short_term-onboarding.json',
252+
product: OFFER.PAY_LATER_SHORT_TERM
253+
}
254+
],
255+
messageThresholds: [
256+
{
257+
amount: 0,
258+
template: 'short_term_nq.json',
259+
product: OFFER.PAY_LATER_SHORT_TERM
260+
},
261+
{
262+
amount: 30,
263+
template: 'short_term_q.json',
264+
product: OFFER.PAY_LATER_SHORT_TERM
265+
},
266+
{
267+
amount: 1500.01,
268+
template: 'short_term_nq.json',
269+
product: OFFER.PAY_LATER_SHORT_TERM
270+
}
271+
],
272+
offers: {
273+
[OFFER.PAY_LATER_SHORT_TERM]: [
274+
{
275+
totalPayments: 4,
276+
apr: 0,
277+
nominalRate: 0,
278+
minAmount: 30,
279+
maxAmount: 1500
280+
}
281+
]
282+
}
283+
},
247284
DEV_US_NO_INTEREST: {
248285
country: 'US',
249286
modalViews: [
@@ -522,6 +559,70 @@ export default {
522559
]
523560
}
524561
},
562+
DEV_US_LONG_TERM_ONBOARDING: {
563+
country: 'US',
564+
modalViews: [
565+
{
566+
template: 'v2_long_term-onboarding.json',
567+
offersTemplate: 'v2_long_term.json',
568+
product: OFFER.PAY_LATER_LONG_TERM
569+
}
570+
],
571+
messageThresholds: [
572+
{
573+
amount: 0,
574+
template: 'generic.json',
575+
product: 'PRODUCT_LIST'
576+
},
577+
{
578+
amount: 0.01,
579+
template: 'long_term_nq_eqz.json',
580+
product: OFFER.PAY_LATER_LONG_TERM
581+
},
582+
{
583+
amount: 199,
584+
template: 'long_term_single_eqz.json',
585+
product: OFFER.PAY_LATER_LONG_TERM
586+
},
587+
{
588+
amount: 10000.01,
589+
template: 'long_term_nq_eqz.json',
590+
product: OFFER.PAY_LATER_LONG_TERM
591+
}
592+
],
593+
offers: {
594+
[OFFER.PAY_LATER_LONG_TERM]: [
595+
{
596+
totalPayments: 6,
597+
apr: 0,
598+
nominalRate: 0,
599+
minAmount: 199,
600+
maxAmount: 2999.99
601+
},
602+
{
603+
totalPayments: 12,
604+
apr: 0,
605+
nominalRate: 0,
606+
minAmount: 199,
607+
maxAmount: 20000
608+
},
609+
{
610+
totalPayments: 24,
611+
apr: 0,
612+
nominalRate: 0,
613+
minAmount: 500,
614+
maxAmount: 20000
615+
},
616+
{
617+
totalPayments: 36,
618+
apr: 0,
619+
nominalRate: 0,
620+
minAmount: 3000,
621+
maxAmount: 20000
622+
}
623+
]
624+
}
625+
},
525626
DEV_US_LONG_TERM_DF: {
526627
country: 'US',
527628
modalViews: [

0 commit comments

Comments
 (0)