commerce-8.x-2.8/modules/payment/src/Plugin/Commerce/PaymentGateway/SupportsStoredPaymentMethodsInterface.php
modules/payment/src/Plugin/Commerce/PaymentGateway/SupportsStoredPaymentMethodsInterface.php
<?php
namespace Drupal\commerce_payment\Plugin\Commerce\PaymentGateway;
use Drupal\commerce_payment\Entity\PaymentMethodInterface;
/**
* Defines the interface for gateways which support storing payment methods.
*/
interface SupportsStoredPaymentMethodsInterface {
/**
* Creates a payment method with the given payment details.
*
* @param \Drupal\commerce_payment\Entity\PaymentMethodInterface $payment_method
* The payment method.
* @param array $payment_details
* The gateway-specific payment details.
*
* @throws \Drupal\commerce_payment\Exception\PaymentGatewayException
* Thrown when the transaction fails for any reason.
*/
public function createPaymentMethod(PaymentMethodInterface $payment_method, array $payment_details);
/**
* Deletes the given payment method.
*
* Both the entity and the remote record are deleted.
*
* @param \Drupal\commerce_payment\Entity\PaymentMethodInterface $payment_method
* The payment method.
*
* @throws \Drupal\commerce_payment\Exception\PaymentGatewayException
* Thrown when the transaction fails for any reason.
*/
public function deletePaymentMethod(PaymentMethodInterface $payment_method);
}
