Skip to content

Payline Integration ​

Payline is a card payment provider with the most detailed transaction logging in Logidav. Every transaction is recorded through a dedicated logging service, and command-to-transaction mappings are maintained for full audit traceability.

Components ​

ComponentFileRole
PaylineServicesrc/CoreBundle/Services/PaylineService.phpPayment processing and API communication
PaylineTransactionLogServicesrc/CoreBundle/Services/PaylineTransactionLogService.phpLogs every transaction for auditing
PaylineCommandsMappingEntityMaps commands to Payline transactions

Configuration ​

Required parameters in parameters.yml:

yaml
payline:
  merchant_id: "..."
  access_key: "..."
  contract_number: "..."
  environment: "production"

Data Flow ​

View diagram source
sequenceDiagram
    participant CUST as Customer
    participant MAG as Magento Checkout
    participant SVC as PaylineService
    participant PAY as Payline API
    participant LOG as PaylineTransactionLogService
    participant DB as Database

    CUST->>MAG: Submit payment
    MAG->>SVC: Process payment
    SVC->>PAY: doWebPayment / doCapture
    PAY-->>SVC: Transaction result
    SVC->>LOG: Log transaction details
    LOG->>DB: Persist PaylineTransactionLog
    SVC->>DB: Update order payment status

Diagram

Transaction Logging ​

The PaylineTransactionLogService records every interaction with the Payline API, including:

  • Request data: amount, currency, order reference, card type
  • Response data: transaction ID, return code, status message
  • Timestamps: request sent, response received
  • Command mapping: which Logidav command triggered the transaction

The PaylineCommandsMapping entity links Logidav commands (order IDs, refund requests) to their corresponding Payline transaction IDs, enabling full traceability.

Audit trail

Payline's transaction logging is the most complete among all payment integrations. Use PaylineTransactionLogService as a reference when building audit trails for other providers.

Payment Operations ​

OperationAPI CallDescription
Web paymentdoWebPaymentRedirect customer to Payline hosted page
CapturedoCaptureCapture a previously authorized payment
RefunddoRefundProcess a full or partial refund
Status checkgetWebPaymentDetailsQuery transaction status

Refund Flow ​

View diagram source
sequenceDiagram
    participant OP as Operator
    participant SVC as PaylineService
    participant PAY as Payline API
    participant LOG as PaylineTransactionLogService

    OP->>SVC: Request refund (orderId, amount)
    SVC->>PAY: doRefund(transactionId, amount)
    PAY-->>SVC: Refund confirmation
    SVC->>LOG: Log refund transaction
    SVC->>SVC: Update order status

Diagram

Error Handling ​

ScenarioBehavior
Payment declinedLogged; customer redirected to retry
Capture failureAlert raised; operator must retry manually
Refund rejectedLogged; operator notified
API timeoutLogged; retry with backoff
Duplicate transactionDetected via PaylineCommandsMapping; skipped

Duplicate prevention

The PaylineCommandsMapping entity prevents duplicate charges by tracking which commands have already been processed. Always check this mapping before initiating a new transaction for the same order.

Internal developer documentation for Menzzo systems.