boletosimples 0.6.0 → 2.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +16 -12
- data/README.md +21 -59
- data/lib/boletosimples/configuration.rb +25 -28
- data/lib/boletosimples/last_request.rb +17 -10
- data/lib/boletosimples/middlewares/bearer.rb +12 -0
- data/lib/boletosimples/middlewares/custom_headers.rb +12 -0
- data/lib/boletosimples/middlewares/debug.rb +30 -0
- data/lib/boletosimples/middlewares/last_request.rb +3 -1
- data/lib/boletosimples/middlewares/raise_error.rb +9 -2
- data/lib/boletosimples/middlewares/user_agent.rb +3 -1
- data/lib/boletosimples/resources/bank_billet.rb +5 -11
- data/lib/boletosimples/resources/bank_billet_account.rb +3 -1
- data/lib/boletosimples/resources/bank_billet_discharge.rb +3 -1
- data/lib/boletosimples/resources/bank_billet_payment.rb +3 -1
- data/lib/boletosimples/resources/bank_billet_remittance.rb +3 -1
- data/lib/boletosimples/resources/base_model.rb +3 -1
- data/lib/boletosimples/resources/customer.rb +3 -1
- data/lib/boletosimples/resources/customer_import.rb +5 -3
- data/lib/boletosimples/resources/customer_subscription.rb +3 -10
- data/lib/boletosimples/resources/customer_subscription_import.rb +5 -3
- data/lib/boletosimples/resources/discharge.rb +4 -11
- data/lib/boletosimples/resources/email_delivery.rb +3 -1
- data/lib/boletosimples/resources/event.rb +3 -1
- data/lib/boletosimples/resources/installment.rb +3 -1
- data/lib/boletosimples/resources/remittance.rb +3 -1
- data/lib/boletosimples/resources/sms_delivery.rb +6 -0
- data/lib/boletosimples/resources/transaction.rb +3 -1
- data/lib/boletosimples/resources/webhook.rb +3 -1
- data/lib/boletosimples/resources/webhook_delivery.rb +3 -1
- data/lib/boletosimples/response_error.rb +10 -5
- data/lib/boletosimples/version.rb +3 -1
- data/lib/boletosimples.rb +6 -6
- data/spec/boletosimples/configuration_spec.rb +67 -80
- data/spec/boletosimples/last_request_spec.rb +17 -28
- data/spec/boletosimples/middlewares/custom_headers_spec.rb +26 -0
- data/spec/boletosimples/resources/bank_billet_account_spec.rb +57 -33
- data/spec/boletosimples/resources/bank_billet_discharge_spec.rb +7 -12
- data/spec/boletosimples/resources/bank_billet_payment_spec.rb +7 -12
- data/spec/boletosimples/resources/bank_billet_remittance_spec.rb +7 -12
- data/spec/boletosimples/resources/bank_billet_spec.rb +56 -42
- data/spec/boletosimples/resources/customer_import_spec.rb +41 -30
- data/spec/boletosimples/resources/customer_spec.rb +57 -39
- data/spec/boletosimples/resources/customer_subscription_import_spec.rb +41 -30
- data/spec/boletosimples/resources/customer_subscription_spec.rb +61 -33
- data/spec/boletosimples/resources/discharge_spec.rb +64 -11
- data/spec/boletosimples/resources/email_delivery_spec.rb +6 -11
- data/spec/boletosimples/resources/event_spec.rb +7 -12
- data/spec/boletosimples/resources/installment_spec.rb +61 -32
- data/spec/boletosimples/resources/remittance_spec.rb +7 -12
- data/spec/boletosimples/resources/sms_delivery_spec.rb +12 -0
- data/spec/boletosimples/resources/transactions_spec.rb +7 -12
- data/spec/boletosimples/resources/webhook_delivery_spec.rb +7 -12
- data/spec/boletosimples/resources/webhook_spec.rb +7 -12
- data/spec/fixtures/discharge.RET +3 -0
- data/spec/fixtures/vcr_cassettes/custom_headers.yml +113 -0
- data/spec/fixtures/vcr_cassettes/last_request/bank_billets.yml +409 -95
- data/spec/fixtures/vcr_cassettes/resources/bank_billet/all.yml +101 -99
- data/spec/fixtures/vcr_cassettes/resources/bank_billet/cancel/success.yml +55 -95
- data/spec/fixtures/vcr_cassettes/resources/bank_billet/create/invalid_params.yml +55 -27
- data/spec/fixtures/vcr_cassettes/resources/bank_billet/create/invalid_root.yml +51 -24
- data/spec/fixtures/vcr_cassettes/resources/bank_billet/create/valid.yml +64 -34
- data/spec/fixtures/vcr_cassettes/resources/bank_billet/duplicate/success.yml +97 -0
- data/spec/fixtures/vcr_cassettes/resources/bank_billet/find.yml +73 -34
- data/spec/fixtures/vcr_cassettes/resources/bank_billet_account/all.yml +82 -27
- data/spec/fixtures/vcr_cassettes/resources/bank_billet_account/create/invalid_params.yml +57 -27
- data/spec/fixtures/vcr_cassettes/resources/bank_billet_account/create/invalid_root.yml +53 -26
- data/spec/fixtures/vcr_cassettes/resources/bank_billet_account/create/valid.yml +64 -28
- data/spec/fixtures/vcr_cassettes/resources/bank_billet_account/find.yml +61 -25
- data/spec/fixtures/vcr_cassettes/resources/bank_billet_discharge/all.yml +59 -46
- data/spec/fixtures/vcr_cassettes/resources/bank_billet_payment/all.yml +74 -71
- data/spec/fixtures/vcr_cassettes/resources/bank_billet_remittance/all.yml +63 -47
- data/spec/fixtures/vcr_cassettes/resources/customer/all.yml +141 -39
- data/spec/fixtures/vcr_cassettes/resources/customer/create/invalid_params.yml +54 -25
- data/spec/fixtures/vcr_cassettes/resources/customer/create/invalid_root.yml +54 -24
- data/spec/fixtures/vcr_cassettes/resources/customer/create/valid.yml +56 -28
- data/spec/fixtures/vcr_cassettes/resources/customer/find.yml +56 -26
- data/spec/fixtures/vcr_cassettes/resources/customer_import/all.yml +58 -59
- data/spec/fixtures/vcr_cassettes/resources/customer_import/create/invalid_params.yml +53 -51
- data/spec/fixtures/vcr_cassettes/resources/customer_import/create/invalid_root.yml +54 -52
- data/spec/fixtures/vcr_cassettes/resources/customer_import/create/valid.yml +58 -67
- data/spec/fixtures/vcr_cassettes/resources/customer_import/find.yml +55 -53
- data/spec/fixtures/vcr_cassettes/resources/customer_subscription/all.yml +65 -51
- data/spec/fixtures/vcr_cassettes/resources/customer_subscription/create/invalid_params.yml +56 -50
- data/spec/fixtures/vcr_cassettes/resources/customer_subscription/create/invalid_root.yml +52 -48
- data/spec/fixtures/vcr_cassettes/resources/customer_subscription/create/valid.yml +63 -52
- data/spec/fixtures/vcr_cassettes/resources/customer_subscription/find.yml +61 -51
- data/spec/fixtures/vcr_cassettes/resources/customer_subscription/next_charge.yml +60 -132
- data/spec/fixtures/vcr_cassettes/resources/customer_subscription_import/all.yml +58 -54
- data/spec/fixtures/vcr_cassettes/resources/customer_subscription_import/create/invalid_params.yml +53 -52
- data/spec/fixtures/vcr_cassettes/resources/customer_subscription_import/create/invalid_root.yml +55 -53
- data/spec/fixtures/vcr_cassettes/resources/customer_subscription_import/create/valid.yml +58 -69
- data/spec/fixtures/vcr_cassettes/resources/customer_subscription_import/find.yml +55 -54
- data/spec/fixtures/vcr_cassettes/resources/discharge/all.yml +63 -34
- data/spec/fixtures/vcr_cassettes/resources/discharge/create/invalid_params.yml +86 -0
- data/spec/fixtures/vcr_cassettes/resources/discharge/create/invalid_root.yml +85 -0
- data/spec/fixtures/vcr_cassettes/resources/discharge/create/valid.yml +100 -0
- data/spec/fixtures/vcr_cassettes/resources/discharge/find.yml +89 -0
- data/spec/fixtures/vcr_cassettes/resources/email_delivery/all.yml +40 -43
- data/spec/fixtures/vcr_cassettes/resources/event/all.yml +326 -167
- data/spec/fixtures/vcr_cassettes/resources/installment/all.yml +113 -51
- data/spec/fixtures/vcr_cassettes/resources/installment/create/invalid_params.yml +57 -52
- data/spec/fixtures/vcr_cassettes/resources/installment/create/invalid_root.yml +52 -48
- data/spec/fixtures/vcr_cassettes/resources/installment/create/valid.yml +63 -52
- data/spec/fixtures/vcr_cassettes/resources/installment/find.yml +83 -51
- data/spec/fixtures/vcr_cassettes/resources/remittance/all.yml +83 -62
- data/spec/fixtures/vcr_cassettes/resources/sns_delivery/all.yml +89 -0
- data/spec/fixtures/vcr_cassettes/resources/transaction/all.yml +73 -60
- data/spec/fixtures/vcr_cassettes/resources/web_hook/all.yml +59 -34
- data/spec/fixtures/vcr_cassettes/resources/webhook_delivery/all.yml +2684 -55
- data/spec/spec_helper.rb +3 -20
- data/spec/support/stub_env.rb +7 -0
- data/spec/support/vcr.rb +3 -4
- metadata +42 -176
- data/.coveralls.yml +0 -2
- data/.gitignore +0 -19
- data/.ruby-version +0 -1
- data/.travis.yml +0 -46
- data/Gemfile +0 -4
- data/Rakefile +0 -14
- data/boletosimples.gemspec +0 -38
- data/gemfiles/rails_42.gemfile +0 -8
- data/gemfiles/rails_50.gemfile +0 -8
- data/gemfiles/rails_51.gemfile +0 -8
- data/gemfiles/rails_52.gemfile +0 -9
- data/lib/boletosimples/extra.rb +0 -8
- data/lib/boletosimples/resources/partner/user.rb +0 -7
- data/lib/oauth2_patch.rb +0 -24
- data/spec/boletosimples/extra_spec.rb +0 -31
- data/spec/boletosimples/resources/partner/user_spec.rb +0 -19
- data/spec/fixtures/vcr_cassettes/configuration/client_credentials/invalid.yml +0 -64
- data/spec/fixtures/vcr_cassettes/configuration/client_credentials/valid.yml +0 -56
- data/spec/fixtures/vcr_cassettes/extra/userinfo/authenticated.yml +0 -58
- data/spec/fixtures/vcr_cassettes/extra/userinfo/not_authenticated.yml +0 -54
- data/spec/fixtures/vcr_cassettes/last_request/userinfo.yml +0 -58
- data/spec/fixtures/vcr_cassettes/resources/bank_billet/cancel/failure.yml +0 -118
- data/spec/fixtures/vcr_cassettes/resources/partner/user/create.yml +0 -60
- data/spec/spec.opts +0 -8
@@ -1,62 +1,75 @@
|
|
1
1
|
---
|
2
2
|
http_interactions:
|
3
|
-
- request:
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
3
|
+
- request:
|
4
|
+
method: get
|
5
|
+
uri: https://api-sandbox.kobana.com.br/v1/transactions
|
6
|
+
body:
|
7
|
+
encoding: US-ASCII
|
8
|
+
string: ''
|
9
|
+
headers:
|
10
|
+
User-Agent:
|
11
|
+
- email@minhaempresa.com.br
|
12
|
+
Authorization:
|
13
|
+
- Bearer BOLETOSIMPLES_API_TOKEN
|
14
|
+
Accept:
|
15
|
+
- application/json
|
16
|
+
Accept-Encoding:
|
17
|
+
- gzip;q=1.0,deflate;q=0.6,identity;q=0.3
|
18
|
+
response:
|
19
|
+
status:
|
20
|
+
code: 200
|
21
|
+
message: OK
|
22
|
+
headers:
|
23
|
+
Server:
|
24
|
+
- Cowboy
|
25
|
+
Connection:
|
26
|
+
- keep-alive
|
27
|
+
X-Frame-Options:
|
28
|
+
- DENY
|
29
|
+
X-Xss-Protection:
|
30
|
+
- 1; mode=block
|
31
|
+
X-Content-Type-Options:
|
32
|
+
- nosniff
|
33
|
+
X-Download-Options:
|
34
|
+
- noopen
|
35
|
+
X-Permitted-Cross-Domain-Policies:
|
36
|
+
- none
|
37
|
+
Referrer-Policy:
|
38
|
+
- strict-origin-when-cross-origin
|
39
|
+
Per-Page:
|
40
|
+
- '50'
|
41
|
+
Page:
|
42
|
+
- ''
|
43
|
+
Content-Type:
|
44
|
+
- application/json; charset=utf-8
|
45
|
+
X-Ratelimit-Limit:
|
46
|
+
- '60'
|
47
|
+
X-Ratelimit-Remaining:
|
48
|
+
- '39'
|
49
|
+
Etag:
|
50
|
+
- W/"4642ec3d0b34807fa3dcb57d6ebca932"
|
51
|
+
Cache-Control:
|
52
|
+
- must-revalidate, private, max-age=0
|
53
|
+
X-Request-Id:
|
54
|
+
- a207601d-1426-45bc-aaeb-4d1413f507c3
|
55
|
+
X-Runtime:
|
56
|
+
- '0.039746'
|
57
|
+
Date:
|
58
|
+
- Tue, 13 Apr 2021 17:18:55 GMT
|
59
|
+
X-Rack-Cache:
|
60
|
+
- miss
|
61
|
+
Strict-Transport-Security:
|
62
|
+
- max-age=2629746
|
63
|
+
Vary:
|
64
|
+
- Origin,Accept-Encoding
|
65
|
+
Transfer-Encoding:
|
66
|
+
- chunked
|
67
|
+
Via:
|
68
|
+
- 1.1 vegur
|
69
|
+
body:
|
70
|
+
encoding: UTF-8
|
71
|
+
string:
|
72
|
+
'[{"id":526,"amount":-123.0,"created_at":"2021-04-13T09:34:52-03:00","description":"Upgrade
|
73
|
+
de Plano","kind":"plan_fee","processed_at":null,"sent_at":null,"status":"unprocessed","credit_at":"2021-04-13"}]'
|
74
|
+
recorded_at: Tue, 13 Apr 2021 17:18:55 GMT
|
75
|
+
recorded_with: VCR 6.0.0
|
@@ -2,63 +2,88 @@
|
|
2
2
|
http_interactions:
|
3
3
|
- request:
|
4
4
|
method: get
|
5
|
-
uri: https://sandbox.
|
5
|
+
uri: https://api-sandbox.kobana.com.br/v1/webhooks
|
6
6
|
body:
|
7
7
|
encoding: US-ASCII
|
8
8
|
string: ''
|
9
9
|
headers:
|
10
10
|
User-Agent:
|
11
|
-
-
|
11
|
+
- email@minhaempresa.com.br
|
12
12
|
Authorization:
|
13
|
-
-
|
13
|
+
- Bearer BOLETOSIMPLES_API_TOKEN
|
14
|
+
Accept:
|
15
|
+
- application/json
|
14
16
|
Accept-Encoding:
|
15
17
|
- gzip;q=1.0,deflate;q=0.6,identity;q=0.3
|
16
|
-
Accept:
|
17
|
-
- "*/*"
|
18
18
|
response:
|
19
19
|
status:
|
20
20
|
code: 200
|
21
21
|
message: OK
|
22
22
|
headers:
|
23
|
-
Connection:
|
24
|
-
- keep-alive
|
25
23
|
Content-Type:
|
26
24
|
- application/json; charset=utf-8
|
27
25
|
Transfer-Encoding:
|
28
26
|
- chunked
|
29
|
-
|
30
|
-
-
|
31
|
-
|
32
|
-
-
|
27
|
+
Connection:
|
28
|
+
- keep-alive
|
29
|
+
Server:
|
30
|
+
- Cowboy
|
31
|
+
X-Frame-Options:
|
32
|
+
- DENY
|
33
|
+
X-Xss-Protection:
|
34
|
+
- 1; mode=block
|
35
|
+
X-Content-Type-Options:
|
36
|
+
- nosniff
|
37
|
+
X-Download-Options:
|
38
|
+
- noopen
|
39
|
+
X-Permitted-Cross-Domain-Policies:
|
40
|
+
- none
|
41
|
+
Referrer-Policy:
|
42
|
+
- strict-origin-when-cross-origin
|
43
|
+
Expect-Ct:
|
44
|
+
- max-age=0, report-uri="https://boletosimples.report-uri.com/r/d/ct/reportOnly"
|
45
|
+
Cross-Origin-Resource-Policy:
|
46
|
+
- cross-origin
|
47
|
+
Cross-Origin-Embedder-Policy:
|
48
|
+
- unsafe-none
|
49
|
+
Cross-Origin-Opener-Policy:
|
50
|
+
- unsafe-none
|
51
|
+
Per-Page:
|
52
|
+
- '50'
|
53
|
+
Page:
|
54
|
+
- ''
|
33
55
|
X-Ratelimit-Limit:
|
34
|
-
- '
|
35
|
-
Date:
|
36
|
-
- Mon, 24 Aug 2015 18:19:42 GMT
|
37
|
-
Strict-Transport-Security:
|
38
|
-
- max-age=2592000
|
56
|
+
- '100'
|
39
57
|
X-Ratelimit-Remaining:
|
40
|
-
- '
|
41
|
-
Vary:
|
42
|
-
- Accept-Encoding
|
43
|
-
X-Request-Id:
|
44
|
-
- 87f24b72-4d2c-4d34-a42c-96da07bdeb9c
|
45
|
-
Total:
|
46
|
-
- '1'
|
58
|
+
- '57'
|
47
59
|
Etag:
|
48
|
-
- W/"
|
60
|
+
- W/"79dff2ec4de21708e6553fcf54b023e6"
|
61
|
+
Cache-Control:
|
62
|
+
- must-revalidate, private, max-age=0
|
63
|
+
X-Request-Id:
|
64
|
+
- 76175411-ff4a-4d90-bc79-c018df2feb13
|
49
65
|
X-Runtime:
|
50
|
-
- '0.
|
66
|
+
- '0.025149'
|
67
|
+
Date:
|
68
|
+
- Tue, 22 Feb 2022 17:30:43 GMT
|
51
69
|
X-Rack-Cache:
|
52
70
|
- miss
|
53
|
-
|
54
|
-
-
|
55
|
-
|
56
|
-
-
|
71
|
+
Strict-Transport-Security:
|
72
|
+
- max-age=31556952; includeSubDomains; preload
|
73
|
+
Vary:
|
74
|
+
- Origin,Accept-Encoding
|
75
|
+
X-Rack-Cors:
|
76
|
+
- miss; no-origin
|
57
77
|
Via:
|
58
|
-
- 1.1 vegur
|
78
|
+
- 1.1 vegur, 1.1 022bce4b6ed717be65317e9e6e08b754.cloudfront.net (CloudFront)
|
79
|
+
X-Cache:
|
80
|
+
- Miss from cloudfront
|
81
|
+
X-Amz-Cf-Pop:
|
82
|
+
- MIA3-C1
|
83
|
+
X-Amz-Cf-Id:
|
84
|
+
- gLqN-YoNSOEOrYRZKcMpeSbBECprSOcJgEDWEzh33cuQuUUrwQHRHg==
|
59
85
|
body:
|
60
86
|
encoding: UTF-8
|
61
|
-
string: '[{"id":
|
62
|
-
|
63
|
-
|
64
|
-
recorded_with: VCR 2.9.3
|
87
|
+
string: '[{"id":1941,"url":"https://iagro.herokuapp.com/callbacks/boletosimples","content_type":"application/json","events":["bank_billet.*"],"ssl_verification_enabled":true,"active":true,"secret_key":"fa0bcbf2929b402fd485b9150b1cabfede36b9817ffc00512b8b32f75e2919cf","bank_billet_account_id":659,"concurrency_limit":10},{"id":53,"url":"http://requestb.in/1gsu9nc1","content_type":"application/json","events":["*"],"ssl_verification_enabled":true,"active":true,"secret_key":"17ac7d44600e4a09388f81c3f9ed21926a70f562dd31c7a70e58aced4719fe1e","bank_billet_account_id":659,"concurrency_limit":10}]'
|
88
|
+
recorded_at: Tue, 22 Feb 2022 17:30:43 GMT
|
89
|
+
recorded_with: VCR 6.0.0
|