interface SupportsRefundsInterface in Commerce Core 8.2
Defines the interface for gateways which support refunds.
Hierarchy
- interface \Drupal\commerce_payment\Plugin\Commerce\PaymentGateway\SupportsRefundsInterface
Expanded class hierarchy of SupportsRefundsInterface
All classes that implement SupportsRefundsInterface
1 file declares its use of SupportsRefundsInterface
- OnsiteInterface.php in modules/
payment_example/ src/ Plugin/ Commerce/ PaymentGateway/ OnsiteInterface.php
File
- modules/
payment/ src/ Plugin/ Commerce/ PaymentGateway/ SupportsRefundsInterface.php, line 11
Namespace
Drupal\commerce_payment\Plugin\Commerce\PaymentGatewayView source
interface SupportsRefundsInterface {
/**
* Checks whether the given payment can be refunded.
*
* @param \Drupal\commerce_payment\Entity\PaymentInterface $payment
* The payment to refund.
*
* @return bool
* TRUE if the payment can be refunded, FALSE otherwise.
*/
public function canRefundPayment(PaymentInterface $payment);
/**
* Refunds the given payment.
*
* @param \Drupal\commerce_payment\Entity\PaymentInterface $payment
* The payment to refund.
* @param \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.
*/
public function refundPayment(PaymentInterface $payment, Price $amount = NULL);
}
Members
Name![]() |
Modifiers | Type | Description | Overrides |
---|---|---|---|---|
SupportsRefundsInterface:: |
public | function | Checks whether the given payment can be refunded. | |
SupportsRefundsInterface:: |
public | function | Refunds the given payment. | 2 |