Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to save receipt of Apple in-app Purchase in database?

I'm currently trying to implement an in-app purchase (auto-renewal) into my app.

I would like to save the receipt of each user in my database, in order to have a historic. (as prescribed here: iOS & Firebase Auto-renewable Subscriptions)

My question now is, how do I have to save the receipt? Do I have to save it encoded or decoded?

I'm using Firebase to do that (Firestore)

like image 248
KevinB Avatar asked Jun 18 '19 14:06

KevinB


1 Answers

Definitely save the entire encrypted receipt (String). This becomes your source-of-truth since you can continually refresh it with Apple's /verifyReceipt endpoint.

You'll most likely also be saving some of the receipt fields (decrypted) that will be updated as you refresh the receipt.

like image 67
enc_life Avatar answered Oct 22 '22 09:10

enc_life