You are here

public static function Braintree_Subscription::retryCharge in Commerce Braintree 7

2 calls to Braintree_Subscription::retryCharge()
Braintree_SubscriptionTest::testRetryCharge_WithAmount in braintree_php/tests/integration/SubscriptionTest.php
Braintree_SubscriptionTest::testRetryCharge_WithoutAmount in braintree_php/tests/integration/SubscriptionTest.php

File

braintree_php/lib/Braintree/Subscription.php, line 96

Class

Braintree_Subscription
Braintree Subscription module

Code

public static function retryCharge($subscriptionId, $amount = null) {
  $transaction_params = array(
    'type' => Braintree_Transaction::SALE,
    'subscriptionId' => $subscriptionId,
  );
  if (isset($amount)) {
    $transaction_params['amount'] = $amount;
  }
  $response = Braintree_Http::post('/transactions', array(
    'transaction' => $transaction_params,
  ));
  return self::_verifyGatewayResponse($response);
}