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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

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

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.

2 participants