Skip to main content
A payment represents a charge against a customer’s payment method. The SDK routes payments through your configured provider (Stripe, PagarMe, or MercadoPago) and returns a unified response regardless of which provider processes it. Payments can be created with immediate confirmation or held in a pending state for manual confirmation.

Methods

Create a payment

Payment requests are provider-specific. Pass the provider field to select the request shape.

Stripe

PagarMe

PagarMe PIX

MercadoPago

Provider request fields

Confirm a payment

Cancel a payment

Capture a payment

If a payment was created with capture_method: "manual", you must explicitly capture it to collect funds:

Sandbox test helpers

The SDK provides sandbox-only methods to simulate payment state transitions during development.

Simulate a paid payment

Simulate settling a payment

sandboxPaid() and sandboxSettle() are restricted to the sandbox environment. Calling them in production returns an EnvironmentViolationError.

Response type

All three methods return Result<Payment.Response>. The response data extends the original request with additional fields:
To issue a refund on a completed payment, see Refunds.