Mangopay / mangopay2-php-sdk

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

Getting error when create wallet #378

Closed Premlimbachiya closed 4 years ago

Premlimbachiya commented 4 years ago

i am getting error when create wallet by new user id

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

Riwak commented 4 years ago

Hey @Premlimbachiya,

Is the user already created ? Did a get work on his id ? By the way, here is the code sample to create a wallet 😉


// Prepare the api request
$Wallet = new \MangoPay\Wallet();
$Wallet->Owners = array ("8494514"); // ID of who own's the wallet
$Wallet->Description = "A desciption of the wallet";
$Wallet->Currency = "EUR";
$Wallet->Tag = "Custom data that you can add to this item";

// do the request
$Result = $api->Wallets->Create($Wallet);

https://docs.mangopay.com/endpoints/v2.01/wallets#e21_create-a-wallet