Please make sure your internet connection is stable, shut down the game from background running, restart and give it another try.
If purchase failed error message pops up, you'd better clear the caches of the app store to try again.
After that, if problem still persists, we suggest you contact the app store support to report the problem and ask for some specific assistance.