wepay 0.0.1 → 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. data/README +3 -2
  2. data/lib/wepay.rb +2 -2
  3. metadata +3 -3
data/README CHANGED
@@ -2,8 +2,9 @@ WePay Ruby SDK
2
2
 
3
3
  To use this SDK:
4
4
 
5
- # creates a wepay object you can use to make calls
6
- wepay = WePay.new(client_id, client_secret)
5
+ # creates a wepay object you can use to make calls.
6
+ # Set use_stage to true for test/stage, false for production.
7
+ wepay = WePay.new(client_id, client_secret, use_stage)
7
8
 
8
9
  # get the authorization url
9
10
  # you send the user to this url to authorize the application, they will return to your redirect with a code in the get parameters
data/lib/wepay.rb CHANGED
@@ -35,7 +35,6 @@ class WePay
35
35
  def call(call, access_token = false, params = false)
36
36
  # get the url
37
37
  url = URI.parse(@api_endpoint + call)
38
- p url
39
38
  # construct the call data and access token
40
39
  call = Net::HTTP::Post.new(url.path, initheader = {'Content-Type' =>'application/json', 'User-Agent' => 'WePay Ruby SDK'})
41
40
  if params
@@ -46,6 +45,7 @@ class WePay
46
45
  end
47
46
  # create the request object
48
47
  request = Net::HTTP.new(url.host, url.port)
48
+ request.read_timeout = 30
49
49
  request.use_ssl = @use_ssl
50
50
  # make the call
51
51
  response = request.start {|http| http.request(call) }
@@ -55,7 +55,7 @@ class WePay
55
55
 
56
56
  # this function returns the URL that you send the user to to authorize your API application
57
57
  # the redirect_uri must be a full uri (ex https://www.wepay.com)
58
- def oauth2_authorize_url(redirect_uri, user_email = false, user_name = false, permissions = "manage_accounts,view_balance,collect_payments,refund_payments,view_user")
58
+ def oauth2_authorize_url(redirect_uri, user_email = false, user_name = false, permissions = "manage_accounts,view_balance,collect_payments,view_user,send_money,preapprove_payments,manage_subscriptions")
59
59
  url = @ui_endpoint + '/oauth2/authorize?client_id=' + @client_id.to_s + '&redirect_uri=' + redirect_uri + '&scope=' + permissions
60
60
  url += user_name ? '&user_name=' + CGI::escape(user_name) : ''
61
61
  url += user_email ? '&user_email=' + CGI::escape(user_email) : ''
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: wepay
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-09-11 00:00:00.000000000Z
12
+ date: 2013-11-25 00:00:00.000000000 Z
13
13
  dependencies: []
14
14
  description: The WePay Ruby SDK lets you easily make WePay API calls from ruby.
15
15
  email: api@wepay.com
@@ -39,7 +39,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
39
39
  version: '0'
40
40
  requirements: []
41
41
  rubyforge_project:
42
- rubygems_version: 1.8.10
42
+ rubygems_version: 1.8.21
43
43
  signing_key:
44
44
  specification_version: 3
45
45
  summary: Ruby SDK for the WePay API