Advertisement
wrumble

Untitled

Jan 17th, 2017
112
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Ruby 0.52 KB | None | 0 0
  1. post '/account/id' do
  2.   begin
  3.     p params
  4.     path = File.dirname(__FILE__)
  5.     image = Image.new(file: params[:file])
  6.     image.save
  7.     file = Stripe::FileUpload.create(
  8.       {
  9.         :purpose => params[:purpose],
  10.         :file => File.new("#{path}#{image.file.url}")
  11.       },
  12.       {
  13.         :stripe_account => params[:stripe_account]
  14.       }
  15.     )
  16.   rescue Stripe::StripeError => e
  17.     status 402
  18.     return "Error saving verification id to account: #{e.message}"
  19.   end
  20.   status 200
  21.   return file.to_json
  22. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement