Change merchant category code type #245
Merged
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 of Changes
Changes the type of the
merchantCategoryCode
transaction field from String to Integer. The MCC is defined as a 4-digit number and is handled as an integer in multiple MX APIs (e.g. Platform, Nexus, Atrium) and backend services (e.g. Abacus, Sherlock).Jira Issue
Public API Additions/Changes
In the
Transaction
model, themerchantCategoryCode
field is now an Integer. When serialized to JSON, it will appear as a number rather than a string.setMerchantCategoryCode(String merchantCategoryCode)
is deprecated in favor ofsetMerchantCategoryCode(Integer merchantCategoryCode)
.Downstream Consumer Impact
Going forward, accessors that populate the
merchantCategoryCode
field should pass the MCC as an integer tosetMerchantCategoryCode
. If the MCC is a String in the upstream DTO (data transfer object), it should be parsed as an Integer before assigning it to the MDX transaction.For existing implementations, a deprecated setter that accepts a string as input is also provided in order to make this a non-breaking change. This setter will convert the input string to an integer before assigning it to
merchantCategoryCode
and will throw aNumberFormattingException
if the string does not contain a parseable integer.How Has This Been Tested?
I pulled a snapshot version of the changes into Ultraman to verify the new functionality. I was able to successfully use all getters and setters for
merchantCategoryCode
and verified that the field was serialized correctly.Example request:
Example response:
Checklist: