lib/helpers/controller_helpers.rb in wepay-rails-0.1.8 vs lib/helpers/controller_helpers.rb in wepay-rails-0.1.9
- old
+ new
@@ -23,8 +23,26 @@
end
def gateway
@gateway ||= Gateway.new
end
+
+ def wepay_auth_code=(auth_code)
+ @wepay_auth_code = auth_code
+ end
+
+ def wepay_auth_code
+ @wepay_auth_code
+ end
+
+ def wepay_auth_header
+ {'Authorization' => "Bearer: #{wepay_auth_code}"}
+ end
+
+ def wepay_user
+ response = get "/v2/user", {:headers => wepay_auth_header}
+ puts response.inspect
+ JSON.parse(response)
+ end
end
end
end
\ No newline at end of file