promisepay 0.0.6 → 1.0.0

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 7dacee9ed6f0901b5ffc85139e1d62d1d7c89436
4
- data.tar.gz: f99a7de4228a3c7a6190b6bbe478d40d6822c1d9
3
+ metadata.gz: c3efbba09ad1693661066cd70cc8eaf4da701934
4
+ data.tar.gz: a576fd9343df156c15d989e84b0ef60583860f84
5
5
  SHA512:
6
- metadata.gz: 9359c5c0411da5ad38c1ebeaa7253a0279996106f849d2dc38220e8c5c67a146d2ccb8036b26f3da1c09693b6ff0a0587b3e8212e9a0ea82a56b4c474d6c4733
7
- data.tar.gz: c578ec4260aa6293eb095ea1962921132e74fec94e268a5c7c4b4fe358597933c4c427d9f0e2d326e714835ecff470196699436aa0237d2cdd10c6eec16c3b33
6
+ metadata.gz: 872575fef51332bb6ae059113d6cfabdce8310d5fb20cf9af11bdf6234dcd7a2ad02b6ff71c0437b90ba216537016b789093aed2d7dea7561c4fbf22cb6c94e0
7
+ data.tar.gz: 5074bf9962a4b14f5a8318fae8e45602c900d4af17d8f4b97762e1bbb53c17592963314ee79ff4dee05595493a71a041e7f4e4abe548702c8efa8a5899cf9b53
data/README.md CHANGED
@@ -3,8 +3,8 @@
3
3
  [![Join the chat at https://gitter.im/PromisePay/promisepay-ruby](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/PromisePay/promisepay-ruby?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
4
4
 
5
5
  [![Gem Version](https://badge.fury.io/rb/promisepay.svg)](http://badge.fury.io/rb/promisepay)
6
- [![Build Status](https://travis-ci.org/PromisePay/promisepay-ruby.svg?branch=master)](https://travis-ci.org/PromisePay/promisepay-ruby)
7
- [![Coverage Status](https://coveralls.io/repos/PromisePay/promisepay-ruby/badge.svg?branch=master)](https://coveralls.io/r/PromisePay/promisepay-ruby?branch=develop)
6
+ [![Build Status](https://travis-ci.org/PromisePay/promisepay-ruby.svg?branch=develop)](https://travis-ci.org/PromisePay/promisepay-ruby)
7
+ [![Coverage Status](https://coveralls.io/repos/PromisePay/promisepay-ruby/badge.svg?branch=develop)](https://coveralls.io/r/PromisePay/promisepay-ruby?branch=develop)
8
8
  [![Code Climate](https://codeclimate.com/github/PromisePay/promisepay-ruby/badges/gpa.svg)](https://codeclimate.com/github/PromisePay/promisepay-ruby)
9
9
 
10
10
  To see a completed integration in a Ruby on Rails app, visit this [repository](https://github.com/dannyshafer/PromisePay_api_integration).
@@ -33,6 +33,11 @@ See [PromisePay documentation](https://promisepay-docs.readme.io/v1.0/docs/fetch
33
33
 
34
34
  **Create a PromisePay client**
35
35
 
36
+ ```ruby
37
+ #In the Gemfile
38
+ gem 'promisepay'
39
+ ```
40
+
36
41
  The client can be configured through environment variables.
37
42
 
38
43
  ```ruby
@@ -48,7 +53,7 @@ The following parameters are configurable through the client:
48
53
  * `:environment` / `ENV['PROMISEPAY_ENVIRONMENT']`: API [environment](http://docs.promisepay.com/v2.2/docs/environments) to use (default: 'test')
49
54
  * `:api_domain` / `ENV['PROMISEPAY_API_DOMAIN']`: API domain name to use (default: 'api.promisepay.com')
50
55
 
51
- Instantiate the PromisePay client.
56
+ Instantiate client in the appropriate controller
52
57
 
53
58
  ```ruby
54
59
  client = Promisepay::Client.new(username: ENV['PROMISEPAY_USERNAME'], token: ENV['PROMISEPAY_TOKEN'])
@@ -58,7 +63,7 @@ client = Promisepay::Client.new(username: ENV['PROMISEPAY_USERNAME'], token: ENV
58
63
 
59
64
  ##Tokens
60
65
  ##### Example 1 - Request session token
61
- The below example shows the controller request for a marketplace configured to have the Item and User IDs generated automatically for them. Note: by default, the ability to have PromisePay auto generate IDs is turned off. However, it can easily be requested by contacting PromisePay support.
66
+ The below example shows the controller request for a marketplace configured to have the Item and User IDs generated automatically for them.
62
67
 
63
68
  ```ruby
64
69
  token_request = client.tokens.create(:session, {
@@ -220,10 +225,6 @@ user.bank_account
220
225
  ```ruby
221
226
  user.items
222
227
  ```
223
- #####Get a user's address
224
- ```ruby
225
- user.address
226
- ```
227
228
  #####Set a user's disbursement account
228
229
  ```ruby
229
230
  user.disbursement_account(bank_account.id)
@@ -328,10 +329,6 @@ bank_account.deactivate
328
329
  ```ruby
329
330
  bank_account.user
330
331
  ```
331
- #####Validate Routing Number
332
- ```ruby
333
- client.bank_accounts.validate('122235821')
334
- ```
335
332
 
336
333
  ##PayPal Accounts
337
334
  #####Create a PayPal account
@@ -382,11 +379,6 @@ client.companies.find('compamy_id')
382
379
  client.companies.find_all
383
380
  ```
384
381
 
385
- #####Get a company's address
386
- ```ruby
387
- company.address
388
- ```
389
-
390
382
  #####Update a company
391
383
  ```ruby
392
384
  client.companies.update(
data/Rakefile CHANGED
@@ -1,9 +1 @@
1
1
  require 'bundler/gem_tasks'
2
-
3
- task :console do
4
- require 'irb'
5
- require 'irb/completion'
6
- require 'promisepay'
7
- ARGV.clear
8
- IRB.start
9
- end
@@ -55,9 +55,9 @@ module Promisepay
55
55
  # @param url [String] The path, relative to {#api_endpoint}
56
56
  # @param parameters [Hash] Query params for request
57
57
  # @return [Faraday::Response]
58
- def get(url, parameters = {}, skip_status_check = false)
58
+ def get(url, parameters = {})
59
59
  response = connection.get("#{api_endpoint}#{url}", parameters)
60
- on_complete(response) unless skip_status_check
60
+ on_complete(response)
61
61
  response
62
62
  end
63
63
 
@@ -39,7 +39,9 @@ module Promisepay
39
39
  message = ''
40
40
  message << json_response['message'] if json_response.key?('message')
41
41
  if json_response.key?('errors')
42
- message << json_response['errors'].map{|attribute, content| "#{attribute}: #{content}"}.join(", ")
42
+ json_response['errors'].each do |attribute, content|
43
+ message << "#{attribute}: #{content}"
44
+ end
43
45
  end
44
46
 
45
47
  message
@@ -3,7 +3,7 @@ module Promisepay
3
3
  class BankAccount < Account
4
4
  # Get the user the bank account belongs to.
5
5
  #
6
- # @see https://reference.promisepay.com/#show-bank-account-user
6
+ # @see http://docs.promisepay.com/v2.2/docs/bank_accountsidusers
7
7
  #
8
8
  # @return [Promisepay::User]
9
9
  def user
@@ -14,7 +14,7 @@ module Promisepay
14
14
  # Deletes a bank account for a user on a marketplace.
15
15
  # Sets the account to in-active.
16
16
  #
17
- # @see https://reference.promisepay.com/#redact-bank-account
17
+ # @see http://docs.promisepay.com/v2.2/docs/bank_accountsid
18
18
  #
19
19
  # @param mobile_pin [String] Mobile PIN.
20
20
  #
@@ -3,7 +3,7 @@ module Promisepay
3
3
  class CardAccount < Account
4
4
  # Get the user the card account belongs to.
5
5
  #
6
- # @see https://reference.promisepay.com/#show-card-account-user
6
+ # @see http://docs.promisepay.com/v2.2/docs/card_accountsidusers
7
7
  #
8
8
  # @return [Promisepay::User]
9
9
  def user
@@ -14,7 +14,7 @@ module Promisepay
14
14
  # Deletes a card account for a user on a marketplace.
15
15
  # Sets the account to in-active.
16
16
  #
17
- # @see https://reference.promisepay.com/#redact-card-account
17
+ # @see http://docs.promisepay.com/v2.2/docs/card_accountsid
18
18
  #
19
19
  # @return [Boolean]
20
20
  def deactivate
@@ -1,38 +1,15 @@
1
1
  module Promisepay
2
2
  # Manage Companies
3
3
  class Company < BaseModel
4
- # Update the attributes of an item.
5
- #
6
- # @see https://reference.promisepay.com/#update-item
7
- #
8
- # @param attributes [Hash] Item's attributes to be updated.
9
- #
10
- # @return [self]
11
- def update(attributes)
12
- response = JSON.parse(@client.patch("companies/#{send(:id)}", attributes).body)
13
- @attributes = response['companies']
14
- self
15
- end
16
4
 
17
5
  # Get the user the company belongs to.
18
6
  #
19
- # @see
7
+ # @see
20
8
  #
21
9
  # @return [Promisepay::User]
22
10
  def user
23
11
  response = JSON.parse(@client.get("companies/#{send(:id)}/users").body)
24
12
  Promisepay::User.new(@client, response['users'])
25
13
  end
26
-
27
- # Gets company address.
28
- #
29
- # @see https://reference.promisepay.com/#addresses
30
- #
31
- # @return [Hash]
32
- def address
33
- return nil unless @attributes.key?('related')
34
- response = JSON.parse(@client.get("addresses/#{send(:related)['addresses']}").body)
35
- response['addresses']
36
- end
37
14
  end
38
15
  end
@@ -3,7 +3,7 @@ module Promisepay
3
3
  class Item < BaseModel
4
4
  # Update the attributes of an item.
5
5
  #
6
- # @see https://reference.promisepay.com/#update-item
6
+ # @see http://docs.promisepay.com/v2.2/docs/itemsiduseraction
7
7
  #
8
8
  # @param attributes [Hash] Item's attributes to be updated.
9
9
  #
@@ -16,7 +16,7 @@ module Promisepay
16
16
 
17
17
  # Show the item status for a marketplace.
18
18
  #
19
- # @see https://reference.promisepay.com/#show-item-status
19
+ # @see http://docs.promisepay.com/v2.2/docs/itemsidstatus
20
20
  #
21
21
  # @return [Hash]
22
22
  def status
@@ -26,7 +26,7 @@ module Promisepay
26
26
 
27
27
  # Show the buyer detail for a single item for a marketplace.
28
28
  #
29
- # @see https://reference.promisepay.com/#show-item-buyer
29
+ # @see http://docs.promisepay.com/v2.2/docs/itemsidbuyers
30
30
  #
31
31
  # @return [Promisepay::User]
32
32
  def buyer
@@ -36,7 +36,7 @@ module Promisepay
36
36
 
37
37
  # Show the seller detail for a single item for a marketplace.
38
38
  #
39
- # @see https://reference.promisepay.com/#show-item-seller
39
+ # @see http://docs.promisepay.com/v2.2/docs/itemsidbuyers
40
40
  #
41
41
  # @return [Promisepay::User]
42
42
  def seller
@@ -46,7 +46,7 @@ module Promisepay
46
46
 
47
47
  # Get fees associated to the item.
48
48
  #
49
- # @see https://reference.promisepay.com/#show-item-fees
49
+ # @see http://docs.promisepay.com/v2.2/docs/itemsidfees
50
50
  #
51
51
  # @param options [Hash] Optional options.
52
52
  # @option options [Integer] :limit Can ask for up to 200 fees. default: 10
@@ -61,7 +61,7 @@ module Promisepay
61
61
 
62
62
  # Get historical transaction for the item.
63
63
  #
64
- # @see https://reference.promisepay.com/#list-item-transactions
64
+ # @see http://docs.promisepay.com/v2.2/docs/itemsidtransactions
65
65
  #
66
66
  # @param options [Hash] Optional options.
67
67
  # @option options [Integer] :limit Can ask for up to 200 transactions. default: 10
@@ -76,7 +76,7 @@ module Promisepay
76
76
 
77
77
  # Show the wire details for payment.
78
78
  #
79
- # @see https://reference.promisepay.com/#show-item-wire-details
79
+ # @see http://docs.promisepay.com/v2.2/docs/itemsidwire_details
80
80
  #
81
81
  # @return [Hash]
82
82
  def wire_details
@@ -86,7 +86,7 @@ module Promisepay
86
86
 
87
87
  # Show the bpay details details for payment.
88
88
  #
89
- # @see https://reference.promisepay.com/#show-item-bpay-details
89
+ # @see http://docs.promisepay.com/v2.2/docs/itemsidbpay_details
90
90
  #
91
91
  # @return [Hash]
92
92
  def bpay_details
@@ -94,60 +94,53 @@ module Promisepay
94
94
  response['items']['bpay_details']
95
95
  end
96
96
 
97
- # Make a payment for an Item.
97
+ # .
98
98
  #
99
- # @see https://reference.promisepay.com/#make-payment
99
+ # @see http://docs.promisepay.com/v2.2/docs/itemsidaction
100
100
  #
101
101
  # @return [Boolean]
102
102
  def make_payment(options = {})
103
- response = JSON.parse(@client.patch("items/#{send(:id)}/make_payment", options).body)
104
- @attributes = response['items']
103
+ @client.patch("items/#{send(:id)}/make_payment", options).body
105
104
  true
106
105
  end
107
106
 
108
- # Request payment for an Item.
107
+ # .
109
108
  #
110
- # @see https://reference.promisepay.com/#request-payment
109
+ # @see http://docs.promisepay.com/v2.2/docs/itemsidrequest_payment
111
110
  #
112
111
  # @return [Boolean]
113
112
  def request_payment(options = {})
114
- response = JSON.parse(@client.patch("items/#{send(:id)}/request_payment", options).body)
115
- @attributes = response['items']
113
+ @client.patch("items/#{send(:id)}/request_payment", options).body
116
114
  true
117
115
  end
118
116
 
119
- # Release funds held in escrow from an Item with an Escrow or Escrow Partial Release
120
- # payment type.
117
+ # .
121
118
  #
122
- # @see https://reference.promisepay.com/#release-payment
119
+ # @see http://docs.promisepay.com/v2.2/docs/itemsidrequest_payment
123
120
  #
124
121
  # @return [Boolean]
125
122
  def release_payment(options = {})
126
- response = JSON.parse(@client.patch("items/#{send(:id)}/release_payment", options).body)
127
- @attributes = response['items']
123
+ @client.patch("items/#{send(:id)}/release_payment", options).body
128
124
  true
129
125
  end
130
126
 
131
- # Request release of funds held in escrow, from an Item with an Escrow or Escrow Partial
132
- # Release payment type.
127
+ # .
133
128
  #
134
- # @see https://reference.promisepay.com/#request-release
129
+ # @see http://docs.promisepay.com/v2.2/docs/itemsidrequest_release
135
130
  #
136
131
  # @return [Boolean]
137
132
  def request_release(options = {})
138
- response = JSON.parse(@client.patch("items/#{send(:id)}/request_release", options).body)
139
- @attributes = response['items']
133
+ @client.patch("items/#{send(:id)}/request_release", options).body
140
134
  true
141
135
  end
142
136
 
143
- # Acknowledge that funds are being wired for payment.
137
+ # .
144
138
  #
145
- # @see https://reference.promisepay.com/#acknowledge-wire-transfer
139
+ # @see http://docs.promisepay.com/v2.2/docs/itemsidacknowledge_wire
146
140
  #
147
141
  # @return [Boolean]
148
142
  def acknowledge_wire(options = {})
149
- response = JSON.parse(@client.patch("items/#{send(:id)}/acknowledge_wire", options).body)
150
- @attributes = response['items']
143
+ @client.patch("items/#{send(:id)}/acknowledge_wire", options).body
151
144
  true
152
145
  end
153
146
 
@@ -157,52 +150,47 @@ module Promisepay
157
150
  #
158
151
  # @return [Boolean]
159
152
  def acknowledge_paypal(options = {})
160
- response = JSON.parse(@client.patch("items/#{send(:id)}/acknowledge_paypal", options).body)
161
- @attributes = response['items']
153
+ @client.patch("items/#{send(:id)}/acknowledge_paypal", options).body
162
154
  true
163
155
  end
164
156
 
165
- # Revert an acknowledge wire Item Action.
157
+ # .
166
158
  #
167
- # @see https://reference.promisepay.com/#revert-wire-transfer
159
+ # @see http://docs.promisepay.com/v2.2/docs/itemsidrevert_wire
168
160
  #
169
161
  # @return [Boolean]
170
162
  def revert_wire(options = {})
171
- response = JSON.parse(@client.patch("items/#{send(:id)}/revert_wire", options).body)
172
- @attributes = response['items']
163
+ @client.patch("items/#{send(:id)}/revert_wire", options).body
173
164
  true
174
165
  end
175
166
 
176
- # Request a refund for an Item.
167
+ # .
177
168
  #
178
- # @see https://reference.promisepay.com/#request-refund
169
+ # @see http://docs.promisepay.com/v2.2/docs/itemsidrequest_refund
179
170
  #
180
171
  # @return [Boolean]
181
172
  def request_refund(options = {})
182
- response = JSON.parse(@client.patch("items/#{send(:id)}/request_refund", options).body)
183
- @attributes = response['items']
173
+ @client.patch("items/#{send(:id)}/request_refund", options).body
184
174
  true
185
175
  end
186
176
 
187
- # Refund an Item’s funds held in escrow.
177
+ # .
188
178
  #
189
- # @see https://reference.promisepay.com/#refund
179
+ # @see http://docs.promisepay.com/v2.2/docs/itemsidrefund
190
180
  #
191
181
  # @return [Boolean]
192
182
  def refund(options = {})
193
- response = JSON.parse(@client.patch("items/#{send(:id)}/refund", options).body)
194
- @attributes = response['items']
183
+ @client.patch("items/#{send(:id)}/refund", options).body
195
184
  true
196
185
  end
197
186
 
198
- # Cancel an Item.
187
+ # .
199
188
  #
200
- # @see https://reference.promisepay.com/#cancel
189
+ # @see http://docs.promisepay.com/v2.2/docs/itemsidcancel
201
190
  #
202
191
  # @return [Boolean]
203
192
  def cancel
204
- response = JSON.parse(@client.patch("items/#{id}/cancel").body)
205
- @attributes = response['items']
193
+ @client.patch("items/#{id}/cancel")
206
194
  true
207
195
  end
208
196
  end
@@ -3,7 +3,7 @@ module Promisepay
3
3
  class PaypalAccount < Account
4
4
  # Get the user the paypal account belongs to.
5
5
  #
6
- # @see https://reference.promisepay.com/#show-paypal-account-user
6
+ # @see http://docs.promisepay.com/v2.2/docs/paypal_accountsidusers
7
7
  #
8
8
  # @return [Promisepay::User]
9
9
  def user
@@ -14,7 +14,7 @@ module Promisepay
14
14
  # Deletes a Paypal account for a user on a marketplace.
15
15
  # Sets the account to in-active.
16
16
  #
17
- # @see https://reference.promisepay.com/#redact-paypal-account
17
+ # @see http://docs.promisepay.com/v2.2/docs/paypal_accountsid
18
18
  #
19
19
  # @return [Boolean]
20
20
  def deactivate
@@ -1,9 +1,9 @@
1
1
  module Promisepay
2
2
  # Manage Transactions
3
3
  class Transaction < Account
4
- # Show the User associated with the Transaction.
4
+ # .
5
5
  #
6
- # @see https://reference.promisepay.com/#show-transaction-user
6
+ # @see https://test.api.promisepay.com/transactions/:id/users
7
7
  #
8
8
  # @return [Promisepay::User]
9
9
  def user
@@ -13,7 +13,7 @@ module Promisepay
13
13
 
14
14
  # Gets a transactions fee details if applicable.
15
15
  #
16
- # @see https://reference.promisepay.com/#shows-transaction-fees
16
+ # @see http://docs.promisepay.com/v2.2/docs/transactionsidfees
17
17
  #
18
18
  # @return [Promisepay::Fee]
19
19
  def fee
@@ -2,22 +2,9 @@
2
2
  module Promisepay
3
3
  # Manage Users
4
4
  class User < BaseModel
5
- # Update the attributes of an item.
6
- #
7
- # @see https://reference.promisepay.com/#update-item
8
- #
9
- # @param attributes [Hash] Item's attributes to be updated.
10
- #
11
- # @return [self]
12
- def update(attributes)
13
- response = JSON.parse(@client.patch("users/#{send(:id)}", attributes).body)
14
- @attributes = response['users']
15
- self
16
- end
17
-
18
5
  # Lists items for a user on a marketplace.
19
6
  #
20
- # @see https://reference.promisepay.com/#list-user-items
7
+ # @see http://docs.promisepay.com/v2.2/docs/usersiditems
21
8
  #
22
9
  # @return [Array<Promisepay::Item>]
23
10
  def items
@@ -28,7 +15,7 @@ module Promisepay
28
15
 
29
16
  # Gets Bank account for a user on a marketplace.
30
17
  #
31
- # @see https://reference.promisepay.com/#show-user-bank-account
18
+ # @see http://docs.promisepay.com/v2.2/docs/usersidbank_accounts
32
19
  #
33
20
  # @return [Promisepay::BankAccount]
34
21
  def bank_account
@@ -40,7 +27,7 @@ module Promisepay
40
27
 
41
28
  # Gets Card account for a user on a marketplace.
42
29
  #
43
- # @see https://reference.promisepay.com/#show-user-card-account
30
+ # @see http://docs.promisepay.com/v2.2/docs/usersidcard_accounts
44
31
  #
45
32
  # @return [Promisepay::CardAccount]
46
33
  def card_account
@@ -52,7 +39,7 @@ module Promisepay
52
39
 
53
40
  # Gets PayPal account for a user on a marketplace.
54
41
  #
55
- # @see https://reference.promisepay.com/#show-user-paypal-account
42
+ # @see http://docs.promisepay.com/v2.2/docs/usersidpaypal_accounts
56
43
  #
57
44
  # @return [Promisepay::PaypalAccount]
58
45
  def paypal_account
@@ -64,7 +51,7 @@ module Promisepay
64
51
 
65
52
  # Set the disbursement account for a user.
66
53
  #
67
- # @see https://reference.promisepay.com/#set-user-disbursement-account
54
+ # @see http://docs.promisepay.com/v2.2/docs/usersiddisbursement_account
68
55
  #
69
56
  # @return [Boolean]
70
57
  def disbursement_account(account_id)
@@ -75,7 +62,7 @@ module Promisepay
75
62
 
76
63
  # Gets company for a user on a marketplace.
77
64
  #
78
- # @see
65
+ # @see
79
66
  #
80
67
  # @return [Promisepay::Company]
81
68
  def company
@@ -84,16 +71,5 @@ module Promisepay
84
71
  rescue Promisepay::NotFound
85
72
  nil
86
73
  end
87
-
88
- # Gets user address.
89
- #
90
- # @see https://reference.promisepay.com/#addresses
91
- #
92
- # @return [Hash]
93
- def address
94
- return nil unless @attributes.key?('related')
95
- response = JSON.parse(@client.get("addresses/#{send(:related)['addresses']}").body)
96
- response['addresses']
97
- end
98
74
  end
99
75
  end
@@ -7,7 +7,7 @@ module Promisepay
7
7
 
8
8
  # Get bank account for a user on a marketplace.
9
9
  #
10
- # @see https://reference.promisepay.com/#show-bank-account
10
+ # @see http://docs.promisepay.com/v2.2/docs/bank_accountsid-1
11
11
  #
12
12
  # @param id [String] Bank Account ID.
13
13
  #
@@ -19,7 +19,7 @@ module Promisepay
19
19
 
20
20
  # Create a bank account for a user on a marketplace.
21
21
  #
22
- # @see https://reference.promisepay.com/#create-bank-account
22
+ # @see http://docs.promisepay.com/v2.2/docs/bank_accountsid-2
23
23
  #
24
24
  # @param attributes [Hash] Bank Account's attributes.
25
25
  #
@@ -28,19 +28,5 @@ module Promisepay
28
28
  response = JSON.parse(@client.post('bank_accounts', attributes).body)
29
29
  Promisepay::BankAccount.new(@client, response['bank_accounts'])
30
30
  end
31
-
32
- # Validate a US bank routing number before creating an account.
33
- # This can be used to provide on-demand verification,
34
- # and further information of the bank information a User is providing.
35
- #
36
- # @see https://reference.promisepay.com/#validate-routing-number
37
- #
38
- # @param routing_number [String] Bank account Routing Number
39
- #
40
- # @return [Hash]
41
- def validate(routing_number)
42
- response = @client.get('tools/routing_number', { routing_number: routing_number }, true)
43
- (response.status == 200) ? JSON.parse(response.body)['routing_number'] : {}
44
- end
45
31
  end
46
32
  end
@@ -7,7 +7,7 @@ module Promisepay
7
7
 
8
8
  # Get card account for a user on a marketplace.
9
9
  #
10
- # @see https://reference.promisepay.com/#show-card-account
10
+ # @see http://docs.promisepay.com/v2.2/docs/card_accountsid-1
11
11
  #
12
12
  # @param id [String] Bank Account ID.
13
13
  #
@@ -19,7 +19,7 @@ module Promisepay
19
19
 
20
20
  # Create a card account for a user on a marketplace.
21
21
  #
22
- # @see https://reference.promisepay.com/#create-card-account
22
+ # @see http://docs.promisepay.com/v2.2/docs/card_accountsid-2
23
23
  #
24
24
  # @param attributes [Hash] Bank Account's attributes.
25
25
  #
@@ -7,7 +7,7 @@ module Promisepay
7
7
 
8
8
  # List all companies for a marketplace
9
9
  #
10
- # @see https://reference.promisepay.com/#list-companies
10
+ # @see http://docs.promisepay.com/v2.2/docs/companies
11
11
  #
12
12
  # @param options [Hash] Optional options.
13
13
  # @option options [Integer] :limit Can ask for up to 200 users. default: 10
@@ -22,7 +22,7 @@ module Promisepay
22
22
 
23
23
  # Get a company
24
24
  #
25
- # @see https://reference.promisepay.com/#show-company
25
+ # @see
26
26
  #
27
27
  # @param id [String] Company id
28
28
  #
@@ -34,7 +34,7 @@ module Promisepay
34
34
 
35
35
  # Create a company for a user
36
36
  #
37
- # @see https://reference.promisepay.com/#create-company
37
+ # @see
38
38
  #
39
39
  # @param attributes [Hash] Company's attributes.
40
40
  #
@@ -46,7 +46,7 @@ module Promisepay
46
46
 
47
47
  # Update a company for a user
48
48
  #
49
- # @see https://reference.promisepay.com/#update-company
49
+ # @see
50
50
  #
51
51
  # @param attributes [Hash] Company's attributes.
52
52
  #
@@ -7,7 +7,7 @@ module Promisepay
7
7
 
8
8
  # List all fees for a marketplace
9
9
  #
10
- # @see https://reference.promisepay.com/#list-fees
10
+ # @see http://docs.promisepay.com/v2.2/docs/fees-1
11
11
  #
12
12
  # @param options [Hash] Optional options.
13
13
  # @option options [Integer] :limit Can ask for up to 200 fees. default: 10
@@ -22,7 +22,7 @@ module Promisepay
22
22
 
23
23
  # Get a single fee for a marketplace
24
24
  #
25
- # @see https://reference.promisepay.com/#show-fee
25
+ # @see http://docs.promisepay.com/v2.2/docs/feesid
26
26
  #
27
27
  # @param id [String] Marketplace Fee ID.
28
28
  #
@@ -34,7 +34,7 @@ module Promisepay
34
34
 
35
35
  # Create a fee for a marketplace
36
36
  #
37
- # @see https://reference.promisepay.com/#create-fee
37
+ # @see http://docs.promisepay.com/v2.2/docs/fee_lists
38
38
  #
39
39
  # @param attributes [Hash] Item's attributes.
40
40
  #
@@ -7,7 +7,7 @@ module Promisepay
7
7
 
8
8
  # List all items for a marketplace
9
9
  #
10
- # @see https://reference.promisepay.com/#list-items
10
+ # @see http://docs.promisepay.com/v2.2/docs/items
11
11
  #
12
12
  # @param options [Hash] Optional options.
13
13
  # @option options [Integer] :limit Can ask for up to 200 items. default: 10
@@ -22,7 +22,7 @@ module Promisepay
22
22
 
23
23
  # Get a single item for a marketplace
24
24
  #
25
- # @see https://reference.promisepay.com/#show-item
25
+ # @see http://docs.promisepay.com/v2.2/docs/itemsid
26
26
  #
27
27
  # @param id [String] Marketplace item ID.
28
28
  #
@@ -40,7 +40,7 @@ module Promisepay
40
40
 
41
41
  # Create an item for a marketplace
42
42
  #
43
- # @see https://reference.promisepay.com/#create-item
43
+ # @see http://docs.promisepay.com/v2.2/docs/items-1
44
44
  #
45
45
  # @param attributes [Hash] Item's attributes.
46
46
  #
@@ -7,7 +7,7 @@ module Promisepay
7
7
 
8
8
  # Get paypal account for a user on a marketplace.
9
9
  #
10
- # @see https://reference.promisepay.com/#show-paypal-account
10
+ # @see http://docs.promisepay.com/v2.2/docs/paypal_accountsid-1
11
11
  #
12
12
  # @param id [String] Paypal Account ID.
13
13
  #
@@ -19,7 +19,7 @@ module Promisepay
19
19
 
20
20
  # Create a Paypal account for a user on a marketplace.
21
21
  #
22
- # @see https://reference.promisepay.com/#create-paypal-account
22
+ # @see http://docs.promisepay.com/v2.2/docs/paypal_accountsid-2
23
23
  #
24
24
  # @param attributes [Hash] Paypal Account's attributes.
25
25
  #
@@ -3,7 +3,7 @@ module Promisepay
3
3
  class TokenResource < BaseResource
4
4
  # Create a new token for an item
5
5
  #
6
- # @see https://reference.promisepay.com/#generate-card-token
6
+ # @see http://docs.promisepay.com/v2.2/docs/request_session_token
7
7
  #
8
8
  # @param attributes [Hash] Token's attributes.
9
9
  #
@@ -7,7 +7,7 @@ module Promisepay
7
7
 
8
8
  # List all transactions for a marketplace
9
9
  #
10
- # @see https://reference.promisepay.com/#list-transactions
10
+ # @see http://docs.promisepay.com/v2.2/docs/transactions
11
11
  #
12
12
  # @param options [Hash] Optional options.
13
13
  # @option options [Integer] :limit Can ask for up to 200 transactions. default: 10
@@ -22,7 +22,7 @@ module Promisepay
22
22
 
23
23
  # Get a single transaction for a marketplace
24
24
  #
25
- # @see https://reference.promisepay.com/#show-transaction
25
+ # @see http://docs.promisepay.com/v2.2/docs/transactionsid
26
26
  #
27
27
  # @param id [String] transaction ID.
28
28
  #
@@ -7,7 +7,7 @@ module Promisepay
7
7
 
8
8
  # List all users for a marketplace
9
9
  #
10
- # @see https://reference.promisepay.com/#list-users
10
+ # @see http://docs.promisepay.com/v2.2/docs/users
11
11
  #
12
12
  # @param options [Hash] Optional options.
13
13
  # @option options [Integer] :limit Can ask for up to 200 users. default: 10
@@ -22,7 +22,7 @@ module Promisepay
22
22
 
23
23
  # Get a single user
24
24
  #
25
- # @see https://reference.promisepay.com/#show-user
25
+ # @see http://docs.promisepay.com/v2.2/docs/usersid
26
26
  #
27
27
  # @param id [String] Marketplace user ID.
28
28
  #
@@ -34,7 +34,7 @@ module Promisepay
34
34
 
35
35
  # Create a new user for a marketplace
36
36
  #
37
- # @see https://reference.promisepay.com/#create-user
37
+ # @see http://docs.promisepay.com/v2.2/docs/users-1
38
38
  #
39
39
  # @param attributes [Hash] User's attributes.
40
40
  #
@@ -46,7 +46,7 @@ module Promisepay
46
46
 
47
47
  # Update a user for a marketplace
48
48
  #
49
- # @see https://reference.promisepay.com/#update-user
49
+ # @see http://docs.promisepay.com/v2.2/docs/users-1
50
50
  #
51
51
  # @param attributes [Hash] User's attributes.
52
52
  #
data/promisepay.gemspec CHANGED
@@ -5,7 +5,7 @@ require 'promisepay/version'
5
5
 
6
6
  Gem::Specification.new do |spec|
7
7
  spec.name = 'promisepay'
8
- spec.version = '0.0.6'
8
+ spec.version = Promisepay::VERSION
9
9
  spec.authors = ['Romain Vigo Benia']
10
10
  spec.email = ['romain.vigobenia@gmail.com']
11
11
  spec.summary = 'Gem to wrap promisepay.com API.'
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: promisepay
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.6
4
+ version: 1.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Romain Vigo Benia
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-07-29 00:00:00.000000000 Z
11
+ date: 2015-11-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday
@@ -124,8 +124,9 @@ required_rubygems_version: !ruby/object:Gem::Requirement
124
124
  version: '0'
125
125
  requirements: []
126
126
  rubyforge_project:
127
- rubygems_version: 2.5.1
127
+ rubygems_version: 2.4.8
128
128
  signing_key:
129
129
  specification_version: 4
130
130
  summary: Gem to wrap promisepay.com API.
131
131
  test_files: []
132
+ has_rdoc: