boletosimples 0.4.0 → 1.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (135) hide show
  1. checksums.yaml +5 -5
  2. data/.github/workflows/ruby.yml +34 -0
  3. data/.rspec +3 -0
  4. data/.rubocop.yml +9 -0
  5. data/.ruby-version +1 -1
  6. data/CHANGELOG.md +6 -14
  7. data/Gemfile +2 -0
  8. data/README.md +12 -54
  9. data/Rakefile +10 -0
  10. data/boletosimples.gemspec +21 -17
  11. data/lib/boletosimples.rb +10 -6
  12. data/lib/boletosimples/configuration.rb +17 -32
  13. data/lib/boletosimples/last_request.rb +12 -9
  14. data/lib/boletosimples/middlewares/bearer.rb +12 -0
  15. data/lib/boletosimples/middlewares/last_request.rb +3 -1
  16. data/lib/boletosimples/middlewares/raise_error.rb +9 -2
  17. data/lib/boletosimples/middlewares/user_agent.rb +3 -1
  18. data/lib/boletosimples/resources/bank_billet.rb +5 -11
  19. data/lib/boletosimples/resources/bank_billet_account.rb +3 -1
  20. data/lib/boletosimples/resources/bank_billet_discharge.rb +6 -0
  21. data/lib/boletosimples/resources/bank_billet_payment.rb +6 -0
  22. data/lib/boletosimples/resources/bank_billet_remittance.rb +6 -0
  23. data/lib/boletosimples/resources/base_model.rb +3 -1
  24. data/lib/boletosimples/resources/customer.rb +3 -1
  25. data/lib/boletosimples/resources/customer_import.rb +8 -0
  26. data/lib/boletosimples/resources/customer_subscription.rb +4 -11
  27. data/lib/boletosimples/resources/customer_subscription_import.rb +8 -0
  28. data/lib/boletosimples/resources/discharge.rb +4 -11
  29. data/lib/boletosimples/resources/email_delivery.rb +6 -0
  30. data/lib/boletosimples/resources/event.rb +3 -1
  31. data/lib/boletosimples/resources/installment.rb +3 -1
  32. data/lib/boletosimples/resources/remittance.rb +3 -1
  33. data/lib/boletosimples/resources/sms_delivery.rb +6 -0
  34. data/lib/boletosimples/resources/transaction.rb +3 -1
  35. data/lib/boletosimples/resources/webhook.rb +3 -1
  36. data/lib/boletosimples/resources/webhook_delivery.rb +3 -1
  37. data/lib/boletosimples/response_error.rb +8 -3
  38. data/lib/boletosimples/version.rb +3 -1
  39. data/spec/boletosimples/configuration_spec.rb +71 -83
  40. data/spec/boletosimples/last_request_spec.rb +16 -28
  41. data/spec/boletosimples/resources/bank_billet_account_spec.rb +57 -33
  42. data/spec/boletosimples/resources/bank_billet_discharge_spec.rb +12 -0
  43. data/spec/boletosimples/resources/bank_billet_payment_spec.rb +12 -0
  44. data/spec/boletosimples/resources/bank_billet_remittance_spec.rb +12 -0
  45. data/spec/boletosimples/resources/bank_billet_spec.rb +56 -42
  46. data/spec/boletosimples/resources/customer_import_spec.rb +67 -0
  47. data/spec/boletosimples/resources/customer_spec.rb +52 -39
  48. data/spec/boletosimples/resources/customer_subscription_import_spec.rb +67 -0
  49. data/spec/boletosimples/resources/customer_subscription_spec.rb +64 -30
  50. data/spec/boletosimples/resources/discharge_spec.rb +64 -11
  51. data/spec/boletosimples/resources/email_delivery_spec.rb +12 -0
  52. data/spec/boletosimples/resources/event_spec.rb +7 -12
  53. data/spec/boletosimples/resources/installment_spec.rb +61 -32
  54. data/spec/boletosimples/resources/remittance_spec.rb +7 -12
  55. data/spec/boletosimples/resources/sms_delivery_spec.rb +12 -0
  56. data/spec/boletosimples/resources/transactions_spec.rb +7 -12
  57. data/spec/boletosimples/resources/webhook_delivery_spec.rb +7 -12
  58. data/spec/boletosimples/resources/webhook_spec.rb +7 -12
  59. data/spec/fixtures/customer_imports.csv +1 -0
  60. data/spec/fixtures/customer_subscription_imports.csv +1 -0
  61. data/spec/fixtures/discharge.RET +3 -0
  62. data/spec/fixtures/vcr_cassettes/last_request/bank_billets.yml +536 -88
  63. data/spec/fixtures/vcr_cassettes/resources/bank_billet/all.yml +537 -91
  64. data/spec/fixtures/vcr_cassettes/resources/bank_billet/cancel/success.yml +34 -92
  65. data/spec/fixtures/vcr_cassettes/resources/bank_billet/create/invalid_params.yml +32 -20
  66. data/spec/fixtures/vcr_cassettes/resources/bank_billet/create/invalid_root.yml +28 -17
  67. data/spec/fixtures/vcr_cassettes/resources/bank_billet/create/valid.yml +43 -27
  68. data/spec/fixtures/vcr_cassettes/resources/bank_billet/duplicate/success.yml +83 -0
  69. data/spec/fixtures/vcr_cassettes/resources/bank_billet/find.yml +51 -27
  70. data/spec/fixtures/vcr_cassettes/resources/bank_billet_account/all.yml +131 -20
  71. data/spec/fixtures/vcr_cassettes/resources/bank_billet_account/create/invalid_params.yml +34 -20
  72. data/spec/fixtures/vcr_cassettes/resources/bank_billet_account/create/invalid_root.yml +30 -19
  73. data/spec/fixtures/vcr_cassettes/resources/bank_billet_account/create/valid.yml +41 -21
  74. data/spec/fixtures/vcr_cassettes/resources/bank_billet_account/find.yml +38 -18
  75. data/spec/fixtures/vcr_cassettes/resources/bank_billet_discharge/all.yml +97 -0
  76. data/spec/fixtures/vcr_cassettes/resources/bank_billet_payment/all.yml +75 -0
  77. data/spec/fixtures/vcr_cassettes/resources/bank_billet_remittance/all.yml +126 -0
  78. data/spec/fixtures/vcr_cassettes/resources/customer/all.yml +79 -32
  79. data/spec/fixtures/vcr_cassettes/resources/customer/create/invalid_params.yml +30 -17
  80. data/spec/fixtures/vcr_cassettes/resources/customer/create/invalid_root.yml +28 -17
  81. data/spec/fixtures/vcr_cassettes/resources/customer/create/valid.yml +33 -21
  82. data/spec/fixtures/vcr_cassettes/resources/customer/find.yml +33 -19
  83. data/spec/fixtures/vcr_cassettes/resources/customer_import/all.yml +74 -0
  84. data/spec/fixtures/vcr_cassettes/resources/customer_import/create/invalid_params.yml +69 -0
  85. data/spec/fixtures/vcr_cassettes/resources/customer_import/create/invalid_root.yml +69 -0
  86. data/spec/fixtures/vcr_cassettes/resources/customer_import/create/valid.yml +76 -0
  87. data/spec/fixtures/vcr_cassettes/resources/customer_import/find.yml +71 -0
  88. data/spec/fixtures/vcr_cassettes/resources/customer_subscription/all.yml +102 -52
  89. data/spec/fixtures/vcr_cassettes/resources/customer_subscription/create/invalid_params.yml +40 -50
  90. data/spec/fixtures/vcr_cassettes/resources/customer_subscription/create/invalid_root.yml +36 -48
  91. data/spec/fixtures/vcr_cassettes/resources/customer_subscription/create/valid.yml +48 -53
  92. data/spec/fixtures/vcr_cassettes/resources/customer_subscription/find.yml +44 -50
  93. data/spec/fixtures/vcr_cassettes/resources/customer_subscription/next_charge.yml +77 -0
  94. data/spec/fixtures/vcr_cassettes/resources/customer_subscription_import/all.yml +75 -0
  95. data/spec/fixtures/vcr_cassettes/resources/customer_subscription_import/create/invalid_params.yml +69 -0
  96. data/spec/fixtures/vcr_cassettes/resources/customer_subscription_import/create/invalid_root.yml +70 -0
  97. data/spec/fixtures/vcr_cassettes/resources/customer_subscription_import/create/valid.yml +76 -0
  98. data/spec/fixtures/vcr_cassettes/resources/customer_subscription_import/find.yml +71 -0
  99. data/spec/fixtures/vcr_cassettes/resources/discharge/all.yml +64 -33
  100. data/spec/fixtures/vcr_cassettes/resources/discharge/create/invalid_params.yml +70 -0
  101. data/spec/fixtures/vcr_cassettes/resources/discharge/create/invalid_root.yml +69 -0
  102. data/spec/fixtures/vcr_cassettes/resources/discharge/create/valid.yml +84 -0
  103. data/spec/fixtures/vcr_cassettes/resources/discharge/find.yml +71 -0
  104. data/spec/fixtures/vcr_cassettes/resources/email_delivery/all.yml +73 -0
  105. data/spec/fixtures/vcr_cassettes/resources/event/all.yml +490 -166
  106. data/spec/fixtures/vcr_cassettes/resources/installment/all.yml +418 -52
  107. data/spec/fixtures/vcr_cassettes/resources/installment/create/invalid_params.yml +41 -52
  108. data/spec/fixtures/vcr_cassettes/resources/installment/create/invalid_root.yml +36 -48
  109. data/spec/fixtures/vcr_cassettes/resources/installment/create/valid.yml +48 -53
  110. data/spec/fixtures/vcr_cassettes/resources/installment/find.yml +44 -52
  111. data/spec/fixtures/vcr_cassettes/resources/remittance/all.yml +53 -33
  112. data/spec/fixtures/vcr_cassettes/resources/sns_delivery/all.yml +73 -0
  113. data/spec/fixtures/vcr_cassettes/resources/transaction/all.yml +34 -22
  114. data/spec/fixtures/vcr_cassettes/resources/web_hook/all.yml +42 -33
  115. data/spec/fixtures/vcr_cassettes/resources/webhook_delivery/all.yml +1232 -54
  116. data/spec/spec_helper.rb +3 -20
  117. data/spec/support/stub_env.rb +7 -0
  118. data/spec/support/vcr.rb +3 -4
  119. metadata +181 -77
  120. data/.coveralls.yml +0 -2
  121. data/.ruby-gemset +0 -1
  122. data/.travis.yml +0 -11
  123. data/lib/boletosimples/extra.rb +0 -8
  124. data/lib/boletosimples/resources/partner/user.rb +0 -7
  125. data/lib/oauth2_patch.rb +0 -24
  126. data/spec/boletosimples/extra_spec.rb +0 -31
  127. data/spec/boletosimples/resources/partner/user_spec.rb +0 -19
  128. data/spec/fixtures/vcr_cassettes/configuration/client_credentials/invalid.yml +0 -64
  129. data/spec/fixtures/vcr_cassettes/configuration/client_credentials/valid.yml +0 -56
  130. data/spec/fixtures/vcr_cassettes/extra/userinfo/authenticated.yml +0 -58
  131. data/spec/fixtures/vcr_cassettes/extra/userinfo/not_authenticated.yml +0 -54
  132. data/spec/fixtures/vcr_cassettes/last_request/userinfo.yml +0 -58
  133. data/spec/fixtures/vcr_cassettes/resources/bank_billet/cancel/failure.yml +0 -118
  134. data/spec/fixtures/vcr_cassettes/resources/partner/user/create.yml +0 -60
  135. data/spec/spec.opts +0 -8
data/.coveralls.yml DELETED
@@ -1,2 +0,0 @@
1
- service_name: travis-ci
2
- repo_token: hSYBAmKtSBLrLODdt13qT0A6sk7uGoO8h
data/.ruby-gemset DELETED
@@ -1 +0,0 @@
1
- boletosimples-ruby
data/.travis.yml DELETED
@@ -1,11 +0,0 @@
1
- language: ruby
2
- rvm:
3
- - '2.3.1'
4
- - '2.2.1'
5
- - '2.1.0'
6
- branches:
7
- only:
8
- - master
9
- addons:
10
- code_climate:
11
- repo_token: 9c2feef5a1d636d5b08d10561c53f9293783fc175c0cc44d152cdb05a65d1868
@@ -1,8 +0,0 @@
1
- module BoletoSimples
2
- class Extra
3
- def self.userinfo
4
- response = Her::API.default_api.connection.get '/api/v1/userinfo.json'
5
- response.body[:data]
6
- end
7
- end
8
- end
@@ -1,7 +0,0 @@
1
- module BoletoSimples
2
- module Partner
3
- class User < BoletoSimples::BaseModel
4
- collection_path "partner/users"
5
- end
6
- end
7
- end
data/lib/oauth2_patch.rb DELETED
@@ -1,24 +0,0 @@
1
- module OAuth2
2
- class Error < StandardError
3
- attr_reader :response, :code, :description
4
-
5
- # standard error values include:
6
- # :invalid_request, :invalid_client, :invalid_token, :invalid_grant, :unsupported_grant_type, :invalid_scope
7
- def initialize(response)
8
- response.error = self
9
- @response = response
10
-
11
- message = []
12
-
13
- if response.parsed.is_a?(Hash)
14
- @code = response.parsed['error']
15
- @description = response.parsed['error_description']
16
- message << "#{@code}: #{@description}"
17
- end
18
-
19
- message << response.body.force_encoding('UTF-8')
20
-
21
- super(message.join("\n"))
22
- end
23
- end
24
- end
@@ -1,31 +0,0 @@
1
- # encoding: UTF-8
2
- require 'spec_helper'
3
-
4
- # Before running this spec again, you need to set environment variable BOLETOSIMPLES_ACCESS_TOKEN
5
- RSpec.describe BoletoSimples::Extra do
6
- context 'not authenticated' do
7
- before {
8
- BoletoSimples.configure do |c|
9
- c.application_id = nil
10
- c.application_secret = nil
11
- c.access_token = 'invalid'
12
- end
13
- }
14
- describe 'userinfo', vcr: { cassette_name: 'extra/userinfo/not_authenticated'} do
15
- subject { BoletoSimples::Extra.userinfo }
16
- it { expect{subject}.to raise_error(BoletoSimples::ResponseError, "401 GET https://sandbox.boletosimples.com.br/api/v1/userinfo.json?access_token=invalid (Você precisa se logar ou registrar antes de prosseguir.)") }
17
- end
18
- end
19
- context 'authenticated' do
20
- before {
21
- BoletoSimples.configure do |c|
22
- c.application_id = nil
23
- c.application_secret = nil
24
- end
25
- }
26
- describe 'userinfo', vcr: { cassette_name: 'extra/userinfo/authenticated'} do
27
- subject { BoletoSimples::Extra.userinfo }
28
- it { expect(subject).to eq({:id=>53, :login_url=>"https://sandbox.boletosimples.com.br/welcome?email=user1%40example.com&token=Dx6tDtrP_v9_CcDjMRmr", :email=>"user1@example.com", :account_type=>nil, :first_name=>nil, :middle_name=>nil, :last_name=>nil, :full_name=>nil, :cpf=>nil, :date_of_birth=>nil, :mother_name=>nil, :father_name=>nil, :account_level=>2, :phone_number=>nil, :address_street_name=>nil, :address_number=>nil, :address_complement=>nil, :address_neighborhood=>nil, :address_postal_code=>nil, :address_city_name=>nil, :address_state=>nil, :business_name=>nil, :business_cnpj=>nil, :business_legal_name=>nil}) }
29
- end
30
- end
31
- end
@@ -1,19 +0,0 @@
1
- # encoding: UTF-8
2
-
3
- require 'spec_helper'
4
-
5
- # Before running this spec again, you need to set environment variable BOLETOSIPLES_CLIENT_CREDENTIALS_TOKEN
6
- RSpec.describe BoletoSimples::Partner::User do
7
- before {
8
- BoletoSimples.configure do |c|
9
- c.access_token = ENV['BOLETOSIMPLES_CLIENT_CREDENTIALS_TOKEN']
10
- end
11
- }
12
- # ATENÇÃO: Após rodar este teste, edite o vcr_cassette e remova o token do login_url e substitua o application_access_token para xxx
13
- describe 'create', vcr: { cassette_name: 'resources/partner/user/create'} do
14
- subject { BoletoSimples::Partner::User.create(email: 'user2@example.com') }
15
- it { expect(subject.id).not_to be_nil }
16
- it { expect(subject.response_errors).to eq({}) }
17
- it { expect(subject.attributes.keys).to eq(["email", "id", "account_type", "sex", "cpf", "address_street_name", "address_state", "address_neighborhood", "address_postal_code", "address_number", "address_complement", "phone_number", "withdrawal_period", "notification_url", "first_name", "middle_name", "last_name", "date_of_birth", "business_category", "business_subcategory", "business_website", "business_name", "business_legal_name", "business_type", "business_cnpj", "address_city_name", "full_name", "login_url", "mother_name", "father_name", "application_access_token"]) }
18
- end
19
- end
@@ -1,64 +0,0 @@
1
- ---
2
- http_interactions:
3
- - request:
4
- method: post
5
- uri: https://sandbox.boletosimples.com.br/api/v1/oauth2/token
6
- body:
7
- encoding: UTF-8
8
- string: '{"grant_type":"client_credentials","client_id":"app-id","client_secret":"app-secret"}'
9
- headers:
10
- User-Agent:
11
- - BoletoSimples Ruby Client v0.1.0 (contato@boletosimples.com.br)
12
- Content-Type:
13
- - application/json
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: 401
21
- message: Unauthorized
22
- headers:
23
- Server:
24
- - Cowboy
25
- Connection:
26
- - keep-alive
27
- Strict-Transport-Security:
28
- - max-age=2592000
29
- Cache-Control:
30
- - no-store
31
- Pragma:
32
- - no-cache
33
- Content-Type:
34
- - application/json; charset=utf-8
35
- Www-Authenticate:
36
- - !binary |-
37
- QmVhcmVyIHJlYWxtPSJCb2xldG9TaW1wbGVzIiwgZXJyb3I9ImludmFsaWRf
38
- Y2xpZW50IiwgZXJyb3JfZGVzY3JpcHRpb249IkF1dGVudGljYcOnw6NvIGRv
39
- IGNsaWVudGUgZmFsaG91IGRldmlkbyBow6EgdW0gY2xpZW50ZSBkZXNjb25o
40
- ZWNpZG8sIG5lbmh1bSBjbGllbnRlIGRlIGF1dGVudGljYcOnw6NvIGluY2x1
41
- c28sIG91IG3DqXRvZG8gZGUgYXV0ZW50aWNhw6fDo28gbsOjbyBzdXBvcnRh
42
- ZG8uIg==
43
- X-Request-Id:
44
- - c694e3a4-3021-40b6-94f4-b8e8d8bac941
45
- X-Runtime:
46
- - '0.014012'
47
- Date:
48
- - Sun, 08 Mar 2015 19:58:22 GMT
49
- X-Rack-Cache:
50
- - invalidate, pass
51
- Vary:
52
- - Accept-Encoding
53
- Transfer-Encoding:
54
- - chunked
55
- Via:
56
- - 1.1 vegur
57
- body:
58
- encoding: UTF-8
59
- string: '{"error":"invalid_client","error_description":"Autenticação do cliente
60
- falhou devido há um cliente desconhecido, nenhum cliente de autenticação incluso,
61
- ou método de autenticação não suportado."}'
62
- http_version:
63
- recorded_at: Sun, 08 Mar 2015 19:58:21 GMT
64
- recorded_with: VCR 2.9.3
@@ -1,56 +0,0 @@
1
- ---
2
- http_interactions:
3
- - request:
4
- method: post
5
- uri: https://sandbox.boletosimples.com.br/api/v1/oauth2/token
6
- body:
7
- encoding: UTF-8
8
- string: '{"grant_type":"client_credentials","client_id":"BOLETOSIMPLES_APP_ID","client_secret":"BOLETOSIMPLES_APP_SECRET"}'
9
- headers:
10
- User-Agent:
11
- - BoletoSimples Ruby Client v0.1.0 (contato@boletosimples.com.br)
12
- Content-Type:
13
- - application/json
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
- Cache-Control:
30
- - no-store
31
- Pragma:
32
- - no-cache
33
- Content-Type:
34
- - application/json; charset=utf-8
35
- Etag:
36
- - W/"c8eefa19fc4751fc6480c046e90ccd10"
37
- X-Request-Id:
38
- - 9c0e3e45-1548-4148-bdbb-c1e21ae63929
39
- X-Runtime:
40
- - '0.063431'
41
- Date:
42
- - Sun, 08 Mar 2015 20:00:22 GMT
43
- X-Rack-Cache:
44
- - invalidate, pass
45
- Vary:
46
- - Accept-Encoding
47
- Transfer-Encoding:
48
- - chunked
49
- Via:
50
- - 1.1 vegur
51
- body:
52
- encoding: UTF-8
53
- string: '{"access_token":"xxx","token_type":"bearer","scope":"login","created_at":1425844822}'
54
- http_version:
55
- recorded_at: Sun, 08 Mar 2015 20:00:22 GMT
56
- recorded_with: VCR 2.9.3
@@ -1,58 +0,0 @@
1
- ---
2
- http_interactions:
3
- - request:
4
- method: get
5
- uri: https://sandbox.boletosimples.com.br/api/v1/userinfo.json?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
- - '472'
35
- Etag:
36
- - W/"2d2f54e118a16fc72383e7533ebcfeb1"
37
- Cache-Control:
38
- - must-revalidate, private, max-age=0
39
- X-Request-Id:
40
- - 0ee42794-98d4-45ac-a044-44b68359e921
41
- X-Runtime:
42
- - '0.098253'
43
- Date:
44
- - Sun, 08 Mar 2015 19:55:24 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":53,"login_url":"https://sandbox.boletosimples.com.br/welcome?email=user1%40example.com\u0026token=Dx6tDtrP_v9_CcDjMRmr","email":"user1@example.com","account_type":null,"first_name":null,"middle_name":null,"last_name":null,"full_name":null,"cpf":null,"date_of_birth":null,"mother_name":null,"father_name":null,"account_level":2,"phone_number":null,"address_street_name":null,"address_number":null,"address_complement":null,"address_neighborhood":null,"address_postal_code":null,"address_city_name":null,"address_state":null,"business_name":null,"business_cnpj":null,"business_legal_name":null}'
56
- http_version:
57
- recorded_at: Sun, 08 Mar 2015 19:55:23 GMT
58
- recorded_with: VCR 2.9.3
@@ -1,54 +0,0 @@
1
- ---
2
- http_interactions:
3
- - request:
4
- method: get
5
- uri: https://sandbox.boletosimples.com.br/api/v1/userinfo.json?access_token=invalid
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="invalid"
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: 401
21
- message: Unauthorized
22
- headers:
23
- Server:
24
- - Cowboy
25
- Connection:
26
- - keep-alive
27
- Strict-Transport-Security:
28
- - max-age=2592000
29
- Www-Authenticate:
30
- - Basic realm="Boleto Simples"
31
- Content-Type:
32
- - application/json; charset=utf-8
33
- Cache-Control:
34
- - no-cache, private
35
- X-Request-Id:
36
- - 75fdd36d-7d49-4971-8093-e55394e9a86b
37
- X-Runtime:
38
- - '0.022343'
39
- Date:
40
- - Sun, 08 Mar 2015 19:55:23 GMT
41
- X-Rack-Cache:
42
- - miss
43
- Vary:
44
- - Accept-Encoding
45
- Transfer-Encoding:
46
- - chunked
47
- Via:
48
- - 1.1 vegur
49
- body:
50
- encoding: UTF-8
51
- string: '{"error":"Você precisa se logar ou registrar antes de prosseguir."}'
52
- http_version:
53
- recorded_at: Sun, 08 Mar 2015 19:55:22 GMT
54
- recorded_with: VCR 2.9.3
@@ -1,58 +0,0 @@
1
- ---
2
- http_interactions:
3
- - request:
4
- method: get
5
- uri: https://sandbox.boletosimples.com.br/api/v1/userinfo.json?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
- - '474'
35
- Etag:
36
- - W/"2d2f54e118a16fc72383e7533ebcfeb1"
37
- Cache-Control:
38
- - must-revalidate, private, max-age=0
39
- X-Request-Id:
40
- - 3463012c-9a5f-4987-8d7d-9aad2f7db634
41
- X-Runtime:
42
- - '0.087346'
43
- Date:
44
- - Sun, 08 Mar 2015 19:55:22 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":53,"login_url":"https://sandbox.boletosimples.com.br/welcome?email=user1%40example.com\u0026token=Dx6tDtrP_v9_CcDjMRmr","email":"user1@example.com","account_type":null,"first_name":null,"middle_name":null,"last_name":null,"full_name":null,"cpf":null,"date_of_birth":null,"mother_name":null,"father_name":null,"account_level":2,"phone_number":null,"address_street_name":null,"address_number":null,"address_complement":null,"address_neighborhood":null,"address_postal_code":null,"address_city_name":null,"address_state":null,"business_name":null,"business_cnpj":null,"business_legal_name":null}'
56
- http_version:
57
- recorded_at: Sun, 08 Mar 2015 19:55:21 GMT
58
- recorded_with: VCR 2.9.3
@@ -1,118 +0,0 @@
1
- ---
2
- http_interactions:
3
- - request:
4
- method: get
5
- uri: https://sandbox.boletosimples.com.br/api/v1/bank_billets/863?access_token=BOLETOSIMPLES_ACCESS_TOKEN
6
- body:
7
- encoding: US-ASCII
8
- string: ''
9
- headers:
10
- User-Agent:
11
- - BoletoSimples Ruby Client v0.1.1 (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
- - '476'
35
- Etag:
36
- - W/"c607d4b12f290939443ba87e9694bd72"
37
- Cache-Control:
38
- - must-revalidate, private, max-age=0
39
- X-Request-Id:
40
- - 1f3ceac5-3ed4-42b2-9365-83440f8f578d
41
- X-Runtime:
42
- - '0.033791'
43
- Date:
44
- - Sun, 08 Mar 2015 21:15:40 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":863,"expire_at":"2014-01-01","paid_at":"2015-03-08","description":"Despesas
56
- do contrato 0012","status":"paid","shorten_url":"http://staging.bole.to/nis1avf8","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":null,"send_email_on_creation":null,"created_via_api":true,"customer_city_name":"Rio
60
- de Janeiro","paid_amount":9.01,"amount":9.01}'
61
- http_version:
62
- recorded_at: Sun, 08 Mar 2015 21:15:40 GMT
63
- - request:
64
- method: put
65
- uri: https://sandbox.boletosimples.com.br/api/v1/bank_billets/863/cancel?access_token=BOLETOSIMPLES_ACCESS_TOKEN
66
- body:
67
- encoding: UTF-8
68
- string: "{}"
69
- headers:
70
- User-Agent:
71
- - BoletoSimples Ruby Client v0.1.1 (contato@boletosimples.com.br)
72
- Authorization:
73
- - Token token="BOLETOSIMPLES_ACCESS_TOKEN"
74
- Content-Type:
75
- - application/json
76
- Accept-Encoding:
77
- - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
78
- Accept:
79
- - "*/*"
80
- response:
81
- status:
82
- code: 422
83
- message: Unprocessable Entity
84
- headers:
85
- Server:
86
- - Cowboy
87
- Connection:
88
- - keep-alive
89
- Strict-Transport-Security:
90
- - max-age=2592000
91
- Content-Type:
92
- - application/json; charset=utf-8
93
- X-Ratelimit-Limit:
94
- - '500'
95
- X-Ratelimit-Remaining:
96
- - '475'
97
- Cache-Control:
98
- - no-cache
99
- X-Request-Id:
100
- - c81a3615-db53-4419-806d-5e35dc23aee8
101
- X-Runtime:
102
- - '0.035312'
103
- Date:
104
- - Sun, 08 Mar 2015 21:15:41 GMT
105
- X-Rack-Cache:
106
- - invalidate, pass
107
- Vary:
108
- - Accept-Encoding
109
- Transfer-Encoding:
110
- - chunked
111
- Via:
112
- - 1.1 vegur
113
- body:
114
- encoding: UTF-8
115
- string: '{"errors":{"status":["cannot transition via cancel"]}}'
116
- http_version:
117
- recorded_at: Sun, 08 Mar 2015 21:15:40 GMT
118
- recorded_with: VCR 2.9.3