Alma & Alfy Integration
Alma provides buy-now-pay-later installment payments. Alfy offers insurance-backed payment plans. Both are integrated through dedicated API clients.
Components
| Component | File | Role |
|---|---|---|
AlmaApi | src/CoreBundle/Api/AlmaApi.php | Alma API client |
AlfyApi / AlfyApiInterface | src/CoreBundle/Api/AlfyApi.php | Alfy API client (with interface) |
Configuration
Required parameters in parameters.yml:
alma:
api_url: "https://..."
api_key: "..."
alfy:
api_url: "https://..."
api_key: "..."
Alma -- BNPL Flow
Alma works similarly to Klarna and Scalapay: the customer selects installment payment at checkout, the provider approves the plan, and Logidav receives confirmation to proceed with fulfillment.
Alfy -- Insurance-Backed Payments
Alfy adds an insurance layer to payments, providing coverage for the transaction:
:::info Interface pattern
AlfyApi implements AlfyApiInterface, which allows for easier testing and potential alternative implementations. This is one of the few payment integrations that uses an explicit interface.
:::
Error Handling
| Scenario | Behavior |
|---|---|
| Alma plan rejected | Customer offered alternative payment methods |
| Alfy insurance denied | Fallback to standard payment flow |
| API timeout | Retry with backoff |
| Settlement discrepancy | Alert raised for manual reconciliation |