Android应用内支付

最近因为项目需要,又写了次Android in-app billing,为什么说又呢,因为之前做过次,只不过后面种种原因,不再维护,又没有记录过程,只能再次摸爬滚打的再虐一遍。。。废话到此,以下正题


测试环境

国内,需要翻墙工具

subscription类型,product的没有踩过坑

另外,最终我用了各种招数,大约RP问题,没有最终支付成功,google说支付风险高,被拒,打算换个时间再试RP

首先,你得有台Android手机


这里的Android手机是指带着google play,google service的手机,比如miui rom的手机,请自行安装需要的apk

其次,你得有google account以及开通wallet


别闹了,google账号都没的,洗洗睡吧。。。
墙内用户要开通wallet,请参考下这个文 http://zengrong.net/post/1801.htm,简单说下,就是翻墙 

再者,开始之前请阅读下官方文档


虽然都是英文的,但像我这样的英文水平+google translate都可以,相信大家也不会有啥难度的,文档见 http://developer.android.com/google/play/billing/api.html

文档中明确说明,in-app billing分为两种类型,product和subscription。
product是作为一种消耗品的,subscription是一种订阅,简单说product购买了之后需要消费掉的,消费掉后可再次购买,而subscription则不可被消费,也就是说用户购买之后,不可再次购买。

原文档解释:

A subscription is a product type offered in In-app Billing that lets you sell content, services, or features to users from inside your app with recurring monthly or annual billing. You can sell subscriptions to almost any type of digital content, from any type of app or game. To understand how subscriptions work, see In-app Billing Subscriptions.

Important: Unlike in-app products, subscriptions cannot be consumed.

一些我在开发过程中遇到的问题


  1. 价格定义后,不可被修改,只能通过换支付项,让新用户重新购买
  2. subscription不能被删除,这大概是因为用户有订阅续费的原因,只要用户没有取消续费,则一直可以用原来的价格购买
  3. subscription一旦被激活,不论是不是在测试阶段,都不可删除
  4. 记得在https://play.google.com/apps/publish的settings中添加你的测试账号,酱紫不会被真的扣款
原文:
    • Test purchases, which let test account users make real purchase your published in-app items, but without any actual charges to the user accounts.
    • Static billing responses from Google Play, for testing in early development


目前就想到了这些,以后慢慢补,说的不对的地方,欢迎指正~
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值