diff --git a/CRM/Stripe/Customer.php b/CRM/Stripe/Customer.php index 628349877052c71d06831a40ab80aa8d569d72f2..5bfcfe4ea7b0cd388bf9c9f74f62a7b930c30482 100644 --- a/CRM/Stripe/Customer.php +++ b/CRM/Stripe/Customer.php @@ -17,8 +17,8 @@ class CRM_Stripe_Customer { throw new CRM_Core_Exception('Stripe Customer (find): Missing required parameter: ' . $required); } } - if (empty($params['email']) && empty($params['contact_id'])) { - throw new CRM_Core_Exception('Stripe Customer (find): One of email or contact_id is required'); + if (empty($params['contact_id'])) { + throw new CRM_Core_Exception('Stripe Customer (find): contact_id is required'); } $queryParams = [ 1 => [$params['contact_id'], 'String'], diff --git a/tests/phpunit/CRM/Stripe/BaseTest.php b/tests/phpunit/CRM/Stripe/BaseTest.php index 47878b0ac0b04366033b7769bccdc584ea2920f1..e26ebb93bd9f5e0b893b96f11453b8c3b202a202 100644 --- a/tests/phpunit/CRM/Stripe/BaseTest.php +++ b/tests/phpunit/CRM/Stripe/BaseTest.php @@ -157,6 +157,7 @@ class CRM_Stripe_BaseTest extends \PHPUnit_Framework_TestCase implements Headles 'address_zip' => '12345', ), 'email' => $this->contact->email, + 'contactID' => $this->contact->id, 'description' => 'Test from Stripe Test Code', 'currencyID' => 'USD', 'invoiceID' => $this->_invoiceID,