question

madowlgamesuk avatar image
madowlgamesuk asked

Playfab receipt validation not working?

Hey, the receipt validation seems not to work correctly. It worked before and on the client I still get a positive result, but on the backend it doesn't or shows up late in the player's event history. For google it was like 10 minutes after for iOS right now it doesn't show up at all. The problem is that the items won't be granted then. Also I noticed that on the Players section it takes longer than usual for logins to show up, so maybe there are some general problems? nothing to see on the status page yet https://status.playfab.com/

10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Thomas Muys avatar image
Thomas Muys answered

Hey,

For anyone having a similar issue as described in this discussion, in our case the problem was that we somehow lost our link between Google Play Console and Google Cloud Platform, this resulted in receiving the following error as response from our API requests:

"The project id used to call the Google Play Developer API has not been linked in the Google Play Developer Console."

So make sure to check (on Google Play Console) the "API Access" page (main page, under Settings), check if you have everything setup correctly in there.

The moment we fixed those issues our purchases worked again and PlayFab's validation method returned success.

@Jay Zuo, thank you for all the help, took me a bit to figure it out, but I got there in the end.

Cheers,

Thomas

10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

madowlgamesuk avatar image
madowlgamesuk answered

So it seems to work again but I did not change anything. So I think playfab had some issues. What I did though I implemented that after a purchase the Item can be used on the client for a few hours in case it is not granted instant on the backend

5 comments
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Citrus Yan avatar image Citrus Yan commented ·

Recently we're not experiencing issues regarding delayed event processing. To take look at this issue, may I know your title id and the affected player's PlayFabId?

0 Likes 0 ·
madowlgamesuk avatar image madowlgamesuk Citrus Yan commented ·

Hey, yes title id is 8512D and one player to look at would be C406ED4CF69EB991 So the latest receipt validation was yesterday after I tried another purchase with this account and it seems like it rewarded purchases from the day before and even with the wrong item. The weird thing is subscriptions worked kinda normal. Here another test user where I tested yesterday and it worked normal again 43CDEBA4BBC81CB2

0 Likes 0 ·
Citrus Yan avatar image Citrus Yan madowlgamesuk commented ·

I checked player C406ED4CF69EB991 and according to its Event History everything looks normal though, player_receipt_validation comes with player_inventory_item_added, item added into the inventory as expected (it's a stackable item, uses left is 4). Maybe there were some delays processing the events, if you see this issue again, please inform us.

0 Likes 0 ·
Show more comments
Aidos Ryskeldinov avatar image
Aidos Ryskeldinov answered

Today all payments have not been confirmed, although the payment was successful on Google play!

Title ID: B15DF and 618AA

3 comments
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

JayZuo avatar image JayZuo ♦ commented ·

From what I can see in your titles' event history, this issue has been resolved now. Did you make any change with your Google add-on configurations?

1 Like 1 ·
Thomas Muys avatar image Thomas Muys JayZuo ♦ commented ·

Hey (part 1),

Our app is having the same problem, it "just" stopped working for us, worst thing is our players can pay (as in the payments go through) for the in-app products but they don't receive their rewards because the "PlayFabClientAPI.ValidateGooglePlayPurchase" suddenly started returning the error "Invalid Receipt".

As far as I know this error only happens when

  • the "Google App License Key" isn't correct (I checked this already and it's correct)
  • or some went wrong with the receipt/signature

The only thing that changed or could've caused this is I added a new item to the catalog, both on PlayFab and on the Google Play Console, I since then removed those because I thought those were the problem, but this didn't fix anything.

Any help is highly welcome as this problem also affects our players because they lose money without getting their reward.

1 Like 1 ·
Thomas Muys avatar image Thomas Muys JayZuo ♦ commented ·

(part 2)

Information:

Title ID: C7FA8

Problem started November 18th 2021

Changes made around that time:

  • Added 1 item to our shop in the Economy tab
  • Added 1 in-app product to the Google Play Console In-App Products list (active)
  • Also created a new API key for a custom Admin tool we are developing.

Feel free to ask for any extra information you need.

Kind regards,

Thomas

1 Like 1 ·
indie-devvv avatar image
indie-devvv answered

We also have same issue as Thomas reported

10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

JayZuo avatar image
JayZuo answered

@Thomas Muys & @Indie devvv Did you set up a valid "Service account key"? It would be something like the following:

{
  "type": "service_account",
  "project_id": "api-77067922183xxxx9794-530009",
  "private_key_id": "b7ccb1d3bbe78bxxxxx40f46158339fabd79efa7",
  "private_key": "-----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niQUJUwXXXoYOf7gb5W8Ajfbg//i2HB1mWO+q\nfWn4h1j/wQKBgQCdOEfIFUM0g6O36emW4/hflVHqf6biBzr430RDiojho8d/BLgP\nR65wBLLEVkmPf1tD3TC2KJKVWExITOEPE2scDK4f7Wct+RBg1jxMtAe9gIR2YHNh\nN8kOWTDaxHDRNPRDwJgeXbyZuWCcGp8uLyO06cumczTWwBqtIuvsyvAz1wKBgGwN\nTwV1LbvIEatkNQScrzDG9QTU3zDJ4w4A8gO1PQIPIc47qdZlz+9tZvM9XW7WkPd/\nBI/ej4sPExCJ2e+EPgrTDoecq74dY3BKEPgxvyCbyLZBKqAD4jmG/u+8UmiGjB/A\nnCOFdu4fpSjUMeTOiSt4foCtO5jFXXKE4ryImaSBAoGABypgIGiQ0XJMrtPp9IT9\nTRYw1ywk7KpWAtRDsQtR0kEzXUOMSd9ZGvtZkSN4a6feBFZT2rMfKo1vwXw2+jLL\nqaPLuwHX6JLZ5sQtVoGs5bxeVMcylJE5NuTCilyO4/8azDPEoS5WoFFvJ3Vq9Dwz\nJ0ggQcu06p5+PEIpcH2uOVg=\n-----END PRIVATE KEY-----\n",
  "client_email": "playfab@api-7706xxxxxx794-530009.iam.gserviceaccount.com",
  "client_id": "1140560546xxxxxx7548",
  "auth_uri": "https://accounts.google.com/o/oauth2/auth",
  "token_uri": "https://oauth2.googleapis.com/token",
  "auth_provider_x509_cert_url": "https://www.googleapis.com/oauth2/v1/certs",
  "client_x509_cert_url": "https://www.googleapis.com/robot/v1/metadata/x509/playfab%40api-7706xxxxxx794-530009.iam.gserviceaccount.com"
}

You can get it by referring to https://developers.google.com/android-publisher/getting_started and Using a service account section. Please also make sure your service account has necessary permissions.


nxurz.png (288.7 KiB)
4 comments
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Thomas Muys avatar image Thomas Muys commented ·
@Jay Zuo

I did, but isn't that only used for Subscriptions?, which we don't use at the moment, but we added it anyways, this was back in April (2021). I also checked all the other fields on the Google Add-on page and everything seems to be correct.

The weird thing is it always worked up until last week (Thursday), when it started returning "Invalid Receipt" for everyone. So I'm not really sure what happened, besides the things I mentioned in the previous post (adding a, as in 1, new item on PlayFab and Google)

Conclusion, the problem still hasn't been resolved.

0 Likes 0 ·
JayZuo avatar image JayZuo ♦ Thomas Muys commented ·

We are also using it for one-time product now as per Google’s recommendations: https://developer.android.com/google/play/billing/security#verify. This is enabled to prevent pending payment cheat. You can find more info at PlayFab accepting pending payments - Playfab Community.

According to your description, I'd think you may be using a service account without proper permissions. Could you please use your service account to make a purchases.products.get request and see what returns? If you are not sure how to do this, please share your Service account to File Transfer. I can then do the test on behalf of you.

Thank you for your cooperation and understanding!

0 Likes 0 ·
Thomas Muys avatar image Thomas Muys JayZuo ♦ commented ·

Good to know, and I did the request and got the following response (did this using OAuth playground, but according to some forums this might not be working properly):

{
  "error": {
    "message": "The project id used to call the Google Play Developer API has not been linked in the Google Play Developer Console.", 
    "code": 403, 
    "errors": [
      {
        "reason": "projectNotLinked", 
        "message": "The project id used to call the Google Play Developer API has not been linked in the Google Play Developer Console.", 
        "domain": "androidpublisher"
      }
    ]
  }
}

I did some research and it seems this error can be returned due to several reasons, so not sure what the exact problem is, as far as I know the project is linked properly. It has worked for 6+ months, so I'm a bit clueless here. I also contacted Google as it looks like the problem has something to do with our app settings/configuration.

Also not sure what you meant with "using a service account without proper permissions". Maybe I'm missing something here.

In case you have some information or have seen this issue before, any help is much appreciated.

Kind regards,

Thomas M.

0 Likes 0 ·
Show more comments

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.