public function SupportsAuthorizationsInterface::capturePayment in Commerce Core 8.2
Captures the given authorized payment.
Only payments in the 'authorization' state can be captured.
Parameters
\Drupal\commerce_payment\Entity\PaymentInterface $payment: The payment to capture.
\Drupal\commerce_price\Price $amount: The amount to capture. If NULL, defaults to the entire payment amount.
Throws
\Drupal\commerce_payment\Exception\PaymentGatewayException Thrown when the transaction fails for any reason.
1 method overrides SupportsAuthorizationsInterface::capturePayment()
- Onsite::capturePayment in modules/
payment_example/ src/ Plugin/ Commerce/ PaymentGateway/ Onsite.php - Captures the given authorized payment.
File
- modules/
payment/ src/ Plugin/ Commerce/ PaymentGateway/ SupportsAuthorizationsInterface.php, line 37
Class
- SupportsAuthorizationsInterface
- Defines the interface for gateways which support authorizing payments.
Namespace
Drupal\commerce_payment\Plugin\Commerce\PaymentGatewayCode
public function capturePayment(PaymentInterface $payment, Price $amount = NULL);