dashed-slug.net › Forums › General discussion › Push notifications for the mobile wallet app we are building. › Reply To: Push notifications for the mobile wallet app we are building.
Hello,
Transactions start off in the unconfirmed
state.
As an admin, you choose in “Wallets” -> “Confirms” whether you are going to require withdrawals, and moves, to be confirmed by the user and by admin. (the slugs for these options are: wallets_confirm_withdraw_admin_enabled
, wallets_confirm_withdraw_user_enabled
, wallets_confirm_move_admin_enabled
, wallets_confirm_move_user_enabled
)
Transactions in the DB have two columns, admin_confirm
and user_confirm
. When these values are truthy, it means that the admin, or user, has confirmed the transaction.
The cron jobs periodically check the unconfirmed transactions that have category
equal to withdraw
or move
. If all the required confirmations are there, the transaction gets the pending
status.
You can set the user_confirm
column to 1
for any transaction, and this will indicate that the user has confirmed the transaction. How you do the confirmation is up to you. Once the transaction becomes pending, it will go on to be attempted on a subsequent cron job run.
(All of this means of course that you will not be able to use your app with wallets 6.0.0, which is a complete rebuild of the plugin, and does away with the DB tables among other things. You will need to keep the wallets version to the latest 5.x. This is several months away. You should be ok with 5.x as it is going to be stable.)
Hope this helps.
with regards