Skip to content

Commit

Permalink
DOT-4386: YouCan Pay > Fix bug when we generate an Token & documentat…
Browse files Browse the repository at this point in the history
…ion (#7)

* DOT-4386: YouCan Pay > Fix bug when we generate an Token & documentation

* DOT-4386: changing readme

* DOT-4386: code review 1
  • Loading branch information
Mohamed Oussama EL ABBASSI authored Nov 3, 2021
1 parent 40ee811 commit 048d9a0
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,9 @@ You can specify which environment when initializing `YouCanPay` instance

```php
use YouCan\Pay\YouCanPay;

$youCanPay = YouCanPay::instance()->useKeys('my-private-key', 'my-public-key');

// enable sandbox mode
YouCanPay::setIsSandboxMode(true);

$youCanPay = YouCanPay::instance()->useKeys('my-private-key', 'my-public-key');
```
4 changes: 2 additions & 2 deletions src/API/HTTPAdapter/CurlHTTPAdapter.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ protected function parseHeaders($headers)

public function request(string $method, string $endpoint, array $params = [], array $headers = []): Response
{
$curl = curl_init(sprintf($this->getBaseUrl(), $endpoint));
$curl = curl_init(sprintf('%s%s', $this->getBaseUrl(), $endpoint));
$headers["Content-Type"] = "application/json";
$headers["Accept"] = "application/json";

Expand All @@ -47,7 +47,7 @@ public function request(string $method, string $endpoint, array $params = [], ar
switch (strtolower($method)) {
case 'post':
curl_setopt($curl, CURLOPT_POST, true);
curl_setopt($curl, CURLOPT_POSTFIELDS, $httpBody);
curl_setopt($curl, CURLOPT_POSTFIELDS, json_encode($params));

break;
case 'get':
Expand Down

0 comments on commit 048d9a0

Please sign in to comment.