class PayPalCheckout in Commerce PayPal 8
Same name in this branch
- 8 src/Plugin/Commerce/PaymentType/PayPalCheckout.php \Drupal\commerce_paypal\Plugin\Commerce\PaymentType\PayPalCheckout
- 8 src/Plugin/Commerce/PaymentMethodType/PayPalCheckout.php \Drupal\commerce_paypal\Plugin\Commerce\PaymentMethodType\PayPalCheckout
- 8 src/Plugin/Commerce/CheckoutFlow/PayPalCheckout.php \Drupal\commerce_paypal\Plugin\Commerce\CheckoutFlow\PayPalCheckout
Provides a custom checkout flow for use by PayPal Checkout.
Plugin annotation
@CommerceCheckoutFlow(
id = "paypal_checkout",
label = "PayPal Checkout",
)
Hierarchy
- class \Drupal\Component\Plugin\PluginBase implements DerivativeInspectionInterface, PluginInspectionInterface
- class \Drupal\Core\Plugin\PluginBase uses DependencySerializationTrait, MessengerTrait, StringTranslationTrait
- class \Drupal\commerce_checkout\Plugin\Commerce\CheckoutFlow\CheckoutFlowBase implements CheckoutFlowInterface, ContainerFactoryPluginInterface uses AjaxFormTrait
- class \Drupal\commerce_checkout\Plugin\Commerce\CheckoutFlow\CheckoutFlowWithPanesBase implements CheckoutFlowWithPanesInterface
- class \Drupal\commerce_paypal\Plugin\Commerce\CheckoutFlow\PayPalCheckout
- class \Drupal\commerce_checkout\Plugin\Commerce\CheckoutFlow\CheckoutFlowWithPanesBase implements CheckoutFlowWithPanesInterface
- class \Drupal\commerce_checkout\Plugin\Commerce\CheckoutFlow\CheckoutFlowBase implements CheckoutFlowInterface, ContainerFactoryPluginInterface uses AjaxFormTrait
- class \Drupal\Core\Plugin\PluginBase uses DependencySerializationTrait, MessengerTrait, StringTranslationTrait
Expanded class hierarchy of PayPalCheckout
File
- src/
Plugin/ Commerce/ CheckoutFlow/ PayPalCheckout.php, line 16
Namespace
Drupal\commerce_paypal\Plugin\Commerce\CheckoutFlowView source
class PayPalCheckout extends CheckoutFlowWithPanesBase {
/**
* {@inheritdoc}
*/
public function getSteps() {
// Note that previous_label and next_label are not the labels
// shown on the step itself. Instead, they are the labels shown
// when going back to the step, or proceeding to the step.
return [
'order_information' => [
'label' => $this
->t('Order information'),
'has_sidebar' => TRUE,
'previous_label' => $this
->t('Go back'),
],
'review' => [
'label' => $this
->t('Review'),
'next_label' => $this
->t('Continue to review'),
'previous_label' => $this
->t('Go back'),
'has_sidebar' => TRUE,
],
] + parent::getSteps();
}
/**
* {@inheritdoc}
*/
public function getPanes() {
$panes = parent::getPanes();
// Create a blacklist of panes we disallow adding to steps.
$black_list = [
'contact_information',
'payment_information',
'payment_process',
];
return array_diff_key($panes, array_combine($black_list, $black_list));
}
/**
* {@inheritdoc}
*/
public function validateConfigurationForm(array &$form, FormStateInterface $form_state) {
parent::validateConfigurationForm($form, $form_state);
$values = $form_state
->getValue($form['#parents']);
$pane_values = $values['panes'];
if (!isset($pane_values['paypal_checkout_payment_process']) || $pane_values['paypal_checkout_payment_process']['step_id'] !== 'payment') {
$pane = $this
->getPane('paypal_checkout_payment_process');
$form_state
->setError($form['panes'], $this
->t('The %title pane must be configured in the payment region.', [
'%title' => $pane
->getLabel(),
]));
}
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
AjaxFormTrait:: |
public static | function | Ajax handler for refreshing an entire form. | |
CheckoutFlowBase:: |
protected | property | The entity manager. | |
CheckoutFlowBase:: |
protected | property | The event dispatcher. | |
CheckoutFlowBase:: |
protected | property | The current order. | |
CheckoutFlowBase:: |
protected | property | The parent config entity. | |
CheckoutFlowBase:: |
protected | property | Static cache of visible steps. | |
CheckoutFlowBase:: |
protected | function | Builds the actions element for the current form. | |
CheckoutFlowBase:: |
public | function |
Returns a string identifying the base form. Overrides BaseFormIdInterface:: |
|
CheckoutFlowBase:: |
public | function |
Gets this plugin's configuration. Overrides ConfigurableInterface:: |
|
CheckoutFlowBase:: |
public | function |
Returns a unique string identifying the form. Overrides FormInterface:: |
|
CheckoutFlowBase:: |
public | function |
Gets the next step ID for the given step ID. Overrides CheckoutFlowInterface:: |
|
CheckoutFlowBase:: |
public | function |
Gets the current order. Overrides CheckoutFlowInterface:: |
|
CheckoutFlowBase:: |
public | function |
Gets the previous step ID for the given step ID. Overrides CheckoutFlowInterface:: |
|
CheckoutFlowBase:: |
public | function |
Gets the visible steps. Overrides CheckoutFlowInterface:: |
|
CheckoutFlowBase:: |
protected | function | Gets whether the given step has a sidebar. | |
CheckoutFlowBase:: |
protected | function | Reacts to the current step changing. | |
CheckoutFlowBase:: |
public | function |
Redirects an order to a specific step in the checkout. Overrides CheckoutFlowInterface:: |
|
CheckoutFlowBase:: |
public | function |
Sets the configuration for this plugin instance. Overrides ConfigurableInterface:: |
|
CheckoutFlowBase:: |
public | function |
Overrides DependencySerializationTrait:: |
|
CheckoutFlowWithPanesBase:: |
protected | property | The checkout pane manager. | |
CheckoutFlowWithPanesBase:: |
protected | property | The initialized pane plugins. | |
CheckoutFlowWithPanesBase:: |
public | function |
Form constructor. Overrides CheckoutFlowBase:: |
|
CheckoutFlowWithPanesBase:: |
public | function |
Form constructor. Overrides CheckoutFlowBase:: |
|
CheckoutFlowWithPanesBase:: |
protected | function | Builds the table row structure for a checkout pane. | |
CheckoutFlowWithPanesBase:: |
public | function |
Calculates dependencies for the configured plugin. Overrides CheckoutFlowBase:: |
|
CheckoutFlowWithPanesBase:: |
public static | function |
Creates an instance of the plugin. Overrides CheckoutFlowBase:: |
|
CheckoutFlowWithPanesBase:: |
public | function |
Gets default configuration for this plugin. Overrides CheckoutFlowBase:: |
|
CheckoutFlowWithPanesBase:: |
public | function |
Gets a pane with the given ID. Overrides CheckoutFlowWithPanesInterface:: |
|
CheckoutFlowWithPanesBase:: |
protected | function | Gets the configuration for the given pane. | |
CheckoutFlowWithPanesBase:: |
protected | function | Get the regions for the checkout pane overview table. | |
CheckoutFlowWithPanesBase:: |
public | function |
Gets the visible panes for the given step ID. Overrides CheckoutFlowWithPanesInterface:: |
|
CheckoutFlowWithPanesBase:: |
protected | function |
Gets whether the given step is visible. Overrides CheckoutFlowBase:: |
|
CheckoutFlowWithPanesBase:: |
public static | function | Ajax handler for multistep buttons. | |
CheckoutFlowWithPanesBase:: |
public static | function | Form submission handler for multistep buttons. | |
CheckoutFlowWithPanesBase:: |
public | function |
Form submission handler. Overrides CheckoutFlowBase:: |
|
CheckoutFlowWithPanesBase:: |
public | function |
Form submission handler. Overrides CheckoutFlowBase:: |
|
CheckoutFlowWithPanesBase:: |
public | function |
Form validation handler. Overrides CheckoutFlowBase:: |
|
CheckoutFlowWithPanesBase:: |
public static | function | Validates the pane configuration form. | |
CheckoutFlowWithPanesBase:: |
public | function |
Constructs a new CheckoutFlowWithPanesBase object. Overrides CheckoutFlowBase:: |
|
CheckoutFlowWithPanesBase:: |
public | function |
Overrides CheckoutFlowBase:: |
|
DependencySerializationTrait:: |
protected | property | An array of entity type IDs keyed by the property name of their storages. | |
DependencySerializationTrait:: |
protected | property | An array of service IDs keyed by property name used for serialization. | |
MessengerTrait:: |
protected | property | The messenger. | 29 |
MessengerTrait:: |
public | function | Gets the messenger. | 29 |
MessengerTrait:: |
public | function | Sets the messenger. | |
PayPalCheckout:: |
public | function |
Gets the panes. Overrides CheckoutFlowWithPanesBase:: |
|
PayPalCheckout:: |
public | function |
Gets the defined steps. Overrides CheckoutFlowBase:: |
|
PayPalCheckout:: |
public | function |
Form validation handler. Overrides CheckoutFlowBase:: |
|
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. | |
StringTranslationTrait:: |
protected | property | The string translation service. | 1 |
StringTranslationTrait:: |
protected | function | Formats a string containing a count of items. | |
StringTranslationTrait:: |
protected | function | Returns the number of plurals supported by a given language. | |
StringTranslationTrait:: |
protected | function | Gets the string translation service. | |
StringTranslationTrait:: |
public | function | Sets the string translation service to use. | 2 |
StringTranslationTrait:: |
protected | function | Translates a string to the current language or to a given language. |