Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove omitempty tag from AmountAllocations's amount field #96

Merged
merged 1 commit into from
Dec 14, 2023

Conversation

borosr
Copy link
Contributor

@borosr borosr commented Dec 8, 2023

Problem:

I got the following error when I tried to send a Credit Card verification request with a 0 amount.

{
    "request_id": "some_id",
    "error_type": "request_invalid",
    "error_codes": [
        "sub_entity_amount_required"
    ]
}

That happened because the amount_allocations's amount field was 0, so the json.Marshal(...) removed it from the result JSON object.

Solution:

I recommend removing the omitempty tag from this field because the amount should always be present.

@armando-rodriguez-cko armando-rodriguez-cko merged commit 077cb8e into checkout:master Dec 14, 2023
2 of 4 checks passed
armando-rodriguez-cko added a commit that referenced this pull request Dec 14, 2023
- Remove omitempty tag from AmountAllocations's amount field (#96)
armando-rodriguez-cko added a commit that referenced this pull request Dec 14, 2023
- Remove omitempty tag from AmountAllocations's amount field (#96)
armando-rodriguez-cko added a commit that referenced this pull request Dec 14, 2023
- Remove omitempty tag from AmountAllocations's amount field (#96)
armando-rodriguez-cko added a commit that referenced this pull request Dec 14, 2023
- Remove omitempty tag from AmountAllocations's amount field (#96)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants