Microsoft Azure PlayFab logo
    • Multiplayer
    • LiveOps
    • Data & Analytics
    • Add-ons
    • For Any Role

      • Engineer
      • Designer
      • Executive
      • Marketer
    • For Any Stage

      • Build
      • Improve
      • Grow
    • For Any Size

      • Solo
      • Indie
      • AAA
  • Runs on PlayFab
  • Pricing
    • Blog
    • Forums
    • Contact us
  • Sign up
  • Sign in
  • Ask a question
  • Spaces
    • PlayStream
    • Feature Requests
    • Add-on Marketplace
    • Bugs
    • API and SDK Questions
    • General Discussion
    • LiveOps
    • Topics
    • Questions
    • Articles
    • Ideas
    • Users
    • Badges
  • Home /
  • General Discussion /
avatar image
Question by andreswx@gmail.com · Oct 11, 2016 at 02:23 PM ·

Receipt validation (iOS/Android) after restore purchase

I'm currently using UnityIAP to make purchases and PlayFab for receipt validation. The first time the player makes the purchase everything works fine.

If purchase restoration is triggered, Unity IAP tries to restore the purchase, and I send the receipt to playfab for validation.

Validation fails, because the receipt has already been used during the first validation.

Is there a way to fix this?

Thanks in advance!

Comment

People who like this

0 Show 0
10 |1200 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

2 Replies

· Add your reply
  • Sort: 
avatar image
Best Answer

Answer by Brendan · Oct 12, 2016 at 01:30 AM

[Edit: Updated with the correct Store Kit API reference]

We track on receipt usage, to ensure that players can't cheat and get the item they paid for multiple times. Otherwise, a hacked client could just send the same receipt over and over again, to amass tons of VC, for example.

To restore previous purchases (when a player signs into a new account due to a lost phone, etc.) on iOS, you need to use a Restore Receipt (https://developer.apple.com/reference/storekit/skpaymentqueue/1506123-restorecompletedtransactions). This is a fresh receipt, generated by the iTunes service, which can be used to grant the items to the player.

Google does not provide a similar "restore" style receipt currently. On their platform, you would need to get the list of items the player purchased (https://developer.android.com/google/play/billing/billing_integrate.html - check the "Querying for purchased items" section) and grant them to the player again in Cloud Script (after checking to make sure the player doesn't already have the items).

Comment

People who like this

0 Show 1 · Share
10 |1200 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 Brendan ♦♦ · Oct 12, 2016 at 01:30 AM 0
Share

Of course, ideally, you'd just get them back to their original account by having a common login method, like Facebook, Twitch, etc. :)

avatar image

Answer by andreswx@gmail.com · Oct 12, 2016 at 02:03 PM

Thanks Brendan! We do have a common login method, but we wanted to check other options too.

Comment

People who like this

0 Show 0 · Share
10 |1200 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

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.

Navigation

Spaces
  • General Discussion
  • API and SDK Questions
  • Feature Requests
  • PlayStream
  • Bugs
  • Add-on Marketplace
  • LiveOps
  • Follow this Question

    Answers Answers and Comments

    2 People are following this question.

    avatar image avatar image

    PlayFab

    • Multiplayer
    • LiveOps
    • Data & Analytics
    • Runs on PlayFab
    • Pricing

    Solutions

    • For Any Role

      • Engineer
      • Designer
      • Executive
      • Marketer
    • For Any Stage

      • Build
      • Improve
      • Grow
    • For Any Size

      • Solo
      • Indie
      • AAA

    Engineers

    • Documentation
    • Quickstarts
    • API Reference
    • SDKs
    • Usage Limits

    Resources

    • Forums
    • Contact us
    • Blog
    • Service Health
    • Terms of Service
    • Attribution

    Follow us

    • Facebook
    • Twitter
    • LinkedIn
    • YouTube
    • Sitemap
    • Contact Microsoft
    • Privacy & cookies
    • Terms of use
    • Trademarks
    • Safety & eco
    • About our ads
    • © Microsoft 2020
    • Anonymous
    • Sign in
    • Create
    • Ask a question
    • Create an article
    • Post an idea
    • Spaces
    • PlayStream
    • Feature Requests
    • Add-on Marketplace
    • Bugs
    • API and SDK Questions
    • General Discussion
    • LiveOps
    • Explore
    • Topics
    • Questions
    • Articles
    • Ideas
    • Users
    • Badges