You are here

function Braintree_SubscriptionTest::testCreate_canSetTheMerchantAccountId in Commerce Braintree 7

File

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

Class

Braintree_SubscriptionTest

Code

function testCreate_canSetTheMerchantAccountId() {
  $creditCard = Braintree_SubscriptionTestHelper::createCreditCard();
  $plan = Braintree_SubscriptionTestHelper::triallessPlan();
  $result = Braintree_Subscription::create(array(
    'paymentMethodToken' => $creditCard->token,
    'planId' => $plan['id'],
    'merchantAccountId' => Braintree_TestHelper::nonDefaultMerchantAccountId(),
  ));
  $this
    ->assertTrue($result->success);
  $subscription = $result->subscription;
  $this
    ->assertEquals(Braintree_TestHelper::nonDefaultMerchantAccountId(), $subscription->merchantAccountId);
}