class Unavailable in Payment 8.2
Same name in this branch
- 8.2 src/Plugin/Payment/Method/Unavailable.php \Drupal\payment\Plugin\Payment\Method\Unavailable
- 8.2 src/Plugin/Payment/Type/Unavailable.php \Drupal\payment\Plugin\Payment\Type\Unavailable
A payment method controller that essentially disables payment methods.
This is a 'placeholder' controller that returns defaults and doesn't really do anything else. It is used when no working controller is available for a payment method, so other modules don't have to check for that.
Plugin annotation
@PaymentMethod(
active = FALSE,
id = "payment_unavailable",
label = @Translation("Unavailable"),
module = "payment"
)
Hierarchy
- class \Drupal\Component\Plugin\PluginBase implements DerivativeInspectionInterface, PluginInspectionInterface
- class \Drupal\payment\Plugin\Payment\Method\Unavailable implements PaymentMethodInterface
Expanded class hierarchy of Unavailable
1 file declares its use of Unavailable
- UnavailableTest.php in tests/
src/ Unit/ Plugin/ Payment/ Method/ UnavailableTest.php
5 string references to 'Unavailable'
- PaymentForm::getPaymentDescription in modules/
payment_form/ src/ Plugin/ Payment/ Type/ PaymentForm.php - Returns the description of the payment this plugin is of.
- PaymentListBuilder::buildRow in src/
Entity/ Payment/ PaymentListBuilder.php - {@inheritdnoc}
- PaymentReference::getPaymentDescription in modules/
payment_reference/ src/ Plugin/ Payment/ Type/ PaymentReference.php - Returns the description of the payment this plugin is of.
- PaymentUnitTest::testLabel in tests/
src/ Kernel/ PaymentUnitTest.php - Tests label().
- Unavailable::getPaymentDescription in src/
Plugin/ Payment/ Type/ Unavailable.php - Returns the description of the payment this plugin is of.
File
- src/
Plugin/ Payment/ Method/ Unavailable.php, line 30
Namespace
Drupal\payment\Plugin\Payment\MethodView source
class Unavailable extends PluginBase implements PaymentMethodInterface {
/**
* The payment this payment method is for.
*
* @var \Drupal\payment\Entity\PaymentInterface
*/
protected $payment;
/**
* {@inheritdoc}
*/
public function calculateDependencies() {
return [];
}
/**
* {@inheritdoc}
*/
public function defaultConfiguration() {
return [];
}
/**
* {@inheritdoc}
*/
public function getConfiguration() {
return [];
}
/**
* {@inheritdoc}
*/
public function setConfiguration(array $configuration) {
return $this;
}
/**
* {@inheritdoc}
*/
protected function getSupportedCurrencies() {
return [];
}
/**
* {@inheritdoc}
*/
public function getPaymentExecutionResult() {
return new OperationResult();
}
/**
* {@inheritdoc}
*/
public function executePaymentAccess(AccountInterface $account) {
return AccessResult::forbidden();
}
/**
* {@inheritdoc}
*/
public function executePayment() {
throw new \RuntimeException('This plugin cannot execute payments.');
}
/**
* Gets the payment this payment method is for.
*
* @return \Drupal\payment\Entity\PaymentInterface
*/
public function getPayment() {
return $this->payment;
}
/**
* Gets the payment this payment method is for.
*
* @param \Drupal\payment\Entity\PaymentInterface $payment
*
* @return $this
*/
public function setPayment(PaymentInterface $payment) {
$this->payment = $payment;
return $this;
}
/**
* {@inheritdoc}
*/
public function getPluginLabel() {
return $this->pluginDefinition['label'];
}
/**
* {@inheritdoc}
*/
public function buildConfigurationForm(array $form, FormStateInterface $form_state) {
return [];
}
/**
* {@inheritdoc}
*/
public function validateConfigurationForm(array &$form, FormStateInterface $form_state) {
}
/**
* {@inheritdoc}
*/
public function submitConfigurationForm(array &$form, FormStateInterface $form_state) {
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
PluginBase:: |
protected | property | Configuration information passed into the plugin. | 1 |
PluginBase:: |
protected | property | The plugin implementation definition. | 1 |
PluginBase:: |
protected | property | The plugin_id. | |
PluginBase:: |
constant | A string which is used to separate base plugin IDs from the derivative ID. | ||
PluginBase:: |
public | function |
Gets the base_plugin_id of the plugin instance. Overrides DerivativeInspectionInterface:: |
|
PluginBase:: |
public | function |
Gets the derivative_id of the plugin instance. Overrides DerivativeInspectionInterface:: |
|
PluginBase:: |
public | function |
Gets the definition of the plugin implementation. Overrides PluginInspectionInterface:: |
3 |
PluginBase:: |
public | function |
Gets the plugin_id of the plugin instance. Overrides PluginInspectionInterface:: |
|
PluginBase:: |
public | function | Determines if the plugin is configurable. | |
PluginBase:: |
public | function | Constructs a \Drupal\Component\Plugin\PluginBase object. | 92 |
Unavailable:: |
protected | property | The payment this payment method is for. | |
Unavailable:: |
public | function | ||
Unavailable:: |
public | function | ||
Unavailable:: |
public | function | ||
Unavailable:: |
public | function |
Executes the payment. Overrides PaymentMethodInterface:: |
|
Unavailable:: |
public | function |
Checks if the payment can be executed. Overrides PaymentMethodInterface:: |
|
Unavailable:: |
public | function | ||
Unavailable:: |
public | function |
Gets the payment this payment method is for. Overrides PaymentAwareInterface:: |
|
Unavailable:: |
public | function |
Gets the payment execution status. Overrides PaymentMethodInterface:: |
|
Unavailable:: |
public | function | ||
Unavailable:: |
protected | function | ||
Unavailable:: |
public | function | ||
Unavailable:: |
public | function |
Gets the payment this payment method is for. Overrides PaymentAwareInterface:: |
|
Unavailable:: |
public | function | ||
Unavailable:: |
public | function |