You are here

public function OffsitePaymentGatewayBase::onCancel in Commerce Core 8.2

Processes the "cancel" request.

Allows the payment gateway to clean up any data added to the $order, set a message for the customer.

Parameters

\Drupal\commerce_order\Entity\OrderInterface $order: The order.

\Symfony\Component\HttpFoundation\Request $request: The request.

Overrides OffsitePaymentGatewayInterface::onCancel

File

modules/payment/src/Plugin/Commerce/PaymentGateway/OffsitePaymentGatewayBase.php, line 31

Class

OffsitePaymentGatewayBase
Provides the base class for off-site payment gateways.

Namespace

Drupal\commerce_payment\Plugin\Commerce\PaymentGateway

Code

public function onCancel(OrderInterface $order, Request $request) {
  $this
    ->messenger()
    ->addMessage($this
    ->t('You have canceled checkout at @gateway but may resume the checkout process here when you are ready.', [
    '@gateway' => $this
      ->getDisplayLabel(),
  ]));
}