boletosimples 0.4.1 → 1.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/CHANGELOG.md +6 -14
- data/README.md +12 -54
- data/lib/boletosimples.rb +10 -6
- data/lib/boletosimples/configuration.rb +18 -33
- data/lib/boletosimples/last_request.rb +12 -9
- data/lib/boletosimples/middlewares/bearer.rb +12 -0
- data/lib/boletosimples/middlewares/last_request.rb +3 -1
- data/lib/boletosimples/middlewares/raise_error.rb +9 -2
- data/lib/boletosimples/middlewares/user_agent.rb +3 -1
- data/lib/boletosimples/resources/bank_billet.rb +5 -11
- data/lib/boletosimples/resources/bank_billet_account.rb +3 -1
- data/lib/boletosimples/resources/bank_billet_discharge.rb +6 -0
- data/lib/boletosimples/resources/bank_billet_payment.rb +6 -0
- data/lib/boletosimples/resources/bank_billet_remittance.rb +6 -0
- data/lib/boletosimples/resources/base_model.rb +3 -1
- data/lib/boletosimples/resources/customer.rb +3 -1
- data/lib/boletosimples/resources/customer_import.rb +8 -0
- data/lib/boletosimples/resources/customer_subscription.rb +3 -10
- data/lib/boletosimples/resources/customer_subscription_import.rb +8 -0
- data/lib/boletosimples/resources/discharge.rb +4 -11
- data/lib/boletosimples/resources/email_delivery.rb +6 -0
- data/lib/boletosimples/resources/event.rb +3 -1
- data/lib/boletosimples/resources/installment.rb +3 -1
- data/lib/boletosimples/resources/remittance.rb +3 -1
- data/lib/boletosimples/resources/sms_delivery.rb +6 -0
- data/lib/boletosimples/resources/transaction.rb +3 -1
- data/lib/boletosimples/resources/webhook.rb +3 -1
- data/lib/boletosimples/resources/webhook_delivery.rb +3 -1
- data/lib/boletosimples/response_error.rb +8 -3
- data/lib/boletosimples/version.rb +3 -1
- data/spec/boletosimples/configuration_spec.rb +71 -83
- data/spec/boletosimples/last_request_spec.rb +16 -28
- data/spec/boletosimples/resources/bank_billet_account_spec.rb +57 -33
- data/spec/boletosimples/resources/bank_billet_discharge_spec.rb +12 -0
- data/spec/boletosimples/resources/bank_billet_payment_spec.rb +12 -0
- data/spec/boletosimples/resources/bank_billet_remittance_spec.rb +12 -0
- data/spec/boletosimples/resources/bank_billet_spec.rb +56 -42
- data/spec/boletosimples/resources/customer_import_spec.rb +67 -0
- data/spec/boletosimples/resources/customer_spec.rb +52 -39
- data/spec/boletosimples/resources/customer_subscription_import_spec.rb +67 -0
- data/spec/boletosimples/resources/customer_subscription_spec.rb +61 -33
- data/spec/boletosimples/resources/discharge_spec.rb +64 -11
- data/spec/boletosimples/resources/email_delivery_spec.rb +12 -0
- data/spec/boletosimples/resources/event_spec.rb +7 -12
- data/spec/boletosimples/resources/installment_spec.rb +61 -32
- data/spec/boletosimples/resources/remittance_spec.rb +7 -12
- data/spec/boletosimples/resources/sms_delivery_spec.rb +12 -0
- data/spec/boletosimples/resources/transactions_spec.rb +7 -12
- data/spec/boletosimples/resources/webhook_delivery_spec.rb +7 -12
- data/spec/boletosimples/resources/webhook_spec.rb +7 -12
- data/spec/fixtures/customer_imports.csv +1 -0
- data/spec/fixtures/customer_subscription_imports.csv +1 -0
- data/spec/fixtures/discharge.RET +3 -0
- data/spec/fixtures/vcr_cassettes/last_request/bank_billets.yml +536 -88
- data/spec/fixtures/vcr_cassettes/resources/bank_billet/all.yml +537 -91
- data/spec/fixtures/vcr_cassettes/resources/bank_billet/cancel/success.yml +34 -92
- data/spec/fixtures/vcr_cassettes/resources/bank_billet/create/invalid_params.yml +32 -20
- data/spec/fixtures/vcr_cassettes/resources/bank_billet/create/invalid_root.yml +28 -17
- data/spec/fixtures/vcr_cassettes/resources/bank_billet/create/valid.yml +43 -27
- data/spec/fixtures/vcr_cassettes/resources/bank_billet/duplicate/success.yml +83 -0
- data/spec/fixtures/vcr_cassettes/resources/bank_billet/find.yml +51 -27
- data/spec/fixtures/vcr_cassettes/resources/bank_billet_account/all.yml +131 -20
- data/spec/fixtures/vcr_cassettes/resources/bank_billet_account/create/invalid_params.yml +34 -20
- data/spec/fixtures/vcr_cassettes/resources/bank_billet_account/create/invalid_root.yml +30 -19
- data/spec/fixtures/vcr_cassettes/resources/bank_billet_account/create/valid.yml +41 -21
- data/spec/fixtures/vcr_cassettes/resources/bank_billet_account/find.yml +38 -18
- data/spec/fixtures/vcr_cassettes/resources/bank_billet_discharge/all.yml +97 -0
- data/spec/fixtures/vcr_cassettes/resources/bank_billet_payment/all.yml +75 -0
- data/spec/fixtures/vcr_cassettes/resources/bank_billet_remittance/all.yml +126 -0
- data/spec/fixtures/vcr_cassettes/resources/customer/all.yml +79 -32
- data/spec/fixtures/vcr_cassettes/resources/customer/create/invalid_params.yml +30 -17
- data/spec/fixtures/vcr_cassettes/resources/customer/create/invalid_root.yml +28 -17
- data/spec/fixtures/vcr_cassettes/resources/customer/create/valid.yml +33 -21
- data/spec/fixtures/vcr_cassettes/resources/customer/find.yml +33 -19
- data/spec/fixtures/vcr_cassettes/resources/customer_import/all.yml +74 -0
- data/spec/fixtures/vcr_cassettes/resources/customer_import/create/invalid_params.yml +69 -0
- data/spec/fixtures/vcr_cassettes/resources/customer_import/create/invalid_root.yml +69 -0
- data/spec/fixtures/vcr_cassettes/resources/customer_import/create/valid.yml +76 -0
- data/spec/fixtures/vcr_cassettes/resources/customer_import/find.yml +71 -0
- data/spec/fixtures/vcr_cassettes/resources/customer_subscription/all.yml +102 -52
- data/spec/fixtures/vcr_cassettes/resources/customer_subscription/create/invalid_params.yml +40 -50
- data/spec/fixtures/vcr_cassettes/resources/customer_subscription/create/invalid_root.yml +36 -48
- data/spec/fixtures/vcr_cassettes/resources/customer_subscription/create/valid.yml +48 -53
- data/spec/fixtures/vcr_cassettes/resources/customer_subscription/find.yml +44 -50
- data/spec/fixtures/vcr_cassettes/resources/customer_subscription/next_charge.yml +45 -133
- data/spec/fixtures/vcr_cassettes/resources/customer_subscription_import/all.yml +75 -0
- data/spec/fixtures/vcr_cassettes/resources/customer_subscription_import/create/invalid_params.yml +69 -0
- data/spec/fixtures/vcr_cassettes/resources/customer_subscription_import/create/invalid_root.yml +70 -0
- data/spec/fixtures/vcr_cassettes/resources/customer_subscription_import/create/valid.yml +76 -0
- data/spec/fixtures/vcr_cassettes/resources/customer_subscription_import/find.yml +71 -0
- data/spec/fixtures/vcr_cassettes/resources/discharge/all.yml +64 -33
- data/spec/fixtures/vcr_cassettes/resources/discharge/create/invalid_params.yml +70 -0
- data/spec/fixtures/vcr_cassettes/resources/discharge/create/invalid_root.yml +69 -0
- data/spec/fixtures/vcr_cassettes/resources/discharge/create/valid.yml +84 -0
- data/spec/fixtures/vcr_cassettes/resources/discharge/find.yml +71 -0
- data/spec/fixtures/vcr_cassettes/resources/email_delivery/all.yml +73 -0
- data/spec/fixtures/vcr_cassettes/resources/event/all.yml +490 -166
- data/spec/fixtures/vcr_cassettes/resources/installment/all.yml +418 -52
- data/spec/fixtures/vcr_cassettes/resources/installment/create/invalid_params.yml +41 -52
- data/spec/fixtures/vcr_cassettes/resources/installment/create/invalid_root.yml +36 -48
- data/spec/fixtures/vcr_cassettes/resources/installment/create/valid.yml +48 -53
- data/spec/fixtures/vcr_cassettes/resources/installment/find.yml +44 -52
- data/spec/fixtures/vcr_cassettes/resources/remittance/all.yml +53 -33
- data/spec/fixtures/vcr_cassettes/resources/sns_delivery/all.yml +73 -0
- data/spec/fixtures/vcr_cassettes/resources/transaction/all.yml +34 -22
- data/spec/fixtures/vcr_cassettes/resources/web_hook/all.yml +42 -33
- data/spec/fixtures/vcr_cassettes/resources/webhook_delivery/all.yml +1232 -54
- data/spec/spec_helper.rb +3 -20
- data/spec/support/stub_env.rb +7 -0
- data/spec/support/vcr.rb +3 -4
- metadata +190 -82
- data/.coveralls.yml +0 -2
- data/.gitignore +0 -19
- data/.ruby-gemset +0 -1
- data/.ruby-version +0 -1
- data/.travis.yml +0 -11
- data/Gemfile +0 -4
- data/Rakefile +0 -6
- data/boletosimples.gemspec +0 -37
- data/lib/boletosimples/extra.rb +0 -8
- data/lib/boletosimples/resources/partner/user.rb +0 -7
- data/lib/oauth2_patch.rb +0 -24
- data/spec/boletosimples/extra_spec.rb +0 -31
- data/spec/boletosimples/resources/partner/user_spec.rb +0 -19
- data/spec/fixtures/vcr_cassettes/configuration/client_credentials/invalid.yml +0 -64
- data/spec/fixtures/vcr_cassettes/configuration/client_credentials/valid.yml +0 -56
- data/spec/fixtures/vcr_cassettes/extra/userinfo/authenticated.yml +0 -58
- data/spec/fixtures/vcr_cassettes/extra/userinfo/not_authenticated.yml +0 -54
- data/spec/fixtures/vcr_cassettes/last_request/userinfo.yml +0 -58
- data/spec/fixtures/vcr_cassettes/resources/bank_billet/cancel/failure.yml +0 -118
- data/spec/fixtures/vcr_cassettes/resources/partner/user/create.yml +0 -60
- data/spec/spec.opts +0 -8
@@ -1,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
|