seegno / uphold-sdk-php

Uphold PHP SDK
http://seegno.com
28 stars 24 forks source link

Model/User.php getTransactions() does not get transactions #110

Closed R-K-H closed 8 years ago

R-K-H commented 8 years ago

object(Uphold\Paginator\Paginator)#91 (8) { ["client":protected]=> object(Uphold\UpholdClient)#63 (3) { ["httpClient":"Uphold\UpholdClient":private]=> object(Uphold\HttpClient\HttpClient)#64 (4) { ["client":protected]=> object(GuzzleHttp\Client)#68 (5) { ["messageFactory":"GuzzleHttp\Client":private]=> object(Uphold\HttpClient\Message\MessageFactory)#65 (3) { ["errorPlugin":"GuzzleHttp\Message\MessageFactory":private]=> object(GuzzleHttp\Subscriber\HttpError)#66 (0) { } ["redirectPlugin":"GuzzleHttp\Message\MessageFactory":private]=> object(GuzzleHttp\Subscriber\Redirect)#67 (0) { } ["customOptions":"GuzzleHttp\Message\MessageFactory":private]=> array(0) { } } ["baseUrl":"GuzzleHttp\Client":private]=> object(GuzzleHttp\Url)#69 (8) { ["scheme":"GuzzleHttp\Url":private]=> string(5) "https" ["host":"GuzzleHttp\Url":private]=> string(14) "api.uphold.com" ["port":"GuzzleHttp\Url":private]=> NULL ["username":"GuzzleHttp\Url":private]=> NULL ["password":"GuzzleHttp\Url":private]=> NULL ["path":"GuzzleHttp\Url":private]=> string(1) "/" ["fragment":"GuzzleHttp\Url":private]=> NULL ["query":"GuzzleHttp\Url":private]=> NULL } ["defaults":"GuzzleHttp\Client":private]=> array(5) { ["allow_redirects"]=> bool(true) ["exceptions"]=> bool(true) ["decode_content"]=> bool(true) ["verify"]=> bool(true) ["headers"]=> array(1) { ["User-Agent"]=> string(46) "Guzzle/5.3.0 curl/7.35.0 PHP/5.5.9-1ubuntu4.12" } } ["fsm":"GuzzleHttp\Client":private]=> object(GuzzleHttp\RequestFsm)#77 (3) { ["handler":"GuzzleHttp\RequestFsm":private]=> object(Closure)#76 (2) { ["static"]=> array(2) { ["default"]=> object(Closure)#75 (2) { ["static"]=> array(2) { ["default"]=> object(GuzzleHttp\Ring\Client\CurlHandler)#70 (4) { ["factory":"GuzzleHttp\Ring\Client\CurlHandler":private]=> object(GuzzleHttp\Ring\Client\CurlFactory)#71 (0) { } ["handles":"GuzzleHttp\Ring\Client\CurlHandler":private]=> array(1) { [4]=> resource(4) of type (curl) } ["ownedHandles":"GuzzleHttp\Ring\Client\CurlHandler":private]=> array(1) { [4]=> bool(false) } ["maxHandles":"GuzzleHttp\Ring\Client\CurlHandler":private]=> int(5) } ["streaming"]=> object(GuzzleHttp\Ring\Client\StreamHandler)#74 (2) { ["options":"GuzzleHttp\Ring\Client\StreamHandler":private]=> array(0) { } ["lastHeaders":"GuzzleHttp\Ring\Client\StreamHandler":private]=> NULL } } ["parameter"]=> array(1) { ["$request"]=> string(10) "" } } ["future"]=> object(GuzzleHttp\Ring\Client\CurlMultiHandler)#72 (6) { ["factory":"GuzzleHttp\Ring\Client\CurlMultiHandler":private]=> object(GuzzleHttp\Ring\Client\CurlFactory)#73 (0) { } ["selectTimeout":"GuzzleHttp\Ring\Client\CurlMultiHandler":private]=> int(1) ["active":"GuzzleHttp\Ring\Client\CurlMultiHandler":private]=> NULL ["handles":"GuzzleHttp\Ring\Client\CurlMultiHandler":private]=> array(0) { } ["delays":"GuzzleHttp\Ring\Client\CurlMultiHandler":private]=> array(0) { } ["maxHandles":"GuzzleHttp\Ring\Client\CurlMultiHandler":private]=> int(100) } } ["parameter"]=> array(1) { ["$request"]=> string(10) "" } } ["mf":"GuzzleHttp\RequestFsm":private]=> object(Uphold\HttpClient\Message\MessageFactory)#65 (3) { ["errorPlugin":"GuzzleHttp\Message\MessageFactory":private]=> object(GuzzleHttp\Subscriber\HttpError)#66 (0) { } ["redirectPlugin":"GuzzleHttp\Message\MessageFactory":private]=> object(GuzzleHttp\Subscriber\Redirect)#67 (0) { } ["customOptions":"GuzzleHttp\Message\MessageFactory":private]=> array(0) { } } ["maxTransitions":"GuzzleHttp\RequestFsm":private]=> int(200) } ["emitter":"GuzzleHttp\Client":private]=> object(GuzzleHttp\Event\Emitter)#62 (2) { ["listeners":"GuzzleHttp\Event\Emitter":private]=> array(0) { } ["sorted":"GuzzleHttp\Event\Emitter":private]=> array(0) { } } } ["errorHandler":"Uphold\HttpClient\HttpClient":private]=> object(Uphold\HttpClient\Handler\ErrorHandler)#78 (1) { ["options":"Uphold\HttpClient\Handler\ErrorHandler":private]=> array(8) { ["message_factory"]=> object(Uphold\HttpClient\Message\MessageFactory)#65 (3) { ["errorPlugin":"GuzzleHttp\Message\MessageFactory":private]=> object(GuzzleHttp\Subscriber\HttpError)#66 (0) { } ["redirectPlugin":"GuzzleHttp\Message\MessageFactory":private]=> object(GuzzleHttp\Subscriber\Redirect)#67 (0) { } ["customOptions":"GuzzleHttp\Message\MessageFactory":private]=> array(0) { } } ["api_version"]=> string(2) "v0" ["base_url"]=> string(23) "https://api.uphold.com/" ["debug"]=> bool(false) ["timeout"]=> int(10) ["user_agent"]=> string(67) "uphold-sdk-php {version} (https://github.com/seegno/uphold-sdk-php)" ["version"]=> string(5) "4.0.0" ["bearer"]=> string(40) "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" } } ["headers":protected]=> array(0) { } ["options":protected]=> array(8) { ["message_factory"]=> object(Uphold\HttpClient\Message\MessageFactory)#65 (3) { ["errorPlugin":"GuzzleHttp\Message\MessageFactory":private]=> object(GuzzleHttp\Subscriber\HttpError)#66 (0) { } ["redirectPlugin":"GuzzleHttp\Message\MessageFactory":private]=> object(GuzzleHttp\Subscriber\Redirect)#67 (0) { } ["customOptions":"GuzzleHttp\Message\MessageFactory":private]=> array(0) { } } ["api_version"]=> string(2) "v0" ["base_url"]=> string(23) "https://api.uphold.com/" ["debug"]=> bool(false) ["timeout"]=> int(10) ["user_agent"]=> string(67) "uphold-sdk-php {version} (https://github.com/seegno/uphold-sdk-php)" ["version"]=> string(5) "4.0.0" ["bearer"]=> string(40) "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" } } ["reserve":"Uphold\UpholdClient":private]=> NULL ["options":"Uphold\UpholdClient":private]=> array(7) { ["api_version"]=> string(2) "v0" ["base_url"]=> string(23) "https://api.uphold.com/" ["debug"]=> bool(false) ["timeout"]=> int(10) ["user_agent"]=> string(67) "uphold-sdk-php {version} (https://github.com/seegno/uphold-sdk-php)" ["version"]=> string(5) "4.0.0" ["bearer"]=> string(40) "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" } } ["count":protected]=> NULL ["model":protected]=> string(24) "Uphold\Model\Transaction" ["path":protected]=> string(16) "/me/transactions" ["parameters":protected]=> array(0) { } ["headers":protected]=> array(0) { } ["offset":protected]=> int(0) ["limit":protected]=> NULL }

I'm not sure why it's not working. I have tested with card transactions as well and have the same issue. I can verify that transactions do exist and that they have been commited and filled. Please let me know if you need anything else. (I've removed my bearer key)

nunorafaelrocha commented 8 years ago

@R-K-H The return value of user.getTransations is actually a paginator object were you can call paginator.getNext() to get the next page of transactions.

You can provide the limit number of transactions per page in the getTransactions($limit) arguments.

Just make sure you update the seegno/uphold-sdk-php package to get the patch that was made in #111 on a bug that was found when you don't provide the limit number of transactions per page.