iOS in app purchase transaction receipt broken?

I’m currently trying to validate an in app purchase receipt from Apple but it seems the receipt is malformed.

The receipt field in the transaction event looks like this:

[receipt] =\> “\<7b0a0922 7369676e 61747572 6522203d 20224178 63714332 6a553536 68757735 77716453 3951576e 45426136 7941506c 6b364a4c 46325945 6f374165 6130716c 77734852 32784968 52664832 63756b4b 4c527876 4a6d4a32 63727938 63575870 61492b54 41634243 46336c76 79374e77 53685159 61374a48 72433944 6e74576a 6c2f6766 53527533 4d587a56 716d6c49 4f413068 6646694a 4d574778 69446350 714e6457 426c4a68 47625659 66737266 36597570 31765677 71463158 6870476f 596f466b 59586c4b 4c514131 53754e64 7a49364d 71675970 4b734371 54377734 4767504f 664c4439 694b4644 777a4268 53736d78 69466738 56414272 784d6879 4a6c7342 72696131 44632f59 67765462 6b6c5868 68336134 434d6a73 786c6569 67565333 2b7a6665 67613063 5a634142 6a647945 58586948 68507542 57534244 59484e57 302b725a 3462456c 56494a59 492f764c 76554c34 74503571 6a374c65 626c674a 316d6951 6f414141 57414d49 49466644 43434247 53674177 49424167 49494475 7458682b 65654359 30774451 594a4b6f 5a496876 634e4151 45464251 4177675a 5978437a 414a4267 4e564241 5954416c 56544d52 4d774551\<\M-b\M^@\M-&\>

Exactly like this, so it comes without a closing quote sign at the end.

Furthermore if I convert this HEX receipt into ASCII, we get something like this:

"signature" = "AyxGFeQReVCmG6XIPSIQMoQi6OD4E6yTbIIEO1tIsJpr+17rQbT1zo0ZVBFHpy2xQXnbX7CYP3MoXps4XBPgGddulIAbtjdIykE57lGs0PDIBvqb75yzAK5/kUwuoR+8SfyUBKB7jjZpWSWZuOYBB0cWQt8h2NePiwV7L+4zrkm6y3SvMutP9yej1qvCpfDXkUYBEwc+6WmXpR/CQ6TWIrCfBoqEz1CBq2y/OBxUyOibtFNoO9poNccbS+z1ZVhM+arE1hLfJ8HHOMauJy18g8BAkWHQUeJqGhaB4zXTs5N30qAWM2EuS+DYDCVxnd6op536w27Ga6Ak7alX/KY3og4AAAWAMIIFfDCCBGSgAwIBAgIIDutXh+eeCY0wDQYJKoZIhvcNAQEFBQAwgZYxCzAJBgNVBAYTAlVTMRMwEQ

Seems to be a good start of JSON data, but from a different example I know that the JSON data should contain these fields:

 

"signature" = "ApMUBC86AlzNikV5YtrZAMiJQbK8EdeXk63kWBAXzlC8dXGujq47ZnIYKoFE1oN/FS8cXlFfp9YXt9iMBdL250lRRmiNGbyhitryYVAQori32W9aR0T8L/aYVBdfW+Oy/QyPZEmoNKxhnt2WNSUDoUhZ8Z+4pP70pe5kUQlbdIVhAAADVzCCA1MwggI7oAMCAQICCGUUkU3ZWAS1MA0GCSqGSIb3DQEBBQUAMH8xCzAJBgNVBAYTAlVTMRMwEQYDVQQKDApBcHBsZSBJbmMuMSYwJAYDVQQLDB1BcHBsZSBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eTEzMDEGA1UEAwwqQXBwbGUgaVR1bmVzIFN0b3JlIENlcnRpZmljYXRpb24gQXV0aG9yaXR5MB4XDTA5MDYxNTIyMDU1NloXDTE0MDYxNDIyMDU1NlowZDEjMCEGA1UEAwwaUHVyY2hhc2VSZWNlaXB0Q2VydGlmaWNhdGUxGzAZBgNVBAsMEkFwcGxlIGlUdW5lcyBTdG9yZTETMBEGA1UECgwKQXBwbGUgSW5jLjELMAkGA1UEBhMCVVMwgZ8wDQYJKoZIhvcNAQEBBQADgY0AMIGJAoGBAMrRjF2ct4IrSdiTChaI0g8pwv/cmHs8p/RwV/rt/91XKVhNl4XIBimKjQQNfgHsDs6yju++DrKJE7uKsphMddKYfFE5rGXsAdBEjBwRIxexTevx3HLEFGAt1moKx509dhxtiIdDgJv2YaVs49B0uJvNdy6SMqNNLHsDLzDS9oZHAgMBAAGjcjBwMAwGA1UdEwEB/wQCMAAwHwYDVR0jBBgwFoAUNh3o4p2C0gEYtTJrDtdDC5FYQzowDgYDVR0PAQH/BAQDAgeAMB0GA1UdDgQWBBSpg4PyGUjFPhJXCBTMzaN+mV8k9TAQBgoqhk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9Mb3NfQW5nZWxlcyI7Cgkib3JpZ2luYWwtcHVyY2hhc2UtZGF0ZSIgPSAiMjAxMi0wNC0zMCAxNTowNTo1NSBFdGMvR01UIjsKfQ=="; "environment" = "Sandbox"; "pod" = "100"; "signing-status" = "0";

So my suspicion is, that the receipt field in the transaction data is not fully transmitted. Does some else have problems with iOS receipt validation?

Finally I found out, that this IS NOT a Corona problem.

Infact it was no problem at all. The only thing that messed up is <\M-b\M^@\M-&> which seems to be a console output problem on iOS.

As far as I read this is maybe related to Unicode. If a Unicode character should be printed out to iOS console it gives something liek this <\M-b\M^@\M-&> and the stops the output.

So I copy paste the receipt from console and of course it did not work because half of the receipt was missing.

I managed to print out the whole receipt via remote debugging. From there the receipt was working and I had a proof that was not Corona’s fault.

Sorry for that false report!

Finally I found out, that this IS NOT a Corona problem.

Infact it was no problem at all. The only thing that messed up is <\M-b\M^@\M-&> which seems to be a console output problem on iOS.

As far as I read this is maybe related to Unicode. If a Unicode character should be printed out to iOS console it gives something liek this <\M-b\M^@\M-&> and the stops the output.

So I copy paste the receipt from console and of course it did not work because half of the receipt was missing.

I managed to print out the whole receipt via remote debugging. From there the receipt was working and I had a proof that was not Corona’s fault.

Sorry for that false report!