Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
1
Question by blindgoat · Apr 26, 2013 at 12:26 AM · prime31receiptstorekit

Prime31 StoreKit TransactionId Mismatch

I am using the recommended method of confirming IAP receipts. The client tries to purchase, sends the receipt data to our game server (along with the StoreKitTransaction.productIdentifier and transactionIdentifier), our server verifies the receipt with Apple's server and then our server verifies several things:

  1. Purchase hasn't been used before (isn't in our db)

  2. Purchase is for THIS app (by verifying both the bid and product_id)

  3. transactionIdentifier client sends up from StoreKitTransaction is compared to transaction_id found in Apples receipt

About 95% of our purchases succeed. However, I've had two users whose transactions fail test 3. The StoreKitTransaction.transactionIdentifier the client sends to our game server is different from the transaction_id Apple's receipt contains.

Example of GOOD transaction:

Client sends to our server: transId:14021391238918, prodId:"500 coins"

Our server gets from Apple's server: transId:14021391238918, prodId:"500 coins"

Example of BAD transaction:

Client sends to our server: transId:CD9B55238-3C81-42B7-8TTW-62391FBDLQO6B, prodId:"500 coins"

Our server gets from Apple's server: transId:128391278321, prodId:"500 coins"

ALL of our successful transactionIds are 16 integers like in the good example above. ALL of the failed transactionIds are those big number/letter combos.

Any ideas? Thanks!

Possible interesting sidenote: The format for the failed transactionIds matches up exactly with the "unique_vendor_identifier" field of Apple's receipts.

TLDR: We sometimes experience: transactionId from client doesn't match tansactionId from Apple's receipt when validating from a server.

Comment
Add comment
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

1 Reply

· Add your reply
  • Sort: 
avatar image
2
Best Answer

Answer by blindgoat · Apr 26, 2013 at 05:43 PM

I added more logging on our server. Turns out these really are users using bad data trying to fake purchases.

Apple response from endpoint=ssl://buy.itunes.apple.com: stdClass::__set_state(array( 'original_purchase_date_pst' => '2012-07-12 05:54:35 America/Los_Angeles',

'purchase_date_ms' => '1342097675882',

'original_transaction_id' => '170000029449420',

'original_purchase_date_ms' => '1342097675882',

'app_item_id' => '450542233',

'transaction_id' => '170000029449420',

'quantity' => '1',

'bvrs' => '1.4',

'version_external_identifier' => '9051236',

'bid' => 'com.zeptolab.ctrexperiments',

'product_id' => 'com.zeptolab.ctrbonus.superpower1',

'purchase_date' => '2012-07-12 12:54:35 Etc/GMT',

'purchase_date_pst' => '2012-07-12 05:54:35 America/Los_Angeles',

'original_purchase_date' => '2012-07-12 12:54:35 Etc/GMT',

'item_id' => '534185042', ))

So basically they are using an old purchase from Cut the Rope (NOT our app). A little research shows that this is a pretty common thing and there must be a jailbroken app out there that lets you try to buy stuff from other apps. See this

Comment
Add comment · Show 6 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image Fattie · Apr 26, 2013 at 05:44 PM 0
Share

yeah, it's super-common .. indeed it's universal.

it's actually really, really hard to do IAP and so on, really securely. What a hassle!

Note that in the real world you really have to make your server track all transactions, and only ever approve a transaction to your app ONC$$anonymous$$

it's sort of the "elephant in the room" or the "dirty little secret" of doing IAP.

avatar image blindgoat · Apr 26, 2013 at 05:47 PM 0
Share

Ya - it's crazy how common it is. I'm just glad the system we put in place seems to be secure. We track all the transactions like you said and make sure they only occur once.

Thanks for marking it as the answer.

avatar image Fattie · Apr 26, 2013 at 06:26 PM 0
Share

"We track all the transactions and make sure they only occur once"

You nailed it. Like I say, it's totally weird that you never hear people mentioning that. Like it's an absolute basic in the app store.

Just one of those weird things in life !

avatar image StoneFish · Apr 30, 2013 at 02:03 AM 0
Share

Hi Blindgoat and co

I'm curious as to HOW you track the transactions? Do you save the original transaction number or the product id number? Thanks.

avatar image StoneFish · Apr 30, 2013 at 02:03 AM 0
Share

Hi Blindgoat et al...

I'm curious as to HOW you track the transactions? Do you save the original transaction number or the product id number? Thanks.

Show more comments

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

13 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Prime31 Storekit purchaseSuccessfulEvent claims to have receipt, but I can't find it. How do I find the receipt? 1 Answer

Blackish GUIKit001 + Prime31 StoreKit for In-App-Purchase 1 Answer

How do I implement Receipt validation to transition users from paid to free+inapp? 0 Answers

Problem with Prime31's StoreKit implementation 0 Answers

Prime31 storekit find product ID but not product description 0 Answers


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges