Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: 5.1 modal rebrand #1186

Merged
merged 5 commits into from
Mar 31, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion content/modals/AU/short_term.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@
"qualifying": "{qualifying_offer}",
"amount": "{transaction_amount}",
"apr": "{apr}",
"useV5Design": "false",
"useV5Design": "true",
"v5.1": "true",
"variables": {
"transaction_amount": "${eval(transaction_amount ? transaction_amount : '-')}",
"qualifying_offer": "${eval(CREDIT_OFFERS_DS.qualifying_offer ? CREDIT_OFFERS_DS.qualifying_offer : 'false')}",
Expand Down
3 changes: 2 additions & 1 deletion content/modals/DE/long_term.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
"meta": {
"product": "PAY_LATER_LONG_TERM",
"offerCountry": "DE",
"useV5Design": "false",
"useV5Design": "true",
"v5.1": "true",
"variables": {
"transaction_amount": "${eval(transaction_amount ? transaction_amount : '-')}",
"qualifying_offer": "${eval(CREDIT_OFFERS_DS.qualifying_offer ? CREDIT_OFFERS_DS.qualifying_offer : 'false')}",
Expand Down
3 changes: 2 additions & 1 deletion content/modals/DE/long_term_en.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
"product": "PAY_LATER_LONG_TERM",
"offerCountry": "DE",
"language": "en-DE",
"useV5Design": "false",
"useV5Design": "true",
"v5.1": "true",
"variables": {
"transaction_amount": "${eval(transaction_amount ? transaction_amount : '-')}",
"qualifying_offer": "${eval(CREDIT_OFFERS_DS.qualifying_offer ? CREDIT_OFFERS_DS.qualifying_offer : 'false')}",
Expand Down
3 changes: 2 additions & 1 deletion content/modals/DE/pay_in_1.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
{
"meta": {
"offerCountry": "DE",
"useV5Design": "false",
"useV5Design": "true",
"v5.1": "true",
"periodicPayment": "{formattedPeriodicPayment}",
"product": "PAY_LATER_PAY_IN_1",
"minAmount": "{minAmount}",
Expand Down
3 changes: 2 additions & 1 deletion content/modals/DE/pay_in_1_en.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
"meta": {
"offerCountry": "DE",
"language": "en-DE",
"useV5Design": "false",
"useV5Design": "true",
"v5.1": "true",
"periodicPayment": "{formattedPeriodicPayment}",
"product": "PAY_LATER_PAY_IN_1",
"minAmount": "{minAmount}",
Expand Down
3 changes: 2 additions & 1 deletion content/modals/DE/product_list.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
{
"meta": {
"product": "PRODUCT_LIST",
"useV5Design": "false"
"useV5Design": "true",
"v5.1": "true"
},
"content": {
"headline": "<span aria-hidden='true'>Jetzt kaufen, <br/>später bezahlen</span><span class='sr-only'>Jetzt kaufen, später bezahlen</span>",
Expand Down
3 changes: 2 additions & 1 deletion content/modals/ES/short_term.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@
"qualifying": "{qualifying_offer}",
"amount": "{transaction_amount}",
"apr": "{apr}",
"useV5Design": "false",
"useV5Design": "true",
"v5.1": "true",
"variables": {
"transaction_amount": "${eval(transaction_amount ? transaction_amount : '-')}",
"qualifying_offer": "${eval(CREDIT_OFFERS_DS.qualifying_offer ? CREDIT_OFFERS_DS.qualifying_offer : 'false')}",
Expand Down
3 changes: 2 additions & 1 deletion content/modals/ES/short_term_en.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@
"qualifying": "{qualifying_offer}",
"amount": "{transaction_amount}",
"apr": "{apr}",
"useV5Design": "false",
"useV5Design": "true",
"v5.1": "true",
"variables": {
"transaction_amount": "${eval(transaction_amount ? transaction_amount : '-')}",
"qualifying_offer": "${eval(CREDIT_OFFERS_DS.qualifying_offer ? CREDIT_OFFERS_DS.qualifying_offer : 'false')}",
Expand Down
3 changes: 2 additions & 1 deletion content/modals/FR/short_term.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@
"qualifying": "{qualifying_offer}",
"amount": "{transaction_amount}",
"apr": "{apr}",
"useV5Design": "false",
"useV5Design": "true",
"v5.1": "true",
"variables": {
"transaction_amount": "${eval(transaction_amount ? transaction_amount : '-')}",
"qualifying_offer": "${eval(CREDIT_OFFERS_DS.qualifying_offer ? CREDIT_OFFERS_DS.qualifying_offer : 'false')}",
Expand Down
3 changes: 2 additions & 1 deletion content/modals/FR/short_term_en.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@
"qualifying": "{qualifying_offer}",
"amount": "{transaction_amount}",
"apr": "{apr}",
"useV5Design": "false",
"useV5Design": "true",
"v5.1": "true",
"variables": {
"transaction_amount": "${eval(transaction_amount ? transaction_amount : '-')}",
"qualifying_offer": "${eval(CREDIT_OFFERS_DS.qualifying_offer ? CREDIT_OFFERS_DS.qualifying_offer : 'false')}",
Expand Down
3 changes: 2 additions & 1 deletion content/modals/GB/short_term.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@
"maxAmount": "{maxAmount}",
"qualifying": "{qualifying_offer}",
"amount": "{transaction_amount}",
"useV5Design": "false",
"useV5Design": "true",
"v5.1": "true",
"apr": "{apr}",
"variables": {
"transaction_amount": "${eval(transaction_amount ? transaction_amount : '-')}",
Expand Down
3 changes: 2 additions & 1 deletion content/modals/IT/short_term.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@
"offerCountry": "IT",
"creditProductIdentifier": "{credit_product_identifier}",
"creditType": "{credit_type}",
"useV5Design": "false",
"useV5Design": "true",
"v5.1": "true",
"variables": {
"transaction_amount": "${eval(transaction_amount ? transaction_amount : '-')}",
"qualifying_offer": "${eval(CREDIT_OFFERS_DS.qualifying_offer ? CREDIT_OFFERS_DS.qualifying_offer : 'false')}",
Expand Down
3 changes: 2 additions & 1 deletion content/modals/IT/short_term_en.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@
"offerCountry": "IT",
"creditProductIdentifier": "{credit_product_identifier}",
"creditType": "{credit_type}",
"useV5Design": "false",
"useV5Design": "true",
"v5.1": "true",
"variables": {
"transaction_amount": "${eval(transaction_amount ? transaction_amount : '-')}",
"qualifying_offer": "${eval(CREDIT_OFFERS_DS.qualifying_offer ? CREDIT_OFFERS_DS.qualifying_offer : 'false')}",
Expand Down
3 changes: 2 additions & 1 deletion content/modals/US/PL2GO/pl2go_long_term.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
"meta": {
"product": "PAY_LATER_LONG_TERM",
"offerCountry": "US",
"useV5Design": "false",
"useV5Design": "true",
"v5.1": "true",
"variables": {
"transaction_amount": "${eval(transaction_amount ? transaction_amount : '-')}",
"qualifying_offer": "${eval(CREDIT_OFFERS_DS.qualifying_offer ? CREDIT_OFFERS_DS.qualifying_offer : 'false')}",
Expand Down
3 changes: 2 additions & 1 deletion content/modals/US/PL2GO/pl2go_short_term.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@
"qualifying": "{qualifying_offer}",
"amount": "{transaction_amount}",
"apr": "{apr}",
"useV5Design": "false",
"useV5Design": "true",
"v5.1": "true",
"variables": {
"transaction_amount": "${eval(transaction_amount ? transaction_amount : '-')}",
"qualifying_offer": "${eval(CREDIT_OFFERS_DS.qualifying_offer ? CREDIT_OFFERS_DS.qualifying_offer : 'false')}",
Expand Down
3 changes: 2 additions & 1 deletion content/modals/US/PLHub/plhub_long_term.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
"meta": {
"product": "PAY_LATER_LONG_TERM",
"offerCountry": "US",
"useV5Design": "false",
"useV5Design": "true",
"v5.1": "true",
"variables": {
"transaction_amount": "${eval(transaction_amount ? transaction_amount : '-')}",
"qualifying_offer": "${eval(CREDIT_OFFERS_DS.qualifying_offer ? CREDIT_OFFERS_DS.qualifying_offer : 'false')}",
Expand Down
5 changes: 3 additions & 2 deletions content/modals/US/PLHub/plhub_short_term.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@
"qualifying": "{qualifying_offer}",
"amount": "{transaction_amount}",
"apr": "{apr}",
"useV5Design": "false",
"useV5Design": "true",
"v5.1": "true",
"variables": {
"transaction_amount": "${eval(transaction_amount ? transaction_amount : '-')}",
"qualifying_offer": "${eval(CREDIT_OFFERS_DS.qualifying_offer ? CREDIT_OFFERS_DS.qualifying_offer : 'false')}",
Expand Down Expand Up @@ -36,6 +37,6 @@
"disclosure": [
"Pay in 4 is available to consumers upon approval for purchases of {formattedMinAmount} to {formattedMaxAmount}. Pay in 4 is not currently 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. Loans to California residents are made or arranged pursuant to a California Financing Law License. PayPal, Inc. is a Georgia Installment Lender Licensee, NMLS #910457. Rhode Island Small Loan Lender Licensee."
],
"linkToProductList": "See other ways to pay later"
"linkToProductList": "See other ways to pay over time"
}
}
1 change: 1 addition & 0 deletions content/modals/US/long_term_df.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
"product": "PAY_LATER_LONG_TERM",
"offerCountry": "US",
"useV5Design": "true",
"v5.1": "true",
"variables": {
"transaction_amount": "${eval(transaction_amount ? transaction_amount : '-')}",
"qualifying_offer": "${eval(CREDIT_OFFERS_DS.qualifying_offer ? CREDIT_OFFERS_DS.qualifying_offer : 'false')}",
Expand Down
3 changes: 2 additions & 1 deletion content/modals/US/v2_long_term.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
{
"meta": {
"product": "PAY_LATER_LONG_TERM",
"useV5Design": "false",
"useV5Design": "true",
"v5.1": "true",
"offerCountry": "US",
"variables": {
"transaction_amount": "${eval(transaction_amount ? transaction_amount : '-')}",
Expand Down
4 changes: 3 additions & 1 deletion content/modals/US/v2_ppc_ni.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
"meta": {
"offerCountry": "US",
"product": "PAYPAL_CREDIT_NO_INTEREST",
"useV5Design": "true",
"v5.1": "true",
"periodicPayment": "{formattedPeriodicPayment}",
"minAmount": "{minAmount}",
"maxAmount": "{maxAmount}",
Expand Down Expand Up @@ -49,6 +51,6 @@
],
["Copyright {fullYear} Bill Me Later, Inc. All rights reserved."]
],
"linkToProductList": "See other ways to pay later"
"linkToProductList": "See other ways to pay over time"
}
}
3 changes: 2 additions & 1 deletion content/modals/US/v2_product_list.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
{
"meta": {
"product": "PRODUCT_LIST",
"useV5Design": "false",
"useV5Design": "true",
"v5.1": "true",
"offerCountry": "US"
},
"content": {
Expand Down
5 changes: 3 additions & 2 deletions content/modals/US/v2_short_term.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
{
"meta": {
"product": "PAY_LATER_SHORT_TERM",
"useV5Design": "false",
"useV5Design": "true",
"v5.1": "true",
"periodicPayment": "{formattedPeriodicPayment}",
"minAmount": "{minAmount}",
"maxAmount": "{maxAmount}",
Expand Down Expand Up @@ -36,6 +37,6 @@
"disclosure": [
"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."
],
"linkToProductList": "See other ways to pay later"
"linkToProductList": "See other ways to pay over time"
}
}
1 change: 1 addition & 0 deletions content/offers/DE/long_term.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
"total_payments": "{total_payments}",
"formattedTotalCost": "{formattedTotalCost}",
"formattedTotalInterest": "{formattedTotalInterest}",
"formattedTransactionAmount": "{formattedTransactionAmount}",
"variables": {
"transaction_amount": "${eval(transaction_amount ? transaction_amount : '-')}",
"qualifying_offer": "${eval(CREDIT_OFFERS_DS.qualifying_offer ? CREDIT_OFFERS_DS.qualifying_offer : 'false')}",
Expand Down
1 change: 1 addition & 0 deletions content/offers/DE/long_term_en.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
"total_payments": "{total_payments}",
"formattedTotalCost": "{formattedTotalCost}",
"formattedTotalInterest": "{formattedTotalInterest}",
"formattedTransactionAmount": "{formattedTransactionAmount}",
"variables": {
"transaction_amount": "${eval(transaction_amount ? transaction_amount : '-')}",
"qualifying_offer": "${eval(CREDIT_OFFERS_DS.qualifying_offer ? CREDIT_OFFERS_DS.qualifying_offer : 'false')}",
Expand Down
19 changes: 9 additions & 10 deletions demo/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,20 +4,19 @@
<title>Messages Dev Sandbox</title>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no" />
<script src="//localhost.paypal.com:8080/sdk/js?client-id=DEV_US_MULTI&components=messages"></script>
<script>
window.__TEST_ENV__ = 'https://www.msmaster.qa.paypal.com';
</script>
<script src="https://www.msmaster.qa.paypal.com/sdk/js?client-id=B_AFccMdMuxDJXveYSon7w-PMTQ_aLJPy3b1Q4rz4K9iDYHi8fjX80yGEzQ2-gSHQhJVmCiO7Yp6Q3Kfow&debug=true&components=messages&stage-alias=https://cdn-culs_auth_01.static.engineering.dev.paypalinc.com/upstream/bizcomponents/stage/package.tgz"></script>
</head>
<body>
<div class="messages" data-pp-message></div>
<script>
// paypal
// .Messages({
// style: {
// layout: 'flex',
// ratio: '8x1',
// color: 'blue'
// }
// })
// .render('.messages');
paypal
.Messages({
amount: '500'
})
.render('.messages');
</script>
</body>
</html>
16 changes: 14 additions & 2 deletions demo/standalone-modal.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,25 @@
<title>Standalone Modal Sandbox</title>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no" />
<script src="//localhost.paypal.com:8080/modal.js"></script>
<!-- <script src="//localhost.paypal.com:8080/modal.js"></script> -->
<script>
window.__TEST_ENV__ = 'https://msmaster.qa.paypal.com';
</script>
<script
src="https://cdn-5_1_rebrand_us_01.static.engineering.dev.paypalinc.com/upstream/bizcomponents/stage/modal.js"
data-pp-account="9DZUAPZS6JM5E"
></script>
</head>
<body>
<button class="learn-more">Learn more</button>
<script>
const modal = window.paypal.MessagesModal({
account: 'DEV_US_MULTI'
// account: 'DEV_US_LONG_TERM_DF',
amount: '600',
channel: 'DEBIT_FLIP',
customerId: 'W9WK2RH9RWWQC'
// offer: 'PAY_LATER_SHORT_TERM'
// features: 'new-checkout-design',
});
document.querySelector('.learn-more').addEventListener('click', () => {
modal.show();
Expand Down
38 changes: 26 additions & 12 deletions demo/standalone.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,22 +4,36 @@
<title>Messaging.js Dev Sandbox</title>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no" />
<script src="//localhost.paypal.com:8080/messaging.js" data-pp-account="DEV_US_MULTI"></script>
<script>
window.__TEST_ENV__ = 'https://www.msmaster.qa.paypal.com';
</script>
<script
src="https://cdn-op_only_json_00.static.engineering.dev.paypalinc.com/upstream/bizcomponents/stage/messaging.js"
data-pp-account="9DZUAPZS6JM5E"
></script>
</head>

<body>
<div class="messages" data-pp-message></div>
<div
class="messages"
data-pp-message
data-pp-amount="1000"
data-pp-style-layout="text"
data-pp-style-layout="black"
data-pp-style-logo-type="primary"
data-pp-style-logo-position="left"
></div>
<script>
// paypal
// .Messages({
// style: {
// layout: 'text',
// logo: {
// type: 'none'
// }
// },
// })
// .render('.messages');
paypal
.Messages({
style: {
layout: 'text',
logo: {
type: 'none'
}
}
})
.render('.messages');
</script>
</body>
</html>
Loading
Loading