Changes for purchases - handle different type of purchases

This commit is contained in:
chris2tof committed 2011-11-14 10:22:31 +08:00
1 parent d9d7099da6
commit c1d77fa6d6
4 files changed
+12 -5

No files matched your search

@@ -20,12 +20,13 @@ class Admin::PurchasesController < ApplicationController
protected
def download_purchase(purchase, url)
uri = URI.parse("http://#{APP_CONFIG['store_ip']}/download/design")
uri = URI.parse("http://#{APP_CONFIG['store_ip']}/download/purchase")
http = Net::HTTP.new(uri.host, uri.port)
request = Net::HTTP::Post.new(uri.request_uri)
public_key = OpenSSL::PKey::RSA.new(File.read(APP_CONFIG['main_public_key']))
encrypted_data = public_key.public_encrypt({:purchase_id => purchase.purchase_id,
:purchase_type => purchase._type,
:roaming_id => Site.find(session[:site]).roaming_id,
:url => url}.to_json)
+1
View File
@@ -7,5 +7,6 @@ class Purchase
field :author
field :intro
field :downloaded, :type => Boolean
field :download_date, :type => Date
end