diff --git a/modules/payment/src/PaymentMethodStorage.php b/modules/payment/src/PaymentMethodStorage.php
index a5f7fda6..cd8ba032 100644
--- a/modules/payment/src/PaymentMethodStorage.php
+++ b/modules/payment/src/PaymentMethodStorage.php
@@ -83,6 +83,7 @@ class PaymentMethodStorage extends CommerceContentEntityStorage implements Payme
     $query
       ->condition('uid', $account->id())
       ->condition('payment_gateway', $payment_gateway->id())
+      ->condition('payment_gateway_mode', $payment_gateway->getPlugin()->getMode())
       ->condition('reusable', TRUE)
       ->condition($query->orConditionGroup()
         ->condition('expires', $this->time->getRequestTime(), '>')
diff --git a/modules/payment/tests/src/Kernel/PaymentMethodStorageTest.php b/modules/payment/tests/src/Kernel/PaymentMethodStorageTest.php
index 0932e763..03cd94ae 100644
--- a/modules/payment/tests/src/Kernel/PaymentMethodStorageTest.php
+++ b/modules/payment/tests/src/Kernel/PaymentMethodStorageTest.php
@@ -79,6 +79,11 @@ class PaymentMethodStorageTest extends CommerceKernelTestBase {
       'label' => 'Example',
       'plugin' => 'example_onsite',
     ]);
+    $payment_gateway->getPlugin()->setConfiguration([
+      'api_key' => '2342fewfsfs',
+      'mode' => 'test',
+      'payment_method_types' => ['credit_card'],
+    ]);
     $payment_gateway->save();
     $this->paymentGateway = $this->reloadEntity($payment_gateway);
 
@@ -96,6 +101,7 @@ class PaymentMethodStorageTest extends CommerceKernelTestBase {
     $payment_method_expired = PaymentMethod::create([
       'type' => 'credit_card',
       'payment_gateway' => 'example',
+      'payment_gateway_mode' => 'test',
       // Sat, 16 Jan 2016.
       'expires' => '1452902400',
       'uid' => $this->user->id(),
@@ -105,6 +111,7 @@ class PaymentMethodStorageTest extends CommerceKernelTestBase {
     $payment_method_active = PaymentMethod::create([
       'type' => 'credit_card',
       'payment_gateway' => 'example',
+      'payment_gateway_mode' => 'test',
       // Thu, 16 Jan 2020.
       'expires' => '1579132800',
       'uid' => $this->user->id(),
@@ -114,6 +121,7 @@ class PaymentMethodStorageTest extends CommerceKernelTestBase {
     $payment_method_unlimited = PaymentMethod::create([
       'type' => 'credit_card',
       'payment_gateway' => 'example',
+      'payment_gateway_mode' => 'test',
       'expires' => 0,
       'uid' => $this->user->id(),
     ]);
@@ -129,6 +137,15 @@ class PaymentMethodStorageTest extends CommerceKernelTestBase {
     $payment_method_unlimited->save();
     $this->assertEmpty($this->storage->loadReusable(User::getAnonymousUser(), $this->paymentGateway));
     $this->assertEmpty($this->storage->loadReusable($this->user, $this->paymentGateway));
+
+    // Changing the gateway from test to live should cause all of the testing
+    // payment methods to be ignored.
+    $payment_gateway_configuration = $this->paymentGateway->getPluginConfiguration();
+    $payment_gateway_configuration['mode'] = 'live';
+    $this->paymentGateway->getPlugin()->setConfiguration($payment_gateway_configuration);
+    $this->paymentGateway->save();
+    $reusable_payment_methods = $this->storage->loadReusable($this->user, $this->paymentGateway);
+    $this->assertEmpty($reusable_payment_methods);
   }
 
   /**
