You are here

Redirect.php in Mollie Payment 8.2

File

src/Controller/Redirect.php
View source
<?php

namespace Drupal\mollie_payment\Controller;

use Drupal\Core\Controller\ControllerBase;
use Symfony\Component\HttpFoundation\Request;
use Drupal\payment\Entity\PaymentInterface;

/**
 * Handles the "redirect" route.
 */
class Redirect extends ControllerBase {

  /**
   * Mollie is redirecting the visitor here after the payment process. At this
   * point we don't know the status of the payment yet so we can only load
   * the payment and give control back to the payment context.
   *
   * @param \Drupal\payment\Entity\PaymentInterface $payment
   *
   * @return
   */
  public function execute(PaymentInterface $payment) {
    $response = $payment
      ->getPaymentType()
      ->getResumeContextResponse();
    return $response
      ->getResponse();
  }

}

Classes

Namesort descending Description
Redirect Handles the "redirect" route.