You are here

private static function Braintree_Customer::_validateId in Commerce Braintree 7

verifies that a valid customer id is being used @ignore

Parameters

string customer id:

Throws

InvalidArgumentException

5 calls to Braintree_Customer::_validateId()
Braintree_Customer::credit in braintree_php/lib/Braintree/Customer.php
credit a customer for the passed transaction
Braintree_Customer::delete in braintree_php/lib/Braintree/Customer.php
delete a customer by id
Braintree_Customer::find in braintree_php/lib/Braintree/Customer.php
find a customer by id
Braintree_Customer::sale in braintree_php/lib/Braintree/Customer.php
create a new sale for a customer
Braintree_Customer::update in braintree_php/lib/Braintree/Customer.php
updates the customer record

File

braintree_php/lib/Braintree/Customer.php, line 488

Class

Braintree_Customer
Creates and manages Customers

Code

private static function _validateId($id = null) {
  if (empty($id)) {
    throw new InvalidArgumentException('expected customer id to be set');
  }
  if (!preg_match('/^[0-9A-Za-z_-]+$/', $id)) {
    throw new InvalidArgumentException($id . ' is an invalid customer id.');
  }
}