You are here

public static function Braintree_Plan::all in Commerce Braintree 7

2 calls to Braintree_Plan::all()
Braintree_PlanTest::testAll_returnsAllPlans in braintree_php/tests/integration/PlanTest.php
Braintree_PlanTest::testAll_withNoPlans_returnsEmptyArray in braintree_php/tests/integration/PlanTest.php

File

braintree_php/lib/Braintree/Plan.php, line 4

Class

Braintree_Plan

Code

public static function all() {
  $response = Braintree_Http::get('/plans');
  if (key_exists('plans', $response)) {
    $plans = array(
      "plan" => $response['plans'],
    );
  }
  else {
    $plans = array(
      "plan" => array(),
    );
  }
  return Braintree_Util::extractAttributeAsArray($plans, 'plan');
}