1
Chrome拡張機能内のアプリ内購入に支払いAPIを使用しています。Google Chrome:payments APIは取引が成功したときに購入に失敗しました。
私は購入を開始することができます。これはトランザクションを有効にしますが、コールバックはonPurchaseではなくonPurchaseFailedになります。
マニフェスト:
"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