Apply sorting rules to brands returned by binLookup #873
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
Added a frontend layer to sort the array of
brands
objects from the /binLookup response.This is necessary because there are some inconsistencies in the /binLookup response:
e.g. card brands not always returned in the same order
and the fact that some components force new rules:
e.g. standalone Bancontact/BCMC card component with a dual branded bcmc/maestro card should show the maestro brand with a hidden cvc field
To correct these things we now apply some rules via a frontend sorting procedure.
In the future it may be that the /binLookup will be able to sort the returned brands array according to these criteria.
Tested scenarios
Tested the rules are applied and the brands are sorted accordingly.