diff --git a/src/util/currency.js b/src/util/currency.js index b1827458..0874c1b8 100644 --- a/src/util/currency.js +++ b/src/util/currency.js @@ -1,7 +1,6 @@ import { has, trimEnd } from 'lodash'; import Decimal from 'decimal.js'; import { types } from './sdkLoader'; -import config from '../config'; import { subUnitDivisors } from './currencyConfig'; // https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Global_Objects/Number/MAX_SAFE_INTEGER @@ -205,9 +204,6 @@ export const convertMoneyToNumber = value => { if (!(value instanceof types.Money)) { throw new Error('Value must be a Money type'); } - if (value.currency !== config.currency) { - throw new Error('Given currency different from marketplace currency'); - } const subUnitDivisorAsDecimal = convertDivisorToDecimal(unitDivisor(value.currency)); let amount; @@ -245,9 +241,6 @@ export const formatMoney = (intl, value) => { if (!(value instanceof types.Money)) { throw new Error('Value must be a Money type'); } - if (value.currency !== config.currency) { - throw new Error('Given currency different from marketplace currency'); - } const valueAsNumber = convertMoneyToNumber(value); // See: https://github.com/yahoo/react-intl/wiki/API#formatnumber diff --git a/src/util/currency.test.js b/src/util/currency.test.js index 7e055fc8..cd357319 100644 --- a/src/util/currency.test.js +++ b/src/util/currency.test.js @@ -238,13 +238,6 @@ describe('currency utils', () => { const value = null; expect(() => formatMoney(intl, value)).toThrowError('Value must be a Money type'); }); - it('complains about mismatching currencies', () => { - const intl = null; - const value = new types.Money(100, 'EUR'); - expect(() => formatMoney(intl, value)).toThrowError( - 'Given currency different from marketplace currency' - ); - }); // No test for that actual formatting for now. It depends on the // locale, and it doesn't really make sense to test the fake intl