Skip to content
This repository has been archived by the owner on Apr 27, 2023. It is now read-only.

Commit

Permalink
Fix setting Auth in Source
Browse files Browse the repository at this point in the history
  • Loading branch information
shama committed May 14, 2012
1 parent fb9d572 commit 41e16fb
Showing 1 changed file with 28 additions and 11 deletions.
39 changes: 28 additions & 11 deletions Model/Datasource/StripeSource.php
Expand Up @@ -167,16 +167,13 @@ public function request($request = array()) {
'uri' => array(
'host' => 'api.stripe.com',
'scheme' => 'https',
'path' => '/'
'path' => '/',
),
'method' => 'GET',
'auth' => array(
'user' => $this->config['api_key'],
'pass' => ''
)
);
$this->request = Set::merge($this->request, $request);
$this->request['uri']['path'] = '/v1/'.trim($this->request['uri']['path'], '/');
$this->request['uri']['path'] = '/v1/' . trim($this->request['uri']['path'], '/');
$this->Http->configAuth('Basic', $this->config['api_key'], '');

try {
$response = $this->Http->request($this->request);
Expand Down Expand Up @@ -223,18 +220,38 @@ public function reformat($model, $data) {
return $data;
}



/**
* Unused function
* For checking if record exists. Always say yes.
*
* @param Model $model
* @param Model $Model
* @param string $func
* @return true
*/
public function calculate(Model $Model, $func) {
return 1;
}

/**
* Don't use internal caching
*
* @return null
*/
public function calculate($model, $func) {
public function listSources() {
return null;
}

/**
* Descibe with schema. Check the model or use nothing.
*
* @param Model $Model
* @return array
*/
public function describe(Model $Model) {
if (isset($Model->_schema)) {
return $Model->_schema;
} else {
return null;
}
}

}

0 comments on commit 41e16fb

Please sign in to comment.