Mangopay / mangopay2-php-sdk

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

Update BankAccount: Bad request. One or several required parameters are missing or incorrect. #409

Closed sohaieb closed 4 years ago

sohaieb commented 4 years ago

Hello, I get an error when i tried to update a user bank account, here is the full updated BankAccount object:

image

here is the error i got in postman:

Error: Bad request. One or several required parameters are missing or incorrect. 
An incorrect resource ID also raises this kind of error

here is the code which i wrote in PHP:

$userId = "85498898";
$bankAccount // is set as a bank account object with the precedent image parameters 
$this->api->Users->UpdateBankAccount($userId, $bankAccount)

thanks.

mangomaxoasis commented 4 years ago

Hi @sohaieb In this case the method is calling the 'deactivate' endpoint https://docs.mangopay.com/endpoints/v2.01/bank-accounts#e306_deactivate-a-bank-account We will update the language so it's clearer. As a reminder, bank accounts cannot be changed, they can only be deactivate. The change a bank account you would need to deactivated the current and create a new one max

sohaieb commented 4 years ago

Hi @sohaieb In this case the method is calling the 'deactivate' endpoint https://docs.mangopay.com/endpoints/v2.01/bank-accounts#e306_deactivate-a-bank-account We will update the language so it's clearer. As a reminder, bank accounts cannot be changed, they can only be deactivate. The change a bank account you would need to deactivated the current and create a new one max

thank you a lot for your answer ,

it would be nice if you mention this point in the API documentation.

thanks.