OffsitePaymentGatewayBase.php in Commerce Core 8.2
File
modules/payment/src/Plugin/Commerce/PaymentGateway/OffsitePaymentGatewayBase.php
View source
<?php
namespace Drupal\commerce_payment\Plugin\Commerce\PaymentGateway;
use Drupal\commerce_order\Entity\OrderInterface;
use Drupal\Core\Url;
use Symfony\Component\HttpFoundation\Request;
abstract class OffsitePaymentGatewayBase extends PaymentGatewayBase implements OffsitePaymentGatewayInterface {
public function getNotifyUrl() {
return Url::fromRoute('commerce_payment.notify', [
'commerce_payment_gateway' => $this->parentEntity
->id(),
], [
'absolute' => TRUE,
]);
}
public function onReturn(OrderInterface $order, Request $request) {
}
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(),
]));
}
public function onNotify(Request $request) {
}
}