Add automatic pix#63
Conversation
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Review — pontos a endereçar antes do merge🔴 Blockers1. Exports de classe top-level faltando em Os módulos estão expostos ( Adicionar logo após a linha do exports.PixPullSubscription = exports.pixPullSubscription.PixPullSubscription;
exports.PixPullRequest = exports.pixPullRequest.PixPullRequest;E ajustar os exemplos do README pra usar 2. Testes ausentes de Métodos públicos sem cobertura nenhuma:
Padrão de referência: 🟡 Should-fix3. Normalização de datetime inconsistente entre os dois recursos
Se o servidor pode retornar string vazia no 4. Asserção do "no A descrição do PR diz que
5. Caminho de sucesso do
|
- index.js:84 — add top-level exports.PixPullSubscription and exports.PixPullRequest class aliases (item A) - README.md:2557,2707 — update Pix Pull examples to use the new top-level class names (item A) - sdk/pixPullRequest/pixPullRequest.js:57 — normalize empty-string `due` to null, matching pixPullSubscription.js:76-77 (item C) - tests/testPixPullRequest.js — add TestPixPullRequestInfoGet, TestPixPullRequestPatch, TestPixPullRequestCancel, TestPixPullRequestNoParse, TestPixPullRequestNormalization (items B, D, partial E) - tests/testPixPullSubscription.js — add TestPixPullSubscriptionNormalization, TestPixPullSubscriptionPatch, TestPixPullSubscriptionCancel; the normalization test locks in the due/installmentEnd empty-string -> null invariant without requiring a sandbox-issued signature (items B, E)
Summary
Adds support for the Pix Automático (Automatic Pix) feature: recurring debit authorizations and the per-cycle pulls that draw on them.
New resources
pixPullSubscription— recurring debit authorization. Full CRUD:create(batch),get,query,page,update,cancel. Pluslogsub-resource withget/query/page.pixPullRequest— single pull cycle against an active subscription. Full CRUD +logsub-resource (same shape).Wiring
pix-pull-subscriptionandpix-pull-request-log.[Unreleased] → Added.Test plan
All mocha integration tests run end-to-end against the sandbox:
testPixPullSubscription.js+testPixPullSubscriptionLog.js— CRUD round-trip,subscriptionIdsplural filter,Event.parsedispatch, M8 datetime empty-string normalization.testPixPullRequest.js+testPixPullRequestLog.js— CRUD,requestIdsplural filter, M12 noparsemethod on resource.Notes
e.constructor.name === "InvalidSignatureError"rather thaninstanceof— thestarkcoreandsdk/error.jsmodules define separateInvalidSignatureErrorclasses with different constructor identities; both carry the same.namestring.nullbefore parsing.try/catchguards where the sandbox enforces business rules outside the SDK's contract (state-transition restrictions, receiver-only roles).🤖 Generated with Claude Code