-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(processor): apply fraction digits mapping for adyen
- Loading branch information
1 parent
1497f84
commit 2a7fc00
Showing
10 changed files
with
110 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
import { describe, test, expect } from '@jest/globals'; | ||
import { CURRENCIES_FROM_ADYEN_TO_ISO_MAPPING, CURRENCIES_FROM_ISO_TO_ADYEN_MAPPING } from './currencies'; | ||
|
||
describe('constants.currencies', () => { | ||
test('CURRENCIES_FROM_ISO_TO_ADYEN_MAPPING', () => { | ||
const expected = new Map<string, number>([ | ||
['CLP', -2], | ||
['CVE', 2], | ||
['IDR', 2], | ||
['ISK', -2], | ||
['CVE', 2], | ||
]); | ||
|
||
expect(CURRENCIES_FROM_ISO_TO_ADYEN_MAPPING).toEqual(expected); | ||
}); | ||
|
||
test('CURRENCIES_FROM_ADYEN_TO_ISO_MAPPING', () => { | ||
const expected = new Map<string, number>([ | ||
['CLP', 2], | ||
['CVE', -2], | ||
['IDR', -2], | ||
['ISK', 2], | ||
['CVE', -2], | ||
]); | ||
|
||
expect(CURRENCIES_FROM_ADYEN_TO_ISO_MAPPING).toEqual(expected); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
// Mappings are based on the deviatons from https://en.wikipedia.org/wiki/ISO_4217 defined on the Adyen table defined https://docs.adyen.com/development-resources/currency-codes/#note | ||
|
||
// TODO: SCC-2800: figure out if we can move some of the mapping stuff to here using a updated connect-payments-sdk | ||
const CURRENCIES_FROM_ISO_TO_ADYEN_MAPPING = new Map<string, number>([ | ||
['CLP', -2], | ||
['CVE', 2], | ||
['IDR', 2], | ||
['ISK', -2], | ||
['CVE', 2], | ||
]); | ||
|
||
const CURRENCIES_FROM_ADYEN_TO_ISO_MAPPING = new Map<string, number>([ | ||
['CLP', 2], | ||
['CVE', -2], | ||
['IDR', -2], | ||
['ISK', 2], | ||
['CVE', -2], | ||
]); | ||
|
||
export { CURRENCIES_FROM_ISO_TO_ADYEN_MAPPING, CURRENCIES_FROM_ADYEN_TO_ISO_MAPPING }; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters