checkout_ru 0.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +17 -0
- data/Gemfile +4 -0
- data/LICENSE.txt +22 -0
- data/README.md +72 -0
- data/Rakefile +9 -0
- data/checkout_ru.gemspec +32 -0
- data/lib/checkout_ru/address.rb +12 -0
- data/lib/checkout_ru/delivery.rb +19 -0
- data/lib/checkout_ru/entity.rb +14 -0
- data/lib/checkout_ru/item.rb +21 -0
- data/lib/checkout_ru/order.rb +34 -0
- data/lib/checkout_ru/session.rb +46 -0
- data/lib/checkout_ru/user.rb +9 -0
- data/lib/checkout_ru/version.rb +3 -0
- data/lib/checkout_ru.rb +147 -0
- data/test/checkout_ru/session_test.rb +82 -0
- data/test/checkout_ru_test.rb +124 -0
- data/test/fixtures/calculation.yml +4279 -0
- data/test/fixtures/create_order.yml +39 -0
- data/test/fixtures/get_place_by_postal_code.yml +37 -0
- data/test/fixtures/get_places_by_query.yml +46 -0
- data/test/fixtures/get_postal_code_by_address.yml +34 -0
- data/test/fixtures/get_streets_by_query.yml +41 -0
- data/test/fixtures/get_ticket.yml +32 -0
- data/test/fixtures/get_ticket_invalid_api_key.yml +35 -0
- data/test/fixtures/populated_status_history.yml +70 -0
- data/test/fixtures/status.yml +34 -0
- data/test/fixtures/status_history.yml +42 -0
- data/test/fixtures/update_order.yml +39 -0
- data/test/test_helper.rb +8 -0
- metadata +230 -0
@@ -0,0 +1,39 @@
|
|
1
|
+
---
|
2
|
+
http_interactions:
|
3
|
+
- request:
|
4
|
+
method: post
|
5
|
+
uri: http://platform.checkout.ru/service/order/create
|
6
|
+
body:
|
7
|
+
encoding: UTF-8
|
8
|
+
string: '{"apiKey":"valid-api-key","order":{"goods":[{"name":"blue
|
9
|
+
tshirt","code":"blt","variantCode":"blue","quantity":2,"assessedCost":1000,"payCost":750,"weight":0.5}],"delivery":{"deliveryId":2,"placeFiasId":"0c5b2444-70a0-4932-980c-b4dc0d3f02b5","addressPvz":"Энтузиастов
|
10
|
+
ш., д. 54","type":"postamat","cost":224.41,"minTerm":2,"maxTerm":11},"user":{"fullname":"Вася
|
11
|
+
Пупкин","email":"vasyapupkin@example.com","phone":"555"},"comment":"test order","shopOrderId":"777","paymentMethod":"cash"}}'
|
12
|
+
headers:
|
13
|
+
User-Agent:
|
14
|
+
- Faraday v0.8.9
|
15
|
+
Accept:
|
16
|
+
- application/json
|
17
|
+
Content-Type:
|
18
|
+
- application/json
|
19
|
+
response:
|
20
|
+
status:
|
21
|
+
code: 200
|
22
|
+
message:
|
23
|
+
headers:
|
24
|
+
date:
|
25
|
+
- Sat, 01 Feb 2014 18:57:35 GMT
|
26
|
+
server:
|
27
|
+
- Apache/2.2.22 (Ubuntu)
|
28
|
+
connection:
|
29
|
+
- close
|
30
|
+
transfer-encoding:
|
31
|
+
- chunked
|
32
|
+
content-type:
|
33
|
+
- application/json;charset=UTF-8
|
34
|
+
body:
|
35
|
+
encoding: UTF-8
|
36
|
+
string: '{"order":{"id":75},"delivery":{"id":2,"serviceName":"PickPoint"}}'
|
37
|
+
http_version:
|
38
|
+
recorded_at: Sat, 01 Feb 2014 18:58:49 GMT
|
39
|
+
recorded_with: VCR 2.8.0
|
@@ -0,0 +1,37 @@
|
|
1
|
+
---
|
2
|
+
http_interactions:
|
3
|
+
- request:
|
4
|
+
method: get
|
5
|
+
uri: http://platform.checkout.ru/service/checkout/getPlaceByPostalCode?postIndex=111524&ticket=valid-ticket
|
6
|
+
body:
|
7
|
+
encoding: US-ASCII
|
8
|
+
string: ''
|
9
|
+
headers:
|
10
|
+
User-Agent:
|
11
|
+
- Faraday v0.8.8
|
12
|
+
Accept:
|
13
|
+
- application/json
|
14
|
+
response:
|
15
|
+
status:
|
16
|
+
code: 200
|
17
|
+
message:
|
18
|
+
headers:
|
19
|
+
date:
|
20
|
+
- Wed, 29 Jan 2014 22:29:52 GMT
|
21
|
+
server:
|
22
|
+
- Apache/2.2.22 (Ubuntu)
|
23
|
+
connection:
|
24
|
+
- close
|
25
|
+
transfer-encoding:
|
26
|
+
- chunked
|
27
|
+
content-type:
|
28
|
+
- application/json;charset=UTF-8
|
29
|
+
body:
|
30
|
+
encoding: ASCII-8BIT
|
31
|
+
string: !binary |-
|
32
|
+
eyJpZCI6IjBjNWIyNDQ0LTcwYTAtNDkzMi05ODBjLWI0ZGMwZDNmMDJiNSIs
|
33
|
+
Im5hbWUiOiLQnNC+0YHQutCy0LAiLCJmdWxsTmFtZSI6ItCzLiDQnNC+0YHQ
|
34
|
+
utCy0LAifQ==
|
35
|
+
http_version:
|
36
|
+
recorded_at: Wed, 29 Jan 2014 22:31:39 GMT
|
37
|
+
recorded_with: VCR 2.8.0
|
@@ -0,0 +1,46 @@
|
|
1
|
+
---
|
2
|
+
http_interactions:
|
3
|
+
- request:
|
4
|
+
method: get
|
5
|
+
uri: http://platform.checkout.ru/service/checkout/getPlacesByQuery?place=%D0%BC%D0%BE%D1%81%D0%BA%D0%B2%D0%B0&ticket=valid-ticket
|
6
|
+
body:
|
7
|
+
encoding: US-ASCII
|
8
|
+
string: ''
|
9
|
+
headers:
|
10
|
+
User-Agent:
|
11
|
+
- Faraday v0.8.8
|
12
|
+
response:
|
13
|
+
status:
|
14
|
+
code: 200
|
15
|
+
message:
|
16
|
+
headers:
|
17
|
+
date:
|
18
|
+
- Tue, 28 Jan 2014 23:54:01 GMT
|
19
|
+
server:
|
20
|
+
- Apache/2.2.22 (Ubuntu)
|
21
|
+
connection:
|
22
|
+
- close
|
23
|
+
transfer-encoding:
|
24
|
+
- chunked
|
25
|
+
content-type:
|
26
|
+
- application/json;charset=UTF-8
|
27
|
+
body:
|
28
|
+
encoding: ASCII-8BIT
|
29
|
+
string: !binary |-
|
30
|
+
eyJzdWdnZXN0aW9ucyI6W3siaWQiOiIwYzViMjQ0NC03MGEwLTQ5MzItOTgw
|
31
|
+
Yy1iNGRjMGQzZjAyYjUiLCJuYW1lIjoi0JzQvtGB0LrQstCwIiwiZnVsbE5h
|
32
|
+
bWUiOiLQsy4g0JzQvtGB0LrQstCwIn0seyJpZCI6IjM2MDVlNjYwLWU5MGUt
|
33
|
+
NDdkMy1iNThlLTA2OGYyNGU2ODE0NSIsIm5hbWUiOiLQnNC+0YHQutCy0LAi
|
34
|
+
LCJmdWxsTmFtZSI6ItC0LiDQnNC+0YHQutCy0LAgKNCf0LXQvdC+0LLRgdC6
|
35
|
+
0LjQuSDRgNCw0LnQvtC9LCDQotCy0LXRgNGB0LrQsNGPINC+0LHQu9Cw0YHR
|
36
|
+
gtGMKSJ9LHsiaWQiOiJmMWM3MmI5ZC1hMmQ3LTQ1YjctYjlmNS0yMjIyYzEy
|
37
|
+
ZDUxNjQiLCJuYW1lIjoi0JzQvtGB0LrQstCwIiwiZnVsbE5hbWUiOiLQtC4g
|
38
|
+
0JzQvtGB0LrQstCwICjQktC10YDRhdC+0YjQuNC20LXQvNGB0LrQuNC5INGA
|
39
|
+
0LDQudC+0L0sINCa0LjRgNC+0LLRgdC60LDRjyDQvtCx0LvQsNGB0YLRjCki
|
40
|
+
fSx7ImlkIjoiMjZhMjVlZmEtNGY2My00ZDRiLThkYjYtZGZjMjljZGFhYjI0
|
41
|
+
IiwibmFtZSI6ItCc0L7RgdC60LLQsCIsImZ1bGxOYW1lIjoi0LQuINCc0L7R
|
42
|
+
gdC60LLQsCAo0J/QvtGA0YXQvtCy0YHQutC40Lkg0YDQsNC50L7QvSwg0J/R
|
43
|
+
gdC60L7QstGB0LrQsNGPINC+0LHQu9Cw0YHRgtGMKSJ9XX0=
|
44
|
+
http_version:
|
45
|
+
recorded_at: Tue, 28 Jan 2014 23:55:46 GMT
|
46
|
+
recorded_with: VCR 2.8.0
|
@@ -0,0 +1,34 @@
|
|
1
|
+
---
|
2
|
+
http_interactions:
|
3
|
+
- request:
|
4
|
+
method: get
|
5
|
+
uri: http://platform.checkout.ru/service/checkout/getPostalCodeByAddress?streetId=2b453e3c-d908-4608-b81c-a314a687bee3&house=13&housing=&building=&ticket=valid-ticket
|
6
|
+
body:
|
7
|
+
encoding: US-ASCII
|
8
|
+
string: ''
|
9
|
+
headers:
|
10
|
+
User-Agent:
|
11
|
+
- Faraday v0.8.8
|
12
|
+
Accept:
|
13
|
+
- application/json
|
14
|
+
response:
|
15
|
+
status:
|
16
|
+
code: 200
|
17
|
+
message:
|
18
|
+
headers:
|
19
|
+
date:
|
20
|
+
- Wed, 29 Jan 2014 22:25:42 GMT
|
21
|
+
server:
|
22
|
+
- Apache/2.2.22 (Ubuntu)
|
23
|
+
connection:
|
24
|
+
- close
|
25
|
+
transfer-encoding:
|
26
|
+
- chunked
|
27
|
+
content-type:
|
28
|
+
- application/json;charset=UTF-8
|
29
|
+
body:
|
30
|
+
encoding: UTF-8
|
31
|
+
string: '{"postindex":"111524"}'
|
32
|
+
http_version:
|
33
|
+
recorded_at: Wed, 29 Jan 2014 22:27:29 GMT
|
34
|
+
recorded_with: VCR 2.8.0
|
@@ -0,0 +1,41 @@
|
|
1
|
+
---
|
2
|
+
http_interactions:
|
3
|
+
- request:
|
4
|
+
method: get
|
5
|
+
uri: http://platform.checkout.ru/service/checkout/getStreetsByQuery?street=%D0%BC%D0%B0%D1%81&placeId=0c5b2444-70a0-4932-980c-b4dc0d3f02b5&ticket=valid-ticket
|
6
|
+
body:
|
7
|
+
encoding: US-ASCII
|
8
|
+
string: ''
|
9
|
+
headers:
|
10
|
+
User-Agent:
|
11
|
+
- Faraday v0.8.8
|
12
|
+
response:
|
13
|
+
status:
|
14
|
+
code: 200
|
15
|
+
message:
|
16
|
+
headers:
|
17
|
+
date:
|
18
|
+
- Wed, 29 Jan 2014 21:44:28 GMT
|
19
|
+
server:
|
20
|
+
- Apache/2.2.22 (Ubuntu)
|
21
|
+
connection:
|
22
|
+
- close
|
23
|
+
transfer-encoding:
|
24
|
+
- chunked
|
25
|
+
content-type:
|
26
|
+
- application/json;charset=UTF-8
|
27
|
+
body:
|
28
|
+
encoding: ASCII-8BIT
|
29
|
+
string: !binary |-
|
30
|
+
eyJzdWdnZXN0aW9ucyI6W3siaWQiOiI5NjA5NzJlOC00OGJiLTQ4MzctYjBl
|
31
|
+
ZS1lZTAzNDc5MzFiNzMiLCJuYW1lIjoi0JzQsNGB0LvQvtCy0LrQsCDQktC1
|
32
|
+
0YDRhdC9LiIsInR5cGUiOiLRg9C7In0seyJpZCI6ImFkNGI5OWYwLTMzZGEt
|
33
|
+
NDY2MS1hYTI5LTA1NzU1N2NmNDE0NyIsIm5hbWUiOiLQnNCw0YHQu9C+0LLQ
|
34
|
+
utCwINCd0LjQttC9LiIsInR5cGUiOiLRg9C7In0seyJpZCI6IjBiYzBlMTg3
|
35
|
+
LWM1NWItNGVmOS1iZDBlLTZjMjM2ODNhMTI3MCIsIm5hbWUiOiLQnNCw0YHR
|
36
|
+
gtC10YDQutC+0LLQsCIsInR5cGUiOiLRg9C7In0seyJpZCI6IjJiNDUzZTNj
|
37
|
+
LWQ5MDgtNDYwOC1iODFjLWEzMTRhNjg3YmVlMyIsIm5hbWUiOiLQnNCw0YHR
|
38
|
+
gtC10YDQvtCy0LDRjyIsInR5cGUiOiLRg9C7In1dfQ==
|
39
|
+
http_version:
|
40
|
+
recorded_at: Wed, 29 Jan 2014 21:46:15 GMT
|
41
|
+
recorded_with: VCR 2.8.0
|
@@ -0,0 +1,32 @@
|
|
1
|
+
---
|
2
|
+
http_interactions:
|
3
|
+
- request:
|
4
|
+
method: get
|
5
|
+
uri: http://platform.checkout.ru/service/login/ticket/valid-api-key
|
6
|
+
body:
|
7
|
+
encoding: US-ASCII
|
8
|
+
string: ''
|
9
|
+
headers:
|
10
|
+
User-Agent:
|
11
|
+
- Faraday v0.8.8
|
12
|
+
response:
|
13
|
+
status:
|
14
|
+
code: 200
|
15
|
+
message:
|
16
|
+
headers:
|
17
|
+
date:
|
18
|
+
- Tue, 28 Jan 2014 23:31:30 GMT
|
19
|
+
server:
|
20
|
+
- Apache/2.2.22 (Ubuntu)
|
21
|
+
connection:
|
22
|
+
- close
|
23
|
+
transfer-encoding:
|
24
|
+
- chunked
|
25
|
+
content-type:
|
26
|
+
- application/json;charset=UTF-8
|
27
|
+
body:
|
28
|
+
encoding: UTF-8
|
29
|
+
string: '{"ticket":"valid-ticket"}'
|
30
|
+
http_version:
|
31
|
+
recorded_at: Tue, 28 Jan 2014 23:33:15 GMT
|
32
|
+
recorded_with: VCR 2.8.0
|
@@ -0,0 +1,35 @@
|
|
1
|
+
---
|
2
|
+
http_interactions:
|
3
|
+
- request:
|
4
|
+
method: get
|
5
|
+
uri: http://platform.checkout.ru/service/login/ticket/invalid-api-key
|
6
|
+
body:
|
7
|
+
encoding: US-ASCII
|
8
|
+
string: ''
|
9
|
+
headers:
|
10
|
+
User-Agent:
|
11
|
+
- Faraday v0.8.8
|
12
|
+
response:
|
13
|
+
status:
|
14
|
+
code: 400
|
15
|
+
message:
|
16
|
+
headers:
|
17
|
+
date:
|
18
|
+
- Tue, 28 Jan 2014 22:47:53 GMT
|
19
|
+
server:
|
20
|
+
- Apache/2.2.22 (Ubuntu)
|
21
|
+
vary:
|
22
|
+
- Accept-Encoding
|
23
|
+
connection:
|
24
|
+
- close
|
25
|
+
transfer-encoding:
|
26
|
+
- chunked
|
27
|
+
content-type:
|
28
|
+
- text/plain;charset=UTF-8
|
29
|
+
body:
|
30
|
+
encoding: ASCII-8BIT
|
31
|
+
string: !binary |-
|
32
|
+
0J3QtdCy0LXRgNC90YvQuSDQuNC00LXQvdGC0LjRhNC40LrQsNGC0L7RgA==
|
33
|
+
http_version:
|
34
|
+
recorded_at: Tue, 28 Jan 2014 22:49:38 GMT
|
35
|
+
recorded_with: VCR 2.8.0
|
@@ -0,0 +1,70 @@
|
|
1
|
+
---
|
2
|
+
http_interactions:
|
3
|
+
- request:
|
4
|
+
method: get
|
5
|
+
uri: http://platform.checkout.ru/service/order/statushistory/64?apiKey=valid-api-key
|
6
|
+
body:
|
7
|
+
encoding: US-ASCII
|
8
|
+
string: ''
|
9
|
+
headers:
|
10
|
+
User-Agent:
|
11
|
+
- Faraday v0.8.9
|
12
|
+
Accept:
|
13
|
+
- application/json
|
14
|
+
response:
|
15
|
+
status:
|
16
|
+
code: 200
|
17
|
+
message:
|
18
|
+
headers:
|
19
|
+
date:
|
20
|
+
- Sat, 01 Feb 2014 20:58:07 GMT
|
21
|
+
server:
|
22
|
+
- Apache/2.2.22 (Ubuntu)
|
23
|
+
connection:
|
24
|
+
- close
|
25
|
+
transfer-encoding:
|
26
|
+
- chunked
|
27
|
+
content-type:
|
28
|
+
- application/json;charset=UTF-8
|
29
|
+
body:
|
30
|
+
encoding: ASCII-8BIT
|
31
|
+
string: !binary |-
|
32
|
+
ewoib3JkZXIiOnsKImlkIjoiNjQiLCAKImRhdGUiOiIxNC4xMC4yMDEzIiwg
|
33
|
+
CiJ0b3RhbENvc3QiOjExMzYuMzMsIAoiYXBwcm94aW1hdGVEZWxpdmVyeURh
|
34
|
+
dGUiOm51bGx9LCJ1c2VyIjp7CiJmdWxsbmFtZSI6ItCy0LLQsiIsIAoiYWRk
|
35
|
+
cmVzcyI6ewoicG9zdGluZGV4IjpudWxsLCAKInBsYWNlIjoi0LMuINCS0L7Q
|
36
|
+
u9Cz0L7Qs9GA0LDQtCAo0JLQvtC70LPQvtCz0YDQsNC00YHQutCw0Y8g0L7Q
|
37
|
+
sdC70LDRgdGC0YwpIiwKInN0cmVldCI6IiIsCiJob3VzZSI6bnVsbCwgCiJo
|
38
|
+
b3VzaW5nIjpudWxsLCAKImJ1aWxkaW5nIjpudWxsLCAKImFwcGFydG1lbnQi
|
39
|
+
Om51bGx9fSwiZGVsaXZlcnlOYW1lIjoiRFBEIiwgImRlbGl2ZXJ5SGlzdG9y
|
40
|
+
eSIgOiBbCgp7CiJzdGF0dXMiOiLQn9C+0YHRi9C70LrQsCDQvdCw0YXQvtC0
|
41
|
+
0LjRgtGB0Y8g0L3QsCDRgtC10YDQvNC40L3QsNC70LUgRFBELCDQutC+0YLQ
|
42
|
+
vtGA0YvQuSDQvtGB0YPRidC10YHRgtCy0LvRj9C7INC10ZEg0L/RgNC40ZHQ
|
43
|
+
vCDRgyDQvtGC0L/RgNCw0LLQuNGC0LXQu9GPIiwKImRhdGUiOiIxMC4wOS4y
|
44
|
+
MDEzIDE3OjE5OjEzIgp9LAoKewoic3RhdHVzIjoi0J/QvtGB0YvQu9C60LAg
|
45
|
+
0LTQvtGB0YLQsNCy0LvRj9C10YLRgdGPINC/0L4g0LzQtdC20LTRg9Cz0L7R
|
46
|
+
gNC+0LTQvdC10Lkg0YHQtdGC0LggRFBEIiwKImRhdGUiOiIxMC4wOS4yMDEz
|
47
|
+
IDE5OjMxOjQ3Igp9LAoKewoic3RhdHVzIjoi0J/QvtGB0YvQu9C60LAg0L3Q
|
48
|
+
sNGF0L7QtNC40YLRgdGPINC90LAg0YLRgNCw0L3Qt9C40YLQvdC+0Lwg0YLQ
|
49
|
+
tdGA0LzQuNC90LDQu9C1IERQRCIsCiJkYXRlIjoiMTAuMDkuMjAxMyAyMjoy
|
50
|
+
NDowMyIKfSwKCnsKInN0YXR1cyI6ItCf0L7RgdGL0LvQutCwINC00L7RgdGC
|
51
|
+
0LDQstC70Y/QtdGC0YHRjyDQv9C+INC80LXQttC00YPQs9C+0YDQvtC00L3Q
|
52
|
+
tdC5INGB0LXRgtC4IERQRCIsCiJkYXRlIjoiMTEuMDkuMjAxMyAwMjoyMDo1
|
53
|
+
NyIKfSwKCnsKInN0YXR1cyI6ItCf0L7RgdGL0LvQutCwINC90LDRhdC+0LTQ
|
54
|
+
uNGC0YHRjyDQvdCwINGC0YDQsNC90LfQuNGC0L3QvtC8INGC0LXRgNC80LjQ
|
55
|
+
vdCw0LvQtSBEUEQiLAoiZGF0ZSI6IjExLjA5LjIwMTMgMDg6NTg6MDUiCn0s
|
56
|
+
Cgp7CiJzdGF0dXMiOiLQn9C+0YHRi9C70LrQsCDQtNC+0YHRgtCw0LLQu9GP
|
57
|
+
0LXRgtGB0Y8g0L/QviDQvNC10LbQtNGD0LPQvtGA0L7QtNC90LXQuSDRgdC1
|
58
|
+
0YLQuCBEUEQiLAoiZGF0ZSI6IjExLjA5LjIwMTMgMTE6MjA6NDYiCn0sCgp7
|
59
|
+
CiJzdGF0dXMiOiLQn9C+0YHRi9C70LrQsCDQvdCw0YXQvtC00LjRgtGB0Y8g
|
60
|
+
0L3QsCDRgtC10YDQvNC40L3QsNC70LUgRFBELCDQutC+0YLQvtGA0YvQuSDQ
|
61
|
+
vtGB0YPRidC10YHRgtCy0LvRj9C10YIg0LXRkSDQtNC+0YHRgtCw0LLQutGD
|
62
|
+
INC/0L7Qu9GD0YfQsNGC0LXQu9GOIiwKImRhdGUiOiIxMi4wOS4yMDEzIDEy
|
63
|
+
OjI3OjEwIgp9LAoKewoic3RhdHVzIjoi0J/QvtGB0YvQu9C60LAg0LTQvtGB
|
64
|
+
0YLQsNCy0LvRj9C10YLRgdGPINC/0L7Qu9GD0YfQsNGC0LXQu9GOIiwKImRh
|
65
|
+
dGUiOiIxMi4wOS4yMDEzIDE3OjIxOjI4Igp9LAoKewoic3RhdHVzIjoi0J/Q
|
66
|
+
vtGB0YvQu9C60LAg0LTQvtGB0YLQsNCy0LvQtdC90LAiLAoiZGF0ZSI6IjE2
|
67
|
+
LjA5LjIwMTMgMTQ6MTA6MDAiCn0KCl0KfQ==
|
68
|
+
http_version:
|
69
|
+
recorded_at: Sat, 01 Feb 2014 20:59:19 GMT
|
70
|
+
recorded_with: VCR 2.8.0
|
@@ -0,0 +1,34 @@
|
|
1
|
+
---
|
2
|
+
http_interactions:
|
3
|
+
- request:
|
4
|
+
method: post
|
5
|
+
uri: http://platform.checkout.ru/service/order/status/75
|
6
|
+
body:
|
7
|
+
encoding: UTF-8
|
8
|
+
string: '{"apiKey":"valid-api-key","status":"CANCELLED_BEFORE_SHIPMENT"}'
|
9
|
+
headers:
|
10
|
+
User-Agent:
|
11
|
+
- Faraday v0.8.9
|
12
|
+
Accept:
|
13
|
+
- application/json
|
14
|
+
Content-Type:
|
15
|
+
- application/json
|
16
|
+
response:
|
17
|
+
status:
|
18
|
+
code: 200
|
19
|
+
message:
|
20
|
+
headers:
|
21
|
+
date:
|
22
|
+
- Sat, 01 Feb 2014 19:33:54 GMT
|
23
|
+
server:
|
24
|
+
- Apache/2.2.22 (Ubuntu)
|
25
|
+
connection:
|
26
|
+
- close
|
27
|
+
transfer-encoding:
|
28
|
+
- chunked
|
29
|
+
body:
|
30
|
+
encoding: UTF-8
|
31
|
+
string: ''
|
32
|
+
http_version:
|
33
|
+
recorded_at: Sat, 01 Feb 2014 19:35:06 GMT
|
34
|
+
recorded_with: VCR 2.8.0
|
@@ -0,0 +1,42 @@
|
|
1
|
+
---
|
2
|
+
http_interactions:
|
3
|
+
- request:
|
4
|
+
method: get
|
5
|
+
uri: http://platform.checkout.ru/service/order/statushistory/777?apiKey=valid-api-key
|
6
|
+
body:
|
7
|
+
encoding: US-ASCII
|
8
|
+
string: ''
|
9
|
+
headers:
|
10
|
+
User-Agent:
|
11
|
+
- Faraday v0.8.9
|
12
|
+
Accept:
|
13
|
+
- application/json
|
14
|
+
response:
|
15
|
+
status:
|
16
|
+
code: 200
|
17
|
+
message:
|
18
|
+
headers:
|
19
|
+
date:
|
20
|
+
- Sat, 01 Feb 2014 19:39:16 GMT
|
21
|
+
server:
|
22
|
+
- Apache/2.2.22 (Ubuntu)
|
23
|
+
connection:
|
24
|
+
- close
|
25
|
+
transfer-encoding:
|
26
|
+
- chunked
|
27
|
+
content-type:
|
28
|
+
- application/json;charset=UTF-8
|
29
|
+
body:
|
30
|
+
encoding: ASCII-8BIT
|
31
|
+
string: !binary |-
|
32
|
+
ewoib3JkZXIiOnsKImlkIjoiNzUiLCAKImRhdGUiOiIxLjAyLjIwMTQiLCAK
|
33
|
+
InRvdGFsQ29zdCI6MTcyNC40MSwgCiJhcHByb3hpbWF0ZURlbGl2ZXJ5RGF0
|
34
|
+
ZSI6bnVsbH0sInVzZXIiOnsKImZ1bGxuYW1lIjoi0J/QtdGC0Y8g0J/Rg9C/
|
35
|
+
0LrQuNC9IiwgCiJhZGRyZXNzIjp7CiJwb3N0aW5kZXgiOm51bGwsIAoicGxh
|
36
|
+
Y2UiOiLQsy4g0JzQvtGB0LrQstCwIiwKInN0cmVldCI6IiIsCiJob3VzZSI6
|
37
|
+
bnVsbCwgCiJob3VzaW5nIjpudWxsLCAKImJ1aWxkaW5nIjpudWxsLCAKImFw
|
38
|
+
cGFydG1lbnQiOm51bGx9fSwiZGVsaXZlcnlOYW1lIjoiUGlja1BvaW50Iiwg
|
39
|
+
ImRlbGl2ZXJ5SGlzdG9yeSIgOiBbCgpdCn0=
|
40
|
+
http_version:
|
41
|
+
recorded_at: Sat, 01 Feb 2014 19:40:27 GMT
|
42
|
+
recorded_with: VCR 2.8.0
|
@@ -0,0 +1,39 @@
|
|
1
|
+
---
|
2
|
+
http_interactions:
|
3
|
+
- request:
|
4
|
+
method: post
|
5
|
+
uri: http://platform.checkout.ru/service/order/75
|
6
|
+
body:
|
7
|
+
encoding: UTF-8
|
8
|
+
string: '{"apiKey":"valid-api-key","order":{"goods":[{"name":"blue
|
9
|
+
tshirt","code":"blt","variantCode":"blue","quantity":2,"assessedCost":1000,"payCost":750,"weight":0.5}],"delivery":{"deliveryId":2,"placeFiasId":"0c5b2444-70a0-4932-980c-b4dc0d3f02b5","addressPvz":"Энтузиастов
|
10
|
+
ш., д. 54","type":"postamat","cost":224.41,"minTerm":2,"maxTerm":11},"user":{"fullname":"Петя
|
11
|
+
Пупкин","email":"vasyapupkin@example.com","phone":"555"},"comment":"test order","shopOrderId":"777","paymentMethod":"cash"}}'
|
12
|
+
headers:
|
13
|
+
User-Agent:
|
14
|
+
- Faraday v0.8.9
|
15
|
+
Accept:
|
16
|
+
- application/json
|
17
|
+
Content-Type:
|
18
|
+
- application/json
|
19
|
+
response:
|
20
|
+
status:
|
21
|
+
code: 200
|
22
|
+
message:
|
23
|
+
headers:
|
24
|
+
date:
|
25
|
+
- Sat, 01 Feb 2014 19:27:28 GMT
|
26
|
+
server:
|
27
|
+
- Apache/2.2.22 (Ubuntu)
|
28
|
+
connection:
|
29
|
+
- close
|
30
|
+
transfer-encoding:
|
31
|
+
- chunked
|
32
|
+
content-type:
|
33
|
+
- application/json;charset=UTF-8
|
34
|
+
body:
|
35
|
+
encoding: UTF-8
|
36
|
+
string: '{"order":{"id":75},"delivery":{"id":2,"serviceName":"PickPoint"}}'
|
37
|
+
http_version:
|
38
|
+
recorded_at: Sat, 01 Feb 2014 19:28:41 GMT
|
39
|
+
recorded_with: VCR 2.8.0
|
data/test/test_helper.rb
ADDED
metadata
ADDED
@@ -0,0 +1,230 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: checkout_ru
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.1
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Maxim Chernyak
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2014-02-02 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: faraday
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - ~>
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '0.8'
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - ~>
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '0.8'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: faraday_middleware
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - ~>
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '0.9'
|
34
|
+
type: :runtime
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - ~>
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '0.9'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: faraday_middleware-multi_json
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - ~>
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '0.0'
|
48
|
+
type: :runtime
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - ~>
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '0.0'
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: multi_json
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - ~>
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '1.8'
|
62
|
+
type: :runtime
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - ~>
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '1.8'
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: hashie
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - ~>
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: '2.0'
|
76
|
+
type: :runtime
|
77
|
+
prerelease: false
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
79
|
+
requirements:
|
80
|
+
- - ~>
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: '2.0'
|
83
|
+
- !ruby/object:Gem::Dependency
|
84
|
+
name: nokogiri
|
85
|
+
requirement: !ruby/object:Gem::Requirement
|
86
|
+
requirements:
|
87
|
+
- - ~>
|
88
|
+
- !ruby/object:Gem::Version
|
89
|
+
version: '1.6'
|
90
|
+
type: :runtime
|
91
|
+
prerelease: false
|
92
|
+
version_requirements: !ruby/object:Gem::Requirement
|
93
|
+
requirements:
|
94
|
+
- - ~>
|
95
|
+
- !ruby/object:Gem::Version
|
96
|
+
version: '1.6'
|
97
|
+
- !ruby/object:Gem::Dependency
|
98
|
+
name: bundler
|
99
|
+
requirement: !ruby/object:Gem::Requirement
|
100
|
+
requirements:
|
101
|
+
- - ~>
|
102
|
+
- !ruby/object:Gem::Version
|
103
|
+
version: '1.5'
|
104
|
+
type: :development
|
105
|
+
prerelease: false
|
106
|
+
version_requirements: !ruby/object:Gem::Requirement
|
107
|
+
requirements:
|
108
|
+
- - ~>
|
109
|
+
- !ruby/object:Gem::Version
|
110
|
+
version: '1.5'
|
111
|
+
- !ruby/object:Gem::Dependency
|
112
|
+
name: rake
|
113
|
+
requirement: !ruby/object:Gem::Requirement
|
114
|
+
requirements:
|
115
|
+
- - ~>
|
116
|
+
- !ruby/object:Gem::Version
|
117
|
+
version: '10'
|
118
|
+
type: :development
|
119
|
+
prerelease: false
|
120
|
+
version_requirements: !ruby/object:Gem::Requirement
|
121
|
+
requirements:
|
122
|
+
- - ~>
|
123
|
+
- !ruby/object:Gem::Version
|
124
|
+
version: '10'
|
125
|
+
- !ruby/object:Gem::Dependency
|
126
|
+
name: minitest
|
127
|
+
requirement: !ruby/object:Gem::Requirement
|
128
|
+
requirements:
|
129
|
+
- - ~>
|
130
|
+
- !ruby/object:Gem::Version
|
131
|
+
version: '5.2'
|
132
|
+
type: :development
|
133
|
+
prerelease: false
|
134
|
+
version_requirements: !ruby/object:Gem::Requirement
|
135
|
+
requirements:
|
136
|
+
- - ~>
|
137
|
+
- !ruby/object:Gem::Version
|
138
|
+
version: '5.2'
|
139
|
+
- !ruby/object:Gem::Dependency
|
140
|
+
name: vcr
|
141
|
+
requirement: !ruby/object:Gem::Requirement
|
142
|
+
requirements:
|
143
|
+
- - ~>
|
144
|
+
- !ruby/object:Gem::Version
|
145
|
+
version: '2.8'
|
146
|
+
type: :development
|
147
|
+
prerelease: false
|
148
|
+
version_requirements: !ruby/object:Gem::Requirement
|
149
|
+
requirements:
|
150
|
+
- - ~>
|
151
|
+
- !ruby/object:Gem::Version
|
152
|
+
version: '2.8'
|
153
|
+
description: Ruby client for checkout.ru.
|
154
|
+
email:
|
155
|
+
- max@bitsonnet.com
|
156
|
+
executables: []
|
157
|
+
extensions: []
|
158
|
+
extra_rdoc_files: []
|
159
|
+
files:
|
160
|
+
- .gitignore
|
161
|
+
- Gemfile
|
162
|
+
- LICENSE.txt
|
163
|
+
- README.md
|
164
|
+
- Rakefile
|
165
|
+
- checkout_ru.gemspec
|
166
|
+
- lib/checkout_ru.rb
|
167
|
+
- lib/checkout_ru/address.rb
|
168
|
+
- lib/checkout_ru/delivery.rb
|
169
|
+
- lib/checkout_ru/entity.rb
|
170
|
+
- lib/checkout_ru/item.rb
|
171
|
+
- lib/checkout_ru/order.rb
|
172
|
+
- lib/checkout_ru/session.rb
|
173
|
+
- lib/checkout_ru/user.rb
|
174
|
+
- lib/checkout_ru/version.rb
|
175
|
+
- test/checkout_ru/session_test.rb
|
176
|
+
- test/checkout_ru_test.rb
|
177
|
+
- test/fixtures/calculation.yml
|
178
|
+
- test/fixtures/create_order.yml
|
179
|
+
- test/fixtures/get_place_by_postal_code.yml
|
180
|
+
- test/fixtures/get_places_by_query.yml
|
181
|
+
- test/fixtures/get_postal_code_by_address.yml
|
182
|
+
- test/fixtures/get_streets_by_query.yml
|
183
|
+
- test/fixtures/get_ticket.yml
|
184
|
+
- test/fixtures/get_ticket_invalid_api_key.yml
|
185
|
+
- test/fixtures/populated_status_history.yml
|
186
|
+
- test/fixtures/status.yml
|
187
|
+
- test/fixtures/status_history.yml
|
188
|
+
- test/fixtures/update_order.yml
|
189
|
+
- test/test_helper.rb
|
190
|
+
homepage: http://github.com/maxim/checkout_ru
|
191
|
+
licenses:
|
192
|
+
- MIT
|
193
|
+
metadata: {}
|
194
|
+
post_install_message:
|
195
|
+
rdoc_options: []
|
196
|
+
require_paths:
|
197
|
+
- lib
|
198
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
199
|
+
requirements:
|
200
|
+
- - '>='
|
201
|
+
- !ruby/object:Gem::Version
|
202
|
+
version: '0'
|
203
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
204
|
+
requirements:
|
205
|
+
- - '>='
|
206
|
+
- !ruby/object:Gem::Version
|
207
|
+
version: '0'
|
208
|
+
requirements: []
|
209
|
+
rubyforge_project:
|
210
|
+
rubygems_version: 2.2.1
|
211
|
+
signing_key:
|
212
|
+
specification_version: 4
|
213
|
+
summary: Ruby client for checkout.ru
|
214
|
+
test_files:
|
215
|
+
- test/checkout_ru/session_test.rb
|
216
|
+
- test/checkout_ru_test.rb
|
217
|
+
- test/fixtures/calculation.yml
|
218
|
+
- test/fixtures/create_order.yml
|
219
|
+
- test/fixtures/get_place_by_postal_code.yml
|
220
|
+
- test/fixtures/get_places_by_query.yml
|
221
|
+
- test/fixtures/get_postal_code_by_address.yml
|
222
|
+
- test/fixtures/get_streets_by_query.yml
|
223
|
+
- test/fixtures/get_ticket.yml
|
224
|
+
- test/fixtures/get_ticket_invalid_api_key.yml
|
225
|
+
- test/fixtures/populated_status_history.yml
|
226
|
+
- test/fixtures/status.yml
|
227
|
+
- test/fixtures/status_history.yml
|
228
|
+
- test/fixtures/update_order.yml
|
229
|
+
- test/test_helper.rb
|
230
|
+
has_rdoc:
|