Appearance
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
| Component | File | Role |
|---|---|---|
PaylineService | src/CoreBundle/Services/PaylineService.php | Payment processing and API communication |
PaylineTransactionLogService | src/CoreBundle/Services/PaylineTransactionLogService.php | Logs every transaction for auditing |
PaylineCommandsMapping | Entity | Maps 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
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
| Operation | API Call | Description |
|---|---|---|
| Web payment | doWebPayment | Redirect customer to Payline hosted page |
| Capture | doCapture | Capture a previously authorized payment |
| Refund | doRefund | Process a full or partial refund |
| Status check | getWebPaymentDetails | Query 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
Error Handling
| Scenario | Behavior |
|---|---|
| Payment declined | Logged; customer redirected to retry |
| Capture failure | Alert raised; operator must retry manually |
| Refund rejected | Logged; operator notified |
| API timeout | Logged; retry with backoff |
| Duplicate transaction | Detected 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.