xendit / xendit-php

Xendit REST API Client for PHP - Card, Virtual Account, Invoice, Disbursement, Recurring Payments, Payout, EWallet, Balance, Retail Outlets Services, xenPlatforms
https://developers.xendit.co/api-reference/
MIT License
156 stars 76 forks source link

Error When Running Balance Examples #62

Closed ErvanAdetya closed 4 years ago

ErvanAdetya commented 4 years ago

Got this error when running balance PHP

`Fatal error: Uncaught Xendit\Exceptions\ApiException: Please contact customer support in /Users/ervan/Documents/xendit/project/php/xendit-php/src/HttpClient/GuzzleClient.php:166 Stack trace:

0 /Users/ervan/Documents/xendit/project/php/xendit-php/src/HttpClient/GuzzleClient.php(139): Xendit\HttpClient\GuzzleClient::_handleAPIError(Array)

1 /Users/ervan/Documents/xendit/project/php/xendit-php/src/HttpClient/GuzzleClient.php(92): Xendit\HttpClient\GuzzleClient->_executeRequest(Array, '/balance?accoun...')

2 /Users/ervan/Documents/xendit/project/php/xendit-php/src/ApiRequestor.php(84): Xendit\HttpClient\GuzzleClient->sendRequest('GET', '/balance?accoun...', Array, Array)

3 /Users/ervan/Documents/xendit/project/php/xendit-php/src/ApiRequestor.php(43): Xendit\ApiRequestor->_requestRaw('GET', '/balance?accoun...', Array, Array)

4 /Users/ervan/Documents/xendit/project/php/xendit-php/src/ApiOperations/Request.php(76): Xendit\ApiRequestor->request('GET', '/balance?accoun...', Array, Array)

5 /Users/ervan/Documents/xendit/proj in /Users/ervan/Documents/xendit/project/php/xendit-php/src/HttpClient/GuzzleClient.php on line 166`

fujitsu826 commented 4 years ago

same with me

Fatal error: Uncaught Xendit\Exceptions\ApiException: There was an error with the format submitted to the server. in C:\xampp\htdocs\tester\xendit-php-master\src\HttpClient\GuzzleClient.php:166 Stack trace: #0 C:\xampp\htdocs\tester\xendit-php-master\src\HttpClient\GuzzleClient.php(139): Xendit\HttpClient\GuzzleClient::_handleAPIError(Array) #1 C:\xampp\htdocs\tester\xendit-php-master\src\HttpClient\GuzzleClient.php(92): Xendit\HttpClient\GuzzleClient->_executeRequest(Array, '/balance?accoun...') #2 C:\xampp\htdocs\tester\xendit-php-master\src\ApiRequestor.php(84): Xendit\HttpClient\GuzzleClient->sendRequest('GET', '/balance?accoun...', Array, Array) #3 C:\xampp\htdocs\tester\xendit-php-master\src\ApiRequestor.php(43): Xendit\ApiRequestor->_requestRaw('GET', '/balance?accoun...', Array, Array) #4 C:\xampp\htdocs\tester\xendit-php-master\src\ApiOperations\Request.php(76): Xendit\ApiRequestor->request('GET', '/balance?accoun...', Array, Array) #5 C:\xampp\htdocs\tester\xendit-php-master\src\Balance.php(70): Xendit\Balance:: in C:\xampp\htdocs\tester\xendit-php-master\src\HttpClient\GuzzleClient.php on line 166

ErvanAdetya commented 4 years ago

Just found the issue of mine, it's IP Whitelist, I think it's better if we returned proper error message for it

ErvanAdetya commented 4 years ago

@fujitsu826 I think your error is quite unrelated with mine, the error returned is different. I think this issue is more related to https://github.com/xendit/xendit-php/issues/63.

triasrahman commented 4 years ago

Hi, I think it's caused by the User-Agent from Guzzle, not about the IP whitelisting. I tried to reproduce using Postman. Here is the result.

Screen Shot 2020-06-10 at 11 49 58 PM

But after I remove the User-Agent of Guzzle, it works fine!

Screen Shot 2020-06-10 at 11 52 49 PM

It's better to investigate from Xendit side, why the "GET" request from Guzzle client is blocked.

For a temporary solution, you can use the pure CURL from PHP.

stanleynguyen commented 4 years ago

Resolved with backend change from Xendit

haloriyan commented 2 years ago

I'm using version 2.17 and 7.0.1 for guzzlehttp, still facing this issue and have no idea