Skip to content
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
2 changes: 2 additions & 0 deletions src/components/message/Message.js
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,7 @@ const Message = function ({ markup, meta, parentStyles, warnings }) {
currency,
buyerCountry,
language,
locale,
ignoreCache,
offer,
payerId,
Expand Down Expand Up @@ -165,6 +166,7 @@ const Message = function ({ markup, meta, parentStyles, warnings }) {
currency,
buyer_country: buyerCountry,
language,
locale,
ignore_cache: ignoreCache,
style,
credit_type: offer,
Expand Down
2 changes: 2 additions & 0 deletions src/components/modal/v2/lib/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ export const getContent = memoize(
customerId,
buyerCountry,
language,
locale,
ignoreCache,
deviceID,
version,
Expand All @@ -37,6 +38,7 @@ export const getContent = memoize(
customer_id: customerId,
buyer_country: buyerCountry,
language,
locale,
ignore_cache: ignoreCache,
deviceID,
version,
Expand Down
2 changes: 2 additions & 0 deletions src/components/modal/v2/parts/Container.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ const Container = ({ children }) => {
customerId,
buyerCountry,
language,
locale,
ignoreCache,
version,
env,
Expand Down Expand Up @@ -74,6 +75,7 @@ const Container = ({ children }) => {
customerId,
buyerCountry,
language,
locale,
ignoreCache,
version,
env,
Expand Down
3 changes: 3 additions & 0 deletions src/library/controllers/message/interface.js
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@ export default (options = {}) => ({
offer,
buyerCountry,
language,
locale,
ignoreCache,
onClick,
onRender,
Expand All @@ -122,6 +123,7 @@ export default (options = {}) => ({
amount,
buyerCountry,
language,
locale,
ignoreCache,
channel,
ecToken,
Expand Down Expand Up @@ -183,6 +185,7 @@ export default (options = {}) => ({
amount: ${amount},
buyerCountry: ${buyerCountry},
language: ${language},
locale: ${locale},
pageType: ${pageType},

renderStart: ${new Date(renderStart).toLocaleString()},
Expand Down
4 changes: 3 additions & 1 deletion src/library/controllers/modal/interface.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ const memoizedModal = memoizeOnProps(
amount,
buyerCountry,
language,
locale,
ignoreCache,
offer,
onReady,
Expand Down Expand Up @@ -56,6 +57,7 @@ const memoizedModal = memoizeOnProps(
amount,
buyerCountry,
language,
locale,
ignoreCache,
offer,
onReady,
Expand Down Expand Up @@ -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));
21 changes: 19 additions & 2 deletions src/library/zoid/message/component.js
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down Expand Up @@ -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) {
Expand All @@ -164,6 +180,7 @@ export default createGlobalVariableGetter('__paypal_credit_message__', () =>
amount,
buyerCountry,
language,
locale,
onApply,
offer: offerType,
offerCountry,
Expand Down
11 changes: 11 additions & 0 deletions src/library/zoid/message/validation.js
Original file line number Diff line number Diff line change
Expand Up @@ -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)) {
Expand Down
6 changes: 6 additions & 0 deletions src/library/zoid/modal/component.js
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down
6 changes: 3 additions & 3 deletions tests/functional/v2/config/ES/DEV_ES_LONG_TERM.js
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand All @@ -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%'
}
}
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
16 changes: 8 additions & 8 deletions utils/devServerProxy/config/ES/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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'
}
Expand All @@ -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
Comment thread
surekhaw marked this conversation as resolved.
maxAmount: 5000
},
{
totalPayments: 24,
apr: 14.99,
nominalRate: 14.99,
minAmount: 240,
maxAmount: 2999
maxAmount: 5000
}
]
}
Expand Down Expand Up @@ -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'
}
Expand All @@ -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
}
]
}
Expand Down
Loading