public static function createGrant($gateway, $params) { $http = new Braintree\Http($gateway->config); $http->useClientCredentials(); $response = $http->post('/oauth_testing/grants', array('grant' => $params)); return $response['grant']['code']; }