sibelius / iap-receipt-validator

Validate In-App Purchases (IAP) on App Store using fetch and es6/7
MIT License
97 stars 25 forks source link

Basic question: Why is "latest_receipt_info" an Array? What is "receipt" for? #13

Open booboothefool opened 7 years ago

booboothefool commented 7 years ago

For latest_receipt_info should I just always take latest_receipt_info[0]?

What exactly, is receipt? It has original_purchase_date, etc. in 2013, which confuses me.

Additionally, what is receipt.request_date? It's the date of what request? The verification request? So it's like a last_verified_at?

If the user cancels, will there be cancellation_field?

screen shot 2017-04-18 at 11 44 28 am

booboothefool commented 7 years ago

Okay, so what is going on here exactly?

(I looped through latest_receipt_info and mapped the relevant stuff out.)

screen shot 2017-04-19 at 1 34 45 pm

@sibelius In your example https://github.com/chirag04/react-native-in-app-utils#monthly-subscriptions you mentioned latest_receipt_info[0].

It seems like you really want the last one though?

sibelius commented 7 years ago

hm, that makes sense

do you mind sending a PR fixing this?

tks for taking a look on this

ryancoughlin commented 7 years ago

I've been wondering the same here. Are each of these indexes different purchases? They seem like the same product.

When a purchase is made, the receipt from the purchase needs to be stored somewhere and that is what you send to this validator, correct?

Trying to wrap my head around this process.

Eyesonly88 commented 6 years ago

These are the docs for the receipt fields > https://developer.apple.com/library/content/releasenotes/General/ValidateAppStoreReceipt/Chapters/ValidateRemotely.html

lwx5924 commented 6 years ago

just to check the subscription was activated( legal or worked ) in old past time when the user had stoppted a duration, and then renewed latter.

For example, if a user subscript in Jan, and lapsed in Feb, and renewed in March. So, Jan - Active Feb - Lapsed March - Active.

So return a array.

We can get the check it is current according to 'latest_receipt' & 'latest_receipt_info'

sibelius commented 6 years ago

can we close this?