lib/api/account_methods.rb in wepay-rails-0.2.2 vs lib/api/account_methods.rb in wepay-rails-1.0.0

- old
+ new

@@ -1,35 +1,29 @@ module WepayRails module Api module AccountMethods def create_account(params) - response = self.class.post("#{@base_uri}/account/create", {:headers => wepay_auth_header}.merge!(:body => params)) - JSON.parse(response.body) + self.call("/account/create", {:body => params}) end def get_account(account_id) - response = self.class.post("#{@base_uri}/account", {:headers => wepay_auth_header}.merge!(:body => {:account_id => account_id})) - JSON.parse(response.body) + self.call("/account", {:body => {:account_id => account_id}}) end def find_account(args) - response = self.class.post("#{@base_uri}/account/find", {:headers => wepay_auth_header}.merge!(:body => args)) - JSON.parse(response.body) + self.call("/account/find", {:body => args}) end - def modify_account(params) - response = self.class.put("#{@base_uri}/account/modify", {:headers => wepay_auth_header}.merge!(:body => args)) - JSON.parse(response.body) + def modify_account(args) + self.call("/account/modify", {:body => args}) end def delete_account(account_id) - response = self.class.post("#{@base_uri}/account/delete", {:headers => wepay_auth_header}.merge!(:body => {:account_id => account_id})) - JSON.parse(response.body) + self.call("/account/delete", {:body => {:account_id => account_id}}) end def get_account_balance(account_id) - response = self.class.post("#{@base_uri}/account/balance", {:headers => wepay_auth_header}.merge!(:body => {:account_id => account_id})) - JSON.parse(response.body) + self.call("/account/balance", {:body => {:account_id => account_id}}) end end end end \ No newline at end of file