fix: update Pix check and simulatePayment to use id query param (#41)#47
Closed
Gustavonobregab wants to merge 1 commit intoAbacatePay:developfrom
Closed
fix: update Pix check and simulatePayment to use id query param (#41)#47Gustavonobregab wants to merge 1 commit intoAbacatePay:developfrom
Gustavonobregab wants to merge 1 commit intoAbacatePay:developfrom
Conversation
LeoSSpecht
reviewed
Jun 4, 2025
| return request(`/pixQrCode/simulate-payment?id=${data.id}`, { | ||
| method: 'POST', | ||
| body: JSON.stringify(data), | ||
| body: JSON.stringify({ metadata: {} }), |
There was a problem hiding this comment.
Here originally they were passing in the data parameter. I agree with you change of not sending in the original data.
However, it might valid to pass in an additional (optional) argument so the user can pass in metadata that could later be passed into the response.
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.

Closes #41
This PR updates the check and simulatePayment methods in the pixQrCode module to follow the correct API usage.
What was changed:
-check now uses GET /pixQrCode/check?id=... instead of POST with full payload
-simulatePayment now uses POST /pixQrCode/simulate-payment?id=... with a minimal body { metadata: {} }
-Added a new type PixIdParams to standardize usage with only the id field
Notes:
-Existing tests fail because they expect the old request format. Test mocks should be updated to match the new signature and method type.
-This change aligns the SDK with the current Pix QRCode API behavior.
**This is my first time contributing to and interacting with an open source project. Please feel free to review and let me know if anything needs to be improved , I’ll be happy to adjust.