youknowone / itunes-iap

Apple iTunes In-app purchase verification tool
http://itunes-iap.readthedocs.io
Other
136 stars 50 forks source link

Would there ever be a case to not use 'review' environment in production? #28

Closed jeffjvick closed 7 years ago

jeffjvick commented 8 years ago

This is a question, not an issue but I don't have a way to mark it as such.

It appears when env.review is used a receipt will first be tried on the production environment and fall back to the sandbox which is what apple requires for the reviewers to test with. It would seem this would be needed in the production version of my app to make sure it passes review.

I can see where you'd want to use the sandbox env to speed up testing but when would you ever use production or default (which is the same)? That wouldn't pass review and you'd have to implement your own check for 21007 which is what you already are doing in the review env.

Please let me know if I'm missing something.

youknowone commented 8 years ago

For me, the review mode is good enough for small services. To prevent your testers are getting advantage of free IAP in production version, you can manage review version and enable review mode only for the version under review. (Of course it requires manual management of client version in the server code)

so roughly,

if client_version == review_version:
    env = review
else:
    env = production

To use review mode as default (well... who cares), try this line in your initiation code. Than review mode will be default everywhere.

itunesiap.env.review.push()

This issue makes me think of having easier way to change default mode - because I still believe production mode is better mode for real service, but most of the users will want to use review mode in their service.

jeffjvick commented 8 years ago

Hi, thanks for the response. I just realized that since this code is on my server all I need to do is make a small change to default it to production mode after the apple review process is over. Or implement something like your code example and then change the review_version in settings. There would only be a short time I'd be "stuck" in review mode while waiting for apple to finish its review.

Thanks.