You are here

function Braintree_TransactionTest::testVoid in Commerce Braintree 7

File

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

Class

Braintree_TransactionTest

Code

function testVoid() {
  $transaction = Braintree_Transaction::saleNoValidate(array(
    'amount' => '100.00',
    'creditCard' => array(
      'number' => '5105105105105100',
      'expirationDate' => '05/12',
    ),
  ));
  $this
    ->assertEquals(Braintree_Transaction::AUTHORIZED, $transaction->status);
  $voidResult = Braintree_Transaction::void($transaction->id);
  $this
    ->assertEquals(true, $voidResult->success);
  $this
    ->assertEquals(Braintree_Transaction::VOIDED, $voidResult->transaction->status);
}