Context
The gateway is the only component that talks to the live Pacto API, holding pk_/sk_ credentials on behalf of every merchant. Today /v1/session and outbound webhooks have no rate limiting or replay protection, leaving them open to abuse and duplicate-processing bugs once real merchant traffic hits it.
Scope
- Rate limit
/v1/session and other public gateway endpoints per publishable key (sliding window, configurable).
- Replay protection for signed webhooks: nonce/timestamp validation, reject requests outside a tolerance window.
- Idempotency keys honored end-to-end so retried requests never create duplicate escrows or double-fire webhooks.
Acceptance criteria
- A burst of requests beyond the configured limit returns 429 with a
Retry-After header.
- A replayed webhook payload (same signature, past its tolerance window) is rejected and logged.
- Sending the same idempotency key twice returns the original result, not a duplicate side effect.
Context
The gateway is the only component that talks to the live Pacto API, holding pk_/sk_ credentials on behalf of every merchant. Today
/v1/sessionand outbound webhooks have no rate limiting or replay protection, leaving them open to abuse and duplicate-processing bugs once real merchant traffic hits it.Scope
/v1/sessionand other public gateway endpoints per publishable key (sliding window, configurable).Acceptance criteria
Retry-Afterheader.