You are here

public function PaymentStorage::loadByRemoteId in Commerce Core 8.2

Loads the payment for the given remote ID.

Parameters

string $remote_id: The remote ID.

Return value

\Drupal\commerce_payment\Entity\PaymentInterface|null The payment, or NULL if none found.

Overrides PaymentStorageInterface::loadByRemoteId

File

modules/payment/src/PaymentStorage.php, line 16

Class

PaymentStorage
Defines the payment storage.

Namespace

Drupal\commerce_payment

Code

public function loadByRemoteId($remote_id) {
  $payments = $this
    ->loadByProperties([
    'remote_id' => $remote_id,
  ]);
  $payment = reset($payments);
  return $payment ?: NULL;
}