I reply to all queries on the forums and via email, once per day, Monday to Friday (not weekends).

If you are new here, please see some information on how to ask for support. Thank you!

How can I set default withdrawal address

dashed-slug.net Forums CoinPayments.net Wallet Adapter extension support How can I set default withdrawal address

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #4200
    Anonymous
    Inactive

    I want to set a default admin withdrawal address so that once the user request withdrawal the funds will be sent to admin specified static wallet address.
    This means I will have a function where I can do the following:

    1. Enable or disable withdrawal to external address for all my users except admin.
    2. Enable or disable withdrawal to admin default specified wallet address. This means users will not put an address to withdraw to, they only type the amount and hit submit and money is deducted from their wallet to admin wallet.
    3. The two options above can be enabled at once too and when that happens the user is presented with a drop down option asking him to withdraw to external wallet or withdraw to admin account.
    But if only one option is enabled the drop down will only show that one option while the other option is hidden.

    #4206
    alexg
    Keymaster

    Hello,

    You can already control whether withdrawals are enabled or disabled for a group of users (Role), using the capabilities menu.

    As for your other requirement, there is no need to use a blockchain address. Simply do an internal transfer (move). You could override the [wallets_move] UI to provide a UI that always sends to the admin account, using a hidden input field rather than a visible user field. Please see the documentation on how to override the knockout UIs. If you create your view in wp-content/plugins/wallets/includes/views/move/toadmin.php, then you can use a shortcode such as [wallets_move template="toadmin"].

    kind regards

    #6179
    Anonymous
    Inactive

    been trying to do a hidden field but i keep getting this error

    “Wallet operation failed: Could not move : Required parameter missing: move_toaccount”

    so i tried several variations of a hidden field

    	<input type="hidden" name="__wallets_move_tags" value="move" />
    	<input type="hidden" name="user" value="Central Bank" />

    and

    	<input type="hidden" name="__wallets_move_tags" value="move" />
    	<input type="hidden" name="moveUser" value="Central Bank" />

    but nothing is working, keep getting same error

    what am i doing wrong?

    #6188
    alexg
    Keymaster

    Knockout does not bind observables to hidden values, even if you try. However from your code it doesn’t look like you’ve even tried to add any bindings.

    Instead, follow the instructions I gave earlier. There is no reason for you to use knockout for this, as you have nothing that needs synchronizing. Some plain old jQuery or even vanilla JavaScript will do the trick.

    with regards

    #6192
    Anonymous
    Inactive

    i was following what you said in that link you left 🙁

    https://prnt.sc/ncc591

    and as far as bindings, or wht i left out that is why i asked. I have never came across or used knockout until trying to edit this plugin, its not easy for a novice to work with at all

    #6193
    alexg
    Keymaster

    My apologies, I thought you were trying to use knockout because I saw some input field names that match the observables. My mistake.

    The next step would be to use JavaScript to call the JSON API when the form is submitted. That’s it!

Viewing 6 posts - 1 through 6 (of 6 total)
  • You must be logged in to reply to this topic.