You are here

function Braintree_TransactionTest::testCloneTransactionAndSubmitForSettlement in Commerce Braintree 7

File

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

Class

Braintree_TransactionTest

Code

function testCloneTransactionAndSubmitForSettlement() {
  $result = Braintree_Transaction::sale(array(
    'amount' => '100.00',
    'creditCard' => array(
      'number' => '5105105105105100',
      'expirationDate' => '05/2011',
    ),
  ));
  $this
    ->assertTrue($result->success);
  $transaction = $result->transaction;
  $cloneResult = Braintree_Transaction::cloneTransaction($transaction->id, array(
    'amount' => '123.45',
    'options' => array(
      'submitForSettlement' => true,
    ),
  ));
  $cloneTransaction = $cloneResult->transaction;
  $this
    ->assertEquals('submitted_for_settlement', $cloneTransaction->status);
}