You are here

function Braintree_CreditCardTest::testCreate_withCardVerification in Commerce Braintree 7

File

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

Class

Braintree_CreditCardTest

Code

function testCreate_withCardVerification() {
  $customer = Braintree_Customer::createNoValidate();
  $result = Braintree_CreditCard::create(array(
    'customerId' => $customer->id,
    'number' => '5105105105105100',
    'expirationDate' => '05/2011',
    'options' => array(
      'verifyCard' => true,
    ),
  ));
  $this
    ->assertFalse($result->success);
  $this
    ->assertEquals(Braintree_Result_CreditCardVerification::PROCESSOR_DECLINED, $result->creditCardVerification->status);
  $this
    ->assertEquals('2000', $result->creditCardVerification->processorResponseCode);
  $this
    ->assertEquals('Do Not Honor', $result->creditCardVerification->processorResponseText);
  $this
    ->assertEquals('I', $result->creditCardVerification->cvvResponseCode);
  $this
    ->assertEquals(null, $result->creditCardVerification->avsErrorResponseCode);
  $this
    ->assertEquals('I', $result->creditCardVerification->avsPostalCodeResponseCode);
  $this
    ->assertEquals('I', $result->creditCardVerification->avsStreetAddressResponseCode);
}