Skip to content

verifyReceipt() app_store sandbox returns empty {} #170

Answered by imdhemy
mretcoyy asked this question in Q&A
Discussion options

You must be logged in to vote

The App store LatestReceiptInfo instance is not JSON serializable. The same applies to the SupscriptionPurchase from Google play.

But still, you can get an array value from them.

- return json_encode($latestReceiptInfo[0]);
+ return $latestReceiptInfo[0]->toArray() ;
- return json_encode($subscriptionReceipt);
+ return $subscriptionReceipt->toArray();

I deprecated the verifyRenewable today, so it would be better to replace it with the verify method as follows.

- $receiptResponse = Subscription::appStore()->receiptData($receipt)->verifyRenewable(); 
+ $receiptResponse = Subscription::appStore()->receiptData($receipt)->verify();

Replies: 3 comments

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by mretcoyy
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants