Closed kaomte closed 9 years ago
hum, seems unnecessary.
@r4m, do you remember why you added to_h
and to_json
in the commit?
I've just removed the method. If @r4m is ok, or no response for a while, I'll release new version with this removal.
Thanks for your report.
BTW, in what case, do you convert Itunes::Receipt
instance into JSON, @kaomte ?
I'm storing the receipt in a database field.
Ah, then I recommend you to store what you received from apple server directly. It's always the best way handling singed/encrypted security tokens.
@nov Yes, that's the ideal solution that I'm working towards, but I have not yet figured out a way to access that data from Itunes::Receipt. Any suggestions?
Aren't you giving raw receipt data to this gem?
Sent from my iPhone
On 2014/04/18, at 1:18, kaomte notifications@github.com wrote:
@nov Yes, that's the ideal solution that I'm working towards, but I have not yet figured out a way to access that data from Itunes::Receipt. Any suggestions?
\ Reply to this email directly or view it on GitHub.
You mean the base64 encoded data? You know I never thought to try to decode that, it just seemed easier to get the decoded version from the server response.
This gem doesn't decode
data.
It send the given encoded
data to Apple server, and get a JSON response.
The encoded
data is verifiable (=include signature), but the response isn't.
But the Apple server does verify the encoded data and assuming we trust the connection to the Apple server, we can then simply rely on the response, correct?
At the time you accessing to Apple server, yes. In future, no.
Ah, I see what you're saying. Thanks for the explanation!
@nov I probably added them because I intentionally wanted to distinguish the struct of the json compared to the hash one. I do not remember exactly at the moment the reason why. I'll do some test in the next week with version 1.0.0 and then I'll try again when you release an update with the aforementioned commit
When converting to JSON, many of the fields are missing, most notably the in app purchases are missing.
The json conversion method was added in b99192520526c8d93a74086234bddb4b39678f43.
Was there a specific reason for adding the as_json method? Removing the as_json method seems to resolve the issue.