You are here

function Braintree_SubscriptionTest::testRetryCharge_WithAmount in Commerce Braintree 7

File

braintree_php/tests/integration/SubscriptionTest.php, line 1004

Class

Braintree_SubscriptionTest

Code

function testRetryCharge_WithAmount() {
  $subscription = Braintree_SubscriptionTestHelper::createSubscription();
  Braintree_Http::put('/subscriptions/' . $subscription->id . '/make_past_due');
  $result = Braintree_Subscription::retryCharge($subscription->id, 1000);
  $this
    ->assertTrue($result->success);
  $transaction = $result->transaction;
  $this
    ->assertEquals(1000, $transaction->amount);
  $this
    ->assertNotNull($transaction->processorAuthorizationCode);
  $this
    ->assertEquals(Braintree_Transaction::SALE, $transaction->type);
  $this
    ->assertEquals(Braintree_Transaction::AUTHORIZED, $transaction->status);
}