v0.7.0
What's Changed
CanceltakesRequestOptions, so a cancellation can carry an idempotency key
Why
Issue and Reissue already accepted the key; Cancel — the one irreversible call, inside a legal window — did not. A dropped connection or a retry sent a second cancellation.
result, err := invoice.Cancel(
accessKey,
stackin.NFSE,
"Pedido cancelado pelo comprador",
stackin.WithIdempotencyKey("cancel-8f21"),
)The same key with the same body replays the stored answer. A different body under the same key is refused, not silently accepted. Nothing generates a key for you: two calls without one are two cancellations, deliberately.
The variadic parameter is additive — existing three-argument calls still compile.