wepay-api 0.1.1 → 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 1cb7f2e22bd785065b68ea01888ab6e680de5f04
4
- data.tar.gz: 369d953965217b5e1e1fd54e1f35ae3084c91d03
3
+ metadata.gz: 9c3a53c0e9c48dd3c5266cb67ce46cfd3313a905
4
+ data.tar.gz: 15bf73f8682d923110133b82dc7eae266f42d648
5
5
  SHA512:
6
- metadata.gz: 77cbd73117aa84f8bffcf09b4f8e1344ada80c05b52f14137dc3bf45b13ee5f3cc1fca616d3345623e293ce1b9d27a570807a60fdbf0f829275a645d749f8fb2
7
- data.tar.gz: 089bbbfa55b0caad8158880d6f04681ce006d86a9d423aad25b1de5c860ab8b1bbdad766f037a9f0cc17045c8b3fa24ba28217d5ac2cc88374041d99d6d59d8f
6
+ metadata.gz: e3d4bfe47ec44f6141158f748b2e00f6a590c6eee9857e4aa8b1d464ce8f72459d3d4a336c69b044f6ad3c0c333e56bf5af387565964bc6af4ea08d45d5452d5
7
+ data.tar.gz: 1245663dbeb2c4c87413a949c57bee17998042392d798060fd06a819d94f52c61196c1d4abfa30c40480488f9667b603cb746c483e2437229dd21f26101d91b9
data/README.md CHANGED
@@ -1,3 +1,4 @@
1
+ [![Gem Version](https://badge.fury.io/rb/wepay-api.png)](http://badge.fury.io/rb/wepay-api)
1
2
  [![Build Status](https://travis-ci.org/B-Sides/wepay-api.png?branch=master)](https://travis-ci.org/B-Sides/wepay-api)
2
3
 
3
4
  # wepay-api
@@ -19,17 +20,26 @@ Or install it yourself as:
19
20
 
20
21
  ```ruby
21
22
  Wepay.configure do |config|
22
- config.client_id = ... # app id (compulsory)
23
- config.client_secret = ... # app secret (compulsory)
24
- config.access_token = ... # access token of the app (compulsory)
25
- config.account_id = ... # caller's account id (compulsory)
26
- config.scope = ... # the permission for OAuth authorization (compulsory)
27
- config.using_stage = ... # set to true/false (compulsory)
28
- config.open_timeout = 5 # default is 5 seconds (optional)
29
- config.timeout = 10 # default is 10 seconds (optional)
23
+ config.client_id = ... # app id (compulsory)
24
+ config.client_secret = ... # app secret (compulsory)
25
+ config.access_token = ... # access token of the app (compulsory)
26
+ config.account_id = ... # app's account id (compulsory)
27
+ config.scope = ... # OAuth permissions (comma separated string) (compulsory)
28
+ config.using_stage = ... # use test environment (true/false) (compulsory)
29
+ config.open_timeout = 5 # default is 5 (seconds) (optional)
30
+ config.timeout = 10 # default is 10 (seconds) (optional)
30
31
  end
31
32
  ```
32
33
 
34
+ All the configuration can be accessed later on as followings:
35
+
36
+ ```ruby
37
+ Wepay.client_id
38
+ Wepay.client_secret
39
+ Wepay.access_token
40
+ ...
41
+ ```
42
+
33
43
  ## Usage
34
44
 
35
45
  ### OAuth
@@ -52,6 +62,9 @@ Wepay.get_access_token(code, redirect_uri)
52
62
  Refer to [https://stage.wepay.com/developer/reference/oauth2#token](https://stage.wepay.com/developer/reference/oauth2#token) for more details.
53
63
 
54
64
  ### API
65
+ #### API version
66
+ `2014-01-08`
67
+
55
68
  #### Available API
56
69
  - [/account](lib/wepay/api/account.rb)
57
70
  - [/checkout](lib/wepay/api/checkout.rb)
@@ -98,7 +111,7 @@ Wepay.account.create(
98
111
  ```
99
112
 
100
113
  #### Error/ Exception
101
- If an API call has errors, it will raise an Wepay::ApiError with following fields:
114
+ If an API call has errors, it will raise a Wepay::ApiError with following fields:
102
115
  - type, e.g. invalid_request
103
116
  - code, e.g. 1001
104
117
  - message
@@ -49,37 +49,19 @@ module Wepay
49
49
  ##
50
50
  # @param params [Hash] See documentation below
51
51
  # @return [Hashie::Mash]
52
- # @docs [/account/balance](https://www.wepay.com/developer/reference/account#balance)
52
+ # @docs [/account/get_update_uri](https://www.wepay.com/developer/reference/account#update_uri)
53
53
  #
54
- def balance(params)
55
- post 'account/balance', params
54
+ def get_update_uri(params)
55
+ post 'account/get_update_uri', params
56
56
  end
57
57
 
58
58
  ##
59
59
  # @param params [Hash] See documentation below
60
60
  # @return [Hashie::Mash]
61
- # @docs [/account/add_bank](https://www.wepay.com/developer/reference/account#add_bank)
61
+ # @docs [/account/get_reserve_details](https://www.wepay.com/developer/reference/account#reserve)
62
62
  #
63
- def add_bank(params)
64
- post 'account/add_bank', params
65
- end
66
-
67
- ##
68
- # @param params [Hash] See documentation below
69
- # @return [Hashie::Mash]
70
- # @docs [/account/set_tax](https://www.wepay.com/developer/reference/account#set_tax)
71
- #
72
- def set_tax(params)
73
- post 'account/set_tax', params
74
- end
75
-
76
- ##
77
- # @param params [Hash] See documentation below
78
- # @return [Hashie::Mash]
79
- # @docs [/account/get_tax](https://www.wepay.com/developer/reference/account#get_tax)
80
- #
81
- def get_tax(params)
82
- post 'account/get_tax', params
63
+ def get_reserve_details(params)
64
+ post 'account/get_reserve_details', params
83
65
  end
84
66
  end
85
67
  end
@@ -1,3 +1,3 @@
1
1
  module Wepay
2
- VERSION = "0.1.1"
2
+ VERSION = "0.2.0"
3
3
  end
@@ -4,8 +4,8 @@ http_interactions:
4
4
  method: post
5
5
  uri: https://stage.wepayapi.com/v2/account
6
6
  body:
7
- encoding: UTF-8
8
- string: '{"account_id":"123456"}'
7
+ encoding: UTF-8
8
+ string: '{"account_id":123456}'
9
9
  headers:
10
10
  User-Agent:
11
11
  - Faraday v0.8.8
@@ -16,12 +16,12 @@ http_interactions:
16
16
  response:
17
17
  status:
18
18
  code: 200
19
- message:
19
+ message:
20
20
  headers:
21
21
  server:
22
22
  - nginx
23
23
  date:
24
- - Thu, 05 Dec 2013 10:46:19 GMT
24
+ - Sun, 19 Jan 2014 02:47:04 GMT
25
25
  content-type:
26
26
  - application/json
27
27
  transfer-encoding:
@@ -32,7 +32,8 @@ http_interactions:
32
32
  - max-age=2592000
33
33
  body:
34
34
  encoding: UTF-8
35
- string: '{"account_id":123456,"name":"Test account","state":"active","description":"abc","account_uri":"https:\/\/stage.wepay.com\/account\/123456","payment_limit":50000,"verification_state":"unverified","type":"personal","auto_withdrawal":false,"create_time":1386239642,"verification_uri":"https:\/\/stage.wepay.com\/api\/account_verify\/123456\/d953f41e"}'
36
- http_version:
37
- recorded_at: Thu, 05 Dec 2013 10:46:19 GMT
35
+ string: '{"account_id":123456,"name":"New Account","state":"action_required","description":"Created
36
+ by API","type":"personal","create_time":1390099125,"country":"US","currencies":["USD"],"balances":[{"currency":"USD","balance":0,"incoming_pending_amount":0,"outgoing_pending_amount":0,"reserved_amount":0,"disputed_amount":0,"withdrawal_period":null,"withdrawal_next_time":null,"withdrawal_bank_name":null}],"statuses":[{"currency":"USD","incoming_payments_status":"ok","outgoing_payments_status":"paused"}],"action_reasons":["kyc","bank_account"]}'
37
+ http_version:
38
+ recorded_at: Sun, 19 Jan 2014 02:47:05 GMT
38
39
  recorded_with: VCR 2.8.0
@@ -5,7 +5,7 @@ http_interactions:
5
5
  uri: https://stage.wepayapi.com/v2/account/create
6
6
  body:
7
7
  encoding: UTF-8
8
- string: '{"name":"New+Account", "description":"Created by API"}'
8
+ string: '{"name":"New Account","description":"Created by API"}'
9
9
  headers:
10
10
  User-Agent:
11
11
  - Faraday v0.8.8
@@ -16,12 +16,12 @@ http_interactions:
16
16
  response:
17
17
  status:
18
18
  code: 200
19
- message:
19
+ message:
20
20
  headers:
21
21
  server:
22
22
  - nginx
23
23
  date:
24
- - Thu, 05 Dec 2013 10:46:22 GMT
24
+ - Sun, 19 Jan 2014 02:55:04 GMT
25
25
  content-type:
26
26
  - application/json
27
27
  transfer-encoding:
@@ -29,7 +29,9 @@ http_interactions:
29
29
  connection:
30
30
  - close
31
31
  set-cookie:
32
- - wepay=28q0mcvp2c90sjn6bn43e7s0t5; path=/; domain=stage.wepay.com; secure; HttpOnly, wepay=28q0mcvp2c90sjn6bn43e7s0t5; path=/; domain=stage.wepay.com; secure; httponly
32
+ - wepay=3fpe3r8racskgve8uoccc2k1o7; path=/; domain=stage.wepay.com; secure;
33
+ HttpOnly, wepay=3fpe3r8racskgve8uoccc2k1o7; path=/; domain=stage.wepay.com;
34
+ secure; httponly
33
35
  expires:
34
36
  - Thu, 19 Nov 1981 08:52:00 GMT
35
37
  cache-control:
@@ -40,7 +42,8 @@ http_interactions:
40
42
  - max-age=2592000
41
43
  body:
42
44
  encoding: UTF-8
43
- string: '{"account_id":123456,"account_uri":"https:\/\/stage.wepay.com\/account\/123456"}'
44
- http_version:
45
- recorded_at: Thu, 05 Dec 2013 10:46:22 GMT
45
+ string: '{"account_id":123456,"name":"New Account","state":"action_required","description":"Created
46
+ by API","type":"personal","create_time":1390100104,"country":"US","currencies":["USD"],"balances":[{"currency":"USD","balance":0,"incoming_pending_amount":0,"outgoing_pending_amount":0,"reserved_amount":0,"disputed_amount":0,"withdrawal_period":null,"withdrawal_next_time":null,"withdrawal_bank_name":null}],"statuses":[{"currency":"USD","incoming_payments_status":"ok","outgoing_payments_status":"paused"}],"action_reasons":["kyc","bank_account"]}'
47
+ http_version:
48
+ recorded_at: Sun, 19 Jan 2014 02:55:04 GMT
46
49
  recorded_with: VCR 2.8.0
@@ -21,7 +21,7 @@ http_interactions:
21
21
  server:
22
22
  - nginx
23
23
  date:
24
- - Fri, 13 Dec 2013 08:01:54 GMT
24
+ - Sun, 19 Jan 2014 02:54:20 GMT
25
25
  content-type:
26
26
  - application/json
27
27
  transfer-encoding:
@@ -29,8 +29,8 @@ http_interactions:
29
29
  connection:
30
30
  - close
31
31
  set-cookie:
32
- - wepay=u9p97k43btg1qi7j99od7n6s00; path=/; domain=stage.wepay.com; secure;
33
- HttpOnly, wepay=u9p97k43btg1qi7j99od7n6s00; path=/; domain=stage.wepay.com;
32
+ - wepay=s3hhk1lnrio53rmdq1079bq2h7; path=/; domain=stage.wepay.com; secure;
33
+ HttpOnly, wepay=s3hhk1lnrio53rmdq1079bq2h7; path=/; domain=stage.wepay.com;
34
34
  secure; httponly
35
35
  expires:
36
36
  - Thu, 19 Nov 1981 08:52:00 GMT
@@ -44,5 +44,5 @@ http_interactions:
44
44
  encoding: UTF-8
45
45
  string: '{"account_id":123456,"state":"deleted"}'
46
46
  http_version:
47
- recorded_at: Fri, 13 Dec 2013 08:01:55 GMT
47
+ recorded_at: Sun, 19 Jan 2014 02:54:20 GMT
48
48
  recorded_with: VCR 2.8.0
@@ -5,7 +5,7 @@ http_interactions:
5
5
  uri: https://stage.wepayapi.com/v2/account/find
6
6
  body:
7
7
  encoding: UTF-8
8
- string: ''
8
+ string: '{}'
9
9
  headers:
10
10
  User-Agent:
11
11
  - Faraday v0.8.8
@@ -21,7 +21,7 @@ http_interactions:
21
21
  server:
22
22
  - nginx
23
23
  date:
24
- - Fri, 13 Dec 2013 07:52:42 GMT
24
+ - Sun, 19 Jan 2014 02:49:33 GMT
25
25
  content-type:
26
26
  - application/json
27
27
  transfer-encoding:
@@ -32,12 +32,10 @@ http_interactions:
32
32
  - max-age=2592000
33
33
  body:
34
34
  encoding: UTF-8
35
- string: '[{"account_id":123456,"name":"ABC","state":"active","description":"This
36
- account was created by ABC","account_uri":"https:\/\/stage.wepay.com\/account\/123456","payment_limit":"50000","verification_state":"unverified","type":"personal","auto_withdrawal":false,"create_time":1386243069,"verification_uri":"https:\/\/stage.wepay.com\/api\/account_verify\/123456\/65d2737e"},{"account_id":1245716361,"name":"Payment
37
- account for ABC","state":"active","description":"This account was
38
- created by ABC","account_uri":"https:\/\/stage.wepay.com\/account\/1245716361","payment_limit":"50000","verification_state":"unverified","type":"personal","auto_withdrawal":false,"create_time":1386242810,"verification_uri":"https:\/\/stage.wepay.com\/api\/account_verify\/1245716361\/65d2737e"},{"account_id":2067308492,"name":"New
39
- Account","state":"active","description":"Created by API","account_uri":"https:\/\/stage.wepay.com\/account\/2067308492","payment_limit":"50000","verification_state":"unverified","type":"personal","auto_withdrawal":false,"create_time":1386240381,"verification_uri":"https:\/\/stage.wepay.com\/api\/account_verify\/2067308492\/65d2737e"},{"account_id":1234567,"name":"Test
40
- account","state":"active","description":"abc","account_uri":"https:\/\/stage.wepay.com\/account\/1234567","payment_limit":"50000","verification_state":"unverified","type":"personal","auto_withdrawal":false,"create_time":1386239642,"verification_uri":"https:\/\/stage.wepay.com\/api\/account_verify\/1234567\/65d2737e"}]'
35
+ string: '[{"account_id":123456,"name":"New Account","state":"action_required","description":"Created
36
+ by API","type":"personal","create_time":1390099125,"country":"US","currencies":["USD"],"balances":[{"currency":"USD","balance":0,"incoming_pending_amount":0,"outgoing_pending_amount":0,"reserved_amount":0,"disputed_amount":0,"withdrawal_period":null,"withdrawal_next_time":null,"withdrawal_bank_name":null}],"statuses":[{"currency":"USD","incoming_payments_status":"ok","outgoing_payments_status":"paused"}],"action_reasons":["kyc","bank_account"]},{"account_id":123456,"name":"Juntobox
37
+ Films","state":"action_required","description":"This account was created by
38
+ Juntobox Films","type":"personal","create_time":1390099014,"country":"US","currencies":["USD"],"balances":[{"currency":"USD","balance":0,"incoming_pending_amount":0,"outgoing_pending_amount":0,"reserved_amount":0,"disputed_amount":0,"withdrawal_period":null,"withdrawal_next_time":null,"withdrawal_bank_name":null}],"statuses":[{"currency":"USD","incoming_payments_status":"ok","outgoing_payments_status":"paused"}],"action_reasons":["kyc","bank_account"]}]'
41
39
  http_version:
42
- recorded_at: Fri, 13 Dec 2013 07:52:42 GMT
40
+ recorded_at: Sun, 19 Jan 2014 02:49:33 GMT
43
41
  recorded_with: VCR 2.8.0
@@ -2,7 +2,7 @@
2
2
  http_interactions:
3
3
  - request:
4
4
  method: post
5
- uri: https://stage.wepayapi.com/v2/account/balance
5
+ uri: https://stage.wepayapi.com/v2/account/get_reserve_details
6
6
  body:
7
7
  encoding: UTF-8
8
8
  string: '{"account_id":"123456"}'
@@ -21,7 +21,7 @@ http_interactions:
21
21
  server:
22
22
  - nginx
23
23
  date:
24
- - Fri, 13 Dec 2013 08:09:49 GMT
24
+ - Sun, 19 Jan 2014 02:56:47 GMT
25
25
  content-type:
26
26
  - application/json
27
27
  transfer-encoding:
@@ -32,7 +32,7 @@ http_interactions:
32
32
  - max-age=2592000
33
33
  body:
34
34
  encoding: UTF-8
35
- string: '{"pending_balance":0,"available_balance":0,"pending_amount":0,"reserved_amount":0,"disputed_amount":0,"currency":"USD"}'
35
+ string: '{"account_id":123456,"currency":"USD","reserved_amount":0,"withdrawals_schedule":[{"time":1390100207,"amount":0}]}'
36
36
  http_version:
37
- recorded_at: Fri, 13 Dec 2013 08:09:49 GMT
37
+ recorded_at: Sun, 19 Jan 2014 02:56:47 GMT
38
38
  recorded_with: VCR 2.8.0
@@ -2,7 +2,7 @@
2
2
  http_interactions:
3
3
  - request:
4
4
  method: post
5
- uri: https://stage.wepayapi.com/v2/account/add_bank
5
+ uri: https://stage.wepayapi.com/v2/account/get_update_uri
6
6
  body:
7
7
  encoding: UTF-8
8
8
  string: '{"account_id":"123456"}'
@@ -21,7 +21,7 @@ http_interactions:
21
21
  server:
22
22
  - nginx
23
23
  date:
24
- - Fri, 13 Dec 2013 08:11:12 GMT
24
+ - Sun, 19 Jan 2014 02:55:46 GMT
25
25
  content-type:
26
26
  - application/json
27
27
  transfer-encoding:
@@ -32,7 +32,7 @@ http_interactions:
32
32
  - max-age=2592000
33
33
  body:
34
34
  encoding: UTF-8
35
- string: '{"account_id":123456,"add_bank_uri":"https:\/\/stage.wepay.com\/api\/account_add_bank\/123456\/65d2737e"}'
35
+ string: '{"account_id":123456,"uri":"https:\/\/stage.wepay.com\/api\/account_update\/123456"}'
36
36
  http_version:
37
- recorded_at: Fri, 13 Dec 2013 08:11:12 GMT
37
+ recorded_at: Sun, 19 Jan 2014 02:55:46 GMT
38
38
  recorded_with: VCR 2.8.0
@@ -5,7 +5,7 @@ http_interactions:
5
5
  uri: https://stage.wepayapi.com/v2/account/modify
6
6
  body:
7
7
  encoding: UTF-8
8
- string: '{"account_id":"123456", "name":"New Account Name"}'
8
+ string: '{"account_id":"123456","name":"New Account Name"}'
9
9
  headers:
10
10
  User-Agent:
11
11
  - Faraday v0.8.8
@@ -21,7 +21,7 @@ http_interactions:
21
21
  server:
22
22
  - nginx
23
23
  date:
24
- - Fri, 13 Dec 2013 07:59:13 GMT
24
+ - Sun, 19 Jan 2014 02:51:58 GMT
25
25
  content-type:
26
26
  - application/json
27
27
  transfer-encoding:
@@ -29,8 +29,8 @@ http_interactions:
29
29
  connection:
30
30
  - close
31
31
  set-cookie:
32
- - wepay=1gnrmnud3ajgl9l0fheg14gbj5; path=/; domain=stage.wepay.com; secure;
33
- HttpOnly, wepay=1gnrmnud3ajgl9l0fheg14gbj5; path=/; domain=stage.wepay.com;
32
+ - wepay=rbpndaln7ou6p8becbsdp00nk6; path=/; domain=stage.wepay.com; secure;
33
+ HttpOnly, wepay=rbpndaln7ou6p8becbsdp00nk6; path=/; domain=stage.wepay.com;
34
34
  secure; httponly
35
35
  expires:
36
36
  - Thu, 19 Nov 1981 08:52:00 GMT
@@ -42,8 +42,8 @@ http_interactions:
42
42
  - max-age=2592000
43
43
  body:
44
44
  encoding: UTF-8
45
- string: '{"account_id":123456,"name":"New Account Name","state":"active","description":"This
46
- account was created by ABC","account_uri":"https:\/\/stage.wepay.com\/account\/123456","payment_limit":"50000","verification_state":"unverified","type":"personal","auto_withdrawal":false,"create_time":1386243069,"verification_uri":"https:\/\/stage.wepay.com\/api\/account_verify\/123456\/65d2737e"}'
45
+ string: '{"account_id":123456,"name":"New Account Name","state":"action_required","description":"Created
46
+ by API","type":"personal","create_time":1390099125,"country":"US","currencies":["USD"],"balances":[{"currency":"USD","balance":0,"incoming_pending_amount":0,"outgoing_pending_amount":0,"reserved_amount":0,"disputed_amount":0,"withdrawal_period":null,"withdrawal_next_time":null,"withdrawal_bank_name":null}],"statuses":[{"currency":"USD","incoming_payments_status":"ok","outgoing_payments_status":"paused"}],"action_reasons":["kyc","bank_account"]}'
47
47
  http_version:
48
- recorded_at: Fri, 13 Dec 2013 07:59:13 GMT
48
+ recorded_at: Sun, 19 Jan 2014 02:51:58 GMT
49
49
  recorded_with: VCR 2.8.0
@@ -11,7 +11,7 @@ describe Wepay::Api::Account do
11
11
  access_token: 'access_token'
12
12
  )
13
13
 
14
- expect(data).to have_keys :account_id, :name, :state, :description, :account_uri, :payment_limit, :verification_state, :type, :create_time
14
+ expect(data).to have_keys :account_id, :name, :state, :description, :type, :create_time, :country, :currencies, :balances, :statuses, :action_reasons
15
15
  end
16
16
  end
17
17
 
@@ -22,7 +22,7 @@ describe Wepay::Api::Account do
22
22
  )
23
23
 
24
24
  expect(data).to be_a Array
25
- expect(data.first).to have_keys :account_id, :name, :state, :description, :account_uri, :payment_limit, :verification_state, :type, :create_time
25
+ expect(data.first).to have_keys :account_id, :name, :state, :description, :type, :create_time, :country, :currencies, :balances, :statuses, :action_reasons
26
26
  end
27
27
  end
28
28
 
@@ -34,7 +34,7 @@ describe Wepay::Api::Account do
34
34
  access_token: 'access_token'
35
35
  )
36
36
 
37
- expect(data).to have_keys :account_id, :account_uri
37
+ expect(data).to have_keys :account_id, :name, :state, :description, :type, :create_time, :country, :currencies, :balances, :statuses, :action_reasons
38
38
  end
39
39
  end
40
40
 
@@ -46,7 +46,7 @@ describe Wepay::Api::Account do
46
46
  access_token: 'access_token'
47
47
  )
48
48
 
49
- expect(data).to have_keys :account_id, :name, :state, :description, :account_uri, :payment_limit, :verification_state, :type, :create_time
49
+ expect(data).to have_keys :account_id, :name, :state, :description, :type, :create_time, :country, :currencies, :balances, :statuses, :action_reasons
50
50
  expect(data.name).to eq "New Account Name"
51
51
  end
52
52
  end
@@ -63,48 +63,25 @@ describe Wepay::Api::Account do
63
63
  end
64
64
  end
65
65
 
66
- describe "#balance" do
67
- it "gets balance of an account" do
68
- data = it.balance(
66
+ describe "#get_update_uri" do
67
+ it "gets update uri of an account" do
68
+ data = it.get_update_uri(
69
69
  account_id: "123456",
70
70
  access_token: 'access_token'
71
71
  )
72
72
 
73
- expect(data).to have_keys :pending_balance, :available_balance, :currency
73
+ expect(data).to have_keys :account_id, :uri
74
74
  end
75
75
  end
76
76
 
77
- describe "#add_bank" do
78
- it "adds bank to an account" do
79
- data = it.add_bank(
77
+ describe "#get_reserve_details" do
78
+ it "gets reserve details of an account" do
79
+ data = it.get_reserve_details(
80
80
  account_id: "123456",
81
81
  access_token: 'access_token'
82
82
  )
83
83
 
84
- expect(data).to have_keys :account_id, :add_bank_uri
85
- end
86
- end
87
-
88
- describe "#set_tax" do
89
- it "sets tax of an account" do
90
- data = it.set_tax(
91
- account_id: "123456",
92
- access_token: 'access_token',
93
- taxes: [{"percent" => 10,"country" => "US","state" => "CA","zip" => "94025"}]
94
- )
95
-
96
- expect(data.first).to have_keys :percent, :country, :state, :zip
97
- end
98
- end
99
-
100
- describe "#get_tax" do
101
- it "gets tax of an account" do
102
- data = it.get_tax(
103
- account_id: "123456",
104
- access_token: 'access_token'
105
- )
106
-
107
- expect(data.first).to have_keys :percent, :country, :state, :zip
84
+ expect(data).to have_keys :account_id, :currency, :reserved_amount, :withdrawals_schedule
108
85
  end
109
86
  end
110
87
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: wepay-api
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Anh Nguyen
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-12-19 00:00:00.000000000 Z
11
+ date: 2014-01-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday
@@ -141,14 +141,12 @@ files:
141
141
  - lib/wepay/version.rb
142
142
  - spec/fixtures/vcr_cassettes/Wepay_Middleware/Wepay_Middleware_CheckStatus/raises_a_Wepay_ApiError_with_proper_error_type_message_and_code.yml
143
143
  - spec/fixtures/vcr_cassettes/wepay_account.yml
144
- - spec/fixtures/vcr_cassettes/wepay_account_add_bank.yml
145
- - spec/fixtures/vcr_cassettes/wepay_account_balance.yml
146
144
  - spec/fixtures/vcr_cassettes/wepay_account_create.yml
147
145
  - spec/fixtures/vcr_cassettes/wepay_account_delete.yml
148
146
  - spec/fixtures/vcr_cassettes/wepay_account_find.yml
149
- - spec/fixtures/vcr_cassettes/wepay_account_get_tax.yml
147
+ - spec/fixtures/vcr_cassettes/wepay_account_get_reserve_details.yml
148
+ - spec/fixtures/vcr_cassettes/wepay_account_get_update_uri.yml
150
149
  - spec/fixtures/vcr_cassettes/wepay_account_modify.yml
151
- - spec/fixtures/vcr_cassettes/wepay_account_set_tax.yml
152
150
  - spec/fixtures/vcr_cassettes/wepay_checkout.yml
153
151
  - spec/fixtures/vcr_cassettes/wepay_checkout_cancel.yml
154
152
  - spec/fixtures/vcr_cassettes/wepay_checkout_capture.yml
@@ -220,14 +218,12 @@ summary: Ruby Wrapper for Wepay API
220
218
  test_files:
221
219
  - spec/fixtures/vcr_cassettes/Wepay_Middleware/Wepay_Middleware_CheckStatus/raises_a_Wepay_ApiError_with_proper_error_type_message_and_code.yml
222
220
  - spec/fixtures/vcr_cassettes/wepay_account.yml
223
- - spec/fixtures/vcr_cassettes/wepay_account_add_bank.yml
224
- - spec/fixtures/vcr_cassettes/wepay_account_balance.yml
225
221
  - spec/fixtures/vcr_cassettes/wepay_account_create.yml
226
222
  - spec/fixtures/vcr_cassettes/wepay_account_delete.yml
227
223
  - spec/fixtures/vcr_cassettes/wepay_account_find.yml
228
- - spec/fixtures/vcr_cassettes/wepay_account_get_tax.yml
224
+ - spec/fixtures/vcr_cassettes/wepay_account_get_reserve_details.yml
225
+ - spec/fixtures/vcr_cassettes/wepay_account_get_update_uri.yml
229
226
  - spec/fixtures/vcr_cassettes/wepay_account_modify.yml
230
- - spec/fixtures/vcr_cassettes/wepay_account_set_tax.yml
231
227
  - spec/fixtures/vcr_cassettes/wepay_checkout.yml
232
228
  - spec/fixtures/vcr_cassettes/wepay_checkout_cancel.yml
233
229
  - spec/fixtures/vcr_cassettes/wepay_checkout_capture.yml
@@ -1,38 +0,0 @@
1
- ---
2
- http_interactions:
3
- - request:
4
- method: post
5
- uri: https://stage.wepayapi.com/v2/account/get_tax
6
- body:
7
- encoding: UTF-8
8
- string: '{"account_id":123456"}'
9
- headers:
10
- User-Agent:
11
- - Faraday v0.8.8
12
- Authorization:
13
- - Bearer access_token
14
- Content-Type:
15
- - application/json
16
- response:
17
- status:
18
- code: 200
19
- message:
20
- headers:
21
- server:
22
- - nginx
23
- date:
24
- - Mon, 16 Dec 2013 03:05:17 GMT
25
- content-type:
26
- - application/json
27
- transfer-encoding:
28
- - chunked
29
- connection:
30
- - close
31
- strict-transport-security:
32
- - max-age=2592000
33
- body:
34
- encoding: UTF-8
35
- string: '[{"zip":94025,"state":"CA","country":"US","percent":10}]'
36
- http_version:
37
- recorded_at: Mon, 16 Dec 2013 03:05:19 GMT
38
- recorded_with: VCR 2.8.0
@@ -1,38 +0,0 @@
1
- ---
2
- http_interactions:
3
- - request:
4
- method: post
5
- uri: https://stage.wepayapi.com/v2/account/set_tax
6
- body:
7
- encoding: UTF-8
8
- string: '{"account_id":"123456","taxes":[{"percent":10,"country":"US","state":"CA","zip":"94025"}]}'
9
- headers:
10
- User-Agent:
11
- - Faraday v0.8.8
12
- Authorization:
13
- - Bearer access_token
14
- Content-Type:
15
- - application/json
16
- response:
17
- status:
18
- code: 200
19
- message:
20
- headers:
21
- server:
22
- - nginx
23
- date:
24
- - Mon, 16 Dec 2013 03:05:15 GMT
25
- content-type:
26
- - application/json
27
- transfer-encoding:
28
- - chunked
29
- connection:
30
- - close
31
- strict-transport-security:
32
- - max-age=2592000
33
- body:
34
- encoding: UTF-8
35
- string: '[{"zip":94025,"state":"CA","country":"US","percent":10}]'
36
- http_version:
37
- recorded_at: Mon, 16 Dec 2013 03:05:18 GMT
38
- recorded_with: VCR 2.8.0