Jbur43
Jbur43

Reputation: 1312

Chrome Web Store (CWS) API Payments TOKEN_MISSING_ERROR

Problem: I can't query Chrome Web Store (CWS) API for my extensions products, I get this error: "TOKEN_MISSING_ERROR"

I am trying to set up payments without using a server:

"The Chrome Web Store (CWS) API can be used to handle in-app purchases without the use of any server-side coding as was previously required by the deprecated Google Wallets for Digital Goods API."

For the interested, these are the main docs I've been referencing.

manifest.json

{
  "manifest_version": 2,
  "name": "HTTP Sherifff",
  "description": "URL Whitelisting Script",
  "version": "0.7",
  "permissions": ["storage", "activeTab", "webRequest", "webRequestBlocking", "webNavigation", "https://www.googleapis.com/"],
  "icons": { "16": "sheriff_boot.png",
             "48": "sheriff_boot.png",
            "128": "sheriff_boot.png" },
  "background": {
    "scripts": ["background.js", "buy.js"]
  },
  "browser_action": {
   "default_popup": "popup.html"
 },
 "oauth2": {
    "client_id": "493953193377-ldt1t6b4d2p86gv99je684jni6ck7tsj.apps.googleusercontent.com",
    "scopes": [
        "https://www.googleapis.com/auth/chromewebstore.readonly"
    ]
  }
}

In background.js:

console.log('buy', google.payments.inapp.getSkuDetails({
'parameters': {'env': 'prod'},
'success': onSkuDetails,
'failure': onSkuDetailsFail
}));

Console response: response: {errorType: "TOKEN_MISSING_ERROR"}

Things I did:

Has anyone gotten Chrome Web Store Payments working like this without a server? Does my config match yours and do my troubleshooting steps seem accurate? What might you try differently?

Upvotes: 1

Views: 260

Answers (1)

Black-Hole
Black-Hole

Reputation: 943

Should be that you are missing identity permission

In this regard, the official documentation has a detailed description: https://developer.chrome.com/webstore/one_time_payments#update-manifest

You can try it, if there is a problem, please let me know.

Upvotes: 2

Related Questions