Klarna & Scalapay Integration
Klarna and Scalapay provide buy-now-pay-later (BNPL) payment options, allowing customers to pay in installments. Both integrations follow a similar flow: order approval, installment plan creation, and periodic settlement.
Components
| Component | File | Role |
|---|---|---|
KlarnaApi | src/CoreBundle/Api/KlarnaApi.php | Klarna API client |
ScalapayApi | src/CoreBundle/Api/ScalapayApi.php | Scalapay API client |
Configuration
Required parameters in parameters.yml:
klarna:
api_url: "https://..."
username: "..."
password: "..."
scalapay:
api_url: "https://..."
api_key: "..."
BNPL Flow
How It Works
- Checkout: the customer selects Klarna or Scalapay as their payment method
- Approval: the BNPL provider evaluates the customer and approves the installment plan
- Confirmation: the customer confirms the payment schedule
- Order creation: Logidav records the approved transaction and proceeds with fulfillment
- Settlement: the BNPL provider collects installments from the customer and settles with the merchant on a schedule
:::info Merchant risk With BNPL, the merchant receives the full payment from the provider (minus fees) regardless of whether the customer completes all installments. The credit risk sits with Klarna or Scalapay. :::
Error Handling
| Scenario | Behavior |
|---|---|
| Customer not approved | Order cancelled or alternative payment offered |
| Session expired | Customer must restart checkout |
| Settlement delay | Monitored; no action needed from Logidav |
| API timeout | Retry with backoff |