espago 0.0.9 → 0.1.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +6 -0
- data/Gemfile.lock +14 -1
- data/Guardfile +1 -0
- data/README.md +118 -6
- data/espago.gemspec +6 -1
- data/lib/espago.rb +4 -3
- data/lib/espago/api_connection.rb +16 -7
- data/lib/espago/api_connection/{post_clients.rb → api.rb} +1 -5
- data/lib/espago/api_connection/api_delete.rb +9 -0
- data/lib/espago/api_connection/api_get.rb +13 -0
- data/lib/espago/api_connection/api_post.rb +9 -0
- data/lib/espago/api_connection/api_put.rb +9 -0
- data/lib/espago/api_connection/charges_complete_post.rb +9 -0
- data/lib/espago/api_connection/charges_delete.rb +9 -0
- data/lib/espago/api_connection/charges_get.rb +9 -0
- data/lib/espago/api_connection/charges_post.rb +9 -0
- data/lib/espago/api_connection/{post_charges_refund.rb → charges_refund_post.rb} +1 -5
- data/lib/espago/api_connection/clients_authorize_post.rb +9 -0
- data/lib/espago/api_connection/clients_delete.rb +9 -0
- data/lib/espago/api_connection/clients_get.rb +9 -0
- data/lib/espago/api_connection/clients_invoices_get.rb +9 -0
- data/lib/espago/api_connection/clients_post.rb +9 -0
- data/lib/espago/api_connection/clients_put.rb +9 -0
- data/lib/espago/api_connection/clients_subscriptions_get.rb +9 -0
- data/lib/espago/api_connection/complete_post.rb +14 -0
- data/lib/espago/api_connection/invoice_items_delete.rb +9 -0
- data/lib/espago/api_connection/invoice_items_get.rb +9 -0
- data/lib/espago/api_connection/invoice_items_post.rb +9 -0
- data/lib/espago/api_connection/invoices_get.rb +9 -0
- data/lib/espago/api_connection/line_items_get.rb +9 -0
- data/lib/espago/api_connection/plans_delete.rb +9 -0
- data/lib/espago/api_connection/plans_get.rb +9 -0
- data/lib/espago/api_connection/plans_post.rb +9 -0
- data/lib/espago/api_connection/plans_put.rb +9 -0
- data/lib/espago/api_connection/subscriptions_delete.rb +9 -0
- data/lib/espago/api_connection/subscriptions_get.rb +9 -0
- data/lib/espago/api_connection/subscriptions_post.rb +9 -0
- data/lib/espago/api_connection/tokens_get.rb +9 -0
- data/lib/espago/api_connection/{post_tokens.rb → tokens_post.rb} +2 -2
- data/lib/espago/back_request.rb +33 -0
- data/lib/espago/client.rb +12 -3
- data/lib/espago/router.rb +1 -1
- data/lib/espago/version.rb +1 -1
- data/spec/espago/api_connection_spec.rb +4 -3
- data/spec/espago/back_request_spec.rb +33 -0
- data/spec/espago/client_spec.rb +3 -2
- data/spec/espago/router_spec.rb +2 -2
- data/spec/features/apis_spec.rb +21 -0
- data/spec/features/charges_spec.rb +79 -0
- data/spec/features/clients_spec.rb +100 -0
- data/spec/features/error_spec.rb +28 -0
- data/spec/features/invoice_items_spec.rb +37 -0
- data/spec/features/invoices_spec.rb +24 -0
- data/spec/features/line_items_spec.rb +17 -0
- data/spec/features/plans_spec.rb +61 -0
- data/spec/features/subscriptions_spec.rb +43 -0
- data/spec/features/tokens_spec.rb +40 -0
- data/spec/fixtures/cassettes/api_2.yml +68 -0
- data/spec/fixtures/cassettes/api_3.yml +68 -0
- data/spec/fixtures/cassettes/charges_complete.yml +48 -0
- data/spec/fixtures/cassettes/charges_complete_deprecation.yml +48 -0
- data/spec/fixtures/cassettes/charges_destroy.yml +46 -0
- data/spec/fixtures/cassettes/charges_get.yml +67 -0
- data/spec/fixtures/cassettes/charges_get_pay_mTOngouLTJWZ0w.yml +46 -0
- data/spec/fixtures/cassettes/charges_post.yml +48 -0
- data/spec/fixtures/cassettes/charges_refund.yml +48 -0
- data/spec/fixtures/cassettes/clients_authorize.yml +48 -0
- data/spec/fixtures/cassettes/clients_delete.yml +42 -0
- data/spec/fixtures/cassettes/clients_get.yml +46 -0
- data/spec/fixtures/cassettes/clients_get_cli_w0Se2smYwyQ0Uw.yml +46 -0
- data/spec/fixtures/cassettes/clients_invoices.yml +46 -0
- data/spec/fixtures/cassettes/clients_post.yml +48 -0
- data/spec/fixtures/cassettes/clients_put.yml +48 -0
- data/spec/fixtures/cassettes/clients_subscriptions.yml +46 -0
- data/spec/fixtures/cassettes/error_400.yml +46 -0
- data/spec/fixtures/cassettes/error_401.yml +46 -0
- data/spec/fixtures/cassettes/error_500.yml +46 -0
- data/spec/fixtures/cassettes/invoice_items_delete_ii_WDzszvhTshe78Xd.yml +42 -0
- data/spec/fixtures/cassettes/invoice_items_get_ii_5LS-YR7S1QaJBl3.yml +47 -0
- data/spec/fixtures/cassettes/invoice_items_post_ii_5LS-YR7S1QaJBl3.yml +49 -0
- data/spec/fixtures/cassettes/invoices_get.yml +46 -0
- data/spec/fixtures/cassettes/invoices_get_in_tUCMhwlg2nkvAaL.yml +46 -0
- data/spec/fixtures/cassettes/line_items_get.yml +47 -0
- data/spec/fixtures/cassettes/plans_delete.yml +42 -0
- data/spec/fixtures/cassettes/plans_get.yml +46 -0
- data/spec/fixtures/cassettes/plans_get_pl_12345.yml +46 -0
- data/spec/fixtures/cassettes/plans_post.yml +48 -0
- data/spec/fixtures/cassettes/plans_put.yml +44 -0
- data/spec/fixtures/cassettes/subscriptions_delete_sub_8yYuCBKdywr7e2.yml +42 -0
- data/spec/fixtures/cassettes/subscriptions_get.yml +46 -0
- data/spec/fixtures/cassettes/subscriptions_get_sub_8yYuCBKdywr7e2.yml +46 -0
- data/spec/fixtures/cassettes/subscriptions_post.yml +48 -0
- data/spec/fixtures/cassettes/tokens_get.yml +46 -0
- data/spec/fixtures/cassettes/tokens_post.yml +54 -0
- data/spec/spec_helper.rb +30 -0
- metadata +197 -37
- data/lib/espago/api_connection/delete_charges.rb +0 -13
- data/lib/espago/api_connection/delete_clients.rb +0 -13
- data/lib/espago/api_connection/get_charges.rb +0 -17
- data/lib/espago/api_connection/get_clients.rb +0 -17
- data/lib/espago/api_connection/get_tokens.rb +0 -13
- data/lib/espago/api_connection/post_charges.rb +0 -13
- data/lib/espago/api_connection/post_clients_authorize.rb +0 -13
- data/lib/espago/api_connection/post_complete.rb +0 -13
- data/lib/espago/api_connection/put_clients.rb +0 -13
@@ -0,0 +1,44 @@
|
|
1
|
+
---
|
2
|
+
http_interactions:
|
3
|
+
- request:
|
4
|
+
method: put
|
5
|
+
uri: https://app_id_test:app_password_test@sandbox.espago.com/api/plans/pl_XczKHr_42CRiKXZ
|
6
|
+
body:
|
7
|
+
encoding: US-ASCII
|
8
|
+
string: plan_id=pl_XczKHr_42CRiKXZ&period_unit=month&period=1&amount=149.99¤cy=pln&description=Test+Plan
|
9
|
+
headers:
|
10
|
+
Accept:
|
11
|
+
- application/vnd.espago.v2+json
|
12
|
+
Content-Type:
|
13
|
+
- application/x-www-form-urlencoded
|
14
|
+
Accept-Encoding:
|
15
|
+
- gzip;q=1.0,deflate;q=0.6,identity;q=0.3
|
16
|
+
User-Agent:
|
17
|
+
- Ruby
|
18
|
+
response:
|
19
|
+
status:
|
20
|
+
code: 204
|
21
|
+
message: No Content
|
22
|
+
headers:
|
23
|
+
X-Meta-Request-Version:
|
24
|
+
- 0.2.2
|
25
|
+
X-Ua-Compatible:
|
26
|
+
- IE=Edge
|
27
|
+
Cache-Control:
|
28
|
+
- no-cache
|
29
|
+
Set-Cookie:
|
30
|
+
- _session_id=444820a95c126c20986637ed3efd2fd4; path=/; HttpOnly
|
31
|
+
X-Request-Id:
|
32
|
+
- f6497ce3e4a20c75130f5cac324381a1
|
33
|
+
X-Runtime:
|
34
|
+
- '0.489553'
|
35
|
+
Connection:
|
36
|
+
- close
|
37
|
+
Server:
|
38
|
+
- thin 1.5.0 codename Knife
|
39
|
+
body:
|
40
|
+
encoding: UTF-8
|
41
|
+
string: ''
|
42
|
+
http_version:
|
43
|
+
recorded_at: Wed, 26 Nov 2014 17:51:57 GMT
|
44
|
+
recorded_with: VCR 2.9.3
|
@@ -0,0 +1,42 @@
|
|
1
|
+
---
|
2
|
+
http_interactions:
|
3
|
+
- request:
|
4
|
+
method: delete
|
5
|
+
uri: https://app_id_test:app_password_test@sandbox.espago.com/api/subscriptions/sub_8yYuCBKdywr7e2
|
6
|
+
body:
|
7
|
+
encoding: US-ASCII
|
8
|
+
string: ''
|
9
|
+
headers:
|
10
|
+
Accept:
|
11
|
+
- application/vnd.espago.v2+json
|
12
|
+
Accept-Encoding:
|
13
|
+
- gzip;q=1.0,deflate;q=0.6,identity;q=0.3
|
14
|
+
User-Agent:
|
15
|
+
- Ruby
|
16
|
+
response:
|
17
|
+
status:
|
18
|
+
code: 204
|
19
|
+
message: No Content
|
20
|
+
headers:
|
21
|
+
X-Meta-Request-Version:
|
22
|
+
- 0.2.2
|
23
|
+
X-Ua-Compatible:
|
24
|
+
- IE=Edge
|
25
|
+
Cache-Control:
|
26
|
+
- no-cache
|
27
|
+
Set-Cookie:
|
28
|
+
- _session_id=8e765e9748ae92432715e3d41d9951d2; path=/; HttpOnly
|
29
|
+
X-Request-Id:
|
30
|
+
- a7dbff53bce58ab3f0b52a64d4322c0f
|
31
|
+
X-Runtime:
|
32
|
+
- '1.657240'
|
33
|
+
Connection:
|
34
|
+
- close
|
35
|
+
Server:
|
36
|
+
- thin 1.5.0 codename Knife
|
37
|
+
body:
|
38
|
+
encoding: UTF-8
|
39
|
+
string: ''
|
40
|
+
http_version:
|
41
|
+
recorded_at: Thu, 27 Nov 2014 15:38:16 GMT
|
42
|
+
recorded_with: VCR 2.9.3
|
@@ -0,0 +1,46 @@
|
|
1
|
+
---
|
2
|
+
http_interactions:
|
3
|
+
- request:
|
4
|
+
method: get
|
5
|
+
uri: https://app_id_test:app_password_test@sandbox.espago.com/api/subscriptions
|
6
|
+
body:
|
7
|
+
encoding: US-ASCII
|
8
|
+
string: ''
|
9
|
+
headers:
|
10
|
+
Accept:
|
11
|
+
- application/vnd.espago.v2+json
|
12
|
+
Accept-Encoding:
|
13
|
+
- gzip;q=1.0,deflate;q=0.6,identity;q=0.3
|
14
|
+
User-Agent:
|
15
|
+
- Ruby
|
16
|
+
response:
|
17
|
+
status:
|
18
|
+
code: 200
|
19
|
+
message: OK
|
20
|
+
headers:
|
21
|
+
Content-Type:
|
22
|
+
- application/json; charset=utf-8
|
23
|
+
X-Meta-Request-Version:
|
24
|
+
- 0.2.2
|
25
|
+
X-Ua-Compatible:
|
26
|
+
- IE=Edge
|
27
|
+
Etag:
|
28
|
+
- '"e8b64babf491e15309cc95cc2db2d258"'
|
29
|
+
Cache-Control:
|
30
|
+
- max-age=0, private, must-revalidate
|
31
|
+
Set-Cookie:
|
32
|
+
- _session_id=34e94b2812086a2c7f02e9c1a51d4b03; path=/; HttpOnly
|
33
|
+
X-Request-Id:
|
34
|
+
- bb518b642a4faf3f20c0be5da4259599
|
35
|
+
X-Runtime:
|
36
|
+
- '0.437633'
|
37
|
+
Connection:
|
38
|
+
- close
|
39
|
+
Server:
|
40
|
+
- thin 1.5.0 codename Knife
|
41
|
+
body:
|
42
|
+
encoding: UTF-8
|
43
|
+
string: '{"count":1,"subscriptions":[{"id":"sub_8yYuCBKdywr7e2","state":"active","client":"cli_90Pi6Jf0ndl_PP","plan":"pl_12345","created_at":1417030496,"last_invoice":{"id":"in_tUCMhwlg2nkvAaL","date":1417030496,"client":"cli_90Pi6Jf0ndl_PP","subscription":"sub_8yYuCBKdywr7e2","amount":"123.45","currency":"pln","paid":true,"issuer_response_code":"00","attempts":1,"next_payment_attempt":null,"created_at":1417030497}}]}'
|
44
|
+
http_version:
|
45
|
+
recorded_at: Wed, 26 Nov 2014 19:35:13 GMT
|
46
|
+
recorded_with: VCR 2.9.3
|
@@ -0,0 +1,46 @@
|
|
1
|
+
---
|
2
|
+
http_interactions:
|
3
|
+
- request:
|
4
|
+
method: get
|
5
|
+
uri: https://app_id_test:app_password_test@sandbox.espago.com/api/subscriptions/sub_8yYuCBKdywr7e2
|
6
|
+
body:
|
7
|
+
encoding: US-ASCII
|
8
|
+
string: ''
|
9
|
+
headers:
|
10
|
+
Accept:
|
11
|
+
- application/vnd.espago.v2+json
|
12
|
+
Accept-Encoding:
|
13
|
+
- gzip;q=1.0,deflate;q=0.6,identity;q=0.3
|
14
|
+
User-Agent:
|
15
|
+
- Ruby
|
16
|
+
response:
|
17
|
+
status:
|
18
|
+
code: 200
|
19
|
+
message: OK
|
20
|
+
headers:
|
21
|
+
Content-Type:
|
22
|
+
- application/json; charset=utf-8
|
23
|
+
X-Meta-Request-Version:
|
24
|
+
- 0.2.2
|
25
|
+
X-Ua-Compatible:
|
26
|
+
- IE=Edge
|
27
|
+
Etag:
|
28
|
+
- '"8a7a471581b59dfd11b76713db87dce9"'
|
29
|
+
Cache-Control:
|
30
|
+
- max-age=0, private, must-revalidate
|
31
|
+
Set-Cookie:
|
32
|
+
- _session_id=d03bdbe00f0d157cb00c8a592a485cd3; path=/; HttpOnly
|
33
|
+
X-Request-Id:
|
34
|
+
- fb1102fda30ffbf7d6bdaf533a922195
|
35
|
+
X-Runtime:
|
36
|
+
- '0.531484'
|
37
|
+
Connection:
|
38
|
+
- close
|
39
|
+
Server:
|
40
|
+
- thin 1.5.0 codename Knife
|
41
|
+
body:
|
42
|
+
encoding: UTF-8
|
43
|
+
string: '{"id":"sub_8yYuCBKdywr7e2","state":"active","client":"cli_90Pi6Jf0ndl_PP","plan":"pl_12345","created_at":1417030496,"last_invoice":{"id":"in_tUCMhwlg2nkvAaL","date":1417030496,"client":"cli_90Pi6Jf0ndl_PP","subscription":"sub_8yYuCBKdywr7e2","amount":"123.45","currency":"pln","paid":true,"issuer_response_code":"00","attempts":1,"next_payment_attempt":null,"created_at":1417030497}}'
|
44
|
+
http_version:
|
45
|
+
recorded_at: Wed, 26 Nov 2014 19:42:58 GMT
|
46
|
+
recorded_with: VCR 2.9.3
|
@@ -0,0 +1,48 @@
|
|
1
|
+
---
|
2
|
+
http_interactions:
|
3
|
+
- request:
|
4
|
+
method: post
|
5
|
+
uri: https://app_id_test:app_password_test@sandbox.espago.com/api/subscriptions
|
6
|
+
body:
|
7
|
+
encoding: US-ASCII
|
8
|
+
string: plan=pl_12345&client=cli_90Pi6Jf0ndl_PP
|
9
|
+
headers:
|
10
|
+
Accept:
|
11
|
+
- application/vnd.espago.v2+json
|
12
|
+
Content-Type:
|
13
|
+
- application/x-www-form-urlencoded
|
14
|
+
Accept-Encoding:
|
15
|
+
- gzip;q=1.0,deflate;q=0.6,identity;q=0.3
|
16
|
+
User-Agent:
|
17
|
+
- Ruby
|
18
|
+
response:
|
19
|
+
status:
|
20
|
+
code: 201
|
21
|
+
message: Created
|
22
|
+
headers:
|
23
|
+
Content-Type:
|
24
|
+
- application/json; charset=utf-8
|
25
|
+
X-Meta-Request-Version:
|
26
|
+
- 0.2.2
|
27
|
+
X-Ua-Compatible:
|
28
|
+
- IE=Edge
|
29
|
+
Etag:
|
30
|
+
- '"8a7a471581b59dfd11b76713db87dce9"'
|
31
|
+
Cache-Control:
|
32
|
+
- max-age=0, private, must-revalidate
|
33
|
+
Set-Cookie:
|
34
|
+
- _session_id=e1e08e4c938f82160380340d806c450d; path=/; HttpOnly
|
35
|
+
X-Request-Id:
|
36
|
+
- f95c468b308ee2f72f9726bf6cbd8be6
|
37
|
+
X-Runtime:
|
38
|
+
- '3.763953'
|
39
|
+
Connection:
|
40
|
+
- close
|
41
|
+
Server:
|
42
|
+
- thin 1.5.0 codename Knife
|
43
|
+
body:
|
44
|
+
encoding: UTF-8
|
45
|
+
string: '{"id":"sub_8yYuCBKdywr7e2","state":"active","client":"cli_90Pi6Jf0ndl_PP","plan":"pl_12345","created_at":1417030496,"last_invoice":{"id":"in_tUCMhwlg2nkvAaL","date":1417030496,"client":"cli_90Pi6Jf0ndl_PP","subscription":"sub_8yYuCBKdywr7e2","amount":"123.45","currency":"pln","paid":true,"issuer_response_code":"00","attempts":1,"next_payment_attempt":null,"created_at":1417030497}}'
|
46
|
+
http_version:
|
47
|
+
recorded_at: Wed, 26 Nov 2014 19:35:00 GMT
|
48
|
+
recorded_with: VCR 2.9.3
|
@@ -0,0 +1,46 @@
|
|
1
|
+
---
|
2
|
+
http_interactions:
|
3
|
+
- request:
|
4
|
+
method: get
|
5
|
+
uri: https://app_id_test:app_password_test@sandbox.espago.com/api/tokens/cc_166YDMhrVcemFb3
|
6
|
+
body:
|
7
|
+
encoding: US-ASCII
|
8
|
+
string: ''
|
9
|
+
headers:
|
10
|
+
Accept:
|
11
|
+
- application/vnd.espago.v2+json
|
12
|
+
Accept-Encoding:
|
13
|
+
- gzip;q=1.0,deflate;q=0.6,identity;q=0.3
|
14
|
+
User-Agent:
|
15
|
+
- Ruby
|
16
|
+
response:
|
17
|
+
status:
|
18
|
+
code: 200
|
19
|
+
message: OK
|
20
|
+
headers:
|
21
|
+
Content-Type:
|
22
|
+
- application/json; charset=utf-8
|
23
|
+
X-Meta-Request-Version:
|
24
|
+
- 0.2.2
|
25
|
+
X-Ua-Compatible:
|
26
|
+
- IE=Edge
|
27
|
+
Etag:
|
28
|
+
- '"bebba4898713a5205954333a29c0e1cc"'
|
29
|
+
Cache-Control:
|
30
|
+
- max-age=0, private, must-revalidate
|
31
|
+
Set-Cookie:
|
32
|
+
- _session_id=eed7d2be93464a5f499c50ec411a3fa3; path=/; HttpOnly
|
33
|
+
X-Request-Id:
|
34
|
+
- 7554ad63074b0bbbadb71b495edad7fc
|
35
|
+
X-Runtime:
|
36
|
+
- '0.258735'
|
37
|
+
Connection:
|
38
|
+
- close
|
39
|
+
Server:
|
40
|
+
- thin 1.5.0 codename Knife
|
41
|
+
body:
|
42
|
+
encoding: UTF-8
|
43
|
+
string: '{"id":"cc_166YDMhrVcemFb3","created_at":1417029320,"used":false,"card":{"company":"VI","last4":"4242","year":2015,"month":2,"first_name":"Jan","last_name":"Kowalski","authorized":null,"created_at":1417029320}}'
|
44
|
+
http_version:
|
45
|
+
recorded_at: Wed, 26 Nov 2014 19:24:59 GMT
|
46
|
+
recorded_with: VCR 2.9.3
|
@@ -0,0 +1,54 @@
|
|
1
|
+
---
|
2
|
+
http_interactions:
|
3
|
+
- request:
|
4
|
+
method: post
|
5
|
+
uri: https://app_public_key_test:@sandbox.espago.com/api/tokens
|
6
|
+
body:
|
7
|
+
encoding: US-ASCII
|
8
|
+
string: card%5Bfirst_name%5D=Jan&card%5Blast_name%5D=Kowalski&card%5Bnumber%5D=4242424242424242&card%5Bverification_value%5D=123&card%5Byear%5D=2015&card%5Bmonth%5D=2
|
9
|
+
headers:
|
10
|
+
Accept:
|
11
|
+
- application/vnd.espago.v2+json
|
12
|
+
Content-Type:
|
13
|
+
- application/x-www-form-urlencoded
|
14
|
+
Accept-Encoding:
|
15
|
+
- gzip;q=1.0,deflate;q=0.6,identity;q=0.3
|
16
|
+
User-Agent:
|
17
|
+
- Ruby
|
18
|
+
response:
|
19
|
+
status:
|
20
|
+
code: 201
|
21
|
+
message: Created
|
22
|
+
headers:
|
23
|
+
Access-Control-Allow-Origin:
|
24
|
+
- "*"
|
25
|
+
Access-Control-Allow-Methods:
|
26
|
+
- POST,OPTIONS
|
27
|
+
Access-Control-Allow-Headers:
|
28
|
+
- Origin,Accept,Content-Type,X-Requested-With,X-CSRF-Token,Authorization
|
29
|
+
Content-Type:
|
30
|
+
- application/json; charset=utf-8
|
31
|
+
X-Meta-Request-Version:
|
32
|
+
- 0.2.2
|
33
|
+
X-Ua-Compatible:
|
34
|
+
- IE=Edge
|
35
|
+
Etag:
|
36
|
+
- '"bebba4898713a5205954333a29c0e1cc"'
|
37
|
+
Cache-Control:
|
38
|
+
- max-age=0, private, must-revalidate
|
39
|
+
Set-Cookie:
|
40
|
+
- _session_id=255fbb3fda2057dc4cc956fe42d388b7; path=/; HttpOnly
|
41
|
+
X-Request-Id:
|
42
|
+
- fcb337aec80cff8ef25686049c0b46e7
|
43
|
+
X-Runtime:
|
44
|
+
- '0.553115'
|
45
|
+
Connection:
|
46
|
+
- close
|
47
|
+
Server:
|
48
|
+
- thin 1.5.0 codename Knife
|
49
|
+
body:
|
50
|
+
encoding: UTF-8
|
51
|
+
string: '{"id":"cc_166YDMhrVcemFb3","created_at":1417029320,"used":false,"card":{"company":"VI","last4":"4242","year":2015,"month":2,"first_name":"Jan","last_name":"Kowalski","authorized":null,"created_at":1417029320}}'
|
52
|
+
http_version:
|
53
|
+
recorded_at: Wed, 26 Nov 2014 19:15:20 GMT
|
54
|
+
recorded_with: VCR 2.9.3
|
data/spec/spec_helper.rb
CHANGED
@@ -4,11 +4,41 @@
|
|
4
4
|
# loaded once.
|
5
5
|
#
|
6
6
|
# See http://rubydoc.info/gems/rspec-core/RSpec/Core/Configuration
|
7
|
+
require 'simplecov'
|
8
|
+
SimpleCov.start
|
9
|
+
|
10
|
+
require "codeclimate-test-reporter"
|
11
|
+
CodeClimate::TestReporter.start
|
12
|
+
|
13
|
+
require 'webmock/rspec'
|
14
|
+
require 'vcr'
|
15
|
+
require './lib/espago'
|
16
|
+
|
17
|
+
VCR.configure do |c|
|
18
|
+
c.default_cassette_options = {:record => :once, :serialize_with => :yaml}
|
19
|
+
c.cassette_library_dir = 'spec/fixtures/cassettes'
|
20
|
+
c.hook_into :webmock
|
21
|
+
c.ignore_hosts 'codeclimate.com'
|
22
|
+
end
|
23
|
+
#WebMock.allow_net_connect!
|
24
|
+
#VCR.turn_off!(:ignore_cassettes => false)
|
25
|
+
#VCR.turn_on!
|
26
|
+
|
7
27
|
RSpec.configure do |config|
|
8
28
|
config.treat_symbols_as_metadata_keys_with_true_values = true
|
9
29
|
config.run_all_when_everything_filtered = true
|
10
30
|
config.filter_run :focus
|
11
31
|
|
32
|
+
|
33
|
+
config.before(:each) do
|
34
|
+
Espago.app_id = 'app_id_test'
|
35
|
+
Espago.app_password = 'app_password_test'
|
36
|
+
Espago.public_key = 'app_public_key_test'
|
37
|
+
Espago.production = false
|
38
|
+
Espago.api_version = '2'
|
39
|
+
end
|
40
|
+
|
41
|
+
|
12
42
|
# Run specs in random order to surface order dependencies. If you find an
|
13
43
|
# order dependency and want to debug it, you can fix the order by providing
|
14
44
|
# the seed, which is printed after each run.
|
metadata
CHANGED
@@ -1,142 +1,185 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: espago
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Piotrek
|
8
8
|
- Szymon Fiedler
|
9
|
+
- Waclaw Luczak
|
9
10
|
autorequire:
|
10
11
|
bindir: bin
|
11
12
|
cert_chain: []
|
12
|
-
date:
|
13
|
+
date: 2014-12-29 00:00:00.000000000 Z
|
13
14
|
dependencies:
|
14
15
|
- !ruby/object:Gem::Dependency
|
15
16
|
name: faraday
|
16
17
|
requirement: !ruby/object:Gem::Requirement
|
17
18
|
requirements:
|
18
|
-
- -
|
19
|
+
- - ">="
|
19
20
|
- !ruby/object:Gem::Version
|
20
21
|
version: '0'
|
21
22
|
type: :runtime
|
22
23
|
prerelease: false
|
23
24
|
version_requirements: !ruby/object:Gem::Requirement
|
24
25
|
requirements:
|
25
|
-
- -
|
26
|
+
- - ">="
|
26
27
|
- !ruby/object:Gem::Version
|
27
28
|
version: '0'
|
28
29
|
- !ruby/object:Gem::Dependency
|
29
30
|
name: facets
|
30
31
|
requirement: !ruby/object:Gem::Requirement
|
31
32
|
requirements:
|
32
|
-
- -
|
33
|
+
- - ">="
|
33
34
|
- !ruby/object:Gem::Version
|
34
35
|
version: '0'
|
35
36
|
type: :runtime
|
36
37
|
prerelease: false
|
37
38
|
version_requirements: !ruby/object:Gem::Requirement
|
38
39
|
requirements:
|
39
|
-
- -
|
40
|
+
- - ">="
|
40
41
|
- !ruby/object:Gem::Version
|
41
42
|
version: '0'
|
42
43
|
- !ruby/object:Gem::Dependency
|
43
44
|
name: rspec
|
44
45
|
requirement: !ruby/object:Gem::Requirement
|
45
46
|
requirements:
|
46
|
-
- -
|
47
|
+
- - ">="
|
47
48
|
- !ruby/object:Gem::Version
|
48
49
|
version: '0'
|
49
50
|
type: :development
|
50
51
|
prerelease: false
|
51
52
|
version_requirements: !ruby/object:Gem::Requirement
|
52
53
|
requirements:
|
53
|
-
- -
|
54
|
+
- - ">="
|
54
55
|
- !ruby/object:Gem::Version
|
55
56
|
version: '0'
|
56
57
|
- !ruby/object:Gem::Dependency
|
57
58
|
name: pry
|
58
59
|
requirement: !ruby/object:Gem::Requirement
|
59
60
|
requirements:
|
60
|
-
- -
|
61
|
+
- - ">="
|
61
62
|
- !ruby/object:Gem::Version
|
62
63
|
version: '0'
|
63
64
|
type: :development
|
64
65
|
prerelease: false
|
65
66
|
version_requirements: !ruby/object:Gem::Requirement
|
66
67
|
requirements:
|
67
|
-
- -
|
68
|
+
- - ">="
|
68
69
|
- !ruby/object:Gem::Version
|
69
70
|
version: '0'
|
70
71
|
- !ruby/object:Gem::Dependency
|
71
72
|
name: guard-rspec
|
72
73
|
requirement: !ruby/object:Gem::Requirement
|
73
74
|
requirements:
|
74
|
-
- -
|
75
|
+
- - ">="
|
75
76
|
- !ruby/object:Gem::Version
|
76
77
|
version: '0'
|
77
78
|
type: :development
|
78
79
|
prerelease: false
|
79
80
|
version_requirements: !ruby/object:Gem::Requirement
|
80
81
|
requirements:
|
81
|
-
- -
|
82
|
+
- - ">="
|
82
83
|
- !ruby/object:Gem::Version
|
83
84
|
version: '0'
|
84
85
|
- !ruby/object:Gem::Dependency
|
85
86
|
name: simplecov
|
86
87
|
requirement: !ruby/object:Gem::Requirement
|
87
88
|
requirements:
|
88
|
-
- -
|
89
|
+
- - ">="
|
89
90
|
- !ruby/object:Gem::Version
|
90
91
|
version: '0'
|
91
92
|
type: :development
|
92
93
|
prerelease: false
|
93
94
|
version_requirements: !ruby/object:Gem::Requirement
|
94
95
|
requirements:
|
95
|
-
- -
|
96
|
+
- - ">="
|
96
97
|
- !ruby/object:Gem::Version
|
97
98
|
version: '0'
|
98
99
|
- !ruby/object:Gem::Dependency
|
99
100
|
name: fuubar
|
100
101
|
requirement: !ruby/object:Gem::Requirement
|
101
102
|
requirements:
|
102
|
-
- -
|
103
|
+
- - ">="
|
103
104
|
- !ruby/object:Gem::Version
|
104
105
|
version: '0'
|
105
106
|
type: :development
|
106
107
|
prerelease: false
|
107
108
|
version_requirements: !ruby/object:Gem::Requirement
|
108
109
|
requirements:
|
109
|
-
- -
|
110
|
+
- - ">="
|
110
111
|
- !ruby/object:Gem::Version
|
111
112
|
version: '0'
|
112
113
|
- !ruby/object:Gem::Dependency
|
113
114
|
name: rake
|
114
115
|
requirement: !ruby/object:Gem::Requirement
|
115
116
|
requirements:
|
116
|
-
- -
|
117
|
+
- - ">="
|
117
118
|
- !ruby/object:Gem::Version
|
118
119
|
version: '0'
|
119
120
|
type: :development
|
120
121
|
prerelease: false
|
121
122
|
version_requirements: !ruby/object:Gem::Requirement
|
122
123
|
requirements:
|
123
|
-
- -
|
124
|
+
- - ">="
|
124
125
|
- !ruby/object:Gem::Version
|
125
126
|
version: '0'
|
126
127
|
- !ruby/object:Gem::Dependency
|
127
128
|
name: rb-fsevent
|
128
129
|
requirement: !ruby/object:Gem::Requirement
|
129
130
|
requirements:
|
130
|
-
- - ~>
|
131
|
+
- - "~>"
|
131
132
|
- !ruby/object:Gem::Version
|
132
133
|
version: 0.9.1
|
133
134
|
type: :development
|
134
135
|
prerelease: false
|
135
136
|
version_requirements: !ruby/object:Gem::Requirement
|
136
137
|
requirements:
|
137
|
-
- - ~>
|
138
|
+
- - "~>"
|
138
139
|
- !ruby/object:Gem::Version
|
139
140
|
version: 0.9.1
|
141
|
+
- !ruby/object:Gem::Dependency
|
142
|
+
name: webmock
|
143
|
+
requirement: !ruby/object:Gem::Requirement
|
144
|
+
requirements:
|
145
|
+
- - ">="
|
146
|
+
- !ruby/object:Gem::Version
|
147
|
+
version: '0'
|
148
|
+
type: :development
|
149
|
+
prerelease: false
|
150
|
+
version_requirements: !ruby/object:Gem::Requirement
|
151
|
+
requirements:
|
152
|
+
- - ">="
|
153
|
+
- !ruby/object:Gem::Version
|
154
|
+
version: '0'
|
155
|
+
- !ruby/object:Gem::Dependency
|
156
|
+
name: vcr
|
157
|
+
requirement: !ruby/object:Gem::Requirement
|
158
|
+
requirements:
|
159
|
+
- - ">="
|
160
|
+
- !ruby/object:Gem::Version
|
161
|
+
version: '0'
|
162
|
+
type: :development
|
163
|
+
prerelease: false
|
164
|
+
version_requirements: !ruby/object:Gem::Requirement
|
165
|
+
requirements:
|
166
|
+
- - ">="
|
167
|
+
- !ruby/object:Gem::Version
|
168
|
+
version: '0'
|
169
|
+
- !ruby/object:Gem::Dependency
|
170
|
+
name: codeclimate-test-reporter
|
171
|
+
requirement: !ruby/object:Gem::Requirement
|
172
|
+
requirements:
|
173
|
+
- - ">="
|
174
|
+
- !ruby/object:Gem::Version
|
175
|
+
version: '0'
|
176
|
+
type: :development
|
177
|
+
prerelease: false
|
178
|
+
version_requirements: !ruby/object:Gem::Requirement
|
179
|
+
requirements:
|
180
|
+
- - ">="
|
181
|
+
- !ruby/object:Gem::Version
|
182
|
+
version: '0'
|
140
183
|
description: Espago api wrapper
|
141
184
|
email:
|
142
185
|
- developers@espago.com
|
@@ -144,8 +187,8 @@ executables: []
|
|
144
187
|
extensions: []
|
145
188
|
extra_rdoc_files: []
|
146
189
|
files:
|
147
|
-
- .gitignore
|
148
|
-
- .travis.yml
|
190
|
+
- ".gitignore"
|
191
|
+
- ".travis.yml"
|
149
192
|
- Gemfile
|
150
193
|
- Gemfile.lock
|
151
194
|
- Guardfile
|
@@ -155,18 +198,39 @@ files:
|
|
155
198
|
- espago.gemspec
|
156
199
|
- lib/espago.rb
|
157
200
|
- lib/espago/api_connection.rb
|
158
|
-
- lib/espago/api_connection/
|
159
|
-
- lib/espago/api_connection/
|
160
|
-
- lib/espago/api_connection/
|
161
|
-
- lib/espago/api_connection/
|
162
|
-
- lib/espago/api_connection/
|
163
|
-
- lib/espago/api_connection/
|
164
|
-
- lib/espago/api_connection/
|
165
|
-
- lib/espago/api_connection/
|
166
|
-
- lib/espago/api_connection/
|
167
|
-
- lib/espago/api_connection/
|
168
|
-
- lib/espago/api_connection/
|
169
|
-
- lib/espago/api_connection/
|
201
|
+
- lib/espago/api_connection/api.rb
|
202
|
+
- lib/espago/api_connection/api_delete.rb
|
203
|
+
- lib/espago/api_connection/api_get.rb
|
204
|
+
- lib/espago/api_connection/api_post.rb
|
205
|
+
- lib/espago/api_connection/api_put.rb
|
206
|
+
- lib/espago/api_connection/charges_complete_post.rb
|
207
|
+
- lib/espago/api_connection/charges_delete.rb
|
208
|
+
- lib/espago/api_connection/charges_get.rb
|
209
|
+
- lib/espago/api_connection/charges_post.rb
|
210
|
+
- lib/espago/api_connection/charges_refund_post.rb
|
211
|
+
- lib/espago/api_connection/clients_authorize_post.rb
|
212
|
+
- lib/espago/api_connection/clients_delete.rb
|
213
|
+
- lib/espago/api_connection/clients_get.rb
|
214
|
+
- lib/espago/api_connection/clients_invoices_get.rb
|
215
|
+
- lib/espago/api_connection/clients_post.rb
|
216
|
+
- lib/espago/api_connection/clients_put.rb
|
217
|
+
- lib/espago/api_connection/clients_subscriptions_get.rb
|
218
|
+
- lib/espago/api_connection/complete_post.rb
|
219
|
+
- lib/espago/api_connection/invoice_items_delete.rb
|
220
|
+
- lib/espago/api_connection/invoice_items_get.rb
|
221
|
+
- lib/espago/api_connection/invoice_items_post.rb
|
222
|
+
- lib/espago/api_connection/invoices_get.rb
|
223
|
+
- lib/espago/api_connection/line_items_get.rb
|
224
|
+
- lib/espago/api_connection/plans_delete.rb
|
225
|
+
- lib/espago/api_connection/plans_get.rb
|
226
|
+
- lib/espago/api_connection/plans_post.rb
|
227
|
+
- lib/espago/api_connection/plans_put.rb
|
228
|
+
- lib/espago/api_connection/subscriptions_delete.rb
|
229
|
+
- lib/espago/api_connection/subscriptions_get.rb
|
230
|
+
- lib/espago/api_connection/subscriptions_post.rb
|
231
|
+
- lib/espago/api_connection/tokens_get.rb
|
232
|
+
- lib/espago/api_connection/tokens_post.rb
|
233
|
+
- lib/espago/back_request.rb
|
170
234
|
- lib/espago/client.rb
|
171
235
|
- lib/espago/error.rb
|
172
236
|
- lib/espago/error/api_error.rb
|
@@ -176,10 +240,58 @@ files:
|
|
176
240
|
- lib/espago/router.rb
|
177
241
|
- lib/espago/version.rb
|
178
242
|
- spec/espago/api_connection_spec.rb
|
243
|
+
- spec/espago/back_request_spec.rb
|
179
244
|
- spec/espago/client_spec.rb
|
180
245
|
- spec/espago/error_spec.rb
|
181
246
|
- spec/espago/response_spec.rb
|
182
247
|
- spec/espago/router_spec.rb
|
248
|
+
- spec/features/apis_spec.rb
|
249
|
+
- spec/features/charges_spec.rb
|
250
|
+
- spec/features/clients_spec.rb
|
251
|
+
- spec/features/error_spec.rb
|
252
|
+
- spec/features/invoice_items_spec.rb
|
253
|
+
- spec/features/invoices_spec.rb
|
254
|
+
- spec/features/line_items_spec.rb
|
255
|
+
- spec/features/plans_spec.rb
|
256
|
+
- spec/features/subscriptions_spec.rb
|
257
|
+
- spec/features/tokens_spec.rb
|
258
|
+
- spec/fixtures/cassettes/api_2.yml
|
259
|
+
- spec/fixtures/cassettes/api_3.yml
|
260
|
+
- spec/fixtures/cassettes/charges_complete.yml
|
261
|
+
- spec/fixtures/cassettes/charges_complete_deprecation.yml
|
262
|
+
- spec/fixtures/cassettes/charges_destroy.yml
|
263
|
+
- spec/fixtures/cassettes/charges_get.yml
|
264
|
+
- spec/fixtures/cassettes/charges_get_pay_mTOngouLTJWZ0w.yml
|
265
|
+
- spec/fixtures/cassettes/charges_post.yml
|
266
|
+
- spec/fixtures/cassettes/charges_refund.yml
|
267
|
+
- spec/fixtures/cassettes/clients_authorize.yml
|
268
|
+
- spec/fixtures/cassettes/clients_delete.yml
|
269
|
+
- spec/fixtures/cassettes/clients_get.yml
|
270
|
+
- spec/fixtures/cassettes/clients_get_cli_w0Se2smYwyQ0Uw.yml
|
271
|
+
- spec/fixtures/cassettes/clients_invoices.yml
|
272
|
+
- spec/fixtures/cassettes/clients_post.yml
|
273
|
+
- spec/fixtures/cassettes/clients_put.yml
|
274
|
+
- spec/fixtures/cassettes/clients_subscriptions.yml
|
275
|
+
- spec/fixtures/cassettes/error_400.yml
|
276
|
+
- spec/fixtures/cassettes/error_401.yml
|
277
|
+
- spec/fixtures/cassettes/error_500.yml
|
278
|
+
- spec/fixtures/cassettes/invoice_items_delete_ii_WDzszvhTshe78Xd.yml
|
279
|
+
- spec/fixtures/cassettes/invoice_items_get_ii_5LS-YR7S1QaJBl3.yml
|
280
|
+
- spec/fixtures/cassettes/invoice_items_post_ii_5LS-YR7S1QaJBl3.yml
|
281
|
+
- spec/fixtures/cassettes/invoices_get.yml
|
282
|
+
- spec/fixtures/cassettes/invoices_get_in_tUCMhwlg2nkvAaL.yml
|
283
|
+
- spec/fixtures/cassettes/line_items_get.yml
|
284
|
+
- spec/fixtures/cassettes/plans_delete.yml
|
285
|
+
- spec/fixtures/cassettes/plans_get.yml
|
286
|
+
- spec/fixtures/cassettes/plans_get_pl_12345.yml
|
287
|
+
- spec/fixtures/cassettes/plans_post.yml
|
288
|
+
- spec/fixtures/cassettes/plans_put.yml
|
289
|
+
- spec/fixtures/cassettes/subscriptions_delete_sub_8yYuCBKdywr7e2.yml
|
290
|
+
- spec/fixtures/cassettes/subscriptions_get.yml
|
291
|
+
- spec/fixtures/cassettes/subscriptions_get_sub_8yYuCBKdywr7e2.yml
|
292
|
+
- spec/fixtures/cassettes/subscriptions_post.yml
|
293
|
+
- spec/fixtures/cassettes/tokens_get.yml
|
294
|
+
- spec/fixtures/cassettes/tokens_post.yml
|
183
295
|
- spec/helpers/fake_response.rb
|
184
296
|
- spec/spec_helper.rb
|
185
297
|
homepage: ''
|
@@ -191,25 +303,73 @@ require_paths:
|
|
191
303
|
- lib
|
192
304
|
required_ruby_version: !ruby/object:Gem::Requirement
|
193
305
|
requirements:
|
194
|
-
- -
|
306
|
+
- - ">="
|
195
307
|
- !ruby/object:Gem::Version
|
196
308
|
version: '0'
|
197
309
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
198
310
|
requirements:
|
199
|
-
- -
|
311
|
+
- - ">="
|
200
312
|
- !ruby/object:Gem::Version
|
201
313
|
version: '0'
|
202
314
|
requirements: []
|
203
315
|
rubyforge_project:
|
204
|
-
rubygems_version: 2.
|
316
|
+
rubygems_version: 2.4.4
|
205
317
|
signing_key:
|
206
318
|
specification_version: 4
|
207
319
|
summary: Espago api wrapper
|
208
320
|
test_files:
|
209
321
|
- spec/espago/api_connection_spec.rb
|
322
|
+
- spec/espago/back_request_spec.rb
|
210
323
|
- spec/espago/client_spec.rb
|
211
324
|
- spec/espago/error_spec.rb
|
212
325
|
- spec/espago/response_spec.rb
|
213
326
|
- spec/espago/router_spec.rb
|
327
|
+
- spec/features/apis_spec.rb
|
328
|
+
- spec/features/charges_spec.rb
|
329
|
+
- spec/features/clients_spec.rb
|
330
|
+
- spec/features/error_spec.rb
|
331
|
+
- spec/features/invoice_items_spec.rb
|
332
|
+
- spec/features/invoices_spec.rb
|
333
|
+
- spec/features/line_items_spec.rb
|
334
|
+
- spec/features/plans_spec.rb
|
335
|
+
- spec/features/subscriptions_spec.rb
|
336
|
+
- spec/features/tokens_spec.rb
|
337
|
+
- spec/fixtures/cassettes/api_2.yml
|
338
|
+
- spec/fixtures/cassettes/api_3.yml
|
339
|
+
- spec/fixtures/cassettes/charges_complete.yml
|
340
|
+
- spec/fixtures/cassettes/charges_complete_deprecation.yml
|
341
|
+
- spec/fixtures/cassettes/charges_destroy.yml
|
342
|
+
- spec/fixtures/cassettes/charges_get.yml
|
343
|
+
- spec/fixtures/cassettes/charges_get_pay_mTOngouLTJWZ0w.yml
|
344
|
+
- spec/fixtures/cassettes/charges_post.yml
|
345
|
+
- spec/fixtures/cassettes/charges_refund.yml
|
346
|
+
- spec/fixtures/cassettes/clients_authorize.yml
|
347
|
+
- spec/fixtures/cassettes/clients_delete.yml
|
348
|
+
- spec/fixtures/cassettes/clients_get.yml
|
349
|
+
- spec/fixtures/cassettes/clients_get_cli_w0Se2smYwyQ0Uw.yml
|
350
|
+
- spec/fixtures/cassettes/clients_invoices.yml
|
351
|
+
- spec/fixtures/cassettes/clients_post.yml
|
352
|
+
- spec/fixtures/cassettes/clients_put.yml
|
353
|
+
- spec/fixtures/cassettes/clients_subscriptions.yml
|
354
|
+
- spec/fixtures/cassettes/error_400.yml
|
355
|
+
- spec/fixtures/cassettes/error_401.yml
|
356
|
+
- spec/fixtures/cassettes/error_500.yml
|
357
|
+
- spec/fixtures/cassettes/invoice_items_delete_ii_WDzszvhTshe78Xd.yml
|
358
|
+
- spec/fixtures/cassettes/invoice_items_get_ii_5LS-YR7S1QaJBl3.yml
|
359
|
+
- spec/fixtures/cassettes/invoice_items_post_ii_5LS-YR7S1QaJBl3.yml
|
360
|
+
- spec/fixtures/cassettes/invoices_get.yml
|
361
|
+
- spec/fixtures/cassettes/invoices_get_in_tUCMhwlg2nkvAaL.yml
|
362
|
+
- spec/fixtures/cassettes/line_items_get.yml
|
363
|
+
- spec/fixtures/cassettes/plans_delete.yml
|
364
|
+
- spec/fixtures/cassettes/plans_get.yml
|
365
|
+
- spec/fixtures/cassettes/plans_get_pl_12345.yml
|
366
|
+
- spec/fixtures/cassettes/plans_post.yml
|
367
|
+
- spec/fixtures/cassettes/plans_put.yml
|
368
|
+
- spec/fixtures/cassettes/subscriptions_delete_sub_8yYuCBKdywr7e2.yml
|
369
|
+
- spec/fixtures/cassettes/subscriptions_get.yml
|
370
|
+
- spec/fixtures/cassettes/subscriptions_get_sub_8yYuCBKdywr7e2.yml
|
371
|
+
- spec/fixtures/cassettes/subscriptions_post.yml
|
372
|
+
- spec/fixtures/cassettes/tokens_get.yml
|
373
|
+
- spec/fixtures/cassettes/tokens_post.yml
|
214
374
|
- spec/helpers/fake_response.rb
|
215
375
|
- spec/spec_helper.rb
|