boletosimples 0.6.0 → 2.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (138) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +16 -12
  3. data/README.md +21 -59
  4. data/lib/boletosimples/configuration.rb +25 -28
  5. data/lib/boletosimples/last_request.rb +17 -10
  6. data/lib/boletosimples/middlewares/bearer.rb +12 -0
  7. data/lib/boletosimples/middlewares/custom_headers.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 +3 -1
  15. data/lib/boletosimples/resources/bank_billet_payment.rb +3 -1
  16. data/lib/boletosimples/resources/bank_billet_remittance.rb +3 -1
  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 +3 -1
  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 +10 -5
  32. data/lib/boletosimples/version.rb +3 -1
  33. data/lib/boletosimples.rb +6 -6
  34. data/spec/boletosimples/configuration_spec.rb +67 -80
  35. data/spec/boletosimples/last_request_spec.rb +17 -28
  36. data/spec/boletosimples/middlewares/custom_headers_spec.rb +26 -0
  37. data/spec/boletosimples/resources/bank_billet_account_spec.rb +57 -33
  38. data/spec/boletosimples/resources/bank_billet_discharge_spec.rb +7 -12
  39. data/spec/boletosimples/resources/bank_billet_payment_spec.rb +7 -12
  40. data/spec/boletosimples/resources/bank_billet_remittance_spec.rb +7 -12
  41. data/spec/boletosimples/resources/bank_billet_spec.rb +56 -42
  42. data/spec/boletosimples/resources/customer_import_spec.rb +41 -30
  43. data/spec/boletosimples/resources/customer_spec.rb +57 -39
  44. data/spec/boletosimples/resources/customer_subscription_import_spec.rb +41 -30
  45. data/spec/boletosimples/resources/customer_subscription_spec.rb +61 -33
  46. data/spec/boletosimples/resources/discharge_spec.rb +64 -11
  47. data/spec/boletosimples/resources/email_delivery_spec.rb +6 -11
  48. data/spec/boletosimples/resources/event_spec.rb +7 -12
  49. data/spec/boletosimples/resources/installment_spec.rb +61 -32
  50. data/spec/boletosimples/resources/remittance_spec.rb +7 -12
  51. data/spec/boletosimples/resources/sms_delivery_spec.rb +12 -0
  52. data/spec/boletosimples/resources/transactions_spec.rb +7 -12
  53. data/spec/boletosimples/resources/webhook_delivery_spec.rb +7 -12
  54. data/spec/boletosimples/resources/webhook_spec.rb +7 -12
  55. data/spec/fixtures/discharge.RET +3 -0
  56. data/spec/fixtures/vcr_cassettes/custom_headers.yml +113 -0
  57. data/spec/fixtures/vcr_cassettes/last_request/bank_billets.yml +409 -95
  58. data/spec/fixtures/vcr_cassettes/resources/bank_billet/all.yml +101 -99
  59. data/spec/fixtures/vcr_cassettes/resources/bank_billet/cancel/success.yml +55 -95
  60. data/spec/fixtures/vcr_cassettes/resources/bank_billet/create/invalid_params.yml +55 -27
  61. data/spec/fixtures/vcr_cassettes/resources/bank_billet/create/invalid_root.yml +51 -24
  62. data/spec/fixtures/vcr_cassettes/resources/bank_billet/create/valid.yml +64 -34
  63. data/spec/fixtures/vcr_cassettes/resources/bank_billet/duplicate/success.yml +97 -0
  64. data/spec/fixtures/vcr_cassettes/resources/bank_billet/find.yml +73 -34
  65. data/spec/fixtures/vcr_cassettes/resources/bank_billet_account/all.yml +82 -27
  66. data/spec/fixtures/vcr_cassettes/resources/bank_billet_account/create/invalid_params.yml +57 -27
  67. data/spec/fixtures/vcr_cassettes/resources/bank_billet_account/create/invalid_root.yml +53 -26
  68. data/spec/fixtures/vcr_cassettes/resources/bank_billet_account/create/valid.yml +64 -28
  69. data/spec/fixtures/vcr_cassettes/resources/bank_billet_account/find.yml +61 -25
  70. data/spec/fixtures/vcr_cassettes/resources/bank_billet_discharge/all.yml +59 -46
  71. data/spec/fixtures/vcr_cassettes/resources/bank_billet_payment/all.yml +74 -71
  72. data/spec/fixtures/vcr_cassettes/resources/bank_billet_remittance/all.yml +63 -47
  73. data/spec/fixtures/vcr_cassettes/resources/customer/all.yml +141 -39
  74. data/spec/fixtures/vcr_cassettes/resources/customer/create/invalid_params.yml +54 -25
  75. data/spec/fixtures/vcr_cassettes/resources/customer/create/invalid_root.yml +54 -24
  76. data/spec/fixtures/vcr_cassettes/resources/customer/create/valid.yml +56 -28
  77. data/spec/fixtures/vcr_cassettes/resources/customer/find.yml +56 -26
  78. data/spec/fixtures/vcr_cassettes/resources/customer_import/all.yml +58 -59
  79. data/spec/fixtures/vcr_cassettes/resources/customer_import/create/invalid_params.yml +53 -51
  80. data/spec/fixtures/vcr_cassettes/resources/customer_import/create/invalid_root.yml +54 -52
  81. data/spec/fixtures/vcr_cassettes/resources/customer_import/create/valid.yml +58 -67
  82. data/spec/fixtures/vcr_cassettes/resources/customer_import/find.yml +55 -53
  83. data/spec/fixtures/vcr_cassettes/resources/customer_subscription/all.yml +65 -51
  84. data/spec/fixtures/vcr_cassettes/resources/customer_subscription/create/invalid_params.yml +56 -50
  85. data/spec/fixtures/vcr_cassettes/resources/customer_subscription/create/invalid_root.yml +52 -48
  86. data/spec/fixtures/vcr_cassettes/resources/customer_subscription/create/valid.yml +63 -52
  87. data/spec/fixtures/vcr_cassettes/resources/customer_subscription/find.yml +61 -51
  88. data/spec/fixtures/vcr_cassettes/resources/customer_subscription/next_charge.yml +60 -132
  89. data/spec/fixtures/vcr_cassettes/resources/customer_subscription_import/all.yml +58 -54
  90. data/spec/fixtures/vcr_cassettes/resources/customer_subscription_import/create/invalid_params.yml +53 -52
  91. data/spec/fixtures/vcr_cassettes/resources/customer_subscription_import/create/invalid_root.yml +55 -53
  92. data/spec/fixtures/vcr_cassettes/resources/customer_subscription_import/create/valid.yml +58 -69
  93. data/spec/fixtures/vcr_cassettes/resources/customer_subscription_import/find.yml +55 -54
  94. data/spec/fixtures/vcr_cassettes/resources/discharge/all.yml +63 -34
  95. data/spec/fixtures/vcr_cassettes/resources/discharge/create/invalid_params.yml +86 -0
  96. data/spec/fixtures/vcr_cassettes/resources/discharge/create/invalid_root.yml +85 -0
  97. data/spec/fixtures/vcr_cassettes/resources/discharge/create/valid.yml +100 -0
  98. data/spec/fixtures/vcr_cassettes/resources/discharge/find.yml +89 -0
  99. data/spec/fixtures/vcr_cassettes/resources/email_delivery/all.yml +40 -43
  100. data/spec/fixtures/vcr_cassettes/resources/event/all.yml +326 -167
  101. data/spec/fixtures/vcr_cassettes/resources/installment/all.yml +113 -51
  102. data/spec/fixtures/vcr_cassettes/resources/installment/create/invalid_params.yml +57 -52
  103. data/spec/fixtures/vcr_cassettes/resources/installment/create/invalid_root.yml +52 -48
  104. data/spec/fixtures/vcr_cassettes/resources/installment/create/valid.yml +63 -52
  105. data/spec/fixtures/vcr_cassettes/resources/installment/find.yml +83 -51
  106. data/spec/fixtures/vcr_cassettes/resources/remittance/all.yml +83 -62
  107. data/spec/fixtures/vcr_cassettes/resources/sns_delivery/all.yml +89 -0
  108. data/spec/fixtures/vcr_cassettes/resources/transaction/all.yml +73 -60
  109. data/spec/fixtures/vcr_cassettes/resources/web_hook/all.yml +59 -34
  110. data/spec/fixtures/vcr_cassettes/resources/webhook_delivery/all.yml +2684 -55
  111. data/spec/spec_helper.rb +3 -20
  112. data/spec/support/stub_env.rb +7 -0
  113. data/spec/support/vcr.rb +3 -4
  114. metadata +42 -176
  115. data/.coveralls.yml +0 -2
  116. data/.gitignore +0 -19
  117. data/.ruby-version +0 -1
  118. data/.travis.yml +0 -46
  119. data/Gemfile +0 -4
  120. data/Rakefile +0 -14
  121. data/boletosimples.gemspec +0 -38
  122. data/gemfiles/rails_42.gemfile +0 -8
  123. data/gemfiles/rails_50.gemfile +0 -8
  124. data/gemfiles/rails_51.gemfile +0 -8
  125. data/gemfiles/rails_52.gemfile +0 -9
  126. data/lib/boletosimples/extra.rb +0 -8
  127. data/lib/boletosimples/resources/partner/user.rb +0 -7
  128. data/lib/oauth2_patch.rb +0 -24
  129. data/spec/boletosimples/extra_spec.rb +0 -31
  130. data/spec/boletosimples/resources/partner/user_spec.rb +0 -19
  131. data/spec/fixtures/vcr_cassettes/configuration/client_credentials/invalid.yml +0 -64
  132. data/spec/fixtures/vcr_cassettes/configuration/client_credentials/valid.yml +0 -56
  133. data/spec/fixtures/vcr_cassettes/extra/userinfo/authenticated.yml +0 -58
  134. data/spec/fixtures/vcr_cassettes/extra/userinfo/not_authenticated.yml +0 -54
  135. data/spec/fixtures/vcr_cassettes/last_request/userinfo.yml +0 -58
  136. data/spec/fixtures/vcr_cassettes/resources/bank_billet/cancel/failure.yml +0 -118
  137. data/spec/fixtures/vcr_cassettes/resources/partner/user/create.yml +0 -60
  138. data/spec/spec.opts +0 -8
@@ -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
@@ -1,60 +0,0 @@
1
- ---
2
- http_interactions:
3
- - request:
4
- method: post
5
- uri: https://sandbox.boletosimples.com.br/api/v1/partner/users?access_token=BOLETOSIMPLES_CLIENT_CREDENTIALS_TOKEN
6
- body:
7
- encoding: UTF-8
8
- string: '{"user":{"email":"user2@example.com"}}'
9
- headers:
10
- User-Agent:
11
- - BoletoSimples Ruby Client v0.1.0 (contato@boletosimples.com.br)
12
- Authorization:
13
- - Token token="BOLETOSIMPLES_CLIENT_CREDENTIALS_TOKEN"
14
- Content-Type:
15
- - application/json
16
- Accept-Encoding:
17
- - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
18
- Accept:
19
- - "*/*"
20
- response:
21
- status:
22
- code: 201
23
- message: Created
24
- headers:
25
- Server:
26
- - Cowboy
27
- Connection:
28
- - keep-alive
29
- Strict-Transport-Security:
30
- - max-age=2592000
31
- Content-Type:
32
- - application/json; charset=utf-8
33
- X-Ratelimit-Limit:
34
- - '500'
35
- X-Ratelimit-Remaining:
36
- - '499'
37
- Etag:
38
- - W/"ece5dc3afb4325911152bfc2bfc04d45"
39
- Cache-Control:
40
- - max-age=0, private, must-revalidate
41
- X-Request-Id:
42
- - 23bd5205-8955-4316-887f-b9e92643908b
43
- X-Runtime:
44
- - '4.385478'
45
- Date:
46
- - Sun, 08 Mar 2015 20:02:43 GMT
47
- X-Rack-Cache:
48
- - invalidate, pass
49
- Vary:
50
- - Accept-Encoding
51
- Transfer-Encoding:
52
- - chunked
53
- Via:
54
- - 1.1 vegur
55
- body:
56
- encoding: UTF-8
57
- string: '{"id":60,"email":"user2@example.com","account_type":null,"sex":null,"cpf":null,"address_street_name":null,"address_state":null,"address_neighborhood":null,"address_postal_code":null,"address_number":null,"address_complement":null,"phone_number":null,"withdrawal_period":"biweekly","notification_url":null,"first_name":null,"middle_name":null,"last_name":null,"date_of_birth":null,"business_category":null,"business_subcategory":null,"business_website":null,"business_name":null,"business_legal_name":null,"business_type":null,"business_cnpj":null,"address_city_name":null,"full_name":null,"login_url":"https://sandbox.boletosimples.com.br/welcome?email=user2%40example.com\u0026token=xxx","mother_name":null,"father_name":null,"application_access_token":"xxx"}'
58
- http_version:
59
- recorded_at: Sun, 08 Mar 2015 20:02:42 GMT
60
- recorded_with: VCR 2.9.3
data/spec/spec.opts DELETED
@@ -1,8 +0,0 @@
1
- --colour
2
- --format
3
- progress
4
- --loadby
5
- mtime
6
- --reverse
7
- -rubygems
8
- --debugger