You are here

interface PaymentMethodPluginInterface in Ubercart 8.4

Defines an interface for payment method plugins.

Hierarchy

Expanded class hierarchy of PaymentMethodPluginInterface

All classes that implement PaymentMethodPluginInterface

1 file declares its use of PaymentMethodPluginInterface
PaymentMethodManager.php in payment/uc_payment/src/Plugin/PaymentMethodManager.php

File

payment/uc_payment/src/PaymentMethodPluginInterface.php, line 14

Namespace

Drupal\uc_payment
View source
interface PaymentMethodPluginInterface extends PluginInspectionInterface, PluginFormInterface, ConfigurableInterface {

  /**
   * Returns the payment method label with logo.
   *
   * @param string $label
   *   The payment method label to be styled.
   *
   * @return array
   *   A render array containing the formatted payment method label.
   */
  public function getDisplayLabel($label);

  /**
   * Returns the form or render array to be displayed at checkout.
   *
   * @param \Drupal\uc_order\OrderInterface $order
   *   The order which is being processed.
   * @param array $form
   *   The checkout form array.
   * @param \Drupal\Core\Form\FormStateInterface $form_state
   *   The checkout form state array.
   *
   * @return array
   *   A form or render array.
   */
  public function cartDetails(OrderInterface $order, array $form, FormStateInterface $form_state);

  /**
   * Called when checkout is submitted with this payment method selected.
   *
   * Use this method to process any form elements output by the cartDetails()
   * method.
   *
   * @param \Drupal\uc_order\OrderInterface $order
   *   The order which is being processed.
   * @param array $form
   *   The checkout form array.
   * @param \Drupal\Core\Form\FormStateInterface $form_state
   *   The checkout form state array.
   *
   * @return bool
   *   Return FALSE to abort the checkout process, or any other value to
   *   continue the checkout process.
   */
  public function cartProcess(OrderInterface $order, array $form, FormStateInterface $form_state);

  /**
   * Returns the payment method title to be used on the checkout review page.
   *
   * @return string
   *   The payment method title.
   */
  public function cartReviewTitle();

  /**
   * Returns the payment method review details.
   *
   * @param \Drupal\uc_order\OrderInterface $order
   *   The order that is being processed.
   *
   * @return array
   */
  public function cartReview(OrderInterface $order);

  /**
   * Called when an order is being deleted.
   *
   * @param \Drupal\uc_order\OrderInterface $order
   *   The order that is being deleted.
   */
  public function orderDelete(OrderInterface $order);

  /**
   * Called when an order is being edited with this payment method.
   *
   * @param \Drupal\uc_order\OrderInterface $order
   *   The order that is being edited.
   *
   * @return array
   *   A form array.
   */
  public function orderEditDetails(OrderInterface $order);

  /**
   * Called when an order is being submitted after being edited.
   *
   * @param \Drupal\uc_order\OrderInterface $order
   *   The order that is being edited.
   * @param array $form
   *   The form array.
   * @param \Drupal\Core\Form\FormStateInterface $form_state
   *   The form state array.
   *
   * @return array
   *   An array of changes to log against the order.
   */
  public function orderEditProcess(OrderInterface $order, array $form, FormStateInterface $form_state);

  /**
   * Called when an order is being loaded with this payment method.
   *
   * @param \Drupal\uc_order\OrderInterface $order
   *   The order that is being loaded.
   */
  public function orderLoad(OrderInterface $order);

  /**
   * Called when an order is being saved with this payment method.
   *
   * @param \Drupal\uc_order\OrderInterface $order
   *   The order that is being saved.
   */
  public function orderSave(OrderInterface $order);

  /**
   * Called when an order is being submitted with this payment method.
   *
   * @param \Drupal\uc_order\OrderInterface $order
   *   The order that is being submitted.
   *
   * @return string|null
   *   An error message that can be shown to the user if the payment failed,
   *   or NULL if everything was successful.
   */
  public function orderSubmit(OrderInterface $order);

  /**
   * Called when an order is being viewed by an administrator.
   *
   * @param \Drupal\uc_order\OrderInterface $order
   *   The order that is being viewed.
   *
   * @return array
   *   A render array.
   */
  public function orderView(OrderInterface $order);

  /**
   * Called when an order is being viewed by a customer.
   *
   * @param \Drupal\uc_order\OrderInterface $order
   *   The order that is being viewed.
   *
   * @return array
   *   A render array.
   */
  public function customerView(OrderInterface $order);

}

Members

Namesort descending Modifiers Type Description Overrides
ConfigurableInterface::defaultConfiguration public function Gets default configuration for this plugin. 11
ConfigurableInterface::getConfiguration public function Gets this plugin's configuration. 12
ConfigurableInterface::setConfiguration public function Sets the configuration for this plugin instance. 12
PaymentMethodPluginInterface::cartDetails public function Returns the form or render array to be displayed at checkout. 1
PaymentMethodPluginInterface::cartProcess public function Called when checkout is submitted with this payment method selected. 1
PaymentMethodPluginInterface::cartReview public function Returns the payment method review details. 1
PaymentMethodPluginInterface::cartReviewTitle public function Returns the payment method title to be used on the checkout review page. 1
PaymentMethodPluginInterface::customerView public function Called when an order is being viewed by a customer. 1
PaymentMethodPluginInterface::getDisplayLabel public function Returns the payment method label with logo. 1
PaymentMethodPluginInterface::orderDelete public function Called when an order is being deleted. 1
PaymentMethodPluginInterface::orderEditDetails public function Called when an order is being edited with this payment method. 1
PaymentMethodPluginInterface::orderEditProcess public function Called when an order is being submitted after being edited. 1
PaymentMethodPluginInterface::orderLoad public function Called when an order is being loaded with this payment method. 1
PaymentMethodPluginInterface::orderSave public function Called when an order is being saved with this payment method. 1
PaymentMethodPluginInterface::orderSubmit public function Called when an order is being submitted with this payment method. 1
PaymentMethodPluginInterface::orderView public function Called when an order is being viewed by an administrator. 1
PluginFormInterface::buildConfigurationForm public function Form constructor. 36
PluginFormInterface::submitConfigurationForm public function Form submission handler. 32
PluginFormInterface::validateConfigurationForm public function Form validation handler. 18
PluginInspectionInterface::getPluginDefinition public function Gets the definition of the plugin implementation. 4
PluginInspectionInterface::getPluginId public function Gets the plugin_id of the plugin instance. 2