Are there multiple formats of In App Billing transactions?

冷暖自知 提交于 2019-12-30 07:12:09

问题


We're having problems verifying some of payment transactions (Google In App Billing V3). It looks like data of cumbersome transactions follows a different format than what we can see in transactions we have no problems verifying.

Transactions that we are able to verify

  • OrderId: Two numbers separated with a dot: 92299713162054702728.1224255970239541
  • Signature: Always includes base64 padding at the end, 345 characters long

Transactions that fail to verify

  • OrderId: One number: 5643493869375537013
  • Signature: Is missing base64 padding, 343 characters long

(those are not actual ids)

Adding padding manually when it's missing does not help to verify signatures.

Why are we receiving data in different format? Why are we unable to verify them, even though we have no problems verifying "ordinary" transactions? What should we do / investigate in order to solve this issue?


回答1:


Check this link:

http://developer.android.com/google/play/billing/billing_admin.html#orderId

For transactions dated 5 December 2012 or later, Google Wallet assigns a Merchant Order Number (rather than a Google Order Number) and reports the Merchant Order Number as the value of orderID. Here's an example:

"orderId" : "12999556515565155651.5565135565155651"
For transactions dated previous to 5 December 2012, Google checkout assigned a Google Order Number and reported that number as the value of orderID. Here's an example of an orderID holding a Google Order Number:

"orderId" : "556515565155651"

So I think you can solved it by storing date wise transaction in your database and check the date whether given date is 5 Dec or later then check 1st one else 2nd one.

or

you can also check the developer payload to check whether our transaction is securely done or not. Google play store will give you the same payload that you gave while purchasing the in app product.

For more information check this link for the developer payload link

Hope it will solve your problem.



来源:https://stackoverflow.com/questions/18980703/are-there-multiple-formats-of-in-app-billing-transactions

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!