Support » Plugin: Bitcoin and Altcoin Wallets » Balances / Transactions

  • Resolved graemeconradie

    (@graemeconradie)


    Alex,

    You’ve done an amazing job here, thank you for that.

    I have a question.

    I deposit currency in one of my wallet address, external to the plugin, and the address value does not show ..

    I have three environments, Dev, Staging and Production.

    I transferred currency and interacted with the wallet in prod and all was fine. I could see the log, and the balance reflected.

    But coming to my dev env, it was not there. I had to export the table data from prod back to dev to see my balance.

    So, I assume you do not query the chain, but rely on the data that sits inside the local db.

    This is a problem.

    Handing out addresses to my users, means they will transact outside of the system, and this is not shown.

    Which means you do not query the chain and update the movement in the wallet address in real time.

    Am i right about this ?

    .. and can you see how this would be a problem.

    Graeme

    The page I need help with: [log in to see the link]

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author dashed-slug.net

    (@dashedslug)

    Hello Graeme,

    Thanks for contacting me, this is a great question.

    What you describe is the correct behavior, by design. I have made this clear on the website: deposits will only work on the live site (see troubleshooting section for the adapter).

    Long explanation:

    The plugin is built first with full node wallets in mind. After seeing that many users cannot setup full node wallets, or are interested in ERC-20 tokens which I currently do not support, I had to create a solution that involves the CoinPayments platform.

    The CoinPayments platform is a custodial wallets provider. As such, they send an IPN (payment notice) to a specific API endpoint that you can set. They use this to notify you that a deposit has been performed. This is NOT the same as seeing a blockchain transaction. The platform has rules on when a deposit is accepted (usually a number of confirmations that they have chosen for each blockchain).

    So, even if you see a blockchain transaction, that does not mean that the funds are deposited or usable (not your keys, not your crypto!). What you want to know is whether *they* think the funds were deposited, again, because they are a custodial wallet provider.

    You are very wise to have a dev, staging and live environment; this is best industry practice, and if more web developers were doing this, a lot of problems would be avoided.

    But in this case I am afraid the best you can do is keep your DB tables in sync via some other way. The CoinPayments platform will only notify one endpoint about deposits.

    With a clever combination of ssh, mysql and mysqldump it shouldn’t be more than a couple of lines of script to sync your staging table to the live one. The tables to keep in sync would be wp_wallets_txs and wp_wallets_adds. If you wish to import transactions from live to dev or stage, you can also use the CSV export/import feature of the plugin.

    with regards,
    Alex

    Alex,

    Thanks for clearing this up. There is one thing we need to do though, and that is to query the blockchain for a current balance of the wallet addresses.

    I have a process where I allow my users to purchase currency with a credit card. This balance would then not show inside the wallet, and that is not going to work.

    I guess this is going to be a problem for everyone out there.

    Does it make sense ?

    Graeme

    Plugin Author dashed-slug.net

    (@dashedslug)

    I understand.

    Querying the blockchain is not compatible with using the CoinPayments platform. Additionally, this is not how the plugin works, even with full node wallets. There is no 1-to-1 correspondence between balances and deposit addresses.

    Finally, the plugin is not suitable for selling cryptocurrencies via credit card.

    If you design your own solution, then that would be a different system altogether.

    with regards,

    Alex

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Balances / Transactions’ is closed to new replies.