Jump to content

Api/transactions/gettotalcredit Returns Empty Array


Anton Qcl

Recommended Posts

Version: 3.0.5

Action: Try to get total credit from client with credit equal 0.

Test link: .../api/Transactions/getTotalCredit.json?client_id=2&currency=CAD
Problem: I receive empty array but I expected value equal 0. Is "empty array" correct API answer?


PS Description for getTotalCredit:

/**
* Retrieves the total credit amount available to the client in the given currency
*
* @param int $client_id The ID of the client to fetch a credit value for
* @param string $currency The ISO 4217 3-character currency code (optional)
* @return double The total credit available to the client in the given currency
*/

 


But parameter $currency doen't have default value.

 

 

 

 



public function getTotalCredit($client_id, $currency) {


 

Link to comment
Share on other sites

Moved to bugs.

 

Looks like a couple separate issues here:

 

1. Documentation error ($currency is not optional). CORE-871.

2. API is failing to output results that are equivalent to false (e.g. 0, false, null), returning void instead. CORE-872.

 

Both fixed in 3.0.6.

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
×
×
  • Create New...