Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Chrome extension switch from digital goods to in-app payments

With Google retiring the old iframe version in March 2015 we have to switch to the in-app payment route for our extension.

How can we implement repeated purchases of the same product? I see you use the

google.payments.inapp.getPurchases({...

However in our case the user should be able to purchase the same product multiple times. The thought here was just relying on the server postback but it looks like they are removing that too?

{
  "response": {
    "details": [
      {
        "kind": "chromewebstore#payment",
        "itemId": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
        "sku": "giant_tv",
        "createdTime": "1387221267248",
        "state": "ACTIVE"
      }
    ]
  }
}

I must be missing something here, why would Google not implement a way to allow repeated purchases of the same sku or at least allow us to tag the purchase with additional information?

like image 354
artfulhacker Avatar asked Nov 15 '14 21:11

artfulhacker


1 Answers

For complete information on the new payments API see: https://developer.chrome.com/webstore/payments-iap

To answer your question, purchases for the same SKU will only be accepted if you first call

google.payments.inapp.consumePurchase and pass in the SKU that matches a product the profile/user already owns. This is similar to how the Google Play API works.

like image 177
Steve B Avatar answered Oct 23 '22 14:10

Steve B