You are here

function Braintree_CreditCardTest::testCreateFromTransparentRedirect in Commerce Braintree 7

File

braintree_php/tests/integration/CreditCardTest.php, line 250

Class

Braintree_CreditCardTest

Code

function testCreateFromTransparentRedirect() {
  Braintree_TestHelper::suppressDeprecationWarnings();
  $customer = Braintree_Customer::createNoValidate();
  $queryString = $this
    ->createCreditCardViaTr(array(
    'credit_card' => array(
      'number' => '5105105105105100',
      'expiration_date' => '05/12',
    ),
  ), array(
    'creditCard' => array(
      'customerId' => $customer->id,
    ),
  ));
  $result = Braintree_CreditCard::createFromTransparentRedirect($queryString);
  $this
    ->assertTrue($result->success);
  $this
    ->assertEquals('510510', $result->creditCard->bin);
  $this
    ->assertEquals('5100', $result->creditCard->last4);
  $this
    ->assertEquals('05/2012', $result->creditCard->expirationDate);
}