You are here

private static function Braintree_Address::_validateCustomerId in Commerce Braintree 7

verifies that a valid customer id is being used @ignore

Parameters

string $id customer id:

Throws

InvalidArgumentException

2 calls to Braintree_Address::_validateCustomerId()
Braintree_Address::create in braintree_php/lib/Braintree/Address.php
@access public
Braintree_Address::_determineCustomerId in braintree_php/lib/Braintree/Address.php
determines if a string id or Customer object was passed @ignore

File

braintree_php/lib/Braintree/Address.php, line 264

Class

Braintree_Address
Creates and manages Braintree Addresses

Code

private static function _validateCustomerId($id = null) {
  if (empty($id) || trim($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.');
  }
}