Нашел решение от http://snippets.dzone.com/posts/show/788
Я сделал это по этому коду:
1006 *
http = Net::HTTP.new('sandbox.itunes.apple.com', 443)
http.use_ssl = true
path = '/verifyReceipt'
# GET request -> so the host can set his cookies
resp, data = http.get(path, nil)
cookie = resp.response['set-cookie']
# POST request -> logging in
receipt_data_json = {"receipt-data" => Base64.encode64(receipt_data)}.to_json
#logger.debug "receipt data is now #{receipt_data_json.inspect}"
data = receipt_data_json
headers = {
'Cookie' => cookie,
'Referer' => 'http://sandbox.itunes.apple.com/verifyReceipt',
'Content-Type' => 'application/x-www-form-urlencoded'
}
response, data = http.post(path, data, headers)