You are here

function Braintree_TransactionTest::testSale_withLevel2Attributes in Commerce Braintree 7

File

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

Class

Braintree_TransactionTest

Code

function testSale_withLevel2Attributes() {
  $result = Braintree_Transaction::sale(array(
    'amount' => '100.00',
    'creditCard' => array(
      'cardholderName' => 'The Cardholder',
      'expirationDate' => '05/2011',
      'number' => '5105105105105100',
    ),
    'taxExempt' => true,
    'taxAmount' => '10.00',
    'purchaseOrderNumber' => '12345',
  ));
  $this
    ->assertTrue($result->success);
  $transaction = $result->transaction;
  $this
    ->assertTrue($transaction->taxExempt);
  $this
    ->assertEquals('10.00', $transaction->taxAmount);
  $this
    ->assertEquals('12345', $transaction->purchaseOrderNumber);
}