nov / itunes-receipt

Handle iTunes In App Purchase Receipt Verification
MIT License
94 stars 65 forks source link

[WIP] Fix Time + Update #14

Closed philipgiuliani closed 8 years ago

philipgiuliani commented 9 years ago

THIS IS WORK IN PROGRESS, DO NOT MERGE

I got problems with my current project, so i decided to fix some things of the Gem now (and least for my cases) and ask you if you think that this changes could go into a Gem update.

1. Fix (https://github.com/philipgiuliani/itunes-receipt/commit/2dd48709b3c00c282d813055ecc13008ce5f2e49)

Why should a object have methods like request_date_ms, request_date_pst? Apple returns them, but its definitely enough to parse the default request_date with Time.parse since Apple returns a string with the Timezone included.

In ruby you can than just say receipt.purchase_date and it will return it in the configured Timezone, if you want to get another one, you can say receipt.purchase_data.in_time_zone("Rome") for example.

This fix was applied to:

Since this projects is only Ruby 1.9+ (.travis.yml), i started with updating the Hash syntax to Ruby 1.9 Syntax.

TODO

I noticed that the Gem is very out-of-date with the new apple APIs. A lot of the Receipt fields aren't existing anymore and new has been added.

What do you think about updating it an doing a Major Version bump?