Question

I have a packaged app for chrome web store and I want to implement in-app payment. When a buyer will pay I want to provide a license for him(to use full functionality of my app). Thus, I want to check for the license every time the app starts. It seems that it should be very trivial task but I'm struggling with this task 4 days already. Documentation turned out to be VERY confusing. That's why I want to ask if it is possible at all? Is there any complete samples?

Was it helpful?

Solution

Here is a complete sample: https://github.com/GoogleChrome/chrome-app-samples/tree/master/samples/managed-in-app-payments

Basically, once you have an app/ext in the Chrome Web Store Developer Dashboard and a Google Wallet Merchant account connected, you

1) In the EDIT page of the app/ext in your dashboard, add the items to the "In-app products" tab (and make sure they are activated), and then

2) include the buy.js JS file in your app/ext package. To get a list of the items within your app/ext call getSkuDetails method and to initiate a buy, call the buy method.

For more detailed explanation of the steps, see this page: https://developer.chrome.com/webstore/payments-iap

3) To check if your user has already purchased the item, call getPurchases and see if the item is still listed and is "ACTIVE".

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top