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
153 stars 76 forks source link

Payment not found #93

Closed cierish closed 4 years ago

cierish commented 4 years ago

Hello Xendit team,

I tried to run the EwalletsExample.php and got error messages: Fatal error: Uncaught Xendit\Exceptions\ApiException: Payment not found in /Users/kemkem/Downloads/xendit-php-master/src/HttpClient/GuzzleClient.php:167 Stack trace:

0 /Users/kemkem/Downloads/xendit-php-master/src/HttpClient/GuzzleClient.php(140): Xendit\HttpClient\GuzzleClient::_handleAPIError(Array)

1 /Users/kemkem/Downloads/xendit-php-master/src/HttpClient/GuzzleClient.php(90): Xendit\HttpClient\GuzzleClient->_executeRequest(Array, '/ewallets?exter...')

2 /Users/kemkem/Downloads/xendit-php-master/src/ApiRequestor.php(87): Xendit\HttpClient\GuzzleClient->sendRequest('GET', '/ewallets?exter...', Array, Array)

3 /Users/kemkem/Downloads/xendit-php-master/src/ApiRequestor.php(43): Xendit\ApiRequestor->_requestRaw('GET', '/ewallets?exter...', Array, Array)

What could be the cause? It seems the request has been sent.

Many thanks.

Cheers, Cherry

stanleynguyen commented 4 years ago

HI @cierish you are probably passing in an incorrect external id of your payment

cierish commented 4 years ago

Hi @stanleynguyen,

Thank you for your quick reply.

Is 'demo_' in original file not allowed? It works after I changed it into 'demo-' and define the callback URL in dashboard.

Many thanks!

stanleynguyen commented 4 years ago

Hi @stanleynguyen,

Thank you for your quick reply.

Is 'demo_' in original file not allowed? It works after I changed it into 'demo-' and define the callback URL in dashboard.

Many thanks!

Hi @cierish , both should be fine, but there might have been an issue with url encoding 🤔 , can you pass me your external id values so I can try to reproduce the bug?

cierish commented 4 years ago

Hi @stanleynguyen,

Sorry for late reply. I used the demo files: 'externalid' => 'demo' . time(), doesn't work.

Here the exception:

object(Xendit\Exceptions\ApiException)#41 (8) {
  ["errorCode":protected]=>
  string(27) "EXTERNAL_ID_CHARACTER_ERROR"
  ["message":protected]=>
  string(74) "Restricted character in external_id: demo_1598520948. Only '-' is allowed."

Please tell me if you need more information.

Many thanks

stanleynguyen commented 4 years ago

Oh right, for ewallet, the only special charater that you can use is - according to https://xendit.github.io/apireference/#create-payment @cierish