Skip to main content

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

ComponentFileRole
AlmaApisrc/CoreBundle/Api/AlmaApi.phpAlma API client
AlfyApi / AlfyApiInterfacesrc/CoreBundle/Api/AlfyApi.phpAlfy 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

ScenarioBehavior
Alma plan rejectedCustomer offered alternative payment methods
Alfy insurance deniedFallback to standard payment flow
API timeoutRetry with backoff
Settlement discrepancyAlert raised for manual reconciliation