开发者

In App Purchase Verify certificate problem

开发者 https://www.devze.com 2022-12-12 14:30 出处:网络
I am getting the response as below. {\"status\":21002, \"exception\":\"java.lang.NullPointerException\"}

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开发者_StackOverflow中文版.

What will be the problem? Can anyone help me?


hi all i got the solution

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


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"}


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.


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消