Changes for purchases - handle different type of purchases
This commit is contained in:
1 parent
d9d7099da6
commit
c1d77fa6d6
4 files changed
+12
-5
No files matched your search
@@ -28,11 +28,16 @@ class CentralServerExchangeApp < Sinatra::Base
|
||||
end
|
||||
end
|
||||
|
||||
post '/purchase/design' do
|
||||
post '/purchase/:type' do
|
||||
begin
|
||||
private_key = OpenSSL::PKey::RSA.new(@site.private_key)
|
||||
p_design = PDesign.new.from_json(private_key.private_decrypt(request.params['purchase']))
|
||||
p_design.save
|
||||
|
||||
case params[:type]
|
||||
when 'Design'
|
||||
purchase = PDesign.new.from_json(private_key.private_decrypt(request.params['purchase']))
|
||||
end
|
||||
|
||||
purchase.save
|
||||
body 'true'
|
||||
rescue
|
||||
body 'false'
|
||||
|
||||
Reference in new issue
Block a user