Mangopay / mangopay2-php-sdk

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

Adding a IBAN #455

Closed Batato-Johann closed 3 years ago

Batato-Johann commented 3 years ago

Hello,

I'm trying to simply add an IBAN and I get the famous "Bad request. One or several required parameters are missing or incorrect. An incorrect resource ID also raises this kind of error."

I really don't know what's wrong

Here's my code :

    $BankAccount = new \MangoPay\BankAccount();
    $BankAccount->Type = "IBAN";
    $BankAccount->Details = new MangoPay\BankAccountDetailsIBAN();
    $BankAccount->Details->IBAN = "FR7611808009101234567890147";
    $BankAccount->Details->BIC = "CMBRFR2B";
    $BankAccount->OwnerName = "jean jacques";
    $BankAccount->Address = new \MangoPay\Address();
    $BankAccount->Address->AddressLine1 = "test";
    $BankAccount->Address->AddressLine2 = "test";
    $BankAccount->Address->City = "evry";
    $BankAccount->Address->Region = "Region";
    $BankAccount->Address->PostalCode = "91000";
    $BankAccount->Address->Country = "FR";

    return $this->mangoPayApi->Users->CreateBankAccount($id, $BankAccount);
Batato-Johann commented 3 years ago
$BankAccount->OwnerAddress = new \MangoPay\Address();

instead of : $BankAccount->Address = new \MangoPay\Address();