betalabs / engine-sdk-gateway
Gateway SDK for internal apps Engine
5.3.7
2025-04-11 16:44 UTC
Requires
- php: >=7.2
- betalabs/engine-contracts: ^2.3
- garoevans/php-enum: ^1.2
- laravel/framework: ^7.0|^8.0|^9.0
Requires (Dev)
None
Suggests
None
Provides
None
Conflicts
None
Replaces
None
This package is auto-updated.
Last update: 2026-10-28 14:17:06 UTC
README
This package provides gateway interfaces used in Engine for your internal apps.
Installation
$ composer require betalabs/engine-sdk-gateway
Pix Automático (recurring Pix debit)
Optional contract for gateways that support Pix Automático. A gateway driver
opts in by implementing the two interfaces below; Engine checks instanceof
and refuses the payment method when the driver does not implement them, so
drivers that do not support it are not affected.
| Interface | Role |
|---|---|
PixAutomaticAuthorizer |
authorizePixAutomatic, refreshPixAutomaticAuthorization, cancelPixAutomaticAuthorization |
PixAutomaticCharger |
schedulePixAutomaticCharge, retryPixAutomaticCharge, cancelPixAutomaticCharge |
PixAutomaticAuthorization |
The authorization itself. Implemented by Engine (a persisted model), like Transaction: the gateway reads what to create from the getters and writes the gateway's answer through the setters. |
How it maps to what already exists:
- The authorization plays the role the tokenized card plays for credit cards: it is created once per subscription, after the payer approves it in the bank app.
- Each cycle is a scheduled debit (
schedulePixAutomaticCharge) created days before the due date. Nothing is paid when it returns: theTransactioniswaiting paymentand the final status arrives later (postback or polling), using the existingTransactionStatus. - A debit refused for lack of balance is the only retryable one. The gateway must say which kind of failure it was in the history's status reason.
- Enums (
PixAutomaticPeriodicity,PixAutomaticAmountMode,PixAutomaticAuthorizationStatus) use the Central Bank of Brazil's concepts, not any gateway's vocabulary: each driver translates them.
Design and rollout: docs/payments/pix-automatico-plano.md in the Engine repository.