Fortumo get billing status android go to main activity
I need help regarding Fortumo. I have 2 classes: Pay.class and Main.class. When I open the application, it runs the Pay.class to complete the payment via Fortumo. After successful payment, it redirects to Main.class. But when I open the application it requests payment again. Now, if the same user sends sms again, the application re-executes and the p开发者_运维百科ayment is accepted. I want the user to pay me only once.
You have some options for doing that:
Saving payment status on device: After the user completes the payment you save it to your apps settings and on the next launch, you'll check, it the user has paid already. Now this will only work, for that specific mobile phone. If you want to users to be able to consume your sold goods on multiple devices you should save the payment state on an external server. For this you would use Payment forwarding.
Saving payment state server side: If you enable payment forwarding for your In App service then every time a payment is made, its result is forwarded to that payment forwarding url. It will have all payment information and using the product_name parameter you can forward the username to your server as well. Now each time your app launches you would ask your server how many items logged in user or user with that id has bought.
精彩评论