boletosimples 0.4.1 → 1.0.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (133) hide show
  1. checksums.yaml +5 -5
  2. data/CHANGELOG.md +6 -14
  3. data/README.md +12 -54
  4. data/lib/boletosimples.rb +10 -6
  5. data/lib/boletosimples/configuration.rb +18 -33
  6. data/lib/boletosimples/last_request.rb +12 -9
  7. data/lib/boletosimples/middlewares/bearer.rb +12 -0
  8. data/lib/boletosimples/middlewares/last_request.rb +3 -1
  9. data/lib/boletosimples/middlewares/raise_error.rb +9 -2
  10. data/lib/boletosimples/middlewares/user_agent.rb +3 -1
  11. data/lib/boletosimples/resources/bank_billet.rb +5 -11
  12. data/lib/boletosimples/resources/bank_billet_account.rb +3 -1
  13. data/lib/boletosimples/resources/bank_billet_discharge.rb +6 -0
  14. data/lib/boletosimples/resources/bank_billet_payment.rb +6 -0
  15. data/lib/boletosimples/resources/bank_billet_remittance.rb +6 -0
  16. data/lib/boletosimples/resources/base_model.rb +3 -1
  17. data/lib/boletosimples/resources/customer.rb +3 -1
  18. data/lib/boletosimples/resources/customer_import.rb +8 -0
  19. data/lib/boletosimples/resources/customer_subscription.rb +3 -10
  20. data/lib/boletosimples/resources/customer_subscription_import.rb +8 -0
  21. data/lib/boletosimples/resources/discharge.rb +4 -11
  22. data/lib/boletosimples/resources/email_delivery.rb +6 -0
  23. data/lib/boletosimples/resources/event.rb +3 -1
  24. data/lib/boletosimples/resources/installment.rb +3 -1
  25. data/lib/boletosimples/resources/remittance.rb +3 -1
  26. data/lib/boletosimples/resources/sms_delivery.rb +6 -0
  27. data/lib/boletosimples/resources/transaction.rb +3 -1
  28. data/lib/boletosimples/resources/webhook.rb +3 -1
  29. data/lib/boletosimples/resources/webhook_delivery.rb +3 -1
  30. data/lib/boletosimples/response_error.rb +8 -3
  31. data/lib/boletosimples/version.rb +3 -1
  32. data/spec/boletosimples/configuration_spec.rb +71 -83
  33. data/spec/boletosimples/last_request_spec.rb +16 -28
  34. data/spec/boletosimples/resources/bank_billet_account_spec.rb +57 -33
  35. data/spec/boletosimples/resources/bank_billet_discharge_spec.rb +12 -0
  36. data/spec/boletosimples/resources/bank_billet_payment_spec.rb +12 -0
  37. data/spec/boletosimples/resources/bank_billet_remittance_spec.rb +12 -0
  38. data/spec/boletosimples/resources/bank_billet_spec.rb +56 -42
  39. data/spec/boletosimples/resources/customer_import_spec.rb +67 -0
  40. data/spec/boletosimples/resources/customer_spec.rb +52 -39
  41. data/spec/boletosimples/resources/customer_subscription_import_spec.rb +67 -0
  42. data/spec/boletosimples/resources/customer_subscription_spec.rb +61 -33
  43. data/spec/boletosimples/resources/discharge_spec.rb +64 -11
  44. data/spec/boletosimples/resources/email_delivery_spec.rb +12 -0
  45. data/spec/boletosimples/resources/event_spec.rb +7 -12
  46. data/spec/boletosimples/resources/installment_spec.rb +61 -32
  47. data/spec/boletosimples/resources/remittance_spec.rb +7 -12
  48. data/spec/boletosimples/resources/sms_delivery_spec.rb +12 -0
  49. data/spec/boletosimples/resources/transactions_spec.rb +7 -12
  50. data/spec/boletosimples/resources/webhook_delivery_spec.rb +7 -12
  51. data/spec/boletosimples/resources/webhook_spec.rb +7 -12
  52. data/spec/fixtures/customer_imports.csv +1 -0
  53. data/spec/fixtures/customer_subscription_imports.csv +1 -0
  54. data/spec/fixtures/discharge.RET +3 -0
  55. data/spec/fixtures/vcr_cassettes/last_request/bank_billets.yml +536 -88
  56. data/spec/fixtures/vcr_cassettes/resources/bank_billet/all.yml +537 -91
  57. data/spec/fixtures/vcr_cassettes/resources/bank_billet/cancel/success.yml +34 -92
  58. data/spec/fixtures/vcr_cassettes/resources/bank_billet/create/invalid_params.yml +32 -20
  59. data/spec/fixtures/vcr_cassettes/resources/bank_billet/create/invalid_root.yml +28 -17
  60. data/spec/fixtures/vcr_cassettes/resources/bank_billet/create/valid.yml +43 -27
  61. data/spec/fixtures/vcr_cassettes/resources/bank_billet/duplicate/success.yml +83 -0
  62. data/spec/fixtures/vcr_cassettes/resources/bank_billet/find.yml +51 -27
  63. data/spec/fixtures/vcr_cassettes/resources/bank_billet_account/all.yml +131 -20
  64. data/spec/fixtures/vcr_cassettes/resources/bank_billet_account/create/invalid_params.yml +34 -20
  65. data/spec/fixtures/vcr_cassettes/resources/bank_billet_account/create/invalid_root.yml +30 -19
  66. data/spec/fixtures/vcr_cassettes/resources/bank_billet_account/create/valid.yml +41 -21
  67. data/spec/fixtures/vcr_cassettes/resources/bank_billet_account/find.yml +38 -18
  68. data/spec/fixtures/vcr_cassettes/resources/bank_billet_discharge/all.yml +97 -0
  69. data/spec/fixtures/vcr_cassettes/resources/bank_billet_payment/all.yml +75 -0
  70. data/spec/fixtures/vcr_cassettes/resources/bank_billet_remittance/all.yml +126 -0
  71. data/spec/fixtures/vcr_cassettes/resources/customer/all.yml +79 -32
  72. data/spec/fixtures/vcr_cassettes/resources/customer/create/invalid_params.yml +30 -17
  73. data/spec/fixtures/vcr_cassettes/resources/customer/create/invalid_root.yml +28 -17
  74. data/spec/fixtures/vcr_cassettes/resources/customer/create/valid.yml +33 -21
  75. data/spec/fixtures/vcr_cassettes/resources/customer/find.yml +33 -19
  76. data/spec/fixtures/vcr_cassettes/resources/customer_import/all.yml +74 -0
  77. data/spec/fixtures/vcr_cassettes/resources/customer_import/create/invalid_params.yml +69 -0
  78. data/spec/fixtures/vcr_cassettes/resources/customer_import/create/invalid_root.yml +69 -0
  79. data/spec/fixtures/vcr_cassettes/resources/customer_import/create/valid.yml +76 -0
  80. data/spec/fixtures/vcr_cassettes/resources/customer_import/find.yml +71 -0
  81. data/spec/fixtures/vcr_cassettes/resources/customer_subscription/all.yml +102 -52
  82. data/spec/fixtures/vcr_cassettes/resources/customer_subscription/create/invalid_params.yml +40 -50
  83. data/spec/fixtures/vcr_cassettes/resources/customer_subscription/create/invalid_root.yml +36 -48
  84. data/spec/fixtures/vcr_cassettes/resources/customer_subscription/create/valid.yml +48 -53
  85. data/spec/fixtures/vcr_cassettes/resources/customer_subscription/find.yml +44 -50
  86. data/spec/fixtures/vcr_cassettes/resources/customer_subscription/next_charge.yml +45 -133
  87. data/spec/fixtures/vcr_cassettes/resources/customer_subscription_import/all.yml +75 -0
  88. data/spec/fixtures/vcr_cassettes/resources/customer_subscription_import/create/invalid_params.yml +69 -0
  89. data/spec/fixtures/vcr_cassettes/resources/customer_subscription_import/create/invalid_root.yml +70 -0
  90. data/spec/fixtures/vcr_cassettes/resources/customer_subscription_import/create/valid.yml +76 -0
  91. data/spec/fixtures/vcr_cassettes/resources/customer_subscription_import/find.yml +71 -0
  92. data/spec/fixtures/vcr_cassettes/resources/discharge/all.yml +64 -33
  93. data/spec/fixtures/vcr_cassettes/resources/discharge/create/invalid_params.yml +70 -0
  94. data/spec/fixtures/vcr_cassettes/resources/discharge/create/invalid_root.yml +69 -0
  95. data/spec/fixtures/vcr_cassettes/resources/discharge/create/valid.yml +84 -0
  96. data/spec/fixtures/vcr_cassettes/resources/discharge/find.yml +71 -0
  97. data/spec/fixtures/vcr_cassettes/resources/email_delivery/all.yml +73 -0
  98. data/spec/fixtures/vcr_cassettes/resources/event/all.yml +490 -166
  99. data/spec/fixtures/vcr_cassettes/resources/installment/all.yml +418 -52
  100. data/spec/fixtures/vcr_cassettes/resources/installment/create/invalid_params.yml +41 -52
  101. data/spec/fixtures/vcr_cassettes/resources/installment/create/invalid_root.yml +36 -48
  102. data/spec/fixtures/vcr_cassettes/resources/installment/create/valid.yml +48 -53
  103. data/spec/fixtures/vcr_cassettes/resources/installment/find.yml +44 -52
  104. data/spec/fixtures/vcr_cassettes/resources/remittance/all.yml +53 -33
  105. data/spec/fixtures/vcr_cassettes/resources/sns_delivery/all.yml +73 -0
  106. data/spec/fixtures/vcr_cassettes/resources/transaction/all.yml +34 -22
  107. data/spec/fixtures/vcr_cassettes/resources/web_hook/all.yml +42 -33
  108. data/spec/fixtures/vcr_cassettes/resources/webhook_delivery/all.yml +1232 -54
  109. data/spec/spec_helper.rb +3 -20
  110. data/spec/support/stub_env.rb +7 -0
  111. data/spec/support/vcr.rb +3 -4
  112. metadata +190 -82
  113. data/.coveralls.yml +0 -2
  114. data/.gitignore +0 -19
  115. data/.ruby-gemset +0 -1
  116. data/.ruby-version +0 -1
  117. data/.travis.yml +0 -11
  118. data/Gemfile +0 -4
  119. data/Rakefile +0 -6
  120. data/boletosimples.gemspec +0 -37
  121. data/lib/boletosimples/extra.rb +0 -8
  122. data/lib/boletosimples/resources/partner/user.rb +0 -7
  123. data/lib/oauth2_patch.rb +0 -24
  124. data/spec/boletosimples/extra_spec.rb +0 -31
  125. data/spec/boletosimples/resources/partner/user_spec.rb +0 -19
  126. data/spec/fixtures/vcr_cassettes/configuration/client_credentials/invalid.yml +0 -64
  127. data/spec/fixtures/vcr_cassettes/configuration/client_credentials/valid.yml +0 -56
  128. data/spec/fixtures/vcr_cassettes/extra/userinfo/authenticated.yml +0 -58
  129. data/spec/fixtures/vcr_cassettes/extra/userinfo/not_authenticated.yml +0 -54
  130. data/spec/fixtures/vcr_cassettes/last_request/userinfo.yml +0 -58
  131. data/spec/fixtures/vcr_cassettes/resources/bank_billet/cancel/failure.yml +0 -118
  132. data/spec/fixtures/vcr_cassettes/resources/partner/user/create.yml +0 -60
  133. data/spec/spec.opts +0 -8
@@ -0,0 +1,71 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: get
5
+ uri: https://sandbox.boletosimples.com.br/api/v1/imports/customer_subscriptions/1053
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
+ Location:
40
+ - https://sandbox.boletosimples.com.br/api/v1/imports/customer_subscriptions/1053
41
+ Content-Type:
42
+ - application/json; charset=utf-8
43
+ X-Ratelimit-Limit:
44
+ - '60'
45
+ X-Ratelimit-Remaining:
46
+ - '57'
47
+ Etag:
48
+ - W/"b99d66a320d3419430f8bb66bf777696"
49
+ Cache-Control:
50
+ - must-revalidate, private, max-age=0
51
+ X-Request-Id:
52
+ - 464fc319-6287-4a33-a6c2-91dbaa28380c
53
+ X-Runtime:
54
+ - '0.021531'
55
+ Date:
56
+ - Tue, 13 Apr 2021 17:18:20 GMT
57
+ X-Rack-Cache:
58
+ - miss
59
+ Strict-Transport-Security:
60
+ - max-age=2629746
61
+ Vary:
62
+ - Origin,Accept-Encoding
63
+ Transfer-Encoding:
64
+ - chunked
65
+ Via:
66
+ - 1.1 vegur
67
+ body:
68
+ encoding: UTF-8
69
+ string: '{"id":1053,"created_rows":0,"enqueued_at":"2021-04-13T14:18:16-03:00","started_at":null,"finished_at":null,"processed_at":null,"failed_to_create_rows":0,"failed_to_update_rows":0,"import_errors":null,"processed_rows":0,"total_rows":null,"updated_rows":0,"source_file_name":"customer_subscriptions.csv","source_file_size":239,"status":"enqueued","created_via_api":true}'
70
+ recorded_at: Tue, 13 Apr 2021 17:18:20 GMT
71
+ recorded_with: VCR 6.0.0
@@ -2,63 +2,94 @@
2
2
  http_interactions:
3
3
  - request:
4
4
  method: get
5
- uri: https://sandbox.boletosimples.com.br/api/v1/discharges?access_token=BOLETOSIMPLES_ACCESS_TOKEN
5
+ uri: https://sandbox.boletosimples.com.br/api/v1/discharges
6
6
  body:
7
7
  encoding: US-ASCII
8
8
  string: ''
9
9
  headers:
10
10
  User-Agent:
11
- - BoletoSimples Ruby Client v0.2.3 (contato@boletosimples.com.br)
11
+ - email@minhaempresa.com.br
12
12
  Authorization:
13
- - Token token="BOLETOSIMPLES_ACCESS_TOKEN"
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
+ Server:
24
+ - Cowboy
23
25
  Connection:
24
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
+ - ''
25
43
  Content-Type:
26
44
  - application/json; charset=utf-8
27
- Transfer-Encoding:
28
- - chunked
29
- Status:
30
- - 200 OK
31
- Cache-Control:
32
- - must-revalidate, private, max-age=0
33
45
  X-Ratelimit-Limit:
34
- - '500'
35
- Date:
36
- - Mon, 24 Aug 2015 18:03:13 GMT
37
- Strict-Transport-Security:
38
- - max-age=2592000
46
+ - '60'
39
47
  X-Ratelimit-Remaining:
40
- - '498'
41
- Vary:
42
- - Accept-Encoding
43
- X-Request-Id:
44
- - 796a233a-e38d-4ca8-9cce-2af208d6b0f6
45
- Total:
46
- - '1'
48
+ - '42'
47
49
  Etag:
48
- - W/"368fef8232d9c141edd54608bcff2c22"
50
+ - W/"001838ec1bd26b15664667cef54ce761"
51
+ Cache-Control:
52
+ - must-revalidate, private, max-age=0
53
+ X-Request-Id:
54
+ - fc091652-c165-432f-a018-89585bd3f2d3
49
55
  X-Runtime:
50
- - '0.152599'
56
+ - '0.050491'
57
+ Date:
58
+ - Tue, 13 Apr 2021 17:18:48 GMT
51
59
  X-Rack-Cache:
52
60
  - miss
53
- X-Powered-By:
54
- - Phusion Passenger 5.0.15
55
- Server:
56
- - nginx/1.8.0 + Phusion Passenger 5.0.15
61
+ Strict-Transport-Security:
62
+ - max-age=2629746
63
+ Vary:
64
+ - Origin,Accept-Encoding
65
+ Transfer-Encoding:
66
+ - chunked
57
67
  Via:
58
68
  - 1.1 vegur
59
69
  body:
60
70
  encoding: UTF-8
61
- string: '[{"id":1,"filename":"cnab0904-1.ret","processed_at":"2015-04-17","created_via_api":true,"status":"unprocessed","discharge_transactions":[]}]'
62
- http_version:
63
- recorded_at: Mon, 24 Aug 2015 18:03:13 GMT
64
- recorded_with: VCR 2.9.3
71
+ string: '[{"id":3192,"filename":"discharge.RET","processed_at":null,"created_via_api":true,"status":"unprocessed","bank_billet_account_id":null,"created_via_integration":null,"bank_billet_discharges":[]},{"id":3191,"filename":"discharge.RET","processed_at":"2021-04-13T11:44:18-03:00","created_via_api":true,"status":"unrecognized","bank_billet_account_id":null,"created_via_integration":null,"bank_billet_discharges":[{"id":19809,"occurrence":"10","date_of_occurrence":"2020-03-20","discharge_id":3191,"bank_billet_id":null,"occurrence_error":"00","line_parsed":{"iof":"0","paid_at":"2020-03-20","cnpj_cpf":"78796613000141","discount":"0","bank_rate":"30","credit_at":"2020-03-20","error_code":"00","event_type":"10","our_number":"04958535","billet_fine":"0","paid_amount":"0","other_credit":"0","value_rebate":"0","agency_number":"6519","credit_amount":"0","account_number":"90009999","conta_cobranca":"90009999","control_number":"","banco_recebedor":"033","document_number":"495853","agencia_recebedora":"1651"},"line_raw":{"line_raw":"1027879661300014165199000999990009999 04958535 510200320495853 0495853500 12111900000000300350331651901000000000003000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
72
+ N 200320 SOLUCOES DIGITAIS L 00000000000000000000000000000000000000000C 325000002"},"processed_at":"2021-04-13T11:44:18-03:00","occurrence_detail":"Título
73
+ Baixado Conforme Instrução Ou Por Título Protestado 11 = Em Ser","occurrence_error_detail":null,"our_occurrence":"2074","bank_billet_account_id":null,"bank_number":"033","created_at":"2021-04-13T11:44:18-03:00","kind":"400"}]},{"id":3190,"filename":"discharge.RET","processed_at":"2021-04-13T11:40:02-03:00","created_via_api":true,"status":"unrecognized","bank_billet_account_id":null,"created_via_integration":null,"bank_billet_discharges":[{"id":19808,"occurrence":"10","date_of_occurrence":"2020-03-20","discharge_id":3190,"bank_billet_id":null,"occurrence_error":"00","line_parsed":{"iof":"0","paid_at":"2020-03-20","cnpj_cpf":"78796613000141","discount":"0","bank_rate":"30","credit_at":"2020-03-20","error_code":"00","event_type":"10","our_number":"04958535","billet_fine":"0","paid_amount":"0","other_credit":"0","value_rebate":"0","agency_number":"6519","credit_amount":"0","account_number":"90009999","conta_cobranca":"90009999","control_number":"","banco_recebedor":"033","document_number":"495853","agencia_recebedora":"1651"},"line_raw":{"line_raw":"1027879661300014165199000999990009999 04958535 510200320495853 0495853500 12111900000000300350331651901000000000003000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
74
+ N 200320 SOLUCOES DIGITAIS L 00000000000000000000000000000000000000000C 325000002"},"processed_at":"2021-04-13T11:40:03-03:00","occurrence_detail":"Título
75
+ Baixado Conforme Instrução Ou Por Título Protestado 11 = Em Ser","occurrence_error_detail":null,"our_occurrence":"2074","bank_billet_account_id":null,"bank_number":"033","created_at":"2021-04-13T11:40:03-03:00","kind":"400"}]},{"id":3189,"filename":"discharge.RET","processed_at":"2021-04-13T11:35:30-03:00","created_via_api":true,"status":"unrecognized","bank_billet_account_id":null,"created_via_integration":null,"bank_billet_discharges":[{"id":19807,"occurrence":"10","date_of_occurrence":"2020-03-20","discharge_id":3189,"bank_billet_id":null,"occurrence_error":"00","line_parsed":{"iof":"0","paid_at":"2020-03-20","cnpj_cpf":"78796613000141","discount":"0","bank_rate":"30","credit_at":"2020-03-20","error_code":"00","event_type":"10","our_number":"04958535","billet_fine":"0","paid_amount":"0","other_credit":"0","value_rebate":"0","agency_number":"6519","credit_amount":"0","account_number":"90009999","conta_cobranca":"90009999","control_number":"","banco_recebedor":"033","document_number":"495853","agencia_recebedora":"1651"},"line_raw":{"line_raw":"1027879661300014165199000999990009999 04958535 510200320495853 0495853500 12111900000000300350331651901000000000003000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
76
+ N 200320 SOLUCOES DIGITAIS L 00000000000000000000000000000000000000000C 325000002"},"processed_at":"2021-04-13T11:35:31-03:00","occurrence_detail":"Título
77
+ Baixado Conforme Instrução Ou Por Título Protestado 11 = Em Ser","occurrence_error_detail":null,"our_occurrence":"2074","bank_billet_account_id":null,"bank_number":"033","created_at":"2021-04-13T11:35:31-03:00","kind":"400"}]},{"id":3188,"filename":"discharge.RET","processed_at":"2021-04-13T11:26:08-03:00","created_via_api":true,"status":"unrecognized","bank_billet_account_id":null,"created_via_integration":null,"bank_billet_discharges":[{"id":19806,"occurrence":"10","date_of_occurrence":"2020-03-20","discharge_id":3188,"bank_billet_id":null,"occurrence_error":"00","line_parsed":{"iof":"0","paid_at":"2020-03-20","cnpj_cpf":"78796613000141","discount":"0","bank_rate":"30","credit_at":"2020-03-20","error_code":"00","event_type":"10","our_number":"04958535","billet_fine":"0","paid_amount":"0","other_credit":"0","value_rebate":"0","agency_number":"6519","credit_amount":"0","account_number":"90009999","conta_cobranca":"90009999","control_number":"","banco_recebedor":"033","document_number":"495853","agencia_recebedora":"1651"},"line_raw":{"line_raw":"1027879661300014165199000999990009999 04958535 510200320495853 0495853500 12111900000000300350331651901000000000003000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
78
+ N 200320 SOLUCOES DIGITAIS L 00000000000000000000000000000000000000000C 325000002"},"processed_at":"2021-04-13T11:26:08-03:00","occurrence_detail":"Título
79
+ Baixado Conforme Instrução Ou Por Título Protestado 11 = Em Ser","occurrence_error_detail":null,"our_occurrence":"2074","bank_billet_account_id":null,"bank_number":"033","created_at":"2021-04-13T11:26:08-03:00","kind":"400"}]},{"id":3187,"filename":"discharge.RET","processed_at":"2021-04-13T11:22:11-03:00","created_via_api":true,"status":"unrecognized","bank_billet_account_id":null,"created_via_integration":null,"bank_billet_discharges":[{"id":19805,"occurrence":"10","date_of_occurrence":"2020-03-20","discharge_id":3187,"bank_billet_id":null,"occurrence_error":"00","line_parsed":{"iof":"0","paid_at":"2020-03-20","cnpj_cpf":"78796613000141","discount":"0","bank_rate":"30","credit_at":"2020-03-20","error_code":"00","event_type":"10","our_number":"04958535","billet_fine":"0","paid_amount":"0","other_credit":"0","value_rebate":"0","agency_number":"6519","credit_amount":"0","account_number":"90009999","conta_cobranca":"90009999","control_number":"","banco_recebedor":"033","document_number":"495853","agencia_recebedora":"1651"},"line_raw":{"line_raw":"1027879661300014165199000999990009999 04958535 510200320495853 0495853500 12111900000000300350331651901000000000003000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
80
+ N 200320 SOLUCOES DIGITAIS L 00000000000000000000000000000000000000000C 325000002"},"processed_at":"2021-04-13T11:22:11-03:00","occurrence_detail":"Título
81
+ Baixado Conforme Instrução Ou Por Título Protestado 11 = Em Ser","occurrence_error_detail":null,"our_occurrence":"2074","bank_billet_account_id":null,"bank_number":"033","created_at":"2021-04-13T11:22:11-03:00","kind":"400"}]},{"id":3186,"filename":"discharge.RET","processed_at":"2021-04-13T11:10:39-03:00","created_via_api":true,"status":"unrecognized","bank_billet_account_id":null,"created_via_integration":null,"bank_billet_discharges":[{"id":19804,"occurrence":"10","date_of_occurrence":"2020-03-20","discharge_id":3186,"bank_billet_id":null,"occurrence_error":"00","line_parsed":{"iof":"0","paid_at":"2020-03-20","cnpj_cpf":"78796613000141","discount":"0","bank_rate":"30","credit_at":"2020-03-20","error_code":"00","event_type":"10","our_number":"04958535","billet_fine":"0","paid_amount":"0","other_credit":"0","value_rebate":"0","agency_number":"6519","credit_amount":"0","account_number":"90009999","conta_cobranca":"90009999","control_number":"","banco_recebedor":"033","document_number":"495853","agencia_recebedora":"1651"},"line_raw":{"line_raw":"1027879661300014165199000999990009999 04958535 510200320495853 0495853500 12111900000000300350331651901000000000003000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
82
+ N 200320 SOLUCOES DIGITAIS L 00000000000000000000000000000000000000000C 325000002"},"processed_at":"2021-04-13T11:10:39-03:00","occurrence_detail":"Título
83
+ Baixado Conforme Instrução Ou Por Título Protestado 11 = Em Ser","occurrence_error_detail":null,"our_occurrence":"2074","bank_billet_account_id":null,"bank_number":"033","created_at":"2021-04-13T11:10:39-03:00","kind":"400"}]},{"id":3185,"filename":"discharge.RET","processed_at":"2021-04-13T11:05:50-03:00","created_via_api":true,"status":"unrecognized","bank_billet_account_id":null,"created_via_integration":null,"bank_billet_discharges":[{"id":19803,"occurrence":"10","date_of_occurrence":"2020-03-20","discharge_id":3185,"bank_billet_id":null,"occurrence_error":"00","line_parsed":{"iof":"0","paid_at":"2020-03-20","cnpj_cpf":"78796613000141","discount":"0","bank_rate":"30","credit_at":"2020-03-20","error_code":"00","event_type":"10","our_number":"04958535","billet_fine":"0","paid_amount":"0","other_credit":"0","value_rebate":"0","agency_number":"6519","credit_amount":"0","account_number":"90009999","conta_cobranca":"90009999","control_number":"","banco_recebedor":"033","document_number":"495853","agencia_recebedora":"1651"},"line_raw":{"line_raw":"1027879661300014165199000999990009999 04958535 510200320495853 0495853500 12111900000000300350331651901000000000003000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
84
+ N 200320 SOLUCOES DIGITAIS L 00000000000000000000000000000000000000000C 325000002"},"processed_at":"2021-04-13T11:05:50-03:00","occurrence_detail":"Título
85
+ Baixado Conforme Instrução Ou Por Título Protestado 11 = Em Ser","occurrence_error_detail":null,"our_occurrence":"2074","bank_billet_account_id":null,"bank_number":"033","created_at":"2021-04-13T11:05:50-03:00","kind":"400"}]},{"id":3184,"filename":"discharge.RET","processed_at":"2021-04-13T10:55:36-03:00","created_via_api":true,"status":"unrecognized","bank_billet_account_id":null,"created_via_integration":null,"bank_billet_discharges":[{"id":19802,"occurrence":"10","date_of_occurrence":"2020-03-20","discharge_id":3184,"bank_billet_id":null,"occurrence_error":"00","line_parsed":{"iof":"0","paid_at":"2020-03-20","cnpj_cpf":"78796613000141","discount":"0","bank_rate":"30","credit_at":"2020-03-20","error_code":"00","event_type":"10","our_number":"04958535","billet_fine":"0","paid_amount":"0","other_credit":"0","value_rebate":"0","agency_number":"6519","credit_amount":"0","account_number":"90009999","conta_cobranca":"90009999","control_number":"","banco_recebedor":"033","document_number":"495853","agencia_recebedora":"1651"},"line_raw":{"line_raw":"1027879661300014165199000999990009999 04958535 510200320495853 0495853500 12111900000000300350331651901000000000003000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
86
+ N 200320 SOLUCOES DIGITAIS L 00000000000000000000000000000000000000000C 325000002"},"processed_at":"2021-04-13T10:55:37-03:00","occurrence_detail":"Título
87
+ Baixado Conforme Instrução Ou Por Título Protestado 11 = Em Ser","occurrence_error_detail":null,"our_occurrence":"2074","bank_billet_account_id":null,"bank_number":"033","created_at":"2021-04-13T10:55:37-03:00","kind":"400"}]},{"id":3183,"filename":"discharge.RET","processed_at":"2021-04-13T09:59:46-03:00","created_via_api":true,"status":"unrecognized","bank_billet_account_id":null,"created_via_integration":null,"bank_billet_discharges":[{"id":19801,"occurrence":"10","date_of_occurrence":"2020-03-20","discharge_id":3183,"bank_billet_id":null,"occurrence_error":"00","line_parsed":{"iof":"0","paid_at":"2020-03-20","cnpj_cpf":"78796613000141","discount":"0","bank_rate":"30","credit_at":"2020-03-20","error_code":"00","event_type":"10","our_number":"04958535","billet_fine":"0","paid_amount":"0","other_credit":"0","value_rebate":"0","agency_number":"6519","credit_amount":"0","account_number":"90009999","conta_cobranca":"90009999","control_number":"","banco_recebedor":"033","document_number":"495853","agencia_recebedora":"1651"},"line_raw":{"line_raw":"1027879661300014165199000999990009999 04958535 510200320495853 0495853500 12111900000000300350331651901000000000003000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
88
+ N 200320 SOLUCOES DIGITAIS L 00000000000000000000000000000000000000000C 325000002"},"processed_at":"2021-04-13T09:59:46-03:00","occurrence_detail":"Título
89
+ Baixado Conforme Instrução Ou Por Título Protestado 11 = Em Ser","occurrence_error_detail":null,"our_occurrence":"2074","bank_billet_account_id":null,"bank_number":"033","created_at":"2021-04-13T09:59:46-03:00","kind":"400"}]},{"id":3182,"filename":"discharge.RET","processed_at":"2021-04-13T09:27:07-03:00","created_via_api":true,"status":"unrecognized","bank_billet_account_id":null,"created_via_integration":null,"bank_billet_discharges":[{"id":19800,"occurrence":"10","date_of_occurrence":"2020-03-20","discharge_id":3182,"bank_billet_id":null,"occurrence_error":"00","line_parsed":{"iof":"0","paid_at":"2020-03-20","cnpj_cpf":"78796613000141","discount":"0","bank_rate":"30","credit_at":"2020-03-20","error_code":"00","event_type":"10","our_number":"04958535","billet_fine":"0","paid_amount":"0","other_credit":"0","value_rebate":"0","agency_number":"6519","credit_amount":"0","account_number":"90009999","conta_cobranca":"90009999","control_number":"","banco_recebedor":"033","document_number":"495853","agencia_recebedora":"1651"},"line_raw":{"line_raw":"1027879661300014165199000999990009999 04958535 510200320495853 0495853500 12111900000000300350331651901000000000003000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
90
+ N 200320 SOLUCOES DIGITAIS L 00000000000000000000000000000000000000000C 325000002"},"processed_at":"2021-04-13T09:27:09-03:00","occurrence_detail":"Título
91
+ Baixado Conforme Instrução Ou Por Título Protestado 11 = Em Ser","occurrence_error_detail":null,"our_occurrence":"2074","bank_billet_account_id":null,"bank_number":"033","created_at":"2021-04-13T09:27:09-03:00","kind":"400"}]},{"id":3181,"filename":"discharge.RET","processed_at":"2021-04-12T11:55:06-03:00","created_via_api":true,"status":"unrecognized","bank_billet_account_id":null,"created_via_integration":null,"bank_billet_discharges":[{"id":19799,"occurrence":"10","date_of_occurrence":"2020-03-20","discharge_id":3181,"bank_billet_id":null,"occurrence_error":"00","line_parsed":{"iof":"0","paid_at":"2020-03-20","cnpj_cpf":"78796613000141","discount":"0","bank_rate":"30","credit_at":"2020-03-20","error_code":"00","event_type":"10","our_number":"04958535","billet_fine":"0","paid_amount":"0","other_credit":"0","value_rebate":"0","agency_number":"6519","credit_amount":"0","account_number":"90009999","conta_cobranca":"90009999","control_number":"","banco_recebedor":"033","document_number":"495853","agencia_recebedora":"1651"},"line_raw":{"line_raw":"1027879661300014165199000999990009999 04958535 510200320495853 0495853500 12111900000000300350331651901000000000003000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
92
+ N 200320 SOLUCOES DIGITAIS L 00000000000000000000000000000000000000000C 325000002"},"processed_at":"2021-04-12T11:55:07-03:00","occurrence_detail":"Título
93
+ Baixado Conforme Instrução Ou Por Título Protestado 11 = Em Ser","occurrence_error_detail":null,"our_occurrence":"2074","bank_billet_account_id":null,"bank_number":"033","created_at":"2021-04-12T11:55:07-03:00","kind":"400"}]}]'
94
+ recorded_at: Tue, 13 Apr 2021 17:18:48 GMT
95
+ recorded_with: VCR 6.0.0
@@ -0,0 +1,70 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: post
5
+ uri: https://sandbox.boletosimples.com.br/api/v1/discharges
6
+ body:
7
+ encoding: UTF-8
8
+ string: '{"discharge":{"content":""}}'
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: 422
23
+ message: Unprocessable Entity
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
+ Content-Type:
42
+ - application/json; charset=utf-8
43
+ X-Ratelimit-Limit:
44
+ - '1000'
45
+ X-Ratelimit-Remaining:
46
+ - '981'
47
+ Cache-Control:
48
+ - no-cache
49
+ X-Request-Id:
50
+ - 904c5219-a4ce-4a81-9249-72a63a9eebc0
51
+ X-Runtime:
52
+ - '0.026695'
53
+ Date:
54
+ - Tue, 13 Apr 2021 17:18:49 GMT
55
+ X-Rack-Cache:
56
+ - invalidate, pass
57
+ Strict-Transport-Security:
58
+ - max-age=2629746
59
+ Vary:
60
+ - Origin,Accept-Encoding
61
+ Transfer-Encoding:
62
+ - chunked
63
+ Via:
64
+ - 1.1 vegur
65
+ body:
66
+ encoding: UTF-8
67
+ string: '{"errors":{"content":["não pode ficar em branco"],"filename":["não
68
+ pode ficar em branco"]}}'
69
+ recorded_at: Tue, 13 Apr 2021 17:18:49 GMT
70
+ recorded_with: VCR 6.0.0
@@ -0,0 +1,69 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: post
5
+ uri: https://sandbox.boletosimples.com.br/api/v1/discharges
6
+ body:
7
+ encoding: UTF-8
8
+ string: '{"discharge":{}}'
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: 422
23
+ message: Unprocessable Entity
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
+ Content-Type:
42
+ - application/json; charset=utf-8
43
+ X-Ratelimit-Limit:
44
+ - '1000'
45
+ X-Ratelimit-Remaining:
46
+ - '982'
47
+ Cache-Control:
48
+ - no-cache
49
+ X-Request-Id:
50
+ - f9519ee6-1ff5-45d2-a0a5-0dddaec31060
51
+ X-Runtime:
52
+ - '0.022960'
53
+ Date:
54
+ - Tue, 13 Apr 2021 17:18:48 GMT
55
+ X-Rack-Cache:
56
+ - invalidate, pass
57
+ Strict-Transport-Security:
58
+ - max-age=2629746
59
+ Vary:
60
+ - Origin,Accept-Encoding
61
+ Transfer-Encoding:
62
+ - chunked
63
+ Via:
64
+ - 1.1 vegur
65
+ body:
66
+ encoding: UTF-8
67
+ string: '{"errors":[{"title":"discharge não pode ficar em branco","status":422,"code":422}]}'
68
+ recorded_at: Tue, 13 Apr 2021 17:18:48 GMT
69
+ recorded_with: VCR 6.0.0
@@ -0,0 +1,84 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: post
5
+ uri: https://sandbox.boletosimples.com.br/api/v1/discharges
6
+ body:
7
+ encoding: UTF-8
8
+ string: "-------------RubyMultipartPost-b54f557c3434e9dd5ea8f333d6da7fa3\r\nContent-Disposition:
9
+ form-data; name=\"discharge[file]\"; filename=\"discharge.RET\"\r\nContent-Length:
10
+ 1206\r\nContent-Type: text/plain\r\nContent-Transfer-Encoding: binary\r\n\r\n02RETORNO01COBRANCA
11
+ \ 16511300049999999999 SISTEMAS S.A 033SANTANDER 20032000000000009483012
12
+ \ 325000001\r\n1027879661300014165199000999990009999
13
+ \ 04958535 510200320495853
14
+ \ 0495853500 12111900000000300350331651901000000000003000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
15
+ N 200320 SOLUCOES DIGITAIS L 00000000000000000000000000000000000000000C
16
+ \ 325000002\r\n9201033 000025050000053763329700000518 000000000000000000000000000000
17
+ \ 000000000000000000000000000000 325000632\r\n\r\n-------------RubyMultipartPost-b54f557c3434e9dd5ea8f333d6da7fa3--\r\n"
18
+ headers:
19
+ User-Agent:
20
+ - email@minhaempresa.com.br
21
+ Authorization:
22
+ - Bearer BOLETOSIMPLES_API_TOKEN
23
+ Content-Type:
24
+ - multipart/form-data; boundary=-----------RubyMultipartPost-b54f557c3434e9dd5ea8f333d6da7fa3
25
+ Content-Length:
26
+ - '1507'
27
+ Accept:
28
+ - application/json
29
+ Accept-Encoding:
30
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
31
+ response:
32
+ status:
33
+ code: 201
34
+ message: Created
35
+ headers:
36
+ Server:
37
+ - Cowboy
38
+ Connection:
39
+ - keep-alive
40
+ X-Frame-Options:
41
+ - DENY
42
+ X-Xss-Protection:
43
+ - 1; mode=block
44
+ X-Content-Type-Options:
45
+ - nosniff
46
+ X-Download-Options:
47
+ - noopen
48
+ X-Permitted-Cross-Domain-Policies:
49
+ - none
50
+ Referrer-Policy:
51
+ - strict-origin-when-cross-origin
52
+ Location:
53
+ - https://sandbox.boletosimples.com.br/api/v1/discharges/3192
54
+ Content-Type:
55
+ - application/json; charset=utf-8
56
+ X-Ratelimit-Limit:
57
+ - '1000'
58
+ X-Ratelimit-Remaining:
59
+ - '983'
60
+ Etag:
61
+ - W/"e077f7fad4f8c1d2e95d90396adb0b16"
62
+ Cache-Control:
63
+ - max-age=0, private, must-revalidate
64
+ X-Request-Id:
65
+ - 797fe79a-7db2-4e07-86a7-0e05dd8945be
66
+ X-Runtime:
67
+ - '0.076282'
68
+ Date:
69
+ - Tue, 13 Apr 2021 17:18:46 GMT
70
+ X-Rack-Cache:
71
+ - invalidate, pass
72
+ Strict-Transport-Security:
73
+ - max-age=2629746
74
+ Vary:
75
+ - Origin,Accept-Encoding
76
+ Transfer-Encoding:
77
+ - chunked
78
+ Via:
79
+ - 1.1 vegur
80
+ body:
81
+ encoding: UTF-8
82
+ string: '{"id":3192,"filename":"discharge.RET","processed_at":null,"created_via_api":true,"status":"unprocessed","bank_billet_account_id":null,"created_via_integration":null,"bank_billet_discharges":[]}'
83
+ recorded_at: Tue, 13 Apr 2021 17:18:46 GMT
84
+ recorded_with: VCR 6.0.0
@@ -0,0 +1,71 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: get
5
+ uri: https://sandbox.boletosimples.com.br/api/v1/discharges/3192
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
+ Location:
40
+ - https://sandbox.boletosimples.com.br/api/v1/discharges/3192
41
+ Content-Type:
42
+ - application/json; charset=utf-8
43
+ X-Ratelimit-Limit:
44
+ - '60'
45
+ X-Ratelimit-Remaining:
46
+ - '43'
47
+ Etag:
48
+ - W/"e077f7fad4f8c1d2e95d90396adb0b16"
49
+ Cache-Control:
50
+ - must-revalidate, private, max-age=0
51
+ X-Request-Id:
52
+ - d8c0eaf7-ce3b-49f6-a980-8d870931e2ed
53
+ X-Runtime:
54
+ - '0.029146'
55
+ Date:
56
+ - Tue, 13 Apr 2021 17:18:47 GMT
57
+ X-Rack-Cache:
58
+ - miss
59
+ Strict-Transport-Security:
60
+ - max-age=2629746
61
+ Vary:
62
+ - Origin,Accept-Encoding
63
+ Transfer-Encoding:
64
+ - chunked
65
+ Via:
66
+ - 1.1 vegur
67
+ body:
68
+ encoding: UTF-8
69
+ string: '{"id":3192,"filename":"discharge.RET","processed_at":null,"created_via_api":true,"status":"unprocessed","bank_billet_account_id":null,"created_via_integration":null,"bank_billet_discharges":[]}'
70
+ recorded_at: Tue, 13 Apr 2021 17:18:47 GMT
71
+ recorded_with: VCR 6.0.0