PaymentMethodPluginBase.php in Ubercart 8.4
File
payment/uc_payment/src/PaymentMethodPluginBase.php
View source
<?php
namespace Drupal\uc_payment;
use Drupal\Core\Database\Connection;
use Drupal\Core\Form\FormStateInterface;
use Drupal\Core\Plugin\ContainerFactoryPluginInterface;
use Drupal\Core\Plugin\PluginBase;
use Drupal\uc_order\OrderInterface;
use Symfony\Component\DependencyInjection\ContainerInterface;
abstract class PaymentMethodPluginBase extends PluginBase implements PaymentMethodPluginInterface, ContainerFactoryPluginInterface {
protected $database;
public function __construct(array $configuration, $plugin_id, $plugin_definition, Connection $database) {
parent::__construct($configuration, $plugin_id, $plugin_definition);
$this->configuration += $this
->defaultConfiguration();
$this->database = $database;
}
public static function create(ContainerInterface $container, array $configuration, $plugin_id, $plugin_definition) {
return new static($configuration, $plugin_id, $plugin_definition, $container
->get('database'));
}
public function getDisplayLabel($label) {
return [
'#plain_text' => $label,
];
}
public function defaultConfiguration() {
return [];
}
public function getConfiguration() {
return $this->configuration;
}
public function setConfiguration(array $configuration) {
$this->configuration = $configuration;
}
public function buildConfigurationForm(array $form, FormStateInterface $form_state) {
return $form;
}
public function validateConfigurationForm(array &$form, FormStateInterface $form_state) {
}
public function submitConfigurationForm(array &$form, FormStateInterface $form_state) {
}
public function cartDetails(OrderInterface $order, array $form, FormStateInterface $form_state) {
return [];
}
public function cartProcess(OrderInterface $order, array $form, FormStateInterface $form_state) {
return TRUE;
}
public function cartReviewTitle() {
return $this->pluginDefinition['name'];
}
public function cartReview(OrderInterface $order) {
return [];
}
public function orderDelete(OrderInterface $order) {
}
public function orderEditDetails(OrderInterface $order) {
return [];
}
public function orderEditProcess(OrderInterface $order, array $form, FormStateInterface $form_state) {
return [];
}
public function orderLoad(OrderInterface $order) {
}
public function orderSave(OrderInterface $order) {
}
public function orderSubmit(OrderInterface $order) {
}
public function orderView(OrderInterface $order) {
return [];
}
public function customerView(OrderInterface $order) {
return $this
->orderView($order);
}
}