Mangopay / mangopay2-php-sdk

PHP SDK for MANGOPAY
https://packagist.org/packages/mangopay/php-sdk-v2
MIT License
122 stars 133 forks source link

"Call to undefined method MangoPay\\ScopeBlocked::GetSubObjects()" #450

Closed Ephillius closed 3 years ago

Ephillius commented 3 years ago

I'm currently trying to make use of the new "block status" functions and my sdk is at release 3.1.5.

public function getUserRegulatoryStatus($mp_user_id) { if($mp_user_id) { return $this->mangoPayApi->Users->GetRegulatory($mp_user_id); } else { \Log::warning('Error MangoPayService at getUserRegulatoryStatus: mp_user_id missing'); } }

It currently stops here: [...]/vendor/mangopay/php-sdk-v2/MangoPay/Libraries/ApiBase.php "line": 426, "function": "CastResponseToEntity",

mangomaxoasis commented 3 years ago

Hi @Ephillius We're looking into ti

tsoko17 commented 3 years ago

Hi, I have got the same error. In debug mode :

`

++++++++++++++++++++++ New request ++++++++++++++++++++++:

FullUrl: https://api.mangopay.com/v2.01/xxxxxxxxxxxxxx/users/00000000000000/Regulatory

RequestType: GET

HTTP Headers: Array ( [0] => Content-Type: application/json [1] => User-Agent: MangoPay V2 SDK PHP 3.1.6 [2] => Authorization: bearer xxxxxxxxxxxxxxxxxxxx )


Response JSON: {"ActionCode":"","ScopeBlocked":{"Inflows":false,"Outflows":false},"Id":"00000000000000"}

Response object: stdClass Object ( [ActionCode] => [ScopeBlocked] => stdClass Object ( [Inflows] => [Outflows] => )

[Id] => 00000000000000

)

` The url and response are working fine but It's after :( I've got error 500.

production.ERROR: Call to undefined method MangoPay\ScopeBlocked::GetSubObjects() {"exception":"[object] (Symfony\\Component\\Debug\\Exception\\FatalThrowableError(code: 0): Call to undefined method MangoPay\\ScopeBlocked::GetSubObjects() at /var/www/html/xxxxxxxxxxx/vendor/mangopay/php-sdk-v2/MangoPay/Libraries/ApiBase.php:395)

tsoko17 commented 3 years ago

You know what ?! I found out where that's come from ! You need to open /MangoPay/ScopeBlocked.php Replace : class ScopeBlocked By : class ScopeBlocked extends Libraries\Dto

And enjoy ! 👍

dduwoyemgp commented 3 years ago

Hello @tsoko17 A Pull Request was triggered and will fixed the issue you encountered. It's just a question of time for a the fix to be released

dduwoyemgp commented 3 years ago

Hello @Ephillius Could we close this issue a the last release of the SDK fixed the problem?

Ephillius commented 3 years ago

Yes, absolutely. Thanks for the help. :)