class PaymentOrderProcessor in Commerce Core 8.2
Recalculates the order's total_paid field.
Hierarchy
- class \Drupal\commerce_payment\PaymentOrderProcessor implements OrderProcessorInterface
Expanded class hierarchy of PaymentOrderProcessor
1 string reference to 'PaymentOrderProcessor'
- commerce_payment.services.yml in modules/
payment/ commerce_payment.services.yml - modules/payment/commerce_payment.services.yml
1 service uses PaymentOrderProcessor
File
- modules/
payment/ src/ PaymentOrderProcessor.php, line 11
Namespace
Drupal\commerce_paymentView source
class PaymentOrderProcessor implements OrderProcessorInterface {
/**
* The payment order updater.
*
* @var \Drupal\commerce_payment\PaymentOrderUpdaterInterface
*/
protected $paymentOrderUpdater;
/**
* Constructs a new PaymentOrderProcessor instance.
*
* @param \Drupal\commerce_payment\PaymentOrderUpdaterInterface $payment_order_updater
* The order update manager.
*/
public function __construct(PaymentOrderUpdaterInterface $payment_order_updater) {
$this->paymentOrderUpdater = $payment_order_updater;
}
/**
* {@inheritdoc}
*/
public function process(OrderInterface $order) {
if ($this->paymentOrderUpdater
->needsUpdate($order)) {
$this->paymentOrderUpdater
->updateOrder($order);
}
}
}
Members
Name![]() |
Modifiers | Type | Description | Overrides |
---|---|---|---|---|
PaymentOrderProcessor:: |
protected | property | The payment order updater. | |
PaymentOrderProcessor:: |
public | function |
Processes an order. Overrides OrderProcessorInterface:: |
|
PaymentOrderProcessor:: |
public | function | Constructs a new PaymentOrderProcessor instance. |