diff --git a/content/messages/CA/generic.json b/content/messages/CA/generic.json new file mode 100644 index 0000000000..3dc5407215 --- /dev/null +++ b/content/messages/CA/generic.json @@ -0,0 +1,26 @@ +{ + "meta": { + "id": "", + "offerCountry": "CA", + "offerType": "GENERIC", + "messageType": "GENERIC", + "offerTerm": "${CREDIT_OFFERS_DS.total_payments}", + "lander": "", + "variables": { + "financing_code": "${CREDIT_OFFERS_DS.financing_code}", + "formattedMonthlyPayment": "${CREDIT_OFFERS_DS.formattedMonthlyPayment}", + "total_payments": "${CREDIT_OFFERS_DS.total_payments}", + "minAmount": "${CREDIT_OFFERS_DS.minAmount}", + "maxAmount": "${CREDIT_OFFERS_DS.maxAmount}", + "formattedMinAmount": "${CREDIT_OFFERS_DS.formattedMinAmount}", + "formattedMaxAmount": "${CREDIT_OFFERS_DS.formattedMaxAmount}", + "formattedTotalCost": "${CREDIT_OFFERS_DS.formattedTotalCost}" + } + }, + "headline": [ + ["Buy now, pay later.", ["default", "xsmall"]], + ["Buy now and pay later.", ["xsmall.2"]] + ], + "subHeadline": [], + "disclaimer": [[" Learn more", ["default"]]] +} diff --git a/content/messages/CA/generic_fr.json b/content/messages/CA/generic_fr.json new file mode 100644 index 0000000000..ad8e66d341 --- /dev/null +++ b/content/messages/CA/generic_fr.json @@ -0,0 +1,28 @@ +{ + "meta": { + "id": "", + "offerCountry": "CA", + "offerType": "GENERIC", + "messageType": "GENERIC", + "offerTerm": "${CREDIT_OFFERS_DS.total_payments}", + "lander": "", + "variables": { + "financing_code": "${CREDIT_OFFERS_DS.financing_code}", + "formattedMonthlyPayment": "${CREDIT_OFFERS_DS.formattedMonthlyPayment}", + "total_payments": "${CREDIT_OFFERS_DS.total_payments}", + "minAmount": "${CREDIT_OFFERS_DS.minAmount}", + "maxAmount": "${CREDIT_OFFERS_DS.maxAmount}", + "formattedMinAmount": "${CREDIT_OFFERS_DS.formattedMinAmount}", + "formattedMaxAmount": "${CREDIT_OFFERS_DS.formattedMaxAmount}", + "formattedTotalCost": "${CREDIT_OFFERS_DS.formattedTotalCost}" + } + }, + "headline": [ + ["Achetez maintenant, payez plus tard.", ["default", "xsmall"]], + ["Achetez maintenant et payez plus tard.", ["xsmall.2"]] + ], + "subHeadline": [], + "disclaimer": [ + [" En savoir plus", ["default"]] + ] +} diff --git a/content/messages/CA/short_term_nq.json b/content/messages/CA/short_term_nq.json new file mode 100644 index 0000000000..150976d716 --- /dev/null +++ b/content/messages/CA/short_term_nq.json @@ -0,0 +1,26 @@ +{ + "meta": { + "id": "", + "offerCountry": "CA", + "offerType": "PAY_LATER_SHORT_TERM", + "messageType": "PLST_NQ", + "offerTerm": "${CREDIT_OFFERS_DS.total_payments}", + "lander": "", + "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}" + } + }, + "headline": [ + ["Buy now, pay later.", ["default", "xsmall"]], + ["Buy now and pay later.", ["xsmall.2"]], + [ + "Pay in 4 interest-free payments on purchases of {formattedMinAmount}-{formattedMaxAmount}.", + ["medium", "large", "xlarge"] + ] + ], + "subHeadline": [], + "disclaimer": [[" Learn more", ["default"]]] +} diff --git a/content/messages/CA/short_term_nq_fr.json b/content/messages/CA/short_term_nq_fr.json new file mode 100644 index 0000000000..852a888289 --- /dev/null +++ b/content/messages/CA/short_term_nq_fr.json @@ -0,0 +1,28 @@ +{ + "meta": { + "id": "", + "offerCountry": "CA", + "offerType": "PAY_LATER_SHORT_TERM", + "messageType": "PLST_NQ", + "offerTerm": "${CREDIT_OFFERS_DS.total_payments}", + "lander": "", + "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}" + } + }, + "headline": [ + ["Achetez maintenant, payez plus tard.", ["default", "xsmall"]], + ["Achetez maintenant et payez plus tard.", ["xsmall.2"]], + [ + "Payer en 4 versements sans intérêt pour les achats de {formattedMinAmount} à {formattedMaxAmount}.", + ["medium", "large", "xlarge"] + ] + ], + "subHeadline": [], + "disclaimer": [ + [" En savoir plus", ["default"]] + ] +} diff --git a/content/messages/CA/short_term_q.json b/content/messages/CA/short_term_q.json new file mode 100644 index 0000000000..0dcf6cc046 --- /dev/null +++ b/content/messages/CA/short_term_q.json @@ -0,0 +1,26 @@ +{ + "meta": { + "id": "", + "offerCountry": "CA", + "offerType": "PAY_LATER_SHORT_TERM", + "messageType": "PLST_SQ", + "offerTerm": "${CREDIT_OFFERS_DS.total_payments}", + "lander": "", + "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}" + } + }, + "headline": [ + ["Buy now, pay later.", ["default", "xsmall"]], + [["Buy now and pay later."], ["xsmall.2"]], + [ + ["Pay in 4 interest-free payments of {formattedPeriodicPayment}", [".", "weak"]], + ["medium", "large", "xlarge"] + ] + ], + "subHeadline": [], + "disclaimer": [[" Learn more", ["default"]]] +} diff --git a/content/messages/CA/short_term_q_fr.json b/content/messages/CA/short_term_q_fr.json new file mode 100644 index 0000000000..2e47260fb1 --- /dev/null +++ b/content/messages/CA/short_term_q_fr.json @@ -0,0 +1,28 @@ +{ + "meta": { + "id": "", + "offerCountry": "CA", + "offerType": "PAY_LATER_SHORT_TERM", + "messageType": "PLST_SQ", + "offerTerm": "${CREDIT_OFFERS_DS.total_payments}", + "lander": "", + "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}" + } + }, + "headline": [ + ["Achetez maintenant, payez plus tard.", ["default", "xsmall"]], + [["Achetez maintenant et payez plus tard."], ["xsmall.2"]], + [ + ["Payer en 4 versements sans intérêt de {formattedPeriodicPayment}", [".", "weak"]], + ["medium", "large", "xlarge"] + ] + ], + "subHeadline": [], + "disclaimer": [ + [" En savoir plus", ["default"]] + ] +} diff --git a/content/modals/CA/short_term.json b/content/modals/CA/short_term.json new file mode 100644 index 0000000000..19194822b8 --- /dev/null +++ b/content/modals/CA/short_term.json @@ -0,0 +1,41 @@ +{ + "meta": { + "product": "PAY_LATER_SHORT_TERM", + "periodicPayment": "{formattedPeriodicPayment}", + "minAmount": "{minAmount}", + "maxAmount": "{maxAmount}", + "qualifying": "{qualifying_offer}", + "amount": "{transaction_amount}", + "apr": "{apr}", + "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')}", + "financing_code": "${CREDIT_OFFERS_DS.financing_code}", + "formattedPeriodicPayment": "${CREDIT_OFFERS_DS.formattedPeriodicPayment}", + "total_payments": "${CREDIT_OFFERS_DS.total_payments}", + "formattedMinAmount": "${CREDIT_OFFERS_DS.formattedMinAmount}", + "formattedMaxAmount": "${CREDIT_OFFERS_DS.formattedMaxAmount}", + "formattedTotalCost": "${CREDIT_OFFERS_DS.formattedTotalCost}", + "minAmount": "${CREDIT_OFFERS_DS.minAmount}", + "maxAmount": "${CREDIT_OFFERS_DS.maxAmount}", + "apr": "${CREDIT_OFFERS_DS.apr}", + "nominal_rate": "${CREDIT_OFFERS_DS.nominal_rate}" + } + }, + "content": { + "headline": "Pay in 4 interest-free payments", + "subheadline": "No impact on credit score and no late fees. Available for purchases of {formattedMinAmount} to {formattedMaxAmount}.", + "qualifyingSubheadline": "Split your purchase of {formattedTotalCost} into {total_payments} with no impact on credit score and no late fees.", + "donutTimestamps": ["Today", "2 weeks", "4 weeks", "6 weeks"], + "instructions": [ + "Choose PayPal at checkout to pay later with Pay in 4. ", + "Complete your purchase with a 25% first payment.", + "Use autopay for the rest of your payments. It's easy!" + ], + "disclosure": [ + "Pay in 4 is available to approved consumers for purchases of {formattedMinAmount} to {formattedMaxAmount} (CAD) for certain transaction types. Availability depends on the merchant. You must be age of majority in the province or territory where you live to apply. Any transactions in other currencies will be converted to Canadian dollars subject to applicable currency conversion charges. You may repay the amount you owe in full at any time, without any fees or charges." + ] + } +} diff --git a/content/modals/CA/short_term_fr.json b/content/modals/CA/short_term_fr.json new file mode 100644 index 0000000000..2928e9450e --- /dev/null +++ b/content/modals/CA/short_term_fr.json @@ -0,0 +1,41 @@ +{ + "meta": { + "product": "PAY_LATER_SHORT_TERM", + "periodicPayment": "{formattedPeriodicPayment}", + "minAmount": "{minAmount}", + "maxAmount": "{maxAmount}", + "qualifying": "{qualifying_offer}", + "amount": "{transaction_amount}", + "apr": "{apr}", + "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')}", + "financing_code": "${CREDIT_OFFERS_DS.financing_code}", + "formattedPeriodicPayment": "${CREDIT_OFFERS_DS.formattedPeriodicPayment}", + "total_payments": "${CREDIT_OFFERS_DS.total_payments}", + "formattedMinAmount": "${CREDIT_OFFERS_DS.formattedMinAmount}", + "formattedMaxAmount": "${CREDIT_OFFERS_DS.formattedMaxAmount}", + "formattedTotalCost": "${CREDIT_OFFERS_DS.formattedTotalCost}", + "minAmount": "${CREDIT_OFFERS_DS.minAmount}", + "maxAmount": "${CREDIT_OFFERS_DS.maxAmount}", + "apr": "${CREDIT_OFFERS_DS.apr}", + "nominal_rate": "${CREDIT_OFFERS_DS.nominal_rate}" + } + }, + "content": { + "headline": "Payer en 4 versements sans intérêt", + "subheadline": "Aucun impact sur la cote de crédit et aucuns frais de retard. Disponible pour les achats de {formattedMinAmount} à {formattedMaxAmount}.", + "qualifyingSubheadline": "Divisez le montant de {formattedTotalCost} en {total_payments} versements sans intérêt, sans incidence sur votre cote de crédit et sans frais de retard.", + "donutTimestamps": ["Aujourd'hui", "2 semaines", "4 semaines", "6 semaines"], + "instructions": [ + "Choisissez PayPal à la caisse pour payer plus tard avec le Paiement en 4.", + "Terminez votre achat avec un premier paiement de 25 %.", + "Utilisez le paiement préapprouvé pour le reste de vos paiements. C'est facile !" + ], + "disclosure": [ + "Paiement en 4 est offert aux consommateurs approuvés pour les achats de {formattedMinAmount} à {formattedMaxAmount} (CAD) pour certains types de transactions. La disponibilité dépend du marchand. Vous devez avoir atteint l’âge de la majorité dans la province ou le territoire où vous résidez pour présenter une demande. Toutes les transactions dans d’autres devises seront converties en dollars canadiens, sous réserve des frais de conversion de devise applicables. Vous pouvez rembourser la totalité du montant que vous devez en tout temps, sans frais." + ] + } +} diff --git a/content/modals/CA/short_term_xo.json b/content/modals/CA/short_term_xo.json new file mode 100644 index 0000000000..82e6cb43d8 --- /dev/null +++ b/content/modals/CA/short_term_xo.json @@ -0,0 +1,49 @@ +{ + "meta": { + "product": "PAY_LATER_SHORT_TERM", + "periodicPayment": "{formattedPeriodicPayment}", + "minAmount": "{minAmount}", + "maxAmount": "{maxAmount}", + "qualifying": "{qualifying_offer}", + "amount": "{transaction_amount}", + "apr": "{apr}", + "useV5Design": "true", + + "variables": { + "transaction_amount": "${eval(transaction_amount ? transaction_amount : '-')}", + "qualifying_offer": "${eval(CREDIT_OFFERS_DS.qualifying_offer ? CREDIT_OFFERS_DS.qualifying_offer : 'false')}", + "financing_code": "${CREDIT_OFFERS_DS.financing_code}", + "formattedPeriodicPayment": "${CREDIT_OFFERS_DS.formattedPeriodicPayment}", + "total_payments": "${CREDIT_OFFERS_DS.total_payments}", + "formattedMinAmount": "${CREDIT_OFFERS_DS.formattedMinAmount}", + "formattedMaxAmount": "${CREDIT_OFFERS_DS.formattedMaxAmount}", + "formattedTotalCost": "${CREDIT_OFFERS_DS.formattedTotalCost}", + "minAmount": "${CREDIT_OFFERS_DS.minAmount}", + "maxAmount": "${CREDIT_OFFERS_DS.maxAmount}", + "apr": "${CREDIT_OFFERS_DS.apr}", + "nominal_rate": "${CREDIT_OFFERS_DS.nominal_rate}" + } + }, + "content": { + "headline": "Pay in 4", + "subheadline": "No impact on credit score and no late fees. Available for purchases of {formattedMinAmount} to {formattedMaxAmount}.", + "qualifyingSubheadline": "Split {formattedTotalCost} into {total_payments} interest-free payments with no impact on credit score and no late fees.", + "donutTimestamps": ["Today", "2 weeks", "4 weeks", "6 weeks"], + "instructions": { + "instructionsHeadline": "How Pay in 4 works", + "instructionsSubHeadline": [ + "Choose PayPal at checkout to pay later with Pay in 4", + "Complete your purchase with a 25% first payment.", + "Use autopay for the rest of your payments. It's easy!" + ] + }, + "cta": { + "buttonTextEligible": "Continue with Pay in 4", + "buttonTextIneligible": "Back to Checkout", + "link": "https://www.paypal.com/link/to/short-term-application" + }, + "disclosure": [ + "Pay in 4 is available to approved consumers for purchases of {formattedMinAmount} to {formattedMaxAmount} (CAD) for certain transaction types. Availability depends on the merchant. You must be age of majority in the province or territory where you live to apply. Any transactions in other currencies will be converted to Canadian dollars subject to applicable currency conversion charges. You may repay the amount you owe in full at any time, without any fees or charges." + ] + } +} diff --git a/content/modals/CA/short_term_xo_fr.json b/content/modals/CA/short_term_xo_fr.json new file mode 100644 index 0000000000..f29fe79e2d --- /dev/null +++ b/content/modals/CA/short_term_xo_fr.json @@ -0,0 +1,49 @@ +{ + "meta": { + "product": "PAY_LATER_SHORT_TERM", + "periodicPayment": "{formattedPeriodicPayment}", + "minAmount": "{minAmount}", + "maxAmount": "{maxAmount}", + "qualifying": "{qualifying_offer}", + "amount": "{transaction_amount}", + "apr": "{apr}", + "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')}", + "financing_code": "${CREDIT_OFFERS_DS.financing_code}", + "formattedPeriodicPayment": "${CREDIT_OFFERS_DS.formattedPeriodicPayment}", + "total_payments": "${CREDIT_OFFERS_DS.total_payments}", + "formattedMinAmount": "${CREDIT_OFFERS_DS.formattedMinAmount}", + "formattedMaxAmount": "${CREDIT_OFFERS_DS.formattedMaxAmount}", + "formattedTotalCost": "${CREDIT_OFFERS_DS.formattedTotalCost}", + "minAmount": "${CREDIT_OFFERS_DS.minAmount}", + "maxAmount": "${CREDIT_OFFERS_DS.maxAmount}", + "apr": "${CREDIT_OFFERS_DS.apr}", + "nominal_rate": "${CREDIT_OFFERS_DS.nominal_rate}" + } + }, + "content": { + "headline": "Payer en 4", + "subheadline": "Aucun impact sur la cote de crédit et aucuns frais de retard. Disponible pour les achats de {formattedMinAmount} à {formattedMaxAmount}.", + "qualifyingSubheadline": "Divisez le montant de {formattedTotalCost} en {total_payments} versements sans intérêt, sans incidence sur votre cote de crédit et sans frais de retard.", + "donutTimestamps": ["Exigible aujourd'hui", "2 semaines", "4 semaines", "6 semaines"], + "instructions": { + "instructionsHeadline": "Comment fonctionne le Paiement en 4?", + "instructionsSubHeadline": [ + "Choisissez PayPal à la caisse pour payer plus tard avec le Paiement en 4. ", + "Terminez votre achat avec un premier paiement de 25 %.", + "Utilisez le paiement préapprouvé pour le reste de vos paiements. C'est facile!" + ] + }, + "cta": { + "buttonTextEligible": "Continuer avec le Paiement en 4", + "buttonTextIneligible": "Retour à la caisse", + "link": "https://www.paypal.com/link/to/short-term-application" + }, + "disclosure": [ + "Paiement en 4 est offert aux consommateurs approuvés pour les achats de {formattedMinAmount} à {formattedMaxAmount} (CAD) pour certains types de transactions. La disponibilité dépend du marchand. Vous devez avoir atteint l’âge de la majorité dans la province ou le territoire où vous résidez pour présenter une demande. Toutes les transactions dans d’autres devises seront converties en dollars canadiens, sous réserve des frais de conversion de devise applicables. Vous pouvez rembourser la totalité du montant que vous devez en tout temps, sans frais." + ] + } +} diff --git a/demo/helpers/accounts.js b/demo/helpers/accounts.js index e6e199f943..a1afce3911 100644 --- a/demo/helpers/accounts.js +++ b/demo/helpers/accounts.js @@ -88,4 +88,12 @@ const accounts = [ // 'DEV0000ITPLNA', // 'DEV00000ITPLQ', // 'DEV0000ITPLNQ' + + // CA + // 'DEV000ENCAPLQ', + // 'DEV00ENCAPLNQ', + // 'DEV00ENCAPLNA', + // 'DEV000FRCAPLQ', + // 'DEV00FRCAPLNQ', + // 'DEV00FRCAPLNA', ]; diff --git a/src/components/message/Message.js b/src/components/message/Message.js index bc1db48d79..cce2b6dd83 100644 --- a/src/components/message/Message.js +++ b/src/components/message/Message.js @@ -20,6 +20,7 @@ const Message = function ({ markup, meta, parentStyles, warnings }) { amount: window.xprops.amount ?? null, currency: window.xprops.currency ?? null, buyerCountry: window.xprops.buyerCountry ?? null, + language: window.xprops.language ?? null, ignoreCache: window.xprops.ignoreCache ?? null, style: window.xprops.style, offer: window.xprops.offer ?? null, @@ -115,6 +116,7 @@ const Message = function ({ markup, meta, parentStyles, warnings }) { amount, currency, buyerCountry, + language, ignoreCache, offer, payerId, @@ -137,6 +139,7 @@ const Message = function ({ markup, meta, parentStyles, warnings }) { amount, currency, buyerCountry, + language, ignoreCache, style, offer, @@ -159,6 +162,7 @@ const Message = function ({ markup, meta, parentStyles, warnings }) { amount, currency, buyer_country: buyerCountry, + language, ignore_cache: ignoreCache, style, credit_type: offer, diff --git a/src/components/modal/v2/parts/Donut.jsx b/src/components/modal/v2/parts/Donut.jsx index 976629807e..11bc098f0d 100644 --- a/src/components/modal/v2/parts/Donut.jsx +++ b/src/components/modal/v2/parts/Donut.jsx @@ -91,7 +91,7 @@ const Donut = ({