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

Fix idempotency response should return an Error object #654

Merged
merged 1 commit into from
Nov 12, 2024

Conversation

williamdes
Copy link
Contributor

Before this PR it would build an invalid object and get the code in trouble.
See:

MangoPay\Response {
  +StatusCode: "400"
  +ContentLength: ""
  +ContentType: "application/json"
  +Date: "Tue, 27 Aug 2024 09:00:05 GMT"
  +RequestURL: "https://api.sandbox.mangopay.com/v2.01/xxxx-dev/users/legal"
  +Resource: MangoPay\UserLegal {#2972
    +Id: "e97b2e7b-b5f6-4fce-8ff7-d55252da9bb1#1724749205"
    +Tag: null
    +CreationDate: null
    +PersonType: "LEGAL"
    +Email: null
    +KYCLevel: null
    +TermsAndConditionsAccepted: null
    +TermsAndConditionsAcceptedDate: null
    +UserCategory: null
    +Name: null
    +LegalPersonType: null
    +HeadquartersAddress: null
    +LegalRepresentativeFirstName: null
    +LegalRepresentativeLastName: null
    +LegalRepresentativeAddress: null
    +LegalRepresentativeEmail: null
    +LegalRepresentativeBirthday: null
    +LegalRepresentativeNationality: null
    +LegalRepresentativeCountryOfResidence: null
    +LegalRepresentativeProofOfIdentity: null
    +Statute: null
    +ProofOfRegistration: null
    +ShareholderDeclaration: null
    +CompanyNumber: null
  }
}

You can see that the Id is very wrong and start to understand where the problem is.
This PR fixes it.

Copy link

@ChoppyDev ChoppyDev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@williamdes
Copy link
Contributor Author

@fredericdelordm can you please dispatch this PR for review please, it fixes an important bug

@iulian03 iulian03 merged commit 32313c5 into Mangopay:master Nov 12, 2024
0 of 4 checks passed
@williamdes williamdes deleted the fix-idempotency branch November 12, 2024 10:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants