Title: decrease wallet wallet balance on button click
Last modified: December 12, 2019

---

# decrease wallet wallet balance on button click

 *  Resolved [leaders03](https://wordpress.org/support/users/leaders03/)
 * (@leaders03)
 * [6 years, 5 months ago](https://wordpress.org/support/topic/decrease-wallet-wallet-balance-on-button-click/)
 * is it possible to reduce 1 euro from user balance when he just click on a specific
   button programmatically

Viewing 3 replies - 1 through 3 (of 3 total)

 *  [liammitchell](https://wordpress.org/support/users/liammitchell/)
 * (@liammitchell)
 * [6 years, 5 months ago](https://wordpress.org/support/topic/decrease-wallet-wallet-balance-on-button-click/#post-12233382)
 * Yes, you can call the debit method via an ajax request for example.
 * class Woo_Wallet_Wallet
 *     ```
       global $woo_wallet;
       $woo_wallet->debit($user_id, amount, 'Description here');
       ```
   
 * Or maybe it was $woo_wallet->wallet->debit … I forget.
 * Also useful.
    get_wallet_balance($user_id) You can leave user_id blank to get
   for the logged in user.
 * See
    [https://github.com/malsubrata/woo-wallet/blob/master/includes/class-woo-wallet-wallet.php](https://github.com/malsubrata/woo-wallet/blob/master/includes/class-woo-wallet-wallet.php)
 * There is a filter in recode_transaction for woo_wallet_disallow_negative_transaction
   to say if going negative balance is okay or not.
 *  Plugin Author [Subrata Mal](https://wordpress.org/support/users/subratamal/)
 * (@subratamal)
 * [6 years, 5 months ago](https://wordpress.org/support/topic/decrease-wallet-wallet-balance-on-button-click/#post-12234274)
 * Hi, [@leaders03](https://wordpress.org/support/users/leaders03/) Thanks for reaching
   out and [@liammitchell](https://wordpress.org/support/users/liammitchell/) thanks
   for your response. Yes [@liammitchell](https://wordpress.org/support/users/liammitchell/)
   you are right you can decrease user wallet balance using `woo_wallet()->wallet-
   >debit($user_id, $amount, $description);` function.
 *  [dk2808](https://wordpress.org/support/users/dk2808/)
 * (@dk2808)
 * [6 years ago](https://wordpress.org/support/topic/decrease-wallet-wallet-balance-on-button-click/#post-12768057)
 * How will I check if the user wallet balance is greater than 0.

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘decrease wallet wallet balance on button click’ is closed to new replies.

 * ![](https://ps.w.org/woo-wallet/assets/icon-256x256.png?rev=3360666)
 * [Wallet for WooCommerce](https://wordpress.org/plugins/woo-wallet/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/woo-wallet/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/woo-wallet/)
 * [Active Topics](https://wordpress.org/support/plugin/woo-wallet/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/woo-wallet/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/woo-wallet/reviews/)

 * 3 replies
 * 4 participants
 * Last reply from: [dk2808](https://wordpress.org/support/users/dk2808/)
 * Last activity: [6 years ago](https://wordpress.org/support/topic/decrease-wallet-wallet-balance-on-button-click/#post-12768057)
 * Status: resolved