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:
payline:
merchant_id: "..."
access_key: "..."
contract_number: "..."
environment: "production"
Data Flow
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.
:::tip 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
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 |
:::warning 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.
:::