locked
Verifying purchases using receipts in PHP

    Question

  • Has anyone got any suggestions on how to do the validation of receipts in PHP? The example here http://msdn.microsoft.com/en-us/library/windows/apps/jj649137.aspx uses some built in types for core functionality such as the SignedXml class. Loading and parsing the xml I've no problem with, it's the actual validation I need a hand with if anyone can point me in the right direction

    Thanks

    Monday, December 03, 2012 8:11 PM

Answers

  • Hi Sugudo, 

    I eventually found a solution on Stack overflow. My main problem wasnt the PHP code but that when sending the xml string from C# to the PHP server - compare the base64 strings on either side. You might just find that your + characters have become space characters. If that's the case then the receipt will NEVER verify correctly. Make sure you convert + characters to %2B or some part of the process will think they are spaces

    http://stackoverflow.com/questions/13776551/windows-store-iap-signature-validation-against-remote-certificate-with-php/19737543?noredirect=1#19737543

    • Marked as answer by RWSoftware Tuesday, January 21, 2014 9:00 AM
    Tuesday, January 21, 2014 9:00 AM

All replies

  • I also issue this. can anyone help me ?

    Thanks

    Tuesday, January 21, 2014 8:45 AM
  • Hi Sugudo, 

    I eventually found a solution on Stack overflow. My main problem wasnt the PHP code but that when sending the xml string from C# to the PHP server - compare the base64 strings on either side. You might just find that your + characters have become space characters. If that's the case then the receipt will NEVER verify correctly. Make sure you convert + characters to %2B or some part of the process will think they are spaces

    http://stackoverflow.com/questions/13776551/windows-store-iap-signature-validation-against-remote-certificate-with-php/19737543?noredirect=1#19737543

    • Marked as answer by RWSoftware Tuesday, January 21, 2014 9:00 AM
    Tuesday, January 21, 2014 9:00 AM