- ๐ค I'm a freelance full-stack developer from Belgium ๐ง๐ช
- ๐ฑ I'm currently working on @WinampAudio web platforms
- ๐ ๏ธ Sometimes I write on my blog
- ๐ ๏ธ I documented all the tools I use regularly on my /uses
Let's connect:
Stack :
A simple virtual wallet implementation for Laravel Users
License: MIT License
Hi,
This is amazing but it has no documentation for getting transaction detail, or make transaction status pending until successful payment done using payment gateway and then make it success
currently you are not returning transaction detail after creating transaction history in HasWallet.php
$this->wallet->transactions()
->create([
'amount' => $amount,
'hash' => uniqid('lwch_'),
'type' => $type,
'accepted' => $accepted,
'meta' => $meta
]);
instead just add return
return $this->wallet->transactions()
->create([
'amount' => $amount,
'hash' => uniqid('lwch_'),
'type' => $type,
'accepted' => $accepted,
'meta' => $meta
]);
so that we can get detail by,
$transaction = $user->deposit(100, 'deposit', ['description' => 'Money Deposited to wallet.', 'status' => 'pending'], false);
Can you explain 'meta' column in wallet_transaction table?
thank you!
Should $user->transactions()
default to only include transactions that are accepted
?
Similar to how Eloquent filters out soft deleted models, but you can use the withTrashed()
to include ones that are deleted.
Maybe $user->transactions()->withRejected()->get()
if you wanted every transaction or something?
Hello,
Many many thanks for the amazing laravel package.
I am working with the project which is based on a reward system. A reward can be in points, BTC or USD so need your advice that which type of changes does this package require for the same.
Thanks!
Issue:
When using the actualBalance()
method in HasWallet
, the amount doesn't match balance
field on the wallets
table as it includes transactions that weren't accepted
Should there be a where('accepted', 1)
added to the query builder?
Is there is any chance to get this done sooner
Hi,
Can I know if I use the deposit or withdraw function is that possible race condition happen ?
let say a malicious user try to invoke withdraw function simultaneously, the wallet have balance of 10 and withdrawn 10 simultaneously , can both withdraw success ?
laravel-wallet/src/Transaction.php
Line 33 in 9f147c8
Besides that nice work man!
I want to confirm if this package is still being maintained and if support can be added to php 8.x
hello, when i try to create migration it throws error
In Connection.php line 664:
SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error i
n your SQL syntax; check the manual that corresponds to your MySQL server v
ersion for the right syntax to use near 'json null, `created_at` timestamp
null, `updated_at` timestamp null) default cha' at line 1 (SQL: create tabl
e `wallet_transactions` (`id` int unsigned not null auto_increment primary
key, `wallet_id` int unsigned not null, `amount` int not null, `hash` varch
ar(60) not null, `type` varchar(30) not null, `accepted` tinyint(1) not nul
l, `meta` json null, `created_at` timestamp null, `updated_at` timestamp nu
ll) default character set utf8mb4 collate 'utf8mb4_unicode_ci')
In Connection.php line 452:
SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error i
n your SQL syntax; check the manual that corresponds to your MySQL server v
ersion for the right syntax to use near 'json null, `created_at` timestamp
null, `updated_at` timestamp null) default cha' at line 1
Hi,
Just playing out with the package, if you try to create transaction on fresh user, it will throw an exception.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.