You are here

public function Onsite::updatePaymentMethod in Commerce Core 8.2

Updates the given payment method.

Parameters

\Drupal\commerce_payment\Entity\PaymentMethodInterface $payment_method: The payment method.

Throws

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

Overrides SupportsUpdatingStoredPaymentMethodsInterface::updatePaymentMethod

File

modules/payment_example/src/Plugin/Commerce/PaymentGateway/Onsite.php, line 251

Class

Onsite
Provides the On-site payment gateway.

Namespace

Drupal\commerce_payment_example\Plugin\Commerce\PaymentGateway

Code

public function updatePaymentMethod(PaymentMethodInterface $payment_method) {

  // Note: Since requires_billing_information is FALSE, the payment method
  // is not guaranteed to have a billing profile. Confirm that
  // $payment_method->getBillingProfile() is not NULL before trying to use it.
  //
  // Perform the update request here, throw an exception if it fails.
  // See \Drupal\commerce_payment\Exception for the available exceptions.
}