Skip to content

Commit

Permalink
Pequeños cambios 1.2.4
Browse files Browse the repository at this point in the history
  • Loading branch information
brayancruces committed Nov 7, 2016
1 parent 1862d91 commit b596762
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 6 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
### 1.2.4 03-11-2016
* Cambio en el timeout de la conexión a 120 segundos.
* Ejemplo de Planes añadido.

### 1.2.3 08-10-2016
* Cambio en el timeout de la conexión a 120 segundos.
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
},
"extra": {
"branch-alias": {
"dev-develop": "1.2.1-dev"
"dev-develop": "1.2.4-dev"
}
}
}
10 changes: 6 additions & 4 deletions lib/Culqi/Client.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,17 +21,19 @@ public function request($method, $url, $api_key, $data = NULL, $headers= array("
try {
$options = array(
'auth' => new AuthBearer($api_key),
'timeout' => 120,
);
if($method == "GET") {
'timeout' => 120
);
if($method == "GET") {
$url_params = is_array($data) ? '?' . http_build_query($data) : '';
$response = \Requests::get(Culqi::$api_base . $url . $url_params, $headers, $options);
} else if($method == "POST") {
$response = \Requests::post(Culqi::$api_base . $url, $headers, json_encode($data), $options);


} else if($method == "PATCH") {
$response = \Requests::patch(Culqi::$api_base . $url, $headers, json_encode($data), $options);
} else if($method == "DELETE") {
$response = \Requests::delete(Culqi::$api_base . $url, $headers, $options);
$response = \Requests::delete(Culqi::$api_base, $options);
}
} catch (\Exception $e) {
throw new Errors\UnableToConnect();
Expand Down

0 comments on commit b596762

Please sign in to comment.