boletosimples 0.4.2 → 1.0.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (132) hide show
  1. checksums.yaml +5 -5
  2. data/CHANGELOG.md +9 -17
  3. data/README.md +14 -54
  4. data/lib/boletosimples.rb +9 -6
  5. data/lib/boletosimples/configuration.rb +19 -28
  6. data/lib/boletosimples/last_request.rb +12 -9
  7. data/lib/boletosimples/middlewares/bearer.rb +12 -0
  8. data/lib/boletosimples/middlewares/debug.rb +30 -0
  9. data/lib/boletosimples/middlewares/last_request.rb +3 -1
  10. data/lib/boletosimples/middlewares/raise_error.rb +9 -2
  11. data/lib/boletosimples/middlewares/user_agent.rb +3 -1
  12. data/lib/boletosimples/resources/bank_billet.rb +5 -11
  13. data/lib/boletosimples/resources/bank_billet_account.rb +3 -1
  14. data/lib/boletosimples/resources/bank_billet_discharge.rb +6 -0
  15. data/lib/boletosimples/resources/bank_billet_payment.rb +6 -0
  16. data/lib/boletosimples/resources/bank_billet_remittance.rb +6 -0
  17. data/lib/boletosimples/resources/base_model.rb +3 -1
  18. data/lib/boletosimples/resources/customer.rb +3 -1
  19. data/lib/boletosimples/resources/customer_import.rb +5 -3
  20. data/lib/boletosimples/resources/customer_subscription.rb +3 -10
  21. data/lib/boletosimples/resources/customer_subscription_import.rb +5 -3
  22. data/lib/boletosimples/resources/discharge.rb +4 -11
  23. data/lib/boletosimples/resources/email_delivery.rb +6 -0
  24. data/lib/boletosimples/resources/event.rb +3 -1
  25. data/lib/boletosimples/resources/installment.rb +3 -1
  26. data/lib/boletosimples/resources/remittance.rb +3 -1
  27. data/lib/boletosimples/resources/sms_delivery.rb +6 -0
  28. data/lib/boletosimples/resources/transaction.rb +3 -1
  29. data/lib/boletosimples/resources/webhook.rb +3 -1
  30. data/lib/boletosimples/resources/webhook_delivery.rb +3 -1
  31. data/lib/boletosimples/response_error.rb +8 -3
  32. data/lib/boletosimples/version.rb +3 -1
  33. data/spec/boletosimples/configuration_spec.rb +71 -99
  34. data/spec/boletosimples/last_request_spec.rb +16 -28
  35. data/spec/boletosimples/resources/bank_billet_account_spec.rb +57 -33
  36. data/spec/boletosimples/resources/bank_billet_discharge_spec.rb +12 -0
  37. data/spec/boletosimples/resources/bank_billet_payment_spec.rb +12 -0
  38. data/spec/boletosimples/resources/bank_billet_remittance_spec.rb +12 -0
  39. data/spec/boletosimples/resources/bank_billet_spec.rb +56 -42
  40. data/spec/boletosimples/resources/customer_import_spec.rb +41 -30
  41. data/spec/boletosimples/resources/customer_spec.rb +52 -39
  42. data/spec/boletosimples/resources/customer_subscription_import_spec.rb +41 -30
  43. data/spec/boletosimples/resources/customer_subscription_spec.rb +61 -33
  44. data/spec/boletosimples/resources/discharge_spec.rb +64 -11
  45. data/spec/boletosimples/resources/email_delivery_spec.rb +12 -0
  46. data/spec/boletosimples/resources/event_spec.rb +7 -12
  47. data/spec/boletosimples/resources/installment_spec.rb +61 -32
  48. data/spec/boletosimples/resources/remittance_spec.rb +7 -12
  49. data/spec/boletosimples/resources/sms_delivery_spec.rb +12 -0
  50. data/spec/boletosimples/resources/transactions_spec.rb +7 -12
  51. data/spec/boletosimples/resources/webhook_delivery_spec.rb +7 -12
  52. data/spec/boletosimples/resources/webhook_spec.rb +7 -12
  53. data/spec/fixtures/discharge.RET +3 -0
  54. data/spec/fixtures/vcr_cassettes/last_request/bank_billets.yml +536 -88
  55. data/spec/fixtures/vcr_cassettes/resources/bank_billet/all.yml +537 -91
  56. data/spec/fixtures/vcr_cassettes/resources/bank_billet/cancel/success.yml +34 -92
  57. data/spec/fixtures/vcr_cassettes/resources/bank_billet/create/invalid_params.yml +32 -20
  58. data/spec/fixtures/vcr_cassettes/resources/bank_billet/create/invalid_root.yml +28 -17
  59. data/spec/fixtures/vcr_cassettes/resources/bank_billet/create/valid.yml +43 -27
  60. data/spec/fixtures/vcr_cassettes/resources/bank_billet/duplicate/success.yml +83 -0
  61. data/spec/fixtures/vcr_cassettes/resources/bank_billet/find.yml +51 -27
  62. data/spec/fixtures/vcr_cassettes/resources/bank_billet_account/all.yml +131 -20
  63. data/spec/fixtures/vcr_cassettes/resources/bank_billet_account/create/invalid_params.yml +34 -20
  64. data/spec/fixtures/vcr_cassettes/resources/bank_billet_account/create/invalid_root.yml +30 -19
  65. data/spec/fixtures/vcr_cassettes/resources/bank_billet_account/create/valid.yml +41 -21
  66. data/spec/fixtures/vcr_cassettes/resources/bank_billet_account/find.yml +38 -18
  67. data/spec/fixtures/vcr_cassettes/resources/bank_billet_discharge/all.yml +97 -0
  68. data/spec/fixtures/vcr_cassettes/resources/bank_billet_payment/all.yml +75 -0
  69. data/spec/fixtures/vcr_cassettes/resources/bank_billet_remittance/all.yml +126 -0
  70. data/spec/fixtures/vcr_cassettes/resources/customer/all.yml +79 -32
  71. data/spec/fixtures/vcr_cassettes/resources/customer/create/invalid_params.yml +30 -17
  72. data/spec/fixtures/vcr_cassettes/resources/customer/create/invalid_root.yml +28 -17
  73. data/spec/fixtures/vcr_cassettes/resources/customer/create/valid.yml +33 -21
  74. data/spec/fixtures/vcr_cassettes/resources/customer/find.yml +33 -19
  75. data/spec/fixtures/vcr_cassettes/resources/customer_import/all.yml +43 -60
  76. data/spec/fixtures/vcr_cassettes/resources/customer_import/create/invalid_params.yml +37 -51
  77. data/spec/fixtures/vcr_cassettes/resources/customer_import/create/invalid_root.yml +38 -52
  78. data/spec/fixtures/vcr_cassettes/resources/customer_import/create/valid.yml +43 -68
  79. data/spec/fixtures/vcr_cassettes/resources/customer_import/find.yml +40 -54
  80. data/spec/fixtures/vcr_cassettes/resources/customer_subscription/all.yml +102 -52
  81. data/spec/fixtures/vcr_cassettes/resources/customer_subscription/create/invalid_params.yml +40 -50
  82. data/spec/fixtures/vcr_cassettes/resources/customer_subscription/create/invalid_root.yml +36 -48
  83. data/spec/fixtures/vcr_cassettes/resources/customer_subscription/create/valid.yml +48 -53
  84. data/spec/fixtures/vcr_cassettes/resources/customer_subscription/find.yml +44 -50
  85. data/spec/fixtures/vcr_cassettes/resources/customer_subscription/next_charge.yml +45 -133
  86. data/spec/fixtures/vcr_cassettes/resources/customer_subscription_import/all.yml +44 -55
  87. data/spec/fixtures/vcr_cassettes/resources/customer_subscription_import/create/invalid_params.yml +37 -52
  88. data/spec/fixtures/vcr_cassettes/resources/customer_subscription_import/create/invalid_root.yml +39 -53
  89. data/spec/fixtures/vcr_cassettes/resources/customer_subscription_import/create/valid.yml +43 -70
  90. data/spec/fixtures/vcr_cassettes/resources/customer_subscription_import/find.yml +40 -55
  91. data/spec/fixtures/vcr_cassettes/resources/discharge/all.yml +64 -33
  92. data/spec/fixtures/vcr_cassettes/resources/discharge/create/invalid_params.yml +70 -0
  93. data/spec/fixtures/vcr_cassettes/resources/discharge/create/invalid_root.yml +69 -0
  94. data/spec/fixtures/vcr_cassettes/resources/discharge/create/valid.yml +84 -0
  95. data/spec/fixtures/vcr_cassettes/resources/discharge/find.yml +71 -0
  96. data/spec/fixtures/vcr_cassettes/resources/email_delivery/all.yml +73 -0
  97. data/spec/fixtures/vcr_cassettes/resources/event/all.yml +490 -166
  98. data/spec/fixtures/vcr_cassettes/resources/installment/all.yml +418 -52
  99. data/spec/fixtures/vcr_cassettes/resources/installment/create/invalid_params.yml +41 -52
  100. data/spec/fixtures/vcr_cassettes/resources/installment/create/invalid_root.yml +36 -48
  101. data/spec/fixtures/vcr_cassettes/resources/installment/create/valid.yml +48 -53
  102. data/spec/fixtures/vcr_cassettes/resources/installment/find.yml +44 -52
  103. data/spec/fixtures/vcr_cassettes/resources/remittance/all.yml +53 -33
  104. data/spec/fixtures/vcr_cassettes/resources/sns_delivery/all.yml +73 -0
  105. data/spec/fixtures/vcr_cassettes/resources/transaction/all.yml +34 -22
  106. data/spec/fixtures/vcr_cassettes/resources/web_hook/all.yml +42 -33
  107. data/spec/fixtures/vcr_cassettes/resources/webhook_delivery/all.yml +1232 -54
  108. data/spec/spec_helper.rb +3 -20
  109. data/spec/support/stub_env.rb +7 -0
  110. data/spec/support/vcr.rb +3 -4
  111. metadata +120 -55
  112. data/.coveralls.yml +0 -2
  113. data/.gitignore +0 -19
  114. data/.ruby-gemset +0 -1
  115. data/.ruby-version +0 -1
  116. data/.travis.yml +0 -12
  117. data/Gemfile +0 -4
  118. data/Rakefile +0 -6
  119. data/boletosimples.gemspec +0 -38
  120. data/lib/boletosimples/extra.rb +0 -8
  121. data/lib/boletosimples/resources/partner/user.rb +0 -7
  122. data/lib/oauth2_patch.rb +0 -24
  123. data/spec/boletosimples/extra_spec.rb +0 -31
  124. data/spec/boletosimples/resources/partner/user_spec.rb +0 -19
  125. data/spec/fixtures/vcr_cassettes/configuration/client_credentials/invalid.yml +0 -64
  126. data/spec/fixtures/vcr_cassettes/configuration/client_credentials/valid.yml +0 -56
  127. data/spec/fixtures/vcr_cassettes/extra/userinfo/authenticated.yml +0 -58
  128. data/spec/fixtures/vcr_cassettes/extra/userinfo/not_authenticated.yml +0 -54
  129. data/spec/fixtures/vcr_cassettes/last_request/userinfo.yml +0 -58
  130. data/spec/fixtures/vcr_cassettes/resources/bank_billet/cancel/failure.yml +0 -118
  131. data/spec/fixtures/vcr_cassettes/resources/partner/user/create.yml +0 -60
  132. data/spec/spec.opts +0 -8
@@ -1,125 +1,67 @@
1
1
  ---
2
2
  http_interactions:
3
- - request:
4
- method: get
5
- uri: https://sandbox.boletosimples.com.br/api/v1/bank_billets/851?access_token=BOLETOSIMPLES_ACCESS_TOKEN
6
- body:
7
- encoding: US-ASCII
8
- string: ''
9
- headers:
10
- User-Agent:
11
- - BoletoSimples Ruby Client v0.1.0 (contato@boletosimples.com.br)
12
- Authorization:
13
- - Token token="BOLETOSIMPLES_ACCESS_TOKEN"
14
- Accept-Encoding:
15
- - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
16
- Accept:
17
- - "*/*"
18
- response:
19
- status:
20
- code: 200
21
- message: OK
22
- headers:
23
- Server:
24
- - Cowboy
25
- Connection:
26
- - keep-alive
27
- Strict-Transport-Security:
28
- - max-age=2592000
29
- Content-Type:
30
- - application/json; charset=utf-8
31
- X-Ratelimit-Limit:
32
- - '500'
33
- X-Ratelimit-Remaining:
34
- - '462'
35
- Etag:
36
- - W/"3e63641eb9f541ffab79e1d13c250890"
37
- Cache-Control:
38
- - must-revalidate, private, max-age=0
39
- X-Request-Id:
40
- - 459acce4-87bb-45e0-ba2b-4126250e7b48
41
- X-Runtime:
42
- - '0.041686'
43
- Date:
44
- - Sun, 08 Mar 2015 19:55:37 GMT
45
- X-Rack-Cache:
46
- - miss
47
- Vary:
48
- - Accept-Encoding
49
- Transfer-Encoding:
50
- - chunked
51
- Via:
52
- - 1.1 vegur
53
- body:
54
- encoding: UTF-8
55
- string: '{"id":851,"expire_at":"2014-01-01","paid_at":null,"description":"Despesas
56
- do contrato 0012","status":"opened","shorten_url":"http://staging.bole.to/nirjavew","customer_person_type":"individual","customer_person_name":"Joao
57
- da Silva","customer_cnpj_cpf":"012.345.678-90","customer_address":"Rua quinhentos","customer_state":"RJ","customer_neighborhood":"Sao
58
- Francisco","customer_zipcode":"12312-123","customer_address_number":"111","customer_address_complement":"Sala
59
- 4","customer_phone_number":"2112123434","customer_email":"cliente@example.com","notification_url":"http://example.com.br/notify","send_email_on_creation":null,"created_via_api":true,"customer_city_name":"Rio
60
- de Janeiro","paid_amount":0.0,"amount":9.01}'
61
- http_version:
62
- recorded_at: Sun, 08 Mar 2015 19:55:36 GMT
63
3
  - request:
64
4
  method: put
65
- uri: https://sandbox.boletosimples.com.br/api/v1/bank_billets/851/cancel?access_token=BOLETOSIMPLES_ACCESS_TOKEN
5
+ uri: https://sandbox.boletosimples.com.br/api/v1/bank_billets/382369/cancel
66
6
  body:
67
7
  encoding: UTF-8
68
- string: "{}"
8
+ string: '{"bank_billet":{"id":382369}}'
69
9
  headers:
70
10
  User-Agent:
71
- - BoletoSimples Ruby Client v0.1.0 (contato@boletosimples.com.br)
11
+ - email@minhaempresa.com.br
72
12
  Authorization:
73
- - Token token="BOLETOSIMPLES_ACCESS_TOKEN"
13
+ - Bearer BOLETOSIMPLES_API_TOKEN
74
14
  Content-Type:
75
15
  - application/json
16
+ Accept:
17
+ - application/json
76
18
  Accept-Encoding:
77
19
  - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
78
- Accept:
79
- - "*/*"
80
20
  response:
81
21
  status:
82
- code: 200
83
- message: OK
22
+ code: 204
23
+ message: No Content
84
24
  headers:
85
25
  Server:
86
26
  - Cowboy
27
+ Content-Length:
28
+ - '0'
87
29
  Connection:
88
30
  - keep-alive
89
- Strict-Transport-Security:
90
- - max-age=2592000
91
- Content-Type:
92
- - application/json; charset=utf-8
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
93
43
  X-Ratelimit-Limit:
94
- - '500'
44
+ - '1000'
95
45
  X-Ratelimit-Remaining:
96
- - '461'
97
- Etag:
98
- - W/"d7665b0a15eb03d124030c5f13771e4a"
46
+ - '992'
99
47
  Cache-Control:
100
- - max-age=0, private, must-revalidate
48
+ - no-cache
101
49
  X-Request-Id:
102
- - 7773008b-3423-4038-a157-100679061d62
50
+ - 98887c96-4671-4127-a41f-2aa02a5f03c8
103
51
  X-Runtime:
104
- - '0.185339'
52
+ - '0.152161'
105
53
  Date:
106
- - Sun, 08 Mar 2015 19:55:38 GMT
54
+ - Tue, 13 Apr 2021 17:18:32 GMT
107
55
  X-Rack-Cache:
108
56
  - invalidate, pass
57
+ Strict-Transport-Security:
58
+ - max-age=2629746
109
59
  Vary:
110
- - Accept-Encoding
111
- Transfer-Encoding:
112
- - chunked
60
+ - Origin
113
61
  Via:
114
62
  - 1.1 vegur
115
63
  body:
116
64
  encoding: UTF-8
117
- string: '{"id":851,"expire_at":"2014-01-01","paid_at":null,"description":"Despesas
118
- do contrato 0012","status":"canceled","shorten_url":"http://staging.bole.to/nirjavew","customer_person_type":"individual","customer_person_name":"Joao
119
- da Silva","customer_cnpj_cpf":"012.345.678-90","customer_address":"Rua quinhentos","customer_state":"RJ","customer_neighborhood":"Sao
120
- Francisco","customer_zipcode":"12312-123","customer_address_number":"111","customer_address_complement":"Sala
121
- 4","customer_phone_number":"2112123434","customer_email":"cliente@example.com","notification_url":"http://example.com.br/notify","send_email_on_creation":null,"created_via_api":true,"customer_city_name":"Rio
122
- de Janeiro","paid_amount":0.0,"amount":9.01}'
123
- http_version:
124
- recorded_at: Sun, 08 Mar 2015 19:55:37 GMT
125
- recorded_with: VCR 2.9.3
65
+ string: ''
66
+ recorded_at: Tue, 13 Apr 2021 17:18:32 GMT
67
+ recorded_with: VCR 6.0.0
@@ -2,21 +2,21 @@
2
2
  http_interactions:
3
3
  - request:
4
4
  method: post
5
- uri: https://sandbox.boletosimples.com.br/api/v1/bank_billets?access_token=BOLETOSIMPLES_ACCESS_TOKEN
5
+ uri: https://sandbox.boletosimples.com.br/api/v1/bank_billets
6
6
  body:
7
7
  encoding: UTF-8
8
8
  string: '{"bank_billet":{"amount":9.1}}'
9
9
  headers:
10
10
  User-Agent:
11
- - BoletoSimples Ruby Client v0.1.0 (contato@boletosimples.com.br)
11
+ - email@minhaempresa.com.br
12
12
  Authorization:
13
- - Token token="BOLETOSIMPLES_ACCESS_TOKEN"
13
+ - Bearer BOLETOSIMPLES_API_TOKEN
14
14
  Content-Type:
15
15
  - application/json
16
+ Accept:
17
+ - application/json
16
18
  Accept-Encoding:
17
19
  - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
18
- Accept:
19
- - "*/*"
20
20
  response:
21
21
  status:
22
22
  code: 422
@@ -26,36 +26,48 @@ http_interactions:
26
26
  - Cowboy
27
27
  Connection:
28
28
  - keep-alive
29
- Strict-Transport-Security:
30
- - max-age=2592000
29
+ X-Frame-Options:
30
+ - DENY
31
+ X-Xss-Protection:
32
+ - 1; mode=block
33
+ X-Content-Type-Options:
34
+ - nosniff
35
+ X-Download-Options:
36
+ - noopen
37
+ X-Permitted-Cross-Domain-Policies:
38
+ - none
39
+ Referrer-Policy:
40
+ - strict-origin-when-cross-origin
31
41
  Content-Type:
32
42
  - application/json; charset=utf-8
33
43
  X-Ratelimit-Limit:
34
- - '500'
44
+ - '1000'
35
45
  X-Ratelimit-Remaining:
36
- - '464'
46
+ - '991'
37
47
  Cache-Control:
38
48
  - no-cache
39
49
  X-Request-Id:
40
- - 06416084-e98b-4810-b538-e23526138773
50
+ - ce5fa906-d46d-47d9-ae93-aadfb66e3b39
41
51
  X-Runtime:
42
- - '0.122267'
52
+ - '0.054244'
43
53
  Date:
44
- - Sun, 08 Mar 2015 19:55:34 GMT
54
+ - Tue, 13 Apr 2021 17:18:33 GMT
45
55
  X-Rack-Cache:
46
56
  - invalidate, pass
57
+ Strict-Transport-Security:
58
+ - max-age=2629746
47
59
  Vary:
48
- - Accept-Encoding
60
+ - Origin,Accept-Encoding
49
61
  Transfer-Encoding:
50
62
  - chunked
51
63
  Via:
52
64
  - 1.1 vegur
53
65
  body:
54
66
  encoding: UTF-8
55
- string: '{"errors":{"expire_at":["não pode ficar em branco","não é uma data
56
- válida"],"customer_person_name":["não pode ficar em branco"],"customer_cnpj_cpf":["não
57
- pode ficar em branco"],"description":["não pode ficar em branco"],"customer_zipcode":["não
58
- pode ficar em branco"]}}'
59
- http_version:
60
- recorded_at: Sun, 08 Mar 2015 19:55:34 GMT
61
- recorded_with: VCR 2.9.3
67
+ string: '{"errors":{"customer_person_name":["não pode ficar em branco"],"customer_cnpj_cpf":["não
68
+ pode ficar em branco"],"customer_zipcode":["não pode ficar em branco"],"expire_at":["não
69
+ pode ficar em branco","não é uma data válida"],"customer_address":["não pode
70
+ ficar em branco"],"customer_neighborhood":["não pode ficar em branco"],"customer_city_name":["não
71
+ pode ficar em branco"],"customer_state":["não está incluído na lista"]}}'
72
+ recorded_at: Tue, 13 Apr 2021 17:18:33 GMT
73
+ recorded_with: VCR 6.0.0
@@ -2,21 +2,21 @@
2
2
  http_interactions:
3
3
  - request:
4
4
  method: post
5
- uri: https://sandbox.boletosimples.com.br/api/v1/bank_billets?access_token=BOLETOSIMPLES_ACCESS_TOKEN
5
+ uri: https://sandbox.boletosimples.com.br/api/v1/bank_billets
6
6
  body:
7
7
  encoding: UTF-8
8
8
  string: '{"bank_billet":{}}'
9
9
  headers:
10
10
  User-Agent:
11
- - BoletoSimples Ruby Client v0.1.0 (contato@boletosimples.com.br)
11
+ - email@minhaempresa.com.br
12
12
  Authorization:
13
- - Token token="BOLETOSIMPLES_ACCESS_TOKEN"
13
+ - Bearer BOLETOSIMPLES_API_TOKEN
14
14
  Content-Type:
15
15
  - application/json
16
+ Accept:
17
+ - application/json
16
18
  Accept-Encoding:
17
19
  - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
18
- Accept:
19
- - "*/*"
20
20
  response:
21
21
  status:
22
22
  code: 422
@@ -26,33 +26,44 @@ http_interactions:
26
26
  - Cowboy
27
27
  Connection:
28
28
  - keep-alive
29
- Strict-Transport-Security:
30
- - max-age=2592000
29
+ X-Frame-Options:
30
+ - DENY
31
+ X-Xss-Protection:
32
+ - 1; mode=block
33
+ X-Content-Type-Options:
34
+ - nosniff
35
+ X-Download-Options:
36
+ - noopen
37
+ X-Permitted-Cross-Domain-Policies:
38
+ - none
39
+ Referrer-Policy:
40
+ - strict-origin-when-cross-origin
31
41
  Content-Type:
32
42
  - application/json; charset=utf-8
33
43
  X-Ratelimit-Limit:
34
- - '500'
44
+ - '1000'
35
45
  X-Ratelimit-Remaining:
36
- - '465'
46
+ - '990'
37
47
  Cache-Control:
38
48
  - no-cache
39
49
  X-Request-Id:
40
- - 9960d0bb-e798-4a31-801c-eddbd2cd3afc
50
+ - 9661fa3c-f0bd-4b8f-af56-c27947e50984
41
51
  X-Runtime:
42
- - '0.058479'
52
+ - '0.025355'
43
53
  Date:
44
- - Sun, 08 Mar 2015 19:55:33 GMT
54
+ - Tue, 13 Apr 2021 17:18:34 GMT
45
55
  X-Rack-Cache:
46
56
  - invalidate, pass
57
+ Strict-Transport-Security:
58
+ - max-age=2629746
47
59
  Vary:
48
- - Accept-Encoding
60
+ - Origin,Accept-Encoding
49
61
  Transfer-Encoding:
50
62
  - chunked
51
63
  Via:
52
64
  - 1.1 vegur
53
65
  body:
54
66
  encoding: UTF-8
55
- string: '{"errors":{"bank_billet":["não pode ficar em branco"]}}'
56
- http_version:
57
- recorded_at: Sun, 08 Mar 2015 19:55:33 GMT
58
- recorded_with: VCR 2.9.3
67
+ string: '{"errors":[{"title":"bank_billet não pode ficar em branco","status":422,"code":422}]}'
68
+ recorded_at: Tue, 13 Apr 2021 17:18:34 GMT
69
+ recorded_with: VCR 6.0.0
@@ -2,24 +2,24 @@
2
2
  http_interactions:
3
3
  - request:
4
4
  method: post
5
- uri: https://sandbox.boletosimples.com.br/api/v1/bank_billets?access_token=BOLETOSIMPLES_ACCESS_TOKEN
5
+ uri: https://sandbox.boletosimples.com.br/api/v1/bank_billets
6
6
  body:
7
7
  encoding: UTF-8
8
- string: '{"bank_billet":{"amount":9.01,"description":"Despesas do contrato 0012","expire_at":"2014-01-01","customer_address":"Rua
8
+ string: '{"bank_billet":{"amount":9.01,"description":"Despesas do contrato 0012","expire_at":"2022-01-01","customer_address":"Rua
9
9
  quinhentos","customer_address_complement":"Sala 4","customer_address_number":"111","customer_city_name":"Rio
10
- de Janeiro","customer_cnpj_cpf":"012.345.678-90","customer_email":"cliente@example.com","customer_neighborhood":"Sao
11
- Francisco","customer_person_name":"Joao da Silva","customer_person_type":"individual","customer_phone_number":"2112123434","customer_state":"RJ","customer_zipcode":"12312-123","notification_url":"http://example.com.br/notify"}}'
10
+ de Janeiro","customer_cnpj_cpf":"34.565.715/0001-03","customer_email":"cliente@example.com","customer_neighborhood":"Sao
11
+ Francisco","customer_person_name":"Joao da Silva","customer_person_type":"individual","customer_phone_number":"2112123434","customer_state":"RJ","customer_zipcode":"12312-123"}}'
12
12
  headers:
13
13
  User-Agent:
14
- - BoletoSimples Ruby Client v0.1.0 (contato@boletosimples.com.br)
14
+ - email@minhaempresa.com.br
15
15
  Authorization:
16
- - Token token="BOLETOSIMPLES_ACCESS_TOKEN"
16
+ - Bearer BOLETOSIMPLES_API_TOKEN
17
17
  Content-Type:
18
18
  - application/json
19
+ Accept:
20
+ - application/json
19
21
  Accept-Encoding:
20
22
  - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
21
- Accept:
22
- - "*/*"
23
23
  response:
24
24
  status:
25
25
  code: 201
@@ -29,42 +29,58 @@ http_interactions:
29
29
  - Cowboy
30
30
  Connection:
31
31
  - keep-alive
32
- Strict-Transport-Security:
33
- - max-age=2592000
32
+ X-Frame-Options:
33
+ - DENY
34
+ X-Xss-Protection:
35
+ - 1; mode=block
36
+ X-Content-Type-Options:
37
+ - nosniff
38
+ X-Download-Options:
39
+ - noopen
40
+ X-Permitted-Cross-Domain-Policies:
41
+ - none
42
+ Referrer-Policy:
43
+ - strict-origin-when-cross-origin
34
44
  Location:
35
- - https://sandbox.boletosimples.com.br/api/v1/bank_billets/851
45
+ - https://sandbox.boletosimples.com.br/api/v1/bank_billets/382369
36
46
  Content-Type:
37
47
  - application/json; charset=utf-8
38
48
  X-Ratelimit-Limit:
39
- - '500'
49
+ - '1000'
40
50
  X-Ratelimit-Remaining:
41
- - '466'
51
+ - '993'
42
52
  Etag:
43
- - W/"041ade0c7ea0750fb941604dfe6bf868"
53
+ - W/"bd19073eed4ab3aeb15a251e5af870ee"
44
54
  Cache-Control:
45
55
  - max-age=0, private, must-revalidate
46
56
  X-Request-Id:
47
- - 5af00da9-557a-4907-a3fb-f1ed7a5b970e
57
+ - 044c4197-9bfe-488e-bed4-752bb520bda8
48
58
  X-Runtime:
49
- - '0.225879'
59
+ - '0.300482'
50
60
  Date:
51
- - Sun, 08 Mar 2015 19:55:32 GMT
61
+ - Tue, 13 Apr 2021 17:18:30 GMT
52
62
  X-Rack-Cache:
53
63
  - invalidate, pass
64
+ Strict-Transport-Security:
65
+ - max-age=2629746
54
66
  Vary:
55
- - Accept-Encoding
67
+ - Origin,Accept-Encoding
56
68
  Transfer-Encoding:
57
69
  - chunked
58
70
  Via:
59
71
  - 1.1 vegur
60
72
  body:
61
73
  encoding: UTF-8
62
- string: '{"id":851,"expire_at":"2014-01-01","paid_at":null,"description":"Despesas
63
- do contrato 0012","status":"generating","shorten_url":null,"customer_person_type":"individual","customer_person_name":"Joao
64
- da Silva","customer_cnpj_cpf":"012.345.678-90","customer_address":"Rua quinhentos","customer_state":"RJ","customer_neighborhood":"Sao
65
- Francisco","customer_zipcode":"12312-123","customer_address_number":"111","customer_address_complement":"Sala
66
- 4","customer_phone_number":"2112123434","customer_email":"cliente@example.com","notification_url":"http://example.com.br/notify","send_email_on_creation":null,"created_via_api":true,"customer_city_name":"Rio
67
- de Janeiro","paid_amount":0.0,"amount":9.01}'
68
- http_version:
69
- recorded_at: Sun, 08 Mar 2015 19:55:32 GMT
70
- recorded_with: VCR 2.9.3
74
+ string: '{"id":382369,"expire_at":"2022-01-03","paid_at":null,"description":"Despesas
75
+ do contrato 0012","status":"generating","shorten_url":"https://sandbox.bole.to/3/ojkxyw","customer_person_name":"Joao
76
+ da Silva","customer_cnpj_cpf":"34.565.715/0001-03","customer_address":"Rua
77
+ quinhentos","customer_state":"RJ","customer_neighborhood":"Sao Francisco","customer_zipcode":"12312123","customer_address_number":"111","customer_address_complement":"Sala
78
+ 4","customer_phone_number":"2112123434","customer_email":"cliente@example.com","customer_email_cc":null,"customer_ignore_email":null,"customer_mobile_local_code":null,"customer_mobile_number":null,"customer_nickname":null,"customer_notes":null,"created_via_api":true,"customer_city_name":"Rio
79
+ de Janeiro","paid_amount":0.0,"amount":9.01,"url":"https://sandbox.bole.to/3/ojkxyw","formats":{"default":"https://sandbox.bole.to/3/ojkxyw","png":"https://sandbox.bole.to/3/ojkxyw.png?r=1618334310","pdf":"https://sandbox.bole.to/3/ojkxyw.pdf?r=1618334310","boleto_hibrido":"https://sandbox.bole.to/3/ojkxyw/boleto_hibrido?r=1618334310","boleto_pix":"https://sandbox.bole.to/3/ojkxyw/boleto_pix?r=1618334310","barcode":"https://sandbox.bole.to/3/ojkxyw/barcode","envelope":"https://sandbox.bole.to/3/ojkxyw/envelope","letter":"https://sandbox.bole.to/3/ojkxyw/letter","line":"https://sandbox.bole.to/3/ojkxyw/line","recibo":"https://sandbox.bole.to/3/ojkxyw/recibo"},"meta":null,"fine_for_delay":null,"fine_type":0,"fine_percentage":null,"fine_value":null,"days_for_fine":null,"late_payment_interest":null,"interest_type":0,"interest_daily_value":null,"interest_daily_percentage":null,"interest_monthly_percentage":null,"days_for_interest":null,"discount_type":0,"discount_limit_date":null,"discount_value":null,"discount_percentage":null,"days_for_revoke":null,"notes":null,"payment_count":1,"bank_billet_account_id":3547,"beneficiary_name":"J
80
+ Calçados","beneficiary_cnpj_cpf":"74.766.527/0001-68","beneficiary_address":"Praça
81
+ dos Três Poderes, 171, - Zona Cívico-Administrativa, Brasília - DF, 70165900","beneficiary_assignor_code":"2332
82
+ / 12312-0","guarantor_name":null,"guarantor_cnpj_cpf":null,"payment_place":"Pagável
83
+ em qualquer banco até a data de vencimento.","instructions":null,"document_date":null,"document_type":"02","document_number":null,"acceptance":"N","processed_our_number":"109/00000067-1","processed_our_number_raw":"109000000671","bank_contract_slug":"itau-bs-109","agency_number":"2332","agency_digit":"3","account_number":"12312","account_digit":"2","extra1":null,"extra1_digit":null,"extra2":null,"extra2_digit":null,"line":"34191.09008
84
+ 00006.712335 21231.200003 3 88540000000901","our_number":"00000067","customer_subscription_id":null,"installment_number":null,"installment_id":null,"carne_url":null,"bank_billet_layout_id":null,"created_at":"2021-04-13T14:18:30-03:00","updated_at":"2021-04-13T14:18:30-03:00","tags":[],"tag_list":"","document_type_label":"DM","addons":null,"ignore_email":false,"sue_code":null,"revoke_code":null,"first_instruction":null,"second_instruction":null,"guarantor_address_number":null,"guarantor_neighborhood":null,"guarantor_phone_number":null,"guarantor_city_name":null,"guarantor_state":null,"guarantor_zipcode":null,"guarantor_address":null,"guarantor_address_complement":null,"barcode":"34193885400000009011090000006712332123120000","registered_at":null,"prevent_registration":false,"customer_id":80707,"control_number":null,"divergent_payment_type":null,"divergent_payment_value_type":null,"divergent_payment_maximum_value":null,"divergent_payment_minimum_value":null,"divergent_payment_maximum_percentage":null,"divergent_payment_minimum_percentage":null,"divergent_payment_limit":null,"days_for_discount":null,"days_for_second_discount":null,"second_discount_percentage":null,"second_discount_value":null,"days_for_third_discount":null,"third_discount_percentage":null,"third_discount_value":null,"days_for_sue":null,"days_for_negativation":null,"interest_percentage":null,"interest_value":null,"interest_days_type":0,"customer_contact_person":null,"custom_attachment_name":null,"split_payment":false,"dispatch_type":1,"charge_type":1,"custom_data":null,"bank_billet_discharges":[],"bank_billet_remittances":[],"bank_billet_payments":[],"bank_billet_registrations":[],"bank_billet_split_accounts":[]}'
85
+ recorded_at: Tue, 13 Apr 2021 17:18:30 GMT
86
+ recorded_with: VCR 6.0.0
@@ -0,0 +1,83 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: post
5
+ uri: https://sandbox.boletosimples.com.br/api/v1/bank_billets/382369/duplicate
6
+ body:
7
+ encoding: UTF-8
8
+ string: '{"bank_billet":{"id":382369}}'
9
+ headers:
10
+ User-Agent:
11
+ - email@minhaempresa.com.br
12
+ Authorization:
13
+ - Bearer BOLETOSIMPLES_API_TOKEN
14
+ Content-Type:
15
+ - application/json
16
+ Accept:
17
+ - application/json
18
+ Accept-Encoding:
19
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
20
+ response:
21
+ status:
22
+ code: 201
23
+ message: Created
24
+ headers:
25
+ Server:
26
+ - Cowboy
27
+ Connection:
28
+ - keep-alive
29
+ X-Frame-Options:
30
+ - DENY
31
+ X-Xss-Protection:
32
+ - 1; mode=block
33
+ X-Content-Type-Options:
34
+ - nosniff
35
+ X-Download-Options:
36
+ - noopen
37
+ X-Permitted-Cross-Domain-Policies:
38
+ - none
39
+ Referrer-Policy:
40
+ - strict-origin-when-cross-origin
41
+ Location:
42
+ - https://sandbox.boletosimples.com.br/api/v1/bank_billets/382602
43
+ Content-Type:
44
+ - application/json; charset=utf-8
45
+ X-Ratelimit-Limit:
46
+ - '18000'
47
+ X-Ratelimit-Remaining:
48
+ - '17997'
49
+ Etag:
50
+ - W/"bb8f4b7fc0db6474494e528e349a34af"
51
+ Cache-Control:
52
+ - max-age=0, private, must-revalidate
53
+ X-Request-Id:
54
+ - 2d728ac3-6e78-40bd-93d9-205509507a89
55
+ X-Runtime:
56
+ - '0.858514'
57
+ Date:
58
+ - Tue, 13 Apr 2021 19:47:35 GMT
59
+ X-Rack-Cache:
60
+ - invalidate, pass
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: '{"id":382602,"expire_at":"2021-04-20","paid_at":null,"description":"Despesas
72
+ do contrato 0012","status":"generating","shorten_url":"https://sandbox.bole.to/3/vxomzq","customer_person_name":"Joao
73
+ da Silva","customer_cnpj_cpf":"34.565.715/0001-03","customer_address":"Rua
74
+ quinhentos","customer_state":"RJ","customer_neighborhood":"Sao Francisco","customer_zipcode":"12312123","customer_address_number":"111","customer_address_complement":"Sala
75
+ 4","customer_phone_number":"2112123434","customer_email":"cliente@example.com","customer_email_cc":null,"customer_ignore_email":null,"customer_mobile_local_code":null,"customer_mobile_number":null,"customer_nickname":null,"customer_notes":null,"created_via_api":false,"customer_city_name":"Rio
76
+ de Janeiro","paid_amount":0.0,"amount":9.01,"url":"https://sandbox.bole.to/3/vxomzq","formats":{"default":"https://sandbox.bole.to/3/vxomzq","png":"https://sandbox.bole.to/3/vxomzq.png?r=1618343254","pdf":"https://sandbox.bole.to/3/vxomzq.pdf?r=1618343254","boleto_hibrido":"https://sandbox.bole.to/3/vxomzq/boleto_hibrido?r=1618343254","boleto_pix":"https://sandbox.bole.to/3/vxomzq/boleto_pix?r=1618343254","barcode":"https://sandbox.bole.to/3/vxomzq/barcode","envelope":"https://sandbox.bole.to/3/vxomzq/envelope","letter":"https://sandbox.bole.to/3/vxomzq/letter","line":"https://sandbox.bole.to/3/vxomzq/line","recibo":"https://sandbox.bole.to/3/vxomzq/recibo"},"meta":null,"fine_for_delay":null,"fine_type":0,"fine_percentage":null,"fine_value":null,"days_for_fine":null,"late_payment_interest":null,"interest_type":0,"interest_daily_value":null,"interest_daily_percentage":null,"interest_monthly_percentage":null,"days_for_interest":null,"discount_type":0,"discount_limit_date":null,"discount_value":null,"discount_percentage":null,"days_for_revoke":null,"notes":null,"payment_count":1,"bank_billet_account_id":3547,"beneficiary_name":"J
77
+ Calçados","beneficiary_cnpj_cpf":"74.766.527/0001-68","beneficiary_address":"Praça
78
+ dos Três Poderes, 171, - Zona Cívico-Administrativa, Brasília - DF, 70165900","beneficiary_assignor_code":"2332
79
+ / 12312-0","guarantor_name":null,"guarantor_cnpj_cpf":null,"payment_place":"Pagável
80
+ em qualquer banco até a data de vencimento.","instructions":null,"document_date":null,"document_type":"02","document_number":null,"acceptance":"N","processed_our_number":"109/00000172-9","processed_our_number_raw":"109000001729","bank_contract_slug":"itau-bs-109","agency_number":"2332","agency_digit":"3","account_number":"12312","account_digit":"2","extra1":null,"extra1_digit":null,"extra2":null,"extra2_digit":null,"line":"34191.09008
81
+ 00017.292335 21231.200003 7 85960000000901","our_number":"00000172","customer_subscription_id":null,"installment_number":null,"installment_id":null,"carne_url":null,"bank_billet_layout_id":null,"created_at":"2021-04-13T16:47:34-03:00","updated_at":"2021-04-13T16:47:34-03:00","tags":[],"tag_list":"","document_type_label":"DM","addons":null,"ignore_email":false,"sue_code":null,"revoke_code":null,"first_instruction":null,"second_instruction":null,"guarantor_address_number":null,"guarantor_neighborhood":null,"guarantor_phone_number":null,"guarantor_city_name":null,"guarantor_state":null,"guarantor_zipcode":null,"guarantor_address":null,"guarantor_address_complement":null,"barcode":"34197859600000009011090000017292332123120000","registered_at":null,"prevent_registration":false,"customer_id":80707,"control_number":null,"divergent_payment_type":null,"divergent_payment_value_type":null,"divergent_payment_maximum_value":null,"divergent_payment_minimum_value":null,"divergent_payment_maximum_percentage":null,"divergent_payment_minimum_percentage":null,"divergent_payment_limit":null,"days_for_discount":null,"days_for_second_discount":null,"second_discount_percentage":null,"second_discount_value":null,"days_for_third_discount":null,"third_discount_percentage":null,"third_discount_value":null,"days_for_sue":null,"days_for_negativation":null,"interest_percentage":null,"interest_value":null,"interest_days_type":0,"customer_contact_person":null,"custom_attachment_name":null,"split_payment":false,"dispatch_type":1,"charge_type":1,"custom_data":null,"bank_billet_discharges":[],"bank_billet_remittances":[],"bank_billet_payments":[],"bank_billet_registrations":[],"bank_billet_split_accounts":[]}'
82
+ recorded_at: Tue, 13 Apr 2021 19:47:35 GMT
83
+ recorded_with: VCR 6.0.0