yandex-money-sdk 0.10.0 → 0.11.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 +4 -4
- data/CHANGELOG.md +4 -0
- data/README.md +123 -230
- data/lib/yandex_money/api.rb +19 -29
- data/lib/yandex_money/api/version.rb +1 -1
- data/lib/yandex_money/logger/default.rb +17 -0
- data/lib/yandex_money/logger/empty.rb +10 -0
- data/spec/logger_spec.rb +19 -0
- data/yandex-money-sdk.gemspec +1 -0
- metadata +26 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e244659ec433db17836ed23c99ec4c29cf9aaa96
|
4
|
+
data.tar.gz: aaa309b840e92f5e1c592b53199af46cbb421d4b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0d4c9c824d457f59ddf75833a25612e54f90421ca7730638bf1521adbcaf81e6840f9e2a1b1778326d6336e44d3d7b0519faa7abda7ea5dcb4d91abea10df848
|
7
|
+
data.tar.gz: 5e648204b9d54e34109e9785ce15dc6051d530371617a19c6c90ccd6d4e5a13f4d19a2c21acd80326fb7d7f2e8e2a7b9fe1bd8d16f01a1464b82f942abcaabec
|
data/CHANGELOG.md
CHANGED
data/README.md
CHANGED
@@ -1,270 +1,163 @@
|
|
1
|
-
# Yandex Money Ruby SDK Ruby
|
2
|
-
|
3
1
|
[](https://travis-ci.org/yandex-money/yandex-money-sdk-ruby)
|
4
2
|
[](https://coveralls.io/r/yandex-money/yandex-money-sdk-ruby)
|
5
3
|
[](https://codeclimate.com/github/yandex-money/yandex-money-sdk-ruby)
|
6
4
|
[](http://badge.fury.io/rb/yandex-money-sdk)
|
7
5
|
[](https://gemnasium.com/yandex-money/yandex-money-sdk-ruby)
|
8
6
|
|
9
|
-
Ruby
|
10
|
-
|
11
|
-
## Example application
|
12
|
-
|
13
|
-
You could find small example application in [yandex-money/yandex-money-sdk-ruby-sample](https://github.com/yandex-money/yandex-money-sdk-ruby-sample) repository.
|
14
|
-
|
15
|
-
## Installation
|
16
|
-
|
17
|
-
Add this line to your application's Gemfile:
|
18
|
-
|
19
|
-
```ruby
|
20
|
-
gem 'yandex-money-sdk'
|
21
|
-
```
|
22
|
-
|
23
|
-
And then execute:
|
7
|
+
# Ruby Yandex.Money API SDK
|
24
8
|
|
25
|
-
|
26
|
-
bundle
|
27
|
-
```
|
28
|
-
|
29
|
-
Or install it manually with:
|
30
|
-
|
31
|
-
```
|
32
|
-
gem install yandex-money-sdk
|
33
|
-
```
|
34
|
-
|
35
|
-
## Usage
|
36
|
-
|
37
|
-
### Initialize API
|
38
|
-
|
39
|
-
#### Require gem
|
40
|
-
|
41
|
-
```ruby
|
42
|
-
require 'yandex_money/api'
|
43
|
-
```
|
9
|
+
## Requirements
|
44
10
|
|
45
|
-
|
11
|
+
Supported ruby versions: 1.9.3, 2.0, 2.1, jruby, rbx-2
|
46
12
|
|
47
|
-
|
48
|
-
# If TOKEN was obtained previosly
|
49
|
-
api = YandexMoney::Api.new(token: TOKEN)
|
50
|
-
```
|
13
|
+
## Links
|
51
14
|
|
52
|
-
|
53
|
-
|
54
|
-
api = YandexMoney::Api.new(
|
55
|
-
client_id: CLIENT_ID,
|
56
|
-
redirect_uri: REDIRECT_URI,
|
57
|
-
scope: "account-info operation-history"
|
58
|
-
)
|
59
|
-
```
|
15
|
+
1. Yandex.Money API page: [Ru](http://api.yandex.ru/money/),
|
16
|
+
[En](http://api.yandex.com/money/)
|
60
17
|
|
61
|
-
|
18
|
+
## Getting started
|
62
19
|
|
63
|
-
|
20
|
+
### Installation
|
64
21
|
|
65
|
-
After visiting `api.client_url` the user will be redirected to `REDIRECT_URL` with `code` parameter. It is authorization code, needed for token obtaining.
|
66
22
|
|
67
|
-
|
23
|
+
Add this line to your Gemfile:
|
68
24
|
|
69
25
|
```ruby
|
70
|
-
|
71
|
-
token = api.obtain_token # token contains valid client token
|
26
|
+
gem 'yandex-money-sdk'
|
72
27
|
```
|
73
28
|
|
74
|
-
|
29
|
+
And then execute:
|
75
30
|
|
76
|
-
```ruby
|
77
|
-
api.code = "ACEB6F56EC46B66F280AFB9C805C61A66A8B5" # obtained code
|
78
|
-
token = api.obtain_token(CLIENT_SECRET) # token contains valid client token
|
79
31
|
```
|
80
|
-
|
81
|
-
## Methods
|
82
|
-
|
83
|
-
### Information about a user's account
|
84
|
-
|
85
|
-
#### account-info method
|
86
|
-
|
87
|
-
Getting information about the status of user's account. Required permissions: `account-info`.
|
88
|
-
|
89
|
-
```ruby
|
90
|
-
api.account_info
|
91
|
-
#<OpenStruct account="41001565326286", balance=48.98, currency="643", avatar={"ts"=>"2012-05-02T17:22:59.000+04:00", "url"=>"https://avatars.yandex.net/get-yamoney-profile/yamoney-profile-56809635-2/normal?1335964979000"}, account_type="personal", identified=false, account_status="named">
|
32
|
+
bundle
|
92
33
|
```
|
93
34
|
|
94
|
-
|
95
|
-
|
96
|
-
This method allows viewing the full or partial history of operations in page mode. History records are displayed in reverse chronological order (from most recent to oldest).
|
97
|
-
|
98
|
-
Required permissions: `operation-history`.
|
99
|
-
|
100
|
-
```ruby
|
101
|
-
api.operation_history
|
102
|
-
#<OpenStruct next_record="30", operations=[{"operation_id"=>"462449992116028008", "title"=>"Возврат средств от:", "amount"=>1.0, "direction"=>"in", "datetime"=>"2014-08-27T10:19:52Z", "status"=>"success", "type"=>"deposition"}, ..., {"pattern_id"=>"p2p", "operation_id"=>"460970888534110007", "title"=>"Перевод на счет 410011700000000", "amount"=>3.02, "direction"=>"out", "datetime"=>"2014-08-10T07:28:15Z", "status"=>"success", "type"=>"outgoing-transfer"}]>
|
35
|
+
Or install it manually with:
|
103
36
|
|
104
|
-
# you could pass params:
|
105
|
-
api.operation_history(records: 1)
|
106
|
-
#<OpenStruct next_record="1", operations=[{"pattern_id"=>"p2p", "operation_id"=>"463947376678019004", "title"=>"Перевод от 410011285000000", "amount"=>0.99, "direction"=>"in", "datetime"=>"2014-09-13T18:16:16Z", "status"=>"refused", "type"=>"incoming-transfer-protected"}]>
|
107
37
|
```
|
108
|
-
|
109
|
-
#### operation-details method
|
110
|
-
|
111
|
-
Provides detailed information about a particular operation from the history.
|
112
|
-
|
113
|
-
Required permissions: `operation-details`.
|
114
|
-
|
115
|
-
```ruby
|
116
|
-
api.operation_details(OPERATION_ID)
|
117
|
-
#<OpenStruct operation_id="462449992116028008", title="Возврат средств от:", amount=1.0, direction="in", datetime="2014-08-27T10:19:52Z", status="success", type="deposition", details="Отмена оплаты по банковской карте Яндекс.Денег\n , 5411, , \nНомер транзакции: 423910208430140827101810\nСумма в валюте платежа: 1.00 RUB">
|
38
|
+
gem install yandex-money-sdk
|
118
39
|
```
|
119
40
|
|
120
|
-
|
41
|
+
Next, require it in application:
|
121
42
|
|
122
43
|
```ruby
|
123
|
-
|
124
|
-
# YandexMoney::ApiError:
|
125
|
-
# Illegal param operation id
|
44
|
+
require 'yandex_money/api'
|
126
45
|
```
|
127
46
|
|
128
|
-
If scope is insufficient, expcetion will be raised:
|
129
|
-
|
130
|
-
```ruby
|
131
|
-
api = YandexMoney::Api.new(token: TOKEN)
|
132
|
-
api.operation_details(OPERATION_ID)
|
133
|
-
# YandexMoney::InsufficientScopeError:
|
134
|
-
# YandexMoney::InsufficientScopeError
|
135
|
-
```
|
136
47
|
|
137
48
|
### Payments from the Yandex.Money wallet
|
138
49
|
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
|
156
|
-
|
157
|
-
|
158
|
-
|
159
|
-
```
|
160
|
-
|
161
|
-
|
162
|
-
|
163
|
-
|
164
|
-
|
165
|
-
|
166
|
-
|
167
|
-
|
168
|
-
|
169
|
-
|
170
|
-
|
171
|
-
|
172
|
-
|
173
|
-
```
|
174
|
-
|
175
|
-
|
176
|
-
|
177
|
-
|
178
|
-
|
179
|
-
|
180
|
-
|
181
|
-
|
182
|
-
|
183
|
-
|
184
|
-
|
185
|
-
|
186
|
-
|
187
|
-
|
188
|
-
|
189
|
-
|
190
|
-
|
191
|
-
|
192
|
-
|
193
|
-
|
194
|
-
|
195
|
-
|
196
|
-
|
197
|
-
|
198
|
-
|
199
|
-
|
200
|
-
|
201
|
-
# true
|
202
|
-
api.incoming_transfer_reject ""
|
203
|
-
# YandexMoney::ApiError:
|
204
|
-
# Illegal param operation id
|
205
|
-
```
|
50
|
+
Using Yandex.Money API requires following steps
|
51
|
+
|
52
|
+
1. Obtain token URL and redirect user's browser to Yandex.Money service.
|
53
|
+
Note: `client_id`, `redirect_uri`, `client_secret` are constants that you get,
|
54
|
+
when [register](https://sp-money.yandex.ru/myservices/new.xml) app in Yandex.Money API.
|
55
|
+
|
56
|
+
```ruby
|
57
|
+
api = YandexMoney::Api.new(
|
58
|
+
client_id: CLIENT_ID,
|
59
|
+
redirect_uri: REDIRECT_URI,
|
60
|
+
scope: "account-info operation-history"
|
61
|
+
)
|
62
|
+
auth_url = api.client_url
|
63
|
+
```
|
64
|
+
|
65
|
+
2. After that, user fills Yandex.Money HTML form and user is redirected back to
|
66
|
+
`REDIRECT_URI?code=CODE`.
|
67
|
+
|
68
|
+
3. You should immediately exchange `CODE` with `ACCESS_TOKEN`.
|
69
|
+
|
70
|
+
```ruby
|
71
|
+
api = YandexMoney::Api.new(
|
72
|
+
client_id: CLIENT_ID,
|
73
|
+
redirect_uri: REDIRECT_URI,
|
74
|
+
scope: "account-info operation-history"
|
75
|
+
)
|
76
|
+
api.code = params[:code] # obtained code
|
77
|
+
access_token = api.obtain_token
|
78
|
+
# or, if client secret defined:
|
79
|
+
# access_token = api.obtain_token(CLIENT_SECRET)
|
80
|
+
```
|
81
|
+
|
82
|
+
4. Now you can use Yandex.Money API.
|
83
|
+
|
84
|
+
```ruby
|
85
|
+
api = YandexMoney::Api.new(token: TOKEN) # TOKEN is obtained token
|
86
|
+
account_info = api.account_info
|
87
|
+
balance = account_info.balance # and so on
|
88
|
+
|
89
|
+
request_options = {
|
90
|
+
"pattern_id": "p2p",
|
91
|
+
"to": "410011161616877",
|
92
|
+
"amount_due": "0.02",
|
93
|
+
"comment": "test payment comment from yandex-money-python",
|
94
|
+
"message": "test payment message from yandex-money-python",
|
95
|
+
"label": "testPayment",
|
96
|
+
"test_payment": true,
|
97
|
+
"test_result": "success"
|
98
|
+
};
|
99
|
+
request_result = api.request_payment(request_options)
|
100
|
+
# check status
|
101
|
+
|
102
|
+
process_payment = api.process_payment({
|
103
|
+
request_id: request_result.request_id,
|
104
|
+
})
|
105
|
+
# check result
|
106
|
+
if process_payment.status == "success"
|
107
|
+
# show success page
|
108
|
+
else
|
109
|
+
# something went wrong
|
110
|
+
end
|
111
|
+
```
|
206
112
|
|
207
113
|
### Payments from bank cards without authorization
|
208
114
|
|
209
|
-
|
210
|
-
|
211
|
-
|
212
|
-
|
213
|
-
|
214
|
-
|
215
|
-
|
216
|
-
|
217
|
-
|
218
|
-
|
219
|
-
|
220
|
-
|
221
|
-
|
222
|
-
|
115
|
+
1. Fetch instantce-id(ussually only once for every client. You can store
|
116
|
+
result in DB).
|
117
|
+
|
118
|
+
```ruby
|
119
|
+
api = YandexMoney::Api.new(client_id: CLIENT_ID)
|
120
|
+
response = api.get_instance_id # returns string, contains instance id
|
121
|
+
if reponse.status == "success"
|
122
|
+
instance_id = response.instance_id
|
123
|
+
else
|
124
|
+
# throw exception
|
125
|
+
end
|
126
|
+
```
|
127
|
+
|
128
|
+
2. Make request payment
|
129
|
+
|
130
|
+
```ruby
|
131
|
+
api = YandexMoney::Api.new(
|
132
|
+
client_id: CLIENT_ID,
|
133
|
+
instance_id: INSTANCE_ID
|
134
|
+
)
|
135
|
+
response = api.request_external_payment({
|
136
|
+
pattern_id: "p2p",
|
137
|
+
to: "410011285611534",
|
138
|
+
amount_due: "1.00",
|
139
|
+
message: "test"
|
140
|
+
})
|
141
|
+
if response.status == "success"
|
142
|
+
request_id = response.request_id
|
143
|
+
else
|
144
|
+
# throw exception
|
145
|
+
end
|
146
|
+
```
|
147
|
+
|
148
|
+
3. Process the request with process-payment.
|
149
|
+
|
150
|
+
```ruby
|
151
|
+
api = YandexMoney::Api.new(instance_id: INSTANCE_ID)
|
152
|
+
result = api.process_external_payment({
|
153
|
+
request_id: REQUEST_ID,
|
154
|
+
ext_auth_success_uri: "http://example.com/success",
|
155
|
+
ext_auth_fail_uri: "http://example.com/fail"
|
156
|
+
})
|
157
|
+
# process result according to docs
|
158
|
+
```
|
223
159
|
|
224
|
-
```ruby
|
225
|
-
api = YandexMoney::Api.new(
|
226
|
-
client_id: CLIENT_ID,
|
227
|
-
instance_id: INSTANCE_ID
|
228
|
-
)
|
229
|
-
api.request_external_payment({
|
230
|
-
pattern_id: "p2p",
|
231
|
-
to: "410011285611534",
|
232
|
-
amount_due: "1.00",
|
233
|
-
message: "test"
|
234
|
-
})
|
235
|
-
#<OpenStruct status="success", title="Перевод на счет 4100000000000000", contract_amount=50.0, request_id="313230...93134623165", money_source={"payment-card"=>{}}>
|
236
|
-
```
|
237
|
-
|
238
|
-
#### process-external-payment method
|
239
|
-
|
240
|
-
Making a payment. The application calls the method up until the final payment status is known (`status`=`success`/`refused`).
|
241
|
-
The recommended retry mode is determined by the `next_retry` response field (by default, 5 seconds).
|
242
|
-
|
243
|
-
```ruby
|
244
|
-
api = YandexMoney::Api.new(instance_id: INSTANCE_ID)
|
245
|
-
api.process_external_payment({
|
246
|
-
request_id: REQUEST_ID,
|
247
|
-
ext_auth_success_uri: "http://example.com/success",
|
248
|
-
ext_auth_fail_uri: "http://example.com/fail"
|
249
|
-
})
|
250
|
-
#<OpenStruct status="ext_auth_required", acs_params={"cps_context_id"=>"31323039373...93134623165", "paymentType"=>"FC"}, acs_uri="https://m.sp-money.yandex.ru/internal/public-api/to-payment-type">
|
251
|
-
```
|
252
160
|
|
253
161
|
## Running tests
|
254
162
|
|
255
|
-
Just run it with `rake` command.
|
256
|
-
|
257
|
-
## Caveats
|
258
|
-
|
259
|
-
This library is very unstable. Pull requests welcome!
|
260
|
-
|
261
|
-
## Contributing
|
262
|
-
|
263
|
-
1. Fork it ( https://github.com/yandex-money/yandex-money-sdk-ruby/fork )
|
264
|
-
2. Create your feature branch (`git checkout -b my-new-feature`)
|
265
|
-
3. Write tests with rspec + VCR
|
266
|
-
4. Write code
|
267
|
-
5. Test code
|
268
|
-
6. Commit your changes (`git commit -am 'Add some feature'`)
|
269
|
-
7. Push to the branch (`git push origin my-new-feature`)
|
270
|
-
8. Create a new Pull Request
|
163
|
+
Just run it with `bundle exec rake` command.
|
data/lib/yandex_money/api.rb
CHANGED
@@ -1,5 +1,7 @@
|
|
1
1
|
require "yandex_money/api/version"
|
2
2
|
require "yandex_money/exceptions"
|
3
|
+
require "yandex_money/logger/default"
|
4
|
+
require "yandex_money/logger/empty"
|
3
5
|
require "httparty"
|
4
6
|
require "uri"
|
5
7
|
require "ostruct"
|
@@ -16,6 +18,7 @@ module YandexMoney
|
|
16
18
|
# Returns url to get token
|
17
19
|
def initialize(options)
|
18
20
|
# TOKEN provided
|
21
|
+
@logger = options[:logger] || YandexMoney::Logger::Empty.new(STDOUT)
|
19
22
|
if options.length == 1 && options[:token] != nil
|
20
23
|
@token = options[:token]
|
21
24
|
else
|
@@ -44,8 +47,9 @@ module YandexMoney
|
|
44
47
|
redirect_uri: @redirect_url
|
45
48
|
}
|
46
49
|
options[:client_secret] = client_secret if client_secret
|
47
|
-
@
|
48
|
-
|
50
|
+
@logger.info("url: https://sp-money.yandex.ru#{uri}, params: #{URI.encode_www_form options}")
|
51
|
+
response = self.class.post(uri, body: options).parsed_response
|
52
|
+
@token = response["access_token"]
|
49
53
|
end
|
50
54
|
|
51
55
|
# obtains account info
|
@@ -74,29 +78,12 @@ module YandexMoney
|
|
74
78
|
|
75
79
|
# basic request payment method
|
76
80
|
def request_payment(options)
|
77
|
-
|
78
|
-
response = with_http_retries do
|
79
|
-
request = send_request("/api/request-payment", options)
|
80
|
-
OpenStruct.new request.parsed_response
|
81
|
-
end
|
82
|
-
if response.error
|
83
|
-
raise YandexMoney::ApiError.new response.error
|
84
|
-
else
|
85
|
-
response
|
86
|
-
end
|
81
|
+
send_payment_request("/api/request-payment", options)
|
87
82
|
end
|
88
83
|
|
89
84
|
# basic process payment method
|
90
85
|
def process_payment(options)
|
91
|
-
|
92
|
-
request = send_request("/api/process-payment", options)
|
93
|
-
response = OpenStruct.new request.parsed_response
|
94
|
-
|
95
|
-
if response.error
|
96
|
-
raise YandexMoney::ApiError.new response.error
|
97
|
-
else
|
98
|
-
response
|
99
|
-
end
|
86
|
+
send_payment_request("/api/process-payment", options)
|
100
87
|
end
|
101
88
|
|
102
89
|
def get_instance_id
|
@@ -150,7 +137,6 @@ module YandexMoney
|
|
150
137
|
def process_external_payment(payment_options)
|
151
138
|
payment_options[:instance_id] ||= @instance_id
|
152
139
|
request = send_request("/api/process-external-payment", payment_options)
|
153
|
-
|
154
140
|
if request["status"] == "refused"
|
155
141
|
raise YandexMoney::ApiError.new request["error"]
|
156
142
|
elsif request["status"] == "in_progress"
|
@@ -163,10 +149,12 @@ module YandexMoney
|
|
163
149
|
private
|
164
150
|
|
165
151
|
def send_request(uri, options = nil)
|
152
|
+
@logger.info("url: https://money.yandex.ru#{uri}, bearer: #{@logger.mask_token(@token)}, params: #{URI.encode_www_form options || {}}")
|
166
153
|
request = self.class.post(uri, base_uri: "https://money.yandex.ru", headers: {
|
167
154
|
"Authorization" => "Bearer #{@token}",
|
168
155
|
"Content-Type" => "application/x-www-form-urlencoded"
|
169
156
|
}, body: options)
|
157
|
+
@logger.info("response: #{request.response.body}")
|
170
158
|
|
171
159
|
case request.response.code
|
172
160
|
when "403" then raise YandexMoney::InsufficientScopeError
|
@@ -175,13 +163,14 @@ module YandexMoney
|
|
175
163
|
end
|
176
164
|
end
|
177
165
|
|
178
|
-
|
179
|
-
|
180
|
-
|
181
|
-
|
182
|
-
|
183
|
-
|
184
|
-
|
166
|
+
def send_payment_request(uri, options)
|
167
|
+
check_token
|
168
|
+
request = send_request(uri, options)
|
169
|
+
response = OpenStruct.new request.parsed_response
|
170
|
+
if response.error
|
171
|
+
raise YandexMoney::ApiError.new response.error
|
172
|
+
else
|
173
|
+
response
|
185
174
|
end
|
186
175
|
end
|
187
176
|
|
@@ -191,6 +180,7 @@ module YandexMoney
|
|
191
180
|
|
192
181
|
def send_authorize_request(options)
|
193
182
|
uri = "/oauth/authorize"
|
183
|
+
@logger.info("url: https://money.yandex.ru#{uri}, params: #{URI.encode_www_form options || {}}")
|
194
184
|
self.class.post(uri, body: options).request.path.to_s
|
195
185
|
end
|
196
186
|
end
|
@@ -0,0 +1,17 @@
|
|
1
|
+
require "logger"
|
2
|
+
|
3
|
+
module YandexMoney
|
4
|
+
module Logger
|
5
|
+
class Default < ::Logger
|
6
|
+
# if token exists, then extract first 8 symbols
|
7
|
+
# and last 8 symbols, and join it with ".."
|
8
|
+
def mask_token(token)
|
9
|
+
if token
|
10
|
+
token.match(/\A(.?{8}).*?(.?{8})\z/)[1,2].join("..")
|
11
|
+
else
|
12
|
+
nil
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
data/spec/logger_spec.rb
ADDED
@@ -0,0 +1,19 @@
|
|
1
|
+
require "spec_helper"
|
2
|
+
|
3
|
+
describe "logger" do
|
4
|
+
it "should log to provided logger" do
|
5
|
+
@logger = double
|
6
|
+
expect(@logger).to receive(:info).at_least(:once)
|
7
|
+
|
8
|
+
VCR.use_cassette "obtain token for get account info" do
|
9
|
+
@api = YandexMoney::Api.new(
|
10
|
+
client_id: CLIENT_ID,
|
11
|
+
redirect_uri: REDIRECT_URI,
|
12
|
+
scope: "account-info operation-history operation-details",
|
13
|
+
logger: @logger
|
14
|
+
)
|
15
|
+
@api.code = "39041180F6631E2B56DD0058F75A34C7504226178A45D624313495ECD417DCC3AA6CBF1B010E65BB09F3F9EB5AE63452129BAE2B732B7457C33BE6B2039B7B60A8058D2A387729A601DC817BBFB27CB0CC2D65E3C70997D981AC0E31F18CF32C0675DFD461E2F5C5639B75AC0E5074CE64FCF4546447BBDC566E3459FB1B3C3B"
|
16
|
+
@api.obtain_token
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
data/yandex-money-sdk.gemspec
CHANGED
@@ -27,4 +27,5 @@ Gem::Specification.new do |spec|
|
|
27
27
|
spec.add_development_dependency "vcr", "~> 2.9", ">= 2.9.3"
|
28
28
|
spec.add_development_dependency "webmock", "~> 1.8", ">= 1.8.0"
|
29
29
|
spec.add_development_dependency "rspec", "~> 3.1", ">= 3.1.0"
|
30
|
+
spec.add_development_dependency "rspec-mocks", "~> 3.1", ">= 3.1.0"
|
30
31
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: yandex-money-sdk
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.11.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Alexander Maslov
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-
|
11
|
+
date: 2014-10-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: httparty
|
@@ -124,6 +124,26 @@ dependencies:
|
|
124
124
|
- - ">="
|
125
125
|
- !ruby/object:Gem::Version
|
126
126
|
version: 3.1.0
|
127
|
+
- !ruby/object:Gem::Dependency
|
128
|
+
name: rspec-mocks
|
129
|
+
requirement: !ruby/object:Gem::Requirement
|
130
|
+
requirements:
|
131
|
+
- - "~>"
|
132
|
+
- !ruby/object:Gem::Version
|
133
|
+
version: '3.1'
|
134
|
+
- - ">="
|
135
|
+
- !ruby/object:Gem::Version
|
136
|
+
version: 3.1.0
|
137
|
+
type: :development
|
138
|
+
prerelease: false
|
139
|
+
version_requirements: !ruby/object:Gem::Requirement
|
140
|
+
requirements:
|
141
|
+
- - "~>"
|
142
|
+
- !ruby/object:Gem::Version
|
143
|
+
version: '3.1'
|
144
|
+
- - ">="
|
145
|
+
- !ruby/object:Gem::Version
|
146
|
+
version: 3.1.0
|
127
147
|
description: SDK for Yandex Money API
|
128
148
|
email:
|
129
149
|
- drakmail@delta.pm
|
@@ -142,6 +162,8 @@ files:
|
|
142
162
|
- lib/yandex_money/api.rb
|
143
163
|
- lib/yandex_money/api/version.rb
|
144
164
|
- lib/yandex_money/exceptions.rb
|
165
|
+
- lib/yandex_money/logger/default.rb
|
166
|
+
- lib/yandex_money/logger/empty.rb
|
145
167
|
- spec/account_info_spec.rb
|
146
168
|
- spec/auth_spec.rb
|
147
169
|
- spec/cards_spec.rb
|
@@ -171,6 +193,7 @@ files:
|
|
171
193
|
- spec/fixtures/vcr_cassettes/success_request_payment_to_an_account.yml
|
172
194
|
- spec/fixtures/vcr_cassettes/token_with_client_secret.yml
|
173
195
|
- spec/fixtures/vcr_cassettes/unauthorized_exception.yml
|
196
|
+
- spec/logger_spec.rb
|
174
197
|
- spec/payments_spec.rb
|
175
198
|
- spec/spec_helper.rb
|
176
199
|
- spec/support/constants.rb
|
@@ -229,6 +252,7 @@ test_files:
|
|
229
252
|
- spec/fixtures/vcr_cassettes/success_request_payment_to_an_account.yml
|
230
253
|
- spec/fixtures/vcr_cassettes/token_with_client_secret.yml
|
231
254
|
- spec/fixtures/vcr_cassettes/unauthorized_exception.yml
|
255
|
+
- spec/logger_spec.rb
|
232
256
|
- spec/payments_spec.rb
|
233
257
|
- spec/spec_helper.rb
|
234
258
|
- spec/support/constants.rb
|