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: first_invoice_offset type #83

Conversation

OtavioPontes
Copy link
Contributor

In the preapproval package, when trying to unmarshal the Response struct, it throws the error:

"encoding/json.UnmarshalTypeError {Value: "number", Type: reflect.Type(*reflect.rtype) *{t: (*"internal/abi.Type")(0x1eef160)}, Offset: 1243, Struct: "Response", Field: "first_invoice_offset"}".

This is because the FirstInvoiceOffset field is of type string, when it should be a integer.

@renanneri01
Copy link
Contributor

Hi @OtavioPontes

We will analyze the proposed solution and soon integrate it into our product.
Thank you very much for your contribution!

Copy link
Contributor

@renanneri01 renanneri01 left a comment

Choose a reason for hiding this comment

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

Otavio, you also need to make the change in the tests in pkg/preapproval/client_test that have the FirstInvoiceOffset property as a string, causing the tests to break after the change to int.

@renanneri01 renanneri01 merged commit 998a244 into mercadopago:main Jan 15, 2025
2 checks passed
@renanneri01
Copy link
Contributor

renanneri01 commented Jan 15, 2025

@OtavioPontes We have already made available a new version (v1.0.9) of the SDK with the property correction.

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