Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions lib/Culqi/Client.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
namespace Culqi;

use Culqi\Error as Errors;
use WpOrg\Requests\Requests as Requests;

@kennyhorna kennyhorna Jun 19, 2022

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Dado que la clase tiene el mismo nombre que el alias, está de más esto último.


/**
* Class Client
Expand All @@ -22,13 +23,13 @@ public function request($method, $url, $api_key, $data = NULL, $secure_url = fal
else $base_url = Culqi::BASE_URL;

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