Don't worry, Apple and Google store your purchase history, and you don't need to buy the product again (except for the Time Machine, which can be purchased repeatedly).
Please make sure you're connected with the same Apple ID or the same Google Play Services account you used for your purchase. Double-check and then try to restore the purchase again.