You are here

function Braintree_TransactionTest::testFind in Commerce Braintree 7

File

braintree_php/tests/integration/TransactionTest.php, line 829

Class

Braintree_TransactionTest

Code

function testFind() {
  $result = Braintree_Transaction::sale(array(
    'amount' => '100.00',
    'creditCard' => array(
      'number' => '5105105105105100',
      'expirationDate' => '05/12',
    ),
  ));
  $transaction = Braintree_Transaction::find($result->transaction->id);
  $this
    ->assertEquals(Braintree_Transaction::AUTHORIZED, $transaction->status);
  $this
    ->assertEquals(Braintree_Transaction::SALE, $transaction->type);
  $this
    ->assertEquals('100.00', $transaction->amount);
  $this
    ->assertEquals('510510', $transaction->creditCardDetails->bin);
  $this
    ->assertEquals('5100', $transaction->creditCardDetails->last4);
}