Choosing a Purchase Type
An item's purchase type controls how Google Play manages the purchase of the item. There are two purchase types: "managed per user account" and "unmanaged."
Items that are managed per user account can be purchased only once per user account. When an item is managed per user account, Google Play permanently stores the transaction
information for each item on a per-user basis.This enables you to query Google Play with theRESTORE_TRANSACTIONS
request and restore the state of the items a specific user has purchased.
If a user attempts to purchase a managed item that has already been purchased, Google Play displays an "Item already purchased" error. This occurs during checkout,
when Google Play displays the price and description information on the checkout page. When the user dismisses the error message, the checkout page disappears and the user returns to your user interface.As a best
practice, your application should prevent the user from seeing this error. The sample application demonstrates how you can do this by keeping track of items that are managed and already purchased and not allowing users to select those items from the list.
Your application should do something similar—either graying out the item or hiding it so that it cannot be selected.
The "manage by user account" purchase type is useful if you are selling items such as game levels or application features. These items are not transient and usually need to be restored whenever
a user reinstalls your application, wipes the data on their device, or installs your application on a new device.
Items that are unmanaged do not have their transaction information stored on Google Play, which means you cannot query Google Play to retrieve transaction information for items whose purchase
type is listed as unmanaged. You are responsible for managing the transaction information of unmanaged items. Also, unmanaged items can be purchased multiple times as far as Google Play is concerned, so it's also up to you to control how many times an unmanaged
item can be purchased.
The "unmanaged" purchase type is useful if you are selling consumable items, such as fuel or magic spells. These items are consumed within your application and are usually purchased multiple times.
RESTORE_TRANSACTIONS
This request retrieves a user's transaction status formanaged purchases. You should send this request
only when you need to retrieve a user's transaction status, which is usually only when your application is reinstalled or installed for the first time on a device.
今天继续这个功能,关于RESTORE_TRANSACTIONS ,官方的论述是这样的,这个请求是用来取得以前的交易的记录----防止用户
无故购买两次item。例如当用户重新安装apk时,那么我们必须要保证用户已经买的item应该正常显示。我使用Dungeons Sample来验
证,发现如果我清空程序的数据,再打开(这其实相当于重新安装一次),我发现我已经购买过的,如“android.test.purchased"还是需
要再买一次,而不自动隐藏或者被自动enable.
查了一下文档,原来RESTORE_TRANSACTIONS 这个接口就是用来追踪以前的交易记录的,当你重新安装(Dungeons
sample)后,调用restor_transactions接口,得到的log如下:
04-13 13:18:51.708: I/Security(3264):signedData: {"nonce":4937678692489462368,"orders":[]}
04-13 13:18:51.718: I/Security(3264): signature: jFc2uRlAOQ+lrSGT95ikNH0Yohax702hPt8prKwpXHkfneIi7sR2QMbwb8nMK1F0+oiHvOsJdcQotUtNnrw9Vh6qh3NlqYCzxSFohcgd+KUmOh0q3A1a9I7xqPDvI/OjuMnG5bcdnlPxkeAsZ+fSvBhsERMb2V3FGtSUIn/AFc35GZaddaHxCU7GMjOlCB5p44g4EaVtqVgBlQhbXEE/CBc0z3UaRErIiivDXv15n1JnouX+VhnEzBYvo+O76Ms5C+/C1p5XYRRYYQlh6MOzSpcwfdh+DvnsisscrtXWyqd36TpHJIgjstzdRkiDTLrfe72Lxy1ABzKnWd0I9//I1w==
网上查询资料:
http://stackoverflow.com/questions/6640480/why-restore-transactions-in-app-billing-returns-not-signed-data
I have been experimenting with In-app billings andI discovered that RESTORE_TRANSACTIONS works with only managed items(this is explicitly confirmed on Google In-app billing site). Further, you cannot restore
transactions for reserved Product IDs. I had to purchase a real item to test how restore works.
I may be wrong but that is what I found.
====》
得到的结果是,Google只为managed per user account类型的item存储交易信息,而“android.test.purchased"这个是unmanaged,尽管我已
经在代码里换了类型,
new CatalogEntry("android.test.purchased", R.string.android_test_purchased,
Managed.MANAGED),
可是还是没有作用,而且对于保留的productId是无法取得交易信息的。难道只能实际支付一次!!!
signedData:
{"nonce":4937678692489462368,"orders":[]} 得不到任何以前的交易信息, orders为空
那该怎么办呢?
参考资料:
http://groups.google.com/group/android-developers/browse_thread/thread/408ec3205bbb4256?pli=1
Question:
For a managed item, how do I get order number for itemthat was once purchased
and the app is installed on new device ????
Thanks
Answer:
You'll get that in onPurchaseStateChange in the sample app (calledafter
RESTORE_TRANSACTIONS):
{"nonce":4728283427316410369,"orders":
[{"orderId":"1694851887421222","packageName":"tv.app","productId":"tv.optio ns","purchaseTime":
1302452718521,"purchaseState":2,"developerPayload":"null"},
{"orderId":"509818957061234","packageName":"tv.app","productId":"options"," purchaseTime":
1302718834942,"purchaseState":0,"developerPayload":"null"}]}
On 14 апр, 22:40, Andrei <gml...@gmail.com>
wrote:
> For a managed item, how do I get order number for item
> that was once purchased and the app is installed on new device
> Thanks
谢谢吧
文档布局怎么变形成这样了????
分享到:
相关推荐
Android In-App Billing v3 Library This is a simple, straight-forward implementation of the Android v3 In-app billing API. It supports: In-App Product Purchases (both non-consumable and consumable) ...
自己转换的Android开发指南中的In-app Billing章节, 制作成了6寸的PDF,专门为Kindle3等6寸电纸书设计。
Google Play 应用内支付(In-app Billing V2 + V3)官方示例打包下载
概述 Typographic是Stripe Billing集成的完整完整示例: 特征 :card_index_dividers: 多个计划。 每个服务级别(入门级,增长级和企业级)都包括月度计划和计量计划。 :money_with_wings: 分层定价。 计量计划使用...
Android In-App Billing v3 Library:开发者通过Android v3 API轻松处理应用程序支付问题
SAP Billing方面的权威资料 虽然老了点但是还不错
在应用程序内购买 在应用内购买Android应用程序 在应用内购买类型: 当前订阅类型的演示 为Google Play设置IAP
Reactive Billing is a lightweight reactive wrapper around In App Billing API v3 for Android. Features Reactive: Exposes the In App Billing service methods as Observable, allowing to implement easy ...
Based on the initial work of Anjlab (https://github.com/anjlab/android-inapp-billing-v3). This library provides the existing functionality of Anjlab's initial work and as well a lot of helper methods ...
安卓计费Android 测试应用程序专注于 Google Play In-app Billing。 第一个版本或多或少基于。
Godot-Myket-In-App-Billing 适用于Godot Game Engine的软应用内结算插件
Checkout (Android In-App Billing Library) Description Checkout is an implementation of Android In-App Billing API (v3 ). Its main goal is to make integration of in-app products as simple and straight...
Android SDK r14离线安装包 1、基础包------ android-sdk_r14-windows_1.zip 包含:Tools Android SDK Tools Android SDK Platform-tools Extras Android Support package Google Admob Ads Sdk package ...
Google Play 应用内购
Billing-Warnet-Safitri-Diwanti_7039_MI_A
- name : billing default_region : us-east-1 metrics : - aws_namespace : " AWS/Billing " aws_dimensions : [Currency] aws_dimensions_select : Currency : [USD] aws_metric_name : EstimatedCharges ...
Google Billing library: donations Samsung Look - http://developer.samsung.com/galaxy/edge RootTools - https://github.com/Stericson/RootTools android-hidden-api - ...
水费计费系统 描述 它是为处理复杂的计算和关系而设计的,希望您对您的学习有所帮助,我使用SQL SERVER 2000对于可以在LAN / StandAlone中使用的数据库,希望您喜欢这个。 ) 更多信息 提交时间 ...
react-native-billing, 在Android上,将本地桥反应到InApp计费 用于 Android 的InApp计费 本机计费 为 InApp Billing提供一个易于使用的界面,它通过包装anjlab计费库的 InApp来完成。const InAppBilling = require...
aws dynamodb create-table --table-name BlogsTable --attribute-definitions AttributeName=id,AttributeType=S --key-schema AttributeName=id,KeyType=HASH --billing-mode PAY_PER_REQUEST --endpoint-url ...