Hello, Bitcoin community. I am developing an android application using Unity Engine.There are in-app purchases inside this application (items, gamepoints) that user would buy for the btc.I have few questions about payment confirmations. Let's say I can generate link similar to "bitcoin://12A1MyaddResshRAZEqofac5jCQQjwEPBu?amount=1.00" to parse it by any android btc wallet. But how to get a confirmation that payment has been sent/received? How to make this confirmation safe and secure?Maybe another approach?

In short, you're going to want to generate a bitcoin address for the purchase and record the value you expect. Then you want to watch for when the transaction has been confirmed on the blockchain. There are a couple of methods to do the later, either check the amount received by that address on a recurring basis or setup a node to run a script when that address has received a value. You can also use a 3rd party to do the transaction for you, there are payment API's offered by several companies. The trade-off to using them is of course, trust.

You should check whether the transaction has been confirmed, i.e. it has been included in a block.

Most wallets that you would use for this will tell you whether the transaction has been confirmed and how many confirmations it has.

So my application has to connect to android btc walelt?For example https://play.google.com/store/apps/details?id=de.schildbach.wallet&hl=enStill few questions:1. Where my app can get Transaction ID to check its status? (I suppose only manual enter by user).2. I am not sure that there is programming interface in this wallet to interact with another apps. My goal is to get payment confirmation programatically.

Not necessarily. Presumably you, as the app developer, are operating your own servers with players' account information so that you can unlock their purchases after they pay. Your server should be running its own wallet, and it can check its own wallet to see if a payment has confirmed.

Still few questions:1. Where my app can get Transaction ID to check its status? (I suppose only manual enter by user).

You should be checking it on your own servers and informing the app that the payment has confirmed. Your own servers should be handing out a new address for every single purchase so that it is easier to track people's payments to you. All you need to do is watch for transactions for each address, and then notify the app when those transactions confirm.

Well I'd recommend using some 3rd party API and wait for at least 3 confirmation so it's sure that the btc has arrived.You could also run a wallet and check it periodically whether new transactions have arrived and if they did then track them until 3 comfirmation then you can be sure that it's arrived.

This is a nice project and i will like to play the game when launched.In order to get a better assistance you need to answer some questions1, will you have only one btc address for the game?2, Does every user have their own unique btc address?3, Will those btc address(es) be static or dynamic ?You can check the codes here https://blockchain.info/api/api_websocketLet me know if this does not solve the problem.

From a technical side, I would say that you'd have to incorporate some code that would fetch data to check if the wallet has been funded. One way to do this would be to auto-generate new wallets for every transaction and have the script check for 1-3 confirmations before verifying the payment. Thatvway no two transactions would get mixed up in the system. The Bitcoin transaction themselves would act as a unique payment ID in that sense.

From a practical side however, I would say that given the lengthy transaction times, is it worthwhile for your app? As much as I'm pro BTC, I can't see many people waiting 30+ minutes for an in-app purchase to process. That's just something to consider (unless you opt to go for a very high fee per every transaction but that would make the in-app purchases even pricier).