diff --git a/src/components/message/Message.js b/src/components/message/Message.js index 9bb6021cb5..7f6a803c50 100644 --- a/src/components/message/Message.js +++ b/src/components/message/Message.js @@ -119,6 +119,7 @@ const Message = function ({ markup, meta, parentStyles, warnings }) { currency, buyerCountry, language, + locale, ignoreCache, offer, payerId, @@ -165,6 +166,7 @@ const Message = function ({ markup, meta, parentStyles, warnings }) { currency, buyer_country: buyerCountry, language, + locale, ignore_cache: ignoreCache, style, credit_type: offer, diff --git a/src/components/modal/v2/lib/utils.js b/src/components/modal/v2/lib/utils.js index 0ea068808e..03c4b1119e 100644 --- a/src/components/modal/v2/lib/utils.js +++ b/src/components/modal/v2/lib/utils.js @@ -14,6 +14,7 @@ export const getContent = memoize( customerId, buyerCountry, language, + locale, ignoreCache, deviceID, version, @@ -37,6 +38,7 @@ export const getContent = memoize( customer_id: customerId, buyer_country: buyerCountry, language, + locale, ignore_cache: ignoreCache, deviceID, version, diff --git a/src/components/modal/v2/parts/Container.jsx b/src/components/modal/v2/parts/Container.jsx index f667651d3a..2bf44d2564 100644 --- a/src/components/modal/v2/parts/Container.jsx +++ b/src/components/modal/v2/parts/Container.jsx @@ -29,6 +29,7 @@ const Container = ({ children }) => { customerId, buyerCountry, language, + locale, ignoreCache, version, env, @@ -74,6 +75,7 @@ const Container = ({ children }) => { customerId, buyerCountry, language, + locale, ignoreCache, version, env, diff --git a/src/library/controllers/message/interface.js b/src/library/controllers/message/interface.js index ef4af84d8b..084d25f03f 100644 --- a/src/library/controllers/message/interface.js +++ b/src/library/controllers/message/interface.js @@ -101,6 +101,7 @@ export default (options = {}) => ({ offer, buyerCountry, language, + locale, ignoreCache, onClick, onRender, @@ -122,6 +123,7 @@ export default (options = {}) => ({ amount, buyerCountry, language, + locale, ignoreCache, channel, ecToken, @@ -183,6 +185,7 @@ export default (options = {}) => ({ amount: ${amount}, buyerCountry: ${buyerCountry}, language: ${language}, + locale: ${locale}, pageType: ${pageType}, renderStart: ${new Date(renderStart).toLocaleString()}, diff --git a/src/library/controllers/modal/interface.js b/src/library/controllers/modal/interface.js index 739724f935..a2187da9c3 100644 --- a/src/library/controllers/modal/interface.js +++ b/src/library/controllers/modal/interface.js @@ -29,6 +29,7 @@ const memoizedModal = memoizeOnProps( amount, buyerCountry, language, + locale, ignoreCache, offer, onReady, @@ -56,6 +57,7 @@ const memoizedModal = memoizeOnProps( amount, buyerCountry, language, + locale, ignoreCache, offer, onReady, @@ -184,7 +186,7 @@ const memoizedModal = memoizeOnProps( updateProps: updateModal }; }, - ['account', 'merchantId', 'buyerCountry'] + ['account', 'merchantId', 'buyerCountry', 'language', 'locale'] ); export default options => memoizedModal(objectMerge(getGlobalState().config, options)); diff --git a/src/library/zoid/message/component.js b/src/library/zoid/message/component.js index e98f288a91..0b0a5f65bf 100644 --- a/src/library/zoid/message/component.js +++ b/src/library/zoid/message/component.js @@ -114,6 +114,12 @@ export default createGlobalVariableGetter('__paypal_credit_message__', () => required: false, value: validate.language }, + locale: { + type: 'string', + queryParam: true, + required: false, + value: validate.locale + }, ignoreCache: { type: 'boolean', queryParam: 'ignore_cache', @@ -147,8 +153,18 @@ export default createGlobalVariableGetter('__paypal_credit_message__', () => const { onClick } = props; return ({ meta }) => { - const { modal, index, account, merchantId, currency, amount, buyerCountry, language, onApply } = - props; + const { + modal, + index, + account, + merchantId, + currency, + amount, + buyerCountry, + language, + locale, + onApply + } = props; const { offerType, offerCountry, messageRequestId, lander } = meta; if (offerType === 'PURCHASE_PROTECTION') { if (getURIPopup(lander, offerType) == null) { @@ -164,6 +180,7 @@ export default createGlobalVariableGetter('__paypal_credit_message__', () => amount, buyerCountry, language, + locale, onApply, offer: offerType, offerCountry, diff --git a/src/library/zoid/message/validation.js b/src/library/zoid/message/validation.js index af96030866..13c56b8aa8 100644 --- a/src/library/zoid/message/validation.js +++ b/src/library/zoid/message/validation.js @@ -236,6 +236,17 @@ export default { return undefined; }, + locale: ({ props: { locale } }) => { + if (typeof locale !== 'undefined') { + if (!validateType(Types.STRING, locale)) { + logInvalidType('locale', Types.STRING, locale); + } else { + return locale; + } + } + + return undefined; + }, ignoreCache: ({ props: { ignoreCache } }) => { if (typeof ignoreCache !== 'undefined') { if (!validateType(Types.BOOLEAN, ignoreCache)) { diff --git a/src/library/zoid/modal/component.js b/src/library/zoid/modal/component.js index 156e86a872..b614cfcdb7 100644 --- a/src/library/zoid/modal/component.js +++ b/src/library/zoid/modal/component.js @@ -102,6 +102,12 @@ export default createGlobalVariableGetter('__paypal_credit_modal__', () => required: false, value: validate.language }, + locale: { + type: 'string', + queryParam: true, + required: false, + value: validate.locale + }, offer: { type: 'string', queryParam: 'credit_type', diff --git a/tests/functional/v2/config/ES/DEV_ES_LONG_TERM.js b/tests/functional/v2/config/ES/DEV_ES_LONG_TERM.js index 5ed50e5221..a76eea218a 100644 --- a/tests/functional/v2/config/ES/DEV_ES_LONG_TERM.js +++ b/tests/functional/v2/config/ES/DEV_ES_LONG_TERM.js @@ -3,7 +3,7 @@ export const DEV_ES_LONG_TERM = { country: 'ES', description: 'ES merchant eligible for long term only', minAmount: 60, - maxAmount: 2999, + maxAmount: 5000, amounts: [ { value: '0.00', @@ -28,13 +28,13 @@ export const DEV_ES_LONG_TERM = { } }, { - value: '2999.01', + value: '5000.01', message: 'Non-qualifying Pay Monthly', expectedValue: 'Paga en 6, 12 o 24 plazos', modalContent: { offerHeadline: null, offerFieldValues: null, - aboveMaxAmountErr: 'Introduce un importe inferior a 2.999 €.', + aboveMaxAmountErr: 'Introduce un importe inferior a 5.000 €.', aprDisclaimer: 'Tipo de interes nominal (TIN) fijo anual del 0%' } } diff --git a/tests/functional/v2/snapshots/modal/api/ES/DEV_ES_LONG_TERM/desktop/5000.01-Amounts_above_5000_show_correct_above_threshold_warning-desktop-snap.png b/tests/functional/v2/snapshots/modal/api/ES/DEV_ES_LONG_TERM/desktop/5000.01-Amounts_above_5000_show_correct_above_threshold_warning-desktop-snap.png new file mode 100644 index 0000000000..d3a3f9cd2f Binary files /dev/null and b/tests/functional/v2/snapshots/modal/api/ES/DEV_ES_LONG_TERM/desktop/5000.01-Amounts_above_5000_show_correct_above_threshold_warning-desktop-snap.png differ diff --git a/tests/functional/v2/snapshots/modal/api/ES/DEV_ES_LONG_TERM/mobile/0-Amounts_below_60_show_correct_below_threshold_warning-mobile-snap.png b/tests/functional/v2/snapshots/modal/api/ES/DEV_ES_LONG_TERM/mobile/0-Amounts_below_60_show_correct_below_threshold_warning-mobile-snap.png index 8140a83cb8..ea185399f1 100644 Binary files a/tests/functional/v2/snapshots/modal/api/ES/DEV_ES_LONG_TERM/mobile/0-Amounts_below_60_show_correct_below_threshold_warning-mobile-snap.png and b/tests/functional/v2/snapshots/modal/api/ES/DEV_ES_LONG_TERM/mobile/0-Amounts_below_60_show_correct_below_threshold_warning-mobile-snap.png differ diff --git a/tests/functional/v2/snapshots/modal/api/ES/DEV_ES_LONG_TERM/mobile/5000.01-Amounts_above_5000_show_correct_above_threshold_warning-mobile-snap.png b/tests/functional/v2/snapshots/modal/api/ES/DEV_ES_LONG_TERM/mobile/5000.01-Amounts_above_5000_show_correct_above_threshold_warning-mobile-snap.png new file mode 100644 index 0000000000..2dffe9d068 Binary files /dev/null and b/tests/functional/v2/snapshots/modal/api/ES/DEV_ES_LONG_TERM/mobile/5000.01-Amounts_above_5000_show_correct_above_threshold_warning-mobile-snap.png differ diff --git a/tests/functional/v2/snapshots/modal/sdk/ES/DEV_ES_LONG_TERM/desktop/5000.01-Amounts_above_5000_show_correct_above_threshold_warning-desktop-snap.png b/tests/functional/v2/snapshots/modal/sdk/ES/DEV_ES_LONG_TERM/desktop/5000.01-Amounts_above_5000_show_correct_above_threshold_warning-desktop-snap.png new file mode 100644 index 0000000000..edfe64042c Binary files /dev/null and b/tests/functional/v2/snapshots/modal/sdk/ES/DEV_ES_LONG_TERM/desktop/5000.01-Amounts_above_5000_show_correct_above_threshold_warning-desktop-snap.png differ diff --git a/tests/functional/v2/snapshots/modal/sdk/ES/DEV_ES_LONG_TERM/mobile/0-Amounts_below_60_show_correct_below_threshold_warning-mobile-snap.png b/tests/functional/v2/snapshots/modal/sdk/ES/DEV_ES_LONG_TERM/mobile/0-Amounts_below_60_show_correct_below_threshold_warning-mobile-snap.png index c558dcbd99..6001fbcb45 100644 Binary files a/tests/functional/v2/snapshots/modal/sdk/ES/DEV_ES_LONG_TERM/mobile/0-Amounts_below_60_show_correct_below_threshold_warning-mobile-snap.png and b/tests/functional/v2/snapshots/modal/sdk/ES/DEV_ES_LONG_TERM/mobile/0-Amounts_below_60_show_correct_below_threshold_warning-mobile-snap.png differ diff --git a/tests/functional/v2/snapshots/modal/sdk/ES/DEV_ES_LONG_TERM/mobile/5000.01-Amounts_above_5000_show_correct_above_threshold_warning-mobile-snap.png b/tests/functional/v2/snapshots/modal/sdk/ES/DEV_ES_LONG_TERM/mobile/5000.01-Amounts_above_5000_show_correct_above_threshold_warning-mobile-snap.png new file mode 100644 index 0000000000..1a1acc15ce Binary files /dev/null and b/tests/functional/v2/snapshots/modal/sdk/ES/DEV_ES_LONG_TERM/mobile/5000.01-Amounts_above_5000_show_correct_above_threshold_warning-mobile-snap.png differ diff --git a/tests/functional/v2/snapshots/modal/standalone/ES/DEV_ES_LONG_TERM/desktop/5000.01-Amounts_above_5000_show_correct_above_threshold_warning-desktop-snap.png b/tests/functional/v2/snapshots/modal/standalone/ES/DEV_ES_LONG_TERM/desktop/5000.01-Amounts_above_5000_show_correct_above_threshold_warning-desktop-snap.png new file mode 100644 index 0000000000..7d1ce2d854 Binary files /dev/null and b/tests/functional/v2/snapshots/modal/standalone/ES/DEV_ES_LONG_TERM/desktop/5000.01-Amounts_above_5000_show_correct_above_threshold_warning-desktop-snap.png differ diff --git a/tests/functional/v2/snapshots/modal/standalone/ES/DEV_ES_LONG_TERM/mobile/0-Amounts_below_60_show_correct_below_threshold_warning-mobile-snap.png b/tests/functional/v2/snapshots/modal/standalone/ES/DEV_ES_LONG_TERM/mobile/0-Amounts_below_60_show_correct_below_threshold_warning-mobile-snap.png index c558dcbd99..6001fbcb45 100644 Binary files a/tests/functional/v2/snapshots/modal/standalone/ES/DEV_ES_LONG_TERM/mobile/0-Amounts_below_60_show_correct_below_threshold_warning-mobile-snap.png and b/tests/functional/v2/snapshots/modal/standalone/ES/DEV_ES_LONG_TERM/mobile/0-Amounts_below_60_show_correct_below_threshold_warning-mobile-snap.png differ diff --git a/tests/functional/v2/snapshots/modal/standalone/ES/DEV_ES_LONG_TERM/mobile/5000.01-Amounts_above_5000_show_correct_above_threshold_warning-mobile-snap.png b/tests/functional/v2/snapshots/modal/standalone/ES/DEV_ES_LONG_TERM/mobile/5000.01-Amounts_above_5000_show_correct_above_threshold_warning-mobile-snap.png new file mode 100644 index 0000000000..1a1acc15ce Binary files /dev/null and b/tests/functional/v2/snapshots/modal/standalone/ES/DEV_ES_LONG_TERM/mobile/5000.01-Amounts_above_5000_show_correct_above_threshold_warning-mobile-snap.png differ diff --git a/tests/functional/v2/snapshots/modal/webpage/ES/DEV_ES_LONG_TERM/desktop/0-Amounts_below_60_show_correct_below_threshold_warning-desktop-snap.png b/tests/functional/v2/snapshots/modal/webpage/ES/DEV_ES_LONG_TERM/desktop/0-Amounts_below_60_show_correct_below_threshold_warning-desktop-snap.png index 4f262578da..967c0d1d96 100644 Binary files a/tests/functional/v2/snapshots/modal/webpage/ES/DEV_ES_LONG_TERM/desktop/0-Amounts_below_60_show_correct_below_threshold_warning-desktop-snap.png and b/tests/functional/v2/snapshots/modal/webpage/ES/DEV_ES_LONG_TERM/desktop/0-Amounts_below_60_show_correct_below_threshold_warning-desktop-snap.png differ diff --git a/tests/functional/v2/snapshots/modal/webpage/ES/DEV_ES_LONG_TERM/desktop/5000.01-Amounts_above_5000_show_correct_above_threshold_warning-desktop-snap.png b/tests/functional/v2/snapshots/modal/webpage/ES/DEV_ES_LONG_TERM/desktop/5000.01-Amounts_above_5000_show_correct_above_threshold_warning-desktop-snap.png new file mode 100644 index 0000000000..0e7412e195 Binary files /dev/null and b/tests/functional/v2/snapshots/modal/webpage/ES/DEV_ES_LONG_TERM/desktop/5000.01-Amounts_above_5000_show_correct_above_threshold_warning-desktop-snap.png differ diff --git a/tests/functional/v2/snapshots/modal/webpage/ES/DEV_ES_LONG_TERM/mobile/0-Amounts_below_60_show_correct_below_threshold_warning-mobile-snap.png b/tests/functional/v2/snapshots/modal/webpage/ES/DEV_ES_LONG_TERM/mobile/0-Amounts_below_60_show_correct_below_threshold_warning-mobile-snap.png index 39cc83e6ad..fe02fd8c92 100644 Binary files a/tests/functional/v2/snapshots/modal/webpage/ES/DEV_ES_LONG_TERM/mobile/0-Amounts_below_60_show_correct_below_threshold_warning-mobile-snap.png and b/tests/functional/v2/snapshots/modal/webpage/ES/DEV_ES_LONG_TERM/mobile/0-Amounts_below_60_show_correct_below_threshold_warning-mobile-snap.png differ diff --git a/tests/functional/v2/snapshots/modal/webpage/ES/DEV_ES_LONG_TERM/mobile/5000.01-Amounts_above_5000_show_correct_above_threshold_warning-mobile-snap.png b/tests/functional/v2/snapshots/modal/webpage/ES/DEV_ES_LONG_TERM/mobile/5000.01-Amounts_above_5000_show_correct_above_threshold_warning-mobile-snap.png new file mode 100644 index 0000000000..3d18d81b4c Binary files /dev/null and b/tests/functional/v2/snapshots/modal/webpage/ES/DEV_ES_LONG_TERM/mobile/5000.01-Amounts_above_5000_show_correct_above_threshold_warning-mobile-snap.png differ diff --git a/tests/functional/v2/snapshots/modal/webpage/ES/DEV_ES_MULTI/desktop/0-Amount_persists_between_views-desktop-snap.png b/tests/functional/v2/snapshots/modal/webpage/ES/DEV_ES_MULTI/desktop/0-Amount_persists_between_views-desktop-snap.png index e1282445b3..9eeee69750 100644 Binary files a/tests/functional/v2/snapshots/modal/webpage/ES/DEV_ES_MULTI/desktop/0-Amount_persists_between_views-desktop-snap.png and b/tests/functional/v2/snapshots/modal/webpage/ES/DEV_ES_MULTI/desktop/0-Amount_persists_between_views-desktop-snap.png differ diff --git a/utils/devServerProxy/config/ES/index.js b/utils/devServerProxy/config/ES/index.js index 2ad6309ff3..3317c6cd3f 100644 --- a/utils/devServerProxy/config/ES/index.js +++ b/utils/devServerProxy/config/ES/index.js @@ -40,7 +40,7 @@ export default { product: 'PAY_LATER_LONG_TERM' }, { - amount: 2999.01, + amount: 5000.01, template: 'long_term_nq.json', product: 'PAY_LATER_LONG_TERM' } @@ -61,21 +61,21 @@ export default { apr: 14.99, nominalRate: 14.99, minAmount: 60, - maxAmount: 2999 + maxAmount: 5000 }, { totalPayments: 12, apr: 14.99, nominalRate: 14.99, minAmount: 120, - maxAmount: 50299900 + maxAmount: 5000 }, { totalPayments: 24, apr: 14.99, nominalRate: 14.99, minAmount: 240, - maxAmount: 2999 + maxAmount: 5000 } ] } @@ -133,7 +133,7 @@ export default { product: 'PAY_LATER_LONG_TERM' }, { - amount: 2999.01, + amount: 5000.01, template: 'long_term_nq.json', product: 'PAY_LATER_LONG_TERM' } @@ -145,21 +145,21 @@ export default { apr: 0, nominalRate: 0, minAmount: 60, - maxAmount: 2999 + maxAmount: 5000 }, { totalPayments: 12, apr: 0, nominalRate: 0, minAmount: 60, - maxAmount: 2999 + maxAmount: 5000 }, { totalPayments: 24, apr: 0, nominalRate: 0, minAmount: 60, - maxAmount: 2999 + maxAmount: 5000 } ] }