You are here

private static function Braintree_Transaction::_validateId in Commerce Braintree 7

verifies that a valid transaction id is being used @ignore

Parameters

string transaction id:

Throws

InvalidArgumentException

3 calls to Braintree_Transaction::_validateId()
Braintree_Transaction::find in braintree_php/lib/Braintree/Transaction.php
@access public
Braintree_Transaction::submitForSettlement in braintree_php/lib/Braintree/Transaction.php
Braintree_Transaction::void in braintree_php/lib/Braintree/Transaction.php
void a transaction by id

File

braintree_php/lib/Braintree/Transaction.php, line 604

Class

Braintree_Transaction
Creates and manages transactions

Code

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