function Braintree_TransactionTest::testGatewayRejectionOnCvv in Commerce Braintree 7
File
- braintree_php/
tests/ integration/ TransactionTest.php, line 1246
Class
Code
function testGatewayRejectionOnCvv() {
$old_merchant_id = Braintree_Configuration::merchantId();
$old_public_key = Braintree_Configuration::publicKey();
$old_private_key = Braintree_Configuration::privateKey();
Braintree_Configuration::merchantId('processing_rules_merchant_id');
Braintree_Configuration::publicKey('processing_rules_public_key');
Braintree_Configuration::privateKey('processing_rules_private_key');
$result = Braintree_Transaction::sale(array(
'amount' => '100.00',
'creditCard' => array(
'number' => '5105105105105100',
'expirationDate' => '05/12',
'cvv' => '200',
),
));
Braintree_Configuration::merchantId($old_merchant_id);
Braintree_Configuration::publicKey($old_public_key);
Braintree_Configuration::privateKey($old_private_key);
$this
->assertFalse($result->success);
$transaction = $result->transaction;
$this
->assertEquals(Braintree_Transaction::CVV, $transaction->gatewayRejectionReason);
}