function Braintree_TransactionTest::testCredit in Commerce Braintree 7
File
- braintree_php/
tests/ integration/ TransactionTest.php, line 554
Class
Code
function testCredit() {
$result = Braintree_Transaction::credit(array(
'amount' => '100.00',
'creditCard' => array(
'number' => '5105105105105100',
'expirationDate' => '05/12',
),
));
$this
->assertTrue($result->success);
$transaction = $result->transaction;
$this
->assertEquals(Braintree_Transaction::SUBMITTED_FOR_SETTLEMENT, $transaction->status);
$this
->assertEquals(Braintree_Transaction::CREDIT, $transaction->type);
$this
->assertEquals('100.00', $transaction->amount);
$this
->assertEquals('510510', $transaction->creditCardDetails->bin);
$this
->assertEquals('5100', $transaction->creditCardDetails->last4);
}