Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

iOS In App purchase status 21002, java.lang.NumberFormatException

When verifying Apple IOS in-app purchase receipt with Apple server, a number of our transaction return as:

{"status":21002,"exception":"java.lang.NumberFormatException"}

May I know what's the cause of the problem? We have follow the Apple In-App purchase guide, i.e we will encode app store return receipt with Base 64 from iOS Client, prior sending the receipt for verification purpose

Note: Most of our transaction did go through, there is about 10% of the transactions with the above error

like image 326
James Khoo Avatar asked Mar 15 '13 03:03

James Khoo


1 Answers

A couple of possible causes:

  • Somebody trying to hack your IAP receipt verification. There are some techniques that insert bogus receipts in the hope the developer doesn't properly verify them. The urus hack has this behaviour.

  • Errors during testing lead to test receipts going to the production verifier.

I've seen these errors fairly often but I just don't recall which of these two causes this exact message. I think they both do. I have yet to have a customer complaint after seeing them.

If your volume is low enough (unfortunately, mine is), go into iTunes Connect and see if there are any sales that match the errors. You can also take a look at the receipt data to see if it looks suspicious.

like image 77
DrC Avatar answered Oct 05 '22 05:10

DrC