Skip to content
Draft
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
9 changes: 3 additions & 6 deletions content/messages/ES/short_term_no_amount.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
{
"meta": {
"offerCountry": "ES",
"offerType": "PAY_LATER_SHORT_TERM",
"messageType": "PLST_NA",
"offerType": "GENERIC",
"messageType": "GENERIC",
"offerTerm": "{total_payments}",
"lander": "",
"lander": "https://www.paypal.com/credit-presentment/lander/modal",
"variables": {
"offer_id": "${CREDIT_OFFERS_DS.offer_id}",
"vendor_financing_id": "${CREDIT_OFFERS_DS.vendor_financing_id}",
Expand All @@ -14,10 +14,7 @@
"formattedMaxAmount": "${CREDIT_OFFERS_DS.formattedMaxAmount}"
}
},

"headline": [["Compra ahora y paga después.", ["default"]]],

"subHeadline": [],

"disclaimer": [["Más información", ["default"]]]
}
22 changes: 22 additions & 0 deletions content/messages/FR/generic.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
"meta": {
"offerCountry": "FR",
"offerType": "GENERIC",
"messageType": "GENERIC",
"offerTerm": "{total_payments}",
"lander": "https://www.paypal.com/credit-presentment/lander/modal",
"experiment_id": "{experiment_id}",
"experiment_treatment_id": "{experiment_treatment_id}",
"variables": {
"offer_id": "${CREDIT_OFFERS_DS.offer_id}",
"vendor_financing_id": "${CREDIT_OFFERS_DS.vendor_financing_id}",
"financing_code": "${CREDIT_OFFERS_DS.financing_code}",
"formattedPeriodicPayment": "${CREDIT_OFFERS_DS.formattedPeriodicPayment}",
"formattedMinAmount": "${CREDIT_OFFERS_DS.formattedMinAmount}",
"formattedMaxAmount": "${CREDIT_OFFERS_DS.formattedMaxAmount}"
}
},
"headline": [["Payez en plusieurs fois.", ["default"]]],
"subHeadline": [],
"disclaimer": [["En savoir plus", ["default"]]]
}
29 changes: 29 additions & 0 deletions content/messages/FR/long_term_nq.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
{
"meta": {
"offerCountry": "FR",
"offerType": "PAY_LATER_LONG_TERM",
"offerTerm": "{total_payments}",
"messageType": "PLLT_NQ_GZ",
"lander": "https://www.paypal.com/credit-presentment/lander/modal",
"variables": {
"offer_id": "${CREDIT_OFFERS_DS.offer_id}",
"vendor_financing_id": "${CREDIT_OFFERS_DS.vendor_financing_id}",
"financing_code": "${CREDIT_OFFERS_DS.financing_code}",
"formattedPeriodicPayment": "${CREDIT_OFFERS_DS.formattedPeriodicPayment}",
"formattedMinAmount": "${CREDIT_OFFERS_DS.formattedMinAmount}",
"formattedMaxAmount": "${CREDIT_OFFERS_DS.formattedMaxAmount}"
}
},
"headline": [
["Payez en plusieurs fois.", ["default", "xsmall"]],
["Payez en plusieurs fois.", ["xsmall.2"]],
[
"Payez en plusieurs échéances pour vos achats de {formatted_min_amount} à {formatted_max_amount}.",
["small", "medium", "large", "xlarge"]
]
],
"subHeadline": [],
"disclaimer": [
["<span aria-hidden='true'>En savoir plus</span><span class='sr-only'>En savoir plus</span>", ["default"]]
]
}
26 changes: 26 additions & 0 deletions content/messages/FR/long_term_q_gtz.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
{
"meta": {
"offerCountry": "FR",
"offerType": "PAY_LATER_LONG_TERM",
"messageType": "PLLT_MQ_GZ",
"offerTerm": "{total_payments}",
"lander": "https://www.paypal.com/credit-presentment/lander/modal",
"variables": {
"offer_id": "${CREDIT_OFFERS_DS.offer_id}",
"vendor_financing_id": "${CREDIT_OFFERS_DS.vendor_financing_id}",
"financing_code": "${CREDIT_OFFERS_DS.financing_code}",
"formattedPeriodicPayment": "${CREDIT_OFFERS_DS.formattedPeriodicPayment}",
"formattedMinAmount": "${CREDIT_OFFERS_DS.formattedMinAmount}",
"formattedMaxAmount": "${CREDIT_OFFERS_DS.formattedMaxAmount}"
}
},
"headline": [
["Payez en plusieurs fois.", ["default", "xsmall"]],
["Payez en plusieurs fois.", ["xsmall.2"]],
[["Payez jusqu'à {total_payments} échéances."], ["small", "medium", "large", "xlarge"]]
],
"subHeadline": [],
"disclaimer": [
["<span aria-hidden='true'>En savoir plus</span><span class='sr-only'>En savoir plus</span>", ["default"]]
]
}
4 changes: 2 additions & 2 deletions content/messages/IT/short_term_no_amount.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"meta": {
"offerCountry": "IT",
"offerType": "PAY_LATER_SHORT_TERM",
"messageType": "PLST_NA",
"offerType": "GENERIC",
"messageType": "GENERIC",
"offerTerm": "{total_payments}",
"lander": "",
"variables": {
Expand Down
7 changes: 5 additions & 2 deletions demo/helpers/accounts.js
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,11 @@ const accounts = [
// 'DEV00000GBPLQ',

// FR
// 'DEV000000FRPL',
// 'DEV00000FRPLQ'
// DEV0FRGENERIC
// DEV000000FRPL
// DEV00000FRPLQ
// DEV0000FRPLTQ
// DEV000FRPLTNQ

// ES
// 'DEV00000ESPLQ',
Expand Down
162 changes: 162 additions & 0 deletions src/server/locale/FR/mutations/generic.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,162 @@
import Logo from '../../../message/logos';
import {
textWrap,
messageLogoWidth,
altNoWrap,
setLogoTop,
logo20x1,
xSmallFallback
} from '../../../message/mediaQueries';
import { textLogoMutations, flexLogoMutations } from '../../../message/logoMutations';

const headlineBreaks = [
{
sizes: ['default'],
breaks: ['achats']
}
].reduce((acc, item) => {
const { sizes, breaks } = item;
sizes.forEach(size => {
acc.push({
tag: size,
br: breaks
});
});
return acc;
}, []);

const flex = [
[
'default',
{
logo: Logo.PP_PAYPAL.WHITE,
headline: [
{
tag: 'xsmall'
},
{
tag: 'medium'
}
],
disclaimer: ['default']
}
],
[
'ratio:20x1',
{
headline: [...headlineBreaks],
styles: [logo20x1()]
}
],
[
'ratio:8x1',
{
headline: [...headlineBreaks]
}
],
...flexLogoMutations
];

export default {
'layout:flex': flex,
'layout:text': [
[
'default',
({ textSize }) => ({
styles: [
textWrap(textSize * 33, textSize, 'ES'),
xSmallFallback(textSize * 16),
messageLogoWidth(false, textSize * 4, textSize * 1.25),
setLogoTop(textSize * 16)
],
logo: Logo.PP_PAYPAL.COLOR,
headline: [
{
tag: 'default',
br: ['achats']
}
],
disclaimer: ['default']
})
],
[
'logo.type:primary && logo.position:right',
({ textSize }) => ({
styles: [
xSmallFallback(textSize * 17.4),
setLogoTop(textSize * 41.5),
messageLogoWidth(textSize * 6, textSize * 4, textSize * 1.25)
],
headline: [
{
tag: 'default',
br: ['achats']
}
]
})
],
[
'logo.type:primary && logo.position:top',
({ textSize }) => ({
styles: [
xSmallFallback(textSize * 17.4),
messageLogoWidth(textSize * 6, textSize * 4, textSize * 1.25)
],
headline: [
{
tag: 'default',
br: ['achats']
}
]
})
],
[
'logo.type:alternative',
({ textSize }) => ({
styles: [
`@media screen and (max-width: ${textSize * 10.6}px) { .message__content { white-space: nowrap; }}`,
textWrap(textSize * 36.5, textSize, 'ES'),
xSmallFallback(textSize * 17.75),
altNoWrap(textSize * 10.6),
messageLogoWidth(textSize * 1.75, textSize * 4, textSize * 1.25)
],
logo: Logo.PP_PAYPAL.COLOR[0],
headline: [
{
tag: 'default',
br: ['achats']
}
]
})
],
[
'logo.type:none',
({ textSize }) => ({
styles: [xSmallFallback(textSize * 20)],
logo: false,
headline: [
{
tag: 'default',
br: ['achats'],
replace: [['fois.', 'fois']]
}
]
})
],
[
'logo.type:inline',
({ textSize }) => ({
styles: [xSmallFallback(textSize * 20), `.message__logo { width: ${textSize * 4}px }`],
logo: Logo.NO_PP_MONOGRAM.COLOR,
headline: [
{
tag: 'default',
br: ['achats'],
replace: [['fois.', 'fois']]
}
]
})
],
...textLogoMutations
]
};
11 changes: 10 additions & 1 deletion src/server/locale/FR/mutations/index.js
Original file line number Diff line number Diff line change
@@ -1,15 +1,24 @@
// mutations import here.
import generic from './generic';
import longTermQ from './long_term_q_gtz';
import longTermNq from './long_term_nq';
import gpl from './gpl';
import gplq from './gplq';

export default function getMutations(id, type) {
switch (id) {
case 'PLLT_MQ_GZ':
return longTermQ[type];
case 'PLLT_NQ_GZ':
return longTermNq[type];
case 'GPLQ':
case 'PLST_SQ':
return gplq[type];
case 'GPL':
case 'PLST_NQ':
default:
return gpl[type];
case 'GENERIC':
default:
return generic[type];
}
}
Loading
Loading