You are here

function Braintree_CreditCardTest::testCreate_withCardVerificationAndSpecificMerchantAccount in Commerce Braintree 7

File

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

Class

Braintree_CreditCardTest

Code

function testCreate_withCardVerificationAndSpecificMerchantAccount() {
  $customer = Braintree_Customer::createNoValidate();
  $result = Braintree_CreditCard::create(array(
    'customerId' => $customer->id,
    'number' => '5105105105105100',
    'expirationDate' => '05/2011',
    'options' => array(
      'verificationMerchantAccountId' => Braintree_TestHelper::nonDefaultMerchantAccountId(),
      '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);
}