You are here

public function SupportsRefundsInterface::refundPayment in Commerce Core 8.2

Refunds the given payment.

Parameters

\Drupal\commerce_payment\Entity\PaymentInterface $payment: The payment to refund.

\Drupal\commerce_price\Price $amount: The amount to refund. If NULL, defaults to the entire payment amount.

Throws

\Drupal\commerce_payment\Exception\PaymentGatewayException Thrown when the transaction fails for any reason.

2 methods override SupportsRefundsInterface::refundPayment()
Manual::refundPayment in modules/payment/src/Plugin/Commerce/PaymentGateway/Manual.php
Refunds the given payment.
Onsite::refundPayment in modules/payment_example/src/Plugin/Commerce/PaymentGateway/Onsite.php
Refunds the given payment.

File

modules/payment/src/Plugin/Commerce/PaymentGateway/SupportsRefundsInterface.php, line 35

Class

SupportsRefundsInterface
Defines the interface for gateways which support refunds.

Namespace

Drupal\commerce_payment\Plugin\Commerce\PaymentGateway

Code

public function refundPayment(PaymentInterface $payment, Price $amount = NULL);