So I have in-app-billing working with PHP server verify. However, I cant figure out how to separate my signed data Strings into separate strings in PHP. When I echo $signedData in PHP I get the following.
{\"nonce\":4658477652655443541,\"orders\":[{\"notificationId\":\"android.test.purchased\",\"orderId\":\"transactionId.android.test.purchased\",\"packageName\":\"com.coolboy.coolapp\",\"productId\":\"android.test.purchased\",\"purchaseTime\":1350913071409,\"purchaseState\":0}]}
How do you separate the nonce, orders, and etc. in PHP to separate variables?
Thanks
Use
json_decodeto decode the string into an object.This code:
Produces:
And of course you can do:
More info on JSON: