我想通过网上商店销售离线Chrome网络应用。
它有一个服务器后端。我希望服务器检查许可证数据。我该怎么做?
这是API。这是一个Java HowTo。这是一个OAuth-JWT lib for nodejs。我在lib的自述文件中描述了一个新的client-id。
我收到了这个回复:
{ error:
{ errors: [ [Object] ],
code: 403,
message: 'You don\'t have access to licensing data for App ID: aaaaaaaaaaaaaaaaaaaaaaaaaaaa'
}
}
如何在我的服务器中访问我的应用的许可证数据?
麦克
以下是代码:
var appId = 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa';
var userId = '1111111111111111111111';
// obtain a JWT-enabled version of request
var request = require('google-oauth-jwt').requestWithJWT();
request({
url: 'https://www.googleapis.com/chromewebstore/v1.1/licenses/'+appId+'/'+userId,
jwt: {
// use the email address of the service account, as seen in the API console
email: '11111111111-aaaaaaaaaaaaaaaaaaaaaaaa@developer.gserviceaccount.com',
// use the PEM file we generated from the downloaded key
keyFile: 'config/keys/app-11111111111111.pem',
// specify the scopes you wish to access - each application has different scopes
scopes: ['https://www.googleapis.com/auth/chromewebstore.readonly']
}
}, function (err, res, body) {
console.log(JSON.parse(body));
});
答案 0 :(得分:1)
' ave花了很多时间来解决Chrome Webstore的这个问题以及其他一些小问题。使用Stripe.com,Braintree或类似产品。