• Resolved amirosein

    (@amirosein)


    Hi,
    i want to use your plugin for woocommerce and my custom plugin together.
    1- is there any wordpress hook to use inside wordpress for add user transaction record ?
    2- is it possible to use Rest api for that persose ?

    Sorry for my bad english & THANK YOU…

Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Author Subrata Mal

    (@subratamal)

    @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.

    Thread Starter amirosein

    (@amirosein)

    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”.

    Plugin Author Subrata Mal

    (@subratamal)

    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');.

    Thread Starter amirosein

    (@amirosein)

    Thank you so much for quick response…

    woo_wallet()->wallet->get_wallet_balance($user_id, ‘edit’);

    whats the ‘edit’ parameter ?

    Plugin Author Subrata Mal

    (@subratamal)

    @amirosein if you pass edit parameter then the function will return decimal value else will return html price value.

    Thread Starter amirosein

    (@amirosein)

    @subratamal i used your code and that worked PERFECT!
    i have a wallet for my own plugin now!
    .
    Thank You a Million …

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Can i use Rest Api for transaction in my custom plugin ?’ is closed to new replies.