I'm writing an app that talks to Apple to verifyReceipts. They have both a sandbox and production url that you can post to.
When communicating with Apple, if you receive a
21007 status, it means you were posting to the production url, when you should be posting to the sandbox one.
So I wrote some code to facilitate the retry logic. Here's a simplified version of my code:
var request = require('request') , Q = require('q') ;