Closed kak2z7702 closed 4 years ago
public function createWallet(array $data): WalletModel
{
/**
* Create a default wallet
*/
$this->getBalanceAttribute();
/**
* @var WalletModel $wallet
*/
$wallet = $this->wallets()->create($data);
$this->_wallets[$wallet->slug] = $wallet;
return $wallet;
}
my wallet has a default name "refill" If I create this wallet, then it is created twice. need to check the existence of the wallet in this method.
this work better
/**
* @param array $data
* @return WalletModel
*/
public function createWallet(array $data): WalletModel
{
/**
* @var WalletModel $wallet
*/
$wallet = $this->wallets()->create($data);
$this->_wallets[$wallet->slug] = $wallet;
/**
* Create a default wallet
*/
$this->getBalanceAttribute();
return $wallet;
}
@kak2z7702 Alexey, Thank you! This morning I will fix it.
Алексей, спасибо. Сегодня утром сделаю фикс данного бага.
@kak2z7702 fixed. thank. tag 3.0.3
I will close issue, if I can help you with anything else-create a new one or open it
it is a bug if you want custom default wallet
@ucanbehack I did not understand your problem. More?
Hi there, got few questions: 1) does the wallet work with fiat currencies and cryptos? 2) can this work with Stripe (for ecommerce), Paypal? 3) Any test / demo links? 4) Can admin control KYC for the users?
@Ecoent This is a library for creating virtual wallets. Everything can be implemented, but the developer is already doing it on his side.
@rez1dent3 thank you very much! would love to use this as early as possible for ecommerce apps. If you can share links or any more information, that will be awesome!
so the code thats published, is this usable now for real life app testing?
@Ecoent I use the library in production, but I can’t decide for you.If you have more questions, then create an issue. This issue is about another issue that most likely is no longer there.
@ucanbehack I did not understand your problem. More?
/**
@return WalletModel */ public function createWallet(array $data): WalletModel {
/**
* @var WalletModel $wallet
*/
$wallet = $this->wallets()->create($data);
$this->_wallets[$wallet->slug] = $wallet;
/**
* Create a default wallet
*/
$this->getBalanceAttribute();
return $wallet;
}
in this case if we want to set custom default wallet name so have to return from above after creating new wallet
@ucanbehack All right. The default wallet will be created automatically. This is the expected behavior of the system.
No more questions. I am closing the issue. There will be questions - reopen or create a new one.
Hi)) I do this: 1.
i have error
refresh page
What am I doing wrong? Thank.