In App Purchase Verify certificate problem

妖精的绣舞 提交于 2019-12-13 18:22:50

问题


I am getting the response as below.

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

I am encoding the receipt using Base64 only.

I am testing it in sandbox.

What will be the problem? Can anyone help me?


回答1:


hi all i got the solution

just send the receipt data after encoding into base 64 as json with key "receipt-data"




回答2:


VIP Worth noting that 21002 is also the message you get back when trying to verify a transaction that was initiated via rooted iTunes hack software like the Urus app.

We verify all transactions server side, so are not device dependant, the only transactions that get the 21002 response are ALL not real payments.

an easy way to spot it to look at the transaction id returned Urus gives com.urus.iap.XXXXXXX (x being random numbers), other ones include returning the pack name as the completed transaction id, all very different to the id's you get from the various iTunes servers.

I can't recommend more that everyone verifies server-side in an environment you can control, test and prove, that cant be manipulated (unless your hacked). If this is not an option, then do not pay out on a 21002 response.

verifying in a java environment the json response for the 21002 will be: json: {"status":21002,"exception":"java.lang.ClassCastException"}




回答3:


We had the same problem - until we discovered that we didn't include the post body in the request and only sent an empty request.




回答4:


The only option that work for me after 2 days of hitting my head against the wall: Testing in the sandbox

Pay attention to this advice by apple "Important Do not sign in with your test account in the Settings application."

Make sure on the test device you are signed out of the "test" apple store account before encoding to base 64.



来源:https://stackoverflow.com/questions/1789231/in-app-purchase-verify-certificate-problem

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!