1
我在Chrome擴展程序內使用付款API進行應用內購買。Google Chrome:付款API返回購買交易失敗時失敗
我能夠啓動一項購買,它可以運行並激活交易,但是回調會轉到onPurchaseFail而不是onPurchase。
清單:
"offline_enabled": true,
"name": "__MSG_name__",
"description": "__MSG_description__",
"manifest_version": 2,
"version": "1.1.2",
"default_locale": "en",
"icons": {
"128": "style/128_on.png"
},
"background": {
"persistent": true,
"scripts": [ "js/jquery.min.js","js/bg.js" ]
},
"browser_action": {
"default_title": "__MSG_name__",
"default_icon": "style/128_off.png",
"default_popup": "popup.html"
},
"key": "...",
"oauth2": {
"client_id": "...",
"scopes": [ "https://www.googleapis.com/auth/chromewebstore.readonly" ]
},
"permissions": [ "*://*/*", "activeTab", "tabCapture", "tabs" ]
API買入法:
google.payments.inapp.buy({
parameters: {'env': "prod"},
'sku': sku,
'success': onPurchase,
'failure': onPurchaseFailed
});
我越來越:
onPurchaseFailed Object{
checkoutOrderId:"10370910..."
response:Object{
errorType:"PURCHASE_CANCELED"}
}
許可證被激活但是:
google.payments.inapp.getPurchases({
'parameters': {'env': 'prod'},
'success': onLicenseUpdate,
'failure': onLicenseUpdateFail
});
個
回報:
createdTime: //some number
itemId: //some string
kind:"chromewebstore#payment"
sku: //some string
state:"ACTIVE"
我有一個懷疑,這是因爲採購的窗口,當它關閉,這會觸發onPurchaseFailed回調發送取消消息。如何處理這個?
關於此問題的任何結論? – vondip