You are here

public function OnsiteBase::getPaymentMethodCustomerId in Commerce Authorize.Net 8

Returns the customer identifier from a payment method's remote id.

Parameters

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

Return value

mixed The remote customer id or FALSE if it cannot be resolved.

4 calls to OnsiteBase::getPaymentMethodCustomerId()
AcceptJs::createPayment in src/Plugin/Commerce/PaymentGateway/AcceptJs.php
Creates a payment.
AcceptJs::doCreatePaymentMethod in src/Plugin/Commerce/PaymentGateway/AcceptJs.php
Creates the payment method on the gateway.
AcceptJs::updatePaymentMethod in src/Plugin/Commerce/PaymentGateway/AcceptJs.php
Updates the given payment method.
OnsiteBase::deletePaymentMethod in src/Plugin/Commerce/PaymentGateway/OnsiteBase.php
@todo Needs kernel test

File

src/Plugin/Commerce/PaymentGateway/OnsiteBase.php, line 319

Class

OnsiteBase
Provides the Authorize.net payment gateway base class.

Namespace

Drupal\commerce_authnet\Plugin\Commerce\PaymentGateway

Code

public function getPaymentMethodCustomerId(PaymentMethodInterface $payment_method) {
  $remote_id = $payment_method
    ->getRemoteId();
  if (strstr($remote_id, '|')) {
    $ids = explode('|', $remote_id);
    return reset($ids);
  }
  return FALSE;
}