wepay 0.0.2 → 0.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/README +4 -1
- data/lib/wepay.rb +8 -1
- metadata +7 -9
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 47399cc6932faf12686c2769c482ec48c6f4f33d
|
4
|
+
data.tar.gz: 5bc5e9bd354431d63552eee04465bb202abbcc79
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: e46d440e10ba259c201279a518ab201d7a37d7ca13a425293e90cb52376bd6f5b9f1e5be9ae84cc985b9fe20d7d980d06f69bc9f01368af8d2f8d9037391daf4
|
7
|
+
data.tar.gz: 69e1ac0972e03c967921abcca1870fd90d8f55fd993ece1b761d71a5aa8589b466cb88a8c22c18a427533258265469bf41acc55784f862b6ab9b382f7332552e
|
data/README
CHANGED
@@ -6,7 +6,10 @@ To use this SDK:
|
|
6
6
|
# Set use_stage to true for test/stage, false for production.
|
7
7
|
wepay = WePay.new(client_id, client_secret, use_stage)
|
8
8
|
|
9
|
-
#
|
9
|
+
# To set an [API-Version](https://www.wepay.com/developer/reference/versioning) in the header with your call request, use:
|
10
|
+
wepay = WePay.new(client_id, client_secret, use_stage, true, api_version)
|
11
|
+
|
12
|
+
# get the authorization url
|
10
13
|
# you send the user to this url to authorize the application, they will return to your redirect with a code in the get parameters
|
11
14
|
redirect_uri = "http://myexamplesite.com/wepay"
|
12
15
|
url = wepay.oauth2_authorize_url(redirect_uri)
|
data/lib/wepay.rb
CHANGED
@@ -18,7 +18,7 @@ class WePay
|
|
18
18
|
PRODUCTION_UI_ENDPOINT = "https://www.wepay.com/v2"
|
19
19
|
|
20
20
|
# initializes the API application, api_endpoint should be something like 'https://stage.wepay.com/v2'
|
21
|
-
def initialize(_client_id, _client_secret, _use_stage = true, _use_ssl = true)
|
21
|
+
def initialize(_client_id, _client_secret, _use_stage = true, _use_ssl = true, _api_version = nil)
|
22
22
|
@client_id = _client_id
|
23
23
|
@client_secret = _client_secret
|
24
24
|
if _use_stage
|
@@ -29,6 +29,7 @@ class WePay
|
|
29
29
|
@ui_endpoint = PRODUCTION_UI_ENDPOINT
|
30
30
|
end
|
31
31
|
@use_ssl = _use_ssl
|
32
|
+
@api_version = _api_version
|
32
33
|
end
|
33
34
|
|
34
35
|
# make a call to the WePay API
|
@@ -43,6 +44,12 @@ class WePay
|
|
43
44
|
if access_token
|
44
45
|
call.add_field('Authorization: Bearer', access_token);
|
45
46
|
end
|
47
|
+
|
48
|
+
# send Api Version header
|
49
|
+
if @api_version
|
50
|
+
call.add_field('Api-Version', @api_version);
|
51
|
+
end
|
52
|
+
|
46
53
|
# create the request object
|
47
54
|
request = Net::HTTP.new(url.host, url.port)
|
48
55
|
request.read_timeout = 30
|
metadata
CHANGED
@@ -1,15 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: wepay
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
5
|
-
prerelease:
|
4
|
+
version: 0.0.3
|
6
5
|
platform: ruby
|
7
6
|
authors:
|
8
7
|
- WePay
|
9
8
|
autorequire:
|
10
9
|
bindir: bin
|
11
10
|
cert_chain: []
|
12
|
-
date:
|
11
|
+
date: 2014-01-07 00:00:00.000000000 Z
|
13
12
|
dependencies: []
|
14
13
|
description: The WePay Ruby SDK lets you easily make WePay API calls from ruby.
|
15
14
|
email: api@wepay.com
|
@@ -21,26 +20,25 @@ files:
|
|
21
20
|
- README
|
22
21
|
homepage: https://stage.wepay.com/developer
|
23
22
|
licenses: []
|
23
|
+
metadata: {}
|
24
24
|
post_install_message:
|
25
25
|
rdoc_options: []
|
26
26
|
require_paths:
|
27
27
|
- lib
|
28
28
|
required_ruby_version: !ruby/object:Gem::Requirement
|
29
|
-
none: false
|
30
29
|
requirements:
|
31
|
-
- -
|
30
|
+
- - '>='
|
32
31
|
- !ruby/object:Gem::Version
|
33
32
|
version: '0'
|
34
33
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
35
|
-
none: false
|
36
34
|
requirements:
|
37
|
-
- -
|
35
|
+
- - '>='
|
38
36
|
- !ruby/object:Gem::Version
|
39
37
|
version: '0'
|
40
38
|
requirements: []
|
41
39
|
rubyforge_project:
|
42
|
-
rubygems_version:
|
40
|
+
rubygems_version: 2.0.3
|
43
41
|
signing_key:
|
44
|
-
specification_version:
|
42
|
+
specification_version: 4
|
45
43
|
summary: Ruby SDK for the WePay API
|
46
44
|
test_files: []
|