CoolCMS API

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

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

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
On this page

Search results