Skip to content

Add extra credit if transaction is greater than some amount #602

Answered by rez1dent3
jigarbhaliya asked this question in Q&A
Discussion options

You must be logged in to vote

If we are talking about the credit limit, then you can not replenish the wallet, but increase the credit limit of the wallet.

https://github.com/bavix/laravel-wallet/blob/4ea8dada0f47fa973dbe24502fdc1a4c524c34b3/docs/credit-limits.md

Then, increase the value inside meta.


If you want to do the accrual of funds through the deposit method, then you can add meta data. Conditionally add "internal" to meta.

$wallet->deposit(..., ['internal' => true]);

And already inside the event, check this field and if it exists, then interrupt the additional accrual.

if ($transaction['meta']['internal'] ?? false) { return; }

Something like that.

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@jigarbhaliya
Comment options

Answer selected by rez1dent3
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants