Skip to 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:

yaml
alma:
  api_url: "https://..."
  api_key: "..."

alfy:
  api_url: "https://..."
  api_key: "..."

Alma -- BNPL Flow ​

View diagram source
sequenceDiagram
    participant CUST as Customer
    participant MAG as Magento Checkout
    participant ALMA as Alma API
    participant API as AlmaApi
    participant DB as Database

    CUST->>MAG: Select Alma at checkout
    MAG->>ALMA: Create payment plan
    ALMA-->>CUST: Display installment schedule
    CUST->>ALMA: Approve plan
    ALMA->>API: Payment confirmed
    API->>DB: Record transaction

Diagram

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:

View diagram source
sequenceDiagram
    participant CUST as Customer
    participant MAG as Magento Checkout
    participant ALFY as Alfy API
    participant API as AlfyApi
    participant DB as Database

    CUST->>MAG: Select Alfy option
    MAG->>ALFY: Create insured payment
    ALFY-->>MAG: Insurance + payment confirmation
    API->>DB: Record insured transaction

Diagram

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

Internal developer documentation for Menzzo systems.