Search Unity

[Solved] Remote Validation of Google Receipt failing

Discussion in 'Unity IAP' started by Tx, Dec 13, 2018.

  1. Tx

    Tx

    Joined:
    Jul 4, 2012
    Posts:
    108
    Hello,
    we have an issue with the remote check of receipts we were doing on Google receipts.
    On the remote server we checked in PHP that the receipt was not tampered by checking if the signature was the same of the openssl_verify function.

    Until the recent IAP version all was working fine but now we have issues since all our receipts are marked as invalid and the format of the receipt was changed (seems a change of Unity IAP but we wonder if also Google did change something).

    We would like to fix the PHP but there is no documentation of the change of the format.

    We found new fields like skuDetails and title and description and description, moreover all the json was escaped and it's not clear if, to check the signature, we need to remote the new payload fields and compute the signature or do something else.

    Someone had this issues?
    Is there a documentation of the changes and how the receipt could be now validated?
    Is the only viable way use the CrossPlatformValidator API?
    I hope to get help, we are becoming desperate.
     
  2. JeffDUnity3D

    JeffDUnity3D

    Joined:
    May 2, 2017
    Posts:
    14,446
    The receipts are now encoded in Base64 encoding.
     
    Tx likes this.
  3. Tx

    Tx

    Joined:
    Jul 4, 2012
    Posts:
    108
    Thank you Jeff, that wasn't the issue but now I did understand why the signature didn't match and worked on an imrpoved extraction of the required fields for the verification.