@amirosein yes you can use rest api for this or you can use our inbuilt function woo_wallet()->wallet->credit ($user_id, $amount, $description);
for this.
1- by using this inbuilt function, can i add transaction from my own plugin (that have no woo products and just have a payment form), and debit the wallet after form submittion instead of online payment, without any conflict with woocommerce, correct?
2- please tell me if there is builtin function for “Get user wallet balance by user id” and “add Debit transaction”.
For debit transaction please use woo_wallet()->wallet->debit($user_id, $amount, $description);
and to get user wallet balance please use woo_wallet()->wallet->get_wallet_balance($user_id, 'edit');
.
Thank you so much for quick response…
woo_wallet()->wallet->get_wallet_balance($user_id, ‘edit’);
whats the ‘edit’ parameter ?
@amirosein if you pass edit parameter then the function will return decimal value else will return html price value.
@subratamal i used your code and that worked PERFECT!
i have a wallet for my own plugin now!
.
Thank You a Million …