in-app receipt saved to db has invalid characters

Hi,

I'm needing to save the user's receipt into a db field to retreive for later validation/update. When I copy the saved receipt and submit it for validation I get the error 21001 that says it is malformed. I see when I copy it into a text editor that there are invalid characters.


When the user first signs up, the receipt is sent to my api which then calls the Apple Receipt Validation I am saving the response and the receipt in a db table. The validation returns successful.


When the user signs in on the app I have to revalidate the receipt but when I try to revalidated the receipt data from my db field it contains invalid characters.


I understand that the reciept doesn't have a length and can overflow/be truncated in the db field. I read that I need to save the original receipt but I want to verify that I get the necessary data


What do I need to save in the db field that will not have invalid characters but enough receipt information for revalidation of the receipt to get the latest info so that I can update my user's data ( for website access)?


Thanks

Tracey

Replies

You need to save the entire receipt. It is an NSData object.