PaymentNotificationLogTrait
Writes one row of the payment gateway notification history per notification (admin tab "Communication with the gateway").
PaymentProcessorTrait::processPayment() collects the outcome while it processes the notification
(markNotificationOutcome(); a later step overrides an earlier one) and writes the row at the end.
Entry points that end before processing (a closed payment without a further paid transaction, an unusable
gateway) write directly with recordGatewayNotification().
IMPORTANT: fail-soft. The manager catches and logs a failed write; the payment flow never depends on it.
Table of Contents
Properties
- $paymentGatewayNotificationManager : PaymentGatewayNotificationManager
- $notificationReason : string|null
- $notificationResult : GatewayNotificationResult|null
Methods
- recordClosedPaymentNotification() : void
- Records a notification about a completed or refunded payment as a duplicate. `$check` = what the gateway said (a completed payment is asked, a refunded one is not).
- recordGatewayNotification() : void
- markNotificationOutcome() : void
- A later step overrides the result; reasons of consecutive steps with the same result are joined, so that e.g. "frozen payment" and "callback already ran" both stay visible.
- resetNotificationOutcome() : void
Properties
$paymentGatewayNotificationManager
public
PaymentGatewayNotificationManager
$paymentGatewayNotificationManager
Attributes
- #[Inject]
$notificationReason
private
string|null
$notificationReason
= null
$notificationResult
private
GatewayNotificationResult|null
$notificationResult
= null
Methods
recordClosedPaymentNotification()
Records a notification about a completed or refunded payment as a duplicate. `$check` = what the gateway said (a completed payment is asked, a refunded one is not).
protected
recordClosedPaymentNotification(Payment $payment, GatewayNotificationTransport $transport[, GatewayCheckResult|null $check = null ]) : void
Parameters
- $payment : Payment
- $transport : GatewayNotificationTransport
- $check : GatewayCheckResult|null = null
recordGatewayNotification()
protected
recordGatewayNotification(int|null $paymentId, int|null $paymentGateId, GatewayNotificationTransport $transport, GatewayCheckResult|null $check, GatewayNotificationResult $result[, string|null $reason = null ]) : void
Parameters
- $paymentId : int|null
- $paymentGateId : int|null
- $transport : GatewayNotificationTransport
- $check : GatewayCheckResult|null
- $result : GatewayNotificationResult
- $reason : string|null = null
markNotificationOutcome()
A later step overrides the result; reasons of consecutive steps with the same result are joined, so that e.g. "frozen payment" and "callback already ran" both stay visible.
private
markNotificationOutcome(GatewayNotificationResult $result[, string|null $reason = null ]) : void
Parameters
- $result : GatewayNotificationResult
- $reason : string|null = null
resetNotificationOutcome()
private
resetNotificationOutcome() : void