You are here

CompletePayment.php in Payment 8.2

File

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

namespace Drupal\payment\Controller;

use Drupal\payment\Entity\PaymentInterface;

/**
 * Handles the "complete payment" route.
 */
class CompletePayment {

  /**
   * Completes a payment.
   *
   * @param \Drupal\payment\Entity\PaymentInterface $payment
   *
   * @return \Symfony\Component\HttpFoundation\Response
   */
  public function execute(PaymentInterface $payment) {
    return $payment
      ->getPaymentMethod()
      ->getPaymentExecutionResult()
      ->getCompletionResponse()
      ->getResponse();
  }

}

Classes

Namesort descending Description
CompletePayment Handles the "complete payment" route.