dashed-slug.net › Forums › CoinPayments.net Wallet Adapter extension support › How can I set default withdrawal address
Tagged: frontend, knockout, move, plugin overrides, templates, UI, views, wallets, wallets_views_dir, withdrawal
- This topic has 5 replies, 3 voices, and was last updated 5 years, 4 months ago by
alexg.
-
AuthorPosts
-
August 28, 2018 at 12:31 pm #4200
Anonymous
InactiveI 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.August 29, 2018 at 8:52 am #4206alexg
KeymasterHello,
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 inwp-content/plugins/wallets/includes/views/move/toadmin.php
, then you can use a shortcode such as[wallets_move template="toadmin"]
.kind regards
April 14, 2019 at 2:18 am #6179Anonymous
Inactivebeen 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?
April 15, 2019 at 5:07 am #6188alexg
KeymasterKnockout 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
April 15, 2019 at 6:03 pm #6192Anonymous
Inactivei was following what you said in that link you left 🙁
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
April 15, 2019 at 6:10 pm #6193alexg
KeymasterMy 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!
-
AuthorPosts
- You must be logged in to reply to this topic.