• Resolved VidYen, LLC

    (@vidyen)


    Question, what is the best way for another plugin on the same server to talk with your plugin?

    Say if I wanted to call a function to add credit to a users account programmatically?

    I could use the REST API but that seems odd that the server would have to do a remote call to itself.

    Do you have any recommendations? I’ve seen a few other plugins with internal API calls for other devs making sub plugins.

    Live woo_wallet_add_funds($array)

    Thanks!

    Felty

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

    (@subratamal)

    Hi @vidyen,

    For wallet transactions, you can use woo_wallet()->wallet->credit($user_id, $amount, $details); function for wallet credit, woo_wallet()->wallet->debit($user_id, $amount, $details); for wallet debit, woo_wallet()->wallet->get_wallet_balance($user_id); for wallet balance of a perticular user.

    Cheers!!!

    please how can i add wallet credit to any user account ? where exactly do i use this code

    For wallet transactions, you can use woo_wallet()->wallet->credit($user_id, $amount, $details); function for wallet credit, woo_wallet()->wallet->debit($user_id, $amount, $details); for wallet debit, woo_wallet()->wallet->get_wallet_balance($user_id); for wallet balance of a perticular user.

    how do i use this code

    Thread Starter VidYen, LLC

    (@vidyen)

    Hi thanks so much! This does exactly what I need to do. Should have asked a month ago.

    Thanks!

    -Felty

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Method to add balance via function’ is closed to new replies.