Last active
July 27, 2019 01:58
-
-
Save tochi/f7464cd20f52ec05ae1a98df240c1ea5 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
apple_url = “https://buy.itunes.apple.com/verifyReceipt” | |
receipt_data = params[“receipt-data”] | |
res = RestClient.post apple_url, {:’receipt-data’ => receipt_data}.to_json | |
res = JSON.parse(res) | |
if res[“status”] == 21007 | |
apple_url = “https://sandbox.itunes.apple.com/verifyReceipt” | |
receipt_data = params[“receipt-data”] res = RestClient.post apple_url, {:’receipt-data’ => receipt_data}.to_json | |
res = JSON.parse(res) | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment