boletosimples 0.4.1 → 0.4.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.ruby-version +1 -1
- data/.travis.yml +4 -3
- data/CHANGELOG.md +6 -0
- data/boletosimples.gemspec +12 -11
- data/lib/boletosimples.rb +2 -0
- data/lib/boletosimples/configuration.rb +6 -6
- data/lib/boletosimples/resources/customer_import.rb +6 -0
- data/lib/boletosimples/resources/customer_subscription_import.rb +6 -0
- data/lib/boletosimples/version.rb +1 -1
- data/spec/boletosimples/configuration_spec.rb +25 -9
- data/spec/boletosimples/resources/customer_import_spec.rb +56 -0
- data/spec/boletosimples/resources/customer_subscription_import_spec.rb +56 -0
- data/spec/fixtures/customer_imports.csv +1 -0
- data/spec/fixtures/customer_subscription_imports.csv +1 -0
- data/spec/fixtures/vcr_cassettes/resources/customer_import/all.yml +91 -0
- data/spec/fixtures/vcr_cassettes/resources/customer_import/create/invalid_params.yml +83 -0
- data/spec/fixtures/vcr_cassettes/resources/customer_import/create/invalid_root.yml +83 -0
- data/spec/fixtures/vcr_cassettes/resources/customer_import/create/valid.yml +101 -0
- data/spec/fixtures/vcr_cassettes/resources/customer_import/find.yml +85 -0
- data/spec/fixtures/vcr_cassettes/resources/customer_subscription_import/all.yml +86 -0
- data/spec/fixtures/vcr_cassettes/resources/customer_subscription_import/create/invalid_params.yml +84 -0
- data/spec/fixtures/vcr_cassettes/resources/customer_subscription_import/create/invalid_root.yml +84 -0
- data/spec/fixtures/vcr_cassettes/resources/customer_subscription_import/create/valid.yml +103 -0
- data/spec/fixtures/vcr_cassettes/resources/customer_subscription_import/find.yml +86 -0
- data/spec/spec_helper.rb +2 -2
- metadata +82 -38
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c76fb6e8155355e8695d78ee37756aa0cc2dc5cc
|
4
|
+
data.tar.gz: bddd7d242f6f1cc0b759397bceaf8ad5d8927deb
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3b647a784cfe93ff534a75dce7298f51ccfee3ab72a2d070656ffd9d25476ed347c679733fc8a7960cef68195f6661cbbe9fabe14af20eac46eab40d10007b82
|
7
|
+
data.tar.gz: dbf082c46a21758f78e447a86dc580bd665cdb3f994c5f8d24edb40c561d3d39abb68f88a25ac3f8ed44fb897c3b4efa8adb31daf045e1e708b7f3ee9df4701d
|
data/.ruby-version
CHANGED
@@ -1 +1 @@
|
|
1
|
-
2.
|
1
|
+
2.4.2
|
data/.travis.yml
CHANGED
data/CHANGELOG.md
CHANGED
data/boletosimples.gemspec
CHANGED
@@ -18,20 +18,21 @@ Gem::Specification.new do |gem|
|
|
18
18
|
gem.test_files = gem.files.grep(/^(test|spec|features)\//)
|
19
19
|
gem.require_paths = ['lib']
|
20
20
|
|
21
|
-
gem.required_ruby_version = '>=
|
21
|
+
gem.required_ruby_version = '>= 2.0'
|
22
22
|
|
23
23
|
# Gems that must be intalled for boletosimples to work
|
24
|
-
gem.add_dependency 'her', '~> 0.
|
25
|
-
gem.add_dependency 'faraday_middleware', '~> 0.
|
26
|
-
gem.add_dependency 'faraday-http-cache', '~>
|
24
|
+
gem.add_dependency 'her', '~> 0.10'
|
25
|
+
gem.add_dependency 'faraday_middleware', '~> 0.12'
|
26
|
+
gem.add_dependency 'faraday-http-cache', '~> 2.0.0'
|
27
27
|
|
28
28
|
# Gems that must be installed for boletosimples to compile and build
|
29
|
-
gem.add_development_dependency 'pry'
|
30
|
-
gem.add_development_dependency 'rspec'
|
31
|
-
gem.add_development_dependency 'vcr'
|
32
|
-
gem.add_development_dependency 'webmock'
|
33
|
-
gem.add_development_dependency 'rake'
|
34
|
-
gem.add_development_dependency 'coveralls'
|
35
|
-
gem.add_development_dependency '
|
29
|
+
gem.add_development_dependency 'pry'
|
30
|
+
gem.add_development_dependency 'rspec'
|
31
|
+
gem.add_development_dependency 'vcr'
|
32
|
+
gem.add_development_dependency 'webmock'
|
33
|
+
gem.add_development_dependency 'rake'
|
34
|
+
gem.add_development_dependency 'coveralls'
|
35
|
+
gem.add_development_dependency 'simplecov'
|
36
|
+
gem.add_development_dependency 'codeclimate-test-reporter'
|
36
37
|
gem.add_development_dependency 'rubocop'
|
37
38
|
end
|
data/lib/boletosimples.rb
CHANGED
@@ -13,7 +13,9 @@ module BoletoSimples
|
|
13
13
|
autoload :BankBilletAccount, 'boletosimples/resources/bank_billet_account'
|
14
14
|
autoload :Event, 'boletosimples/resources/event'
|
15
15
|
autoload :Customer, 'boletosimples/resources/customer'
|
16
|
+
autoload :CustomerImport, 'boletosimples/resources/customer_import'
|
16
17
|
autoload :CustomerSubscription, 'boletosimples/resources/customer_subscription'
|
18
|
+
autoload :CustomerSubscriptionImport, 'boletosimples/resources/customer_subscription_import'
|
17
19
|
autoload :Installment, 'boletosimples/resources/installment'
|
18
20
|
autoload :Transaction, 'boletosimples/resources/transaction'
|
19
21
|
autoload :Remittance, 'boletosimples/resources/remittance'
|
@@ -41,14 +41,14 @@ module BoletoSimples
|
|
41
41
|
end
|
42
42
|
|
43
43
|
def setup_her
|
44
|
-
Her::API.setup url:
|
44
|
+
Her::API.setup url: base_uri do |c|
|
45
45
|
# Request
|
46
46
|
c.use BoletoSimples::Middleware::UserAgent
|
47
|
-
c.use FaradayMiddleware::OAuth2,
|
47
|
+
c.use FaradayMiddleware::OAuth2, access_token, token_type: 'param' if access_token?
|
48
|
+
c.use Faraday::Request::Multipart
|
49
|
+
c.use Faraday::Request::UrlEncoded
|
48
50
|
c.use FaradayMiddleware::EncodeJson
|
49
|
-
|
50
|
-
c.use Faraday::HttpCache, store: BoletoSimples.configuration.cache
|
51
|
-
end
|
51
|
+
c.use Faraday::HttpCache, store: cache unless cache.nil?
|
52
52
|
|
53
53
|
# Response
|
54
54
|
c.use BoletoSimples::Middleware::LastRequest
|
@@ -60,7 +60,7 @@ module BoletoSimples
|
|
60
60
|
end
|
61
61
|
|
62
62
|
# Because Her set the api on the moment module is included we need to call use_api again, after changing the configuration.
|
63
|
-
[BankBillet, BankBilletAccount, Customer, CustomerSubscription, Installment, Transaction, Partner::User,
|
63
|
+
[BankBillet, BankBilletAccount, Customer, CustomerImport, CustomerSubscription, CustomerSubscriptionImport, Installment, Transaction, Partner::User,
|
64
64
|
Webhook, Discharge, Remittance, WebhookDelivery, Event].each do |klass|
|
65
65
|
klass.send(:use_api, Her::API.default_api)
|
66
66
|
end
|
@@ -2,14 +2,28 @@
|
|
2
2
|
require 'spec_helper'
|
3
3
|
|
4
4
|
RSpec.describe BoletoSimples::Configuration do
|
5
|
+
before {
|
6
|
+
@last_env = {}
|
7
|
+
@last_env['BOLETOSIMPLES_ENV'] = ENV['BOLETOSIMPLES_ENV']
|
8
|
+
@last_env['BOLETOSIMPLES_APP_ID'] = ENV['BOLETOSIMPLES_APP_ID']
|
9
|
+
@last_env['BOLETOSIMPLES_APP_SECRET'] = ENV['BOLETOSIMPLES_APP_SECRET']
|
10
|
+
@last_env['BOLETOSIMPLES_ACCESS_TOKEN'] = ENV['BOLETOSIMPLES_ACCESS_TOKEN']
|
11
|
+
}
|
12
|
+
after {
|
13
|
+
ENV['BOLETOSIMPLES_ENV'] = @last_env['BOLETOSIMPLES_ENV']
|
14
|
+
ENV['BOLETOSIMPLES_APP_ID'] = @last_env['BOLETOSIMPLES_APP_ID']
|
15
|
+
ENV['BOLETOSIMPLES_APP_SECRET'] = @last_env['BOLETOSIMPLES_APP_SECRET']
|
16
|
+
ENV['BOLETOSIMPLES_ACCESS_TOKEN'] = @last_env['BOLETOSIMPLES_ACCESS_TOKEN']
|
17
|
+
}
|
5
18
|
describe 'defaults' do
|
6
19
|
before {
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
20
|
+
ENV['BOLETOSIMPLES_ENV'] = nil
|
21
|
+
ENV['BOLETOSIMPLES_APP_ID'] = nil
|
22
|
+
ENV['BOLETOSIMPLES_APP_SECRET'] = nil
|
23
|
+
ENV['BOLETOSIMPLES_ACCESS_TOKEN'] = nil
|
11
24
|
}
|
12
25
|
subject { BoletoSimples::Configuration.new }
|
26
|
+
before { subject.setup_her}
|
13
27
|
it { expect(subject.environment).to eq(:sandbox) }
|
14
28
|
it { expect(subject.base_uri).to eq('https://sandbox.boletosimples.com.br/api/v1') }
|
15
29
|
it { expect(subject.application_id).to be_nil }
|
@@ -20,12 +34,14 @@ RSpec.describe BoletoSimples::Configuration do
|
|
20
34
|
end
|
21
35
|
describe 'environment variables' do
|
22
36
|
before {
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
37
|
+
ENV['BOLETOSIMPLES_ENV'] = 'production'
|
38
|
+
ENV['BOLETOSIMPLES_APP_ID'] = 'app-id'
|
39
|
+
ENV['BOLETOSIMPLES_APP_SECRET'] = 'app-secret'
|
40
|
+
ENV['BOLETOSIMPLES_ACCESS_TOKEN'] = 'access-token'
|
27
41
|
}
|
28
|
-
|
42
|
+
before { BoletoSimples.configure }
|
43
|
+
subject { BoletoSimples.configuration }
|
44
|
+
# subject { BoletoSimples::Configuration.new }
|
29
45
|
it { expect(subject.environment).to eq(:production) }
|
30
46
|
it { expect(subject.base_uri).to eq('https://boletosimples.com.br/api/v1') }
|
31
47
|
it { expect(subject.application_id).to eq('app-id') }
|
@@ -0,0 +1,56 @@
|
|
1
|
+
# encoding: UTF-8
|
2
|
+
|
3
|
+
require 'spec_helper'
|
4
|
+
|
5
|
+
# Before running this spec again, you need to set environment variable BOLETOSIMPLES_ACCESS_TOKEN
|
6
|
+
RSpec.describe BoletoSimples::CustomerImport do
|
7
|
+
before {
|
8
|
+
BoletoSimples.configure do |c|
|
9
|
+
c.application_id = nil
|
10
|
+
c.application_secret = nil
|
11
|
+
end
|
12
|
+
}
|
13
|
+
describe 'methods' do
|
14
|
+
before {
|
15
|
+
VCR.use_cassette('resources/customer_import/create/valid') do
|
16
|
+
@customer_import = BoletoSimples::CustomerImport.create({
|
17
|
+
source: Faraday::UploadIO.new(File.join(File.dirname(__FILE__), '..', '..', 'fixtures', 'customer_imports.csv'), 'text/csv', 'customers.csv')
|
18
|
+
})
|
19
|
+
end
|
20
|
+
}
|
21
|
+
describe 'create' do
|
22
|
+
context 'valid parameters' do
|
23
|
+
subject { @customer_import }
|
24
|
+
it { expect(subject).to be_a_kind_of(BoletoSimples::CustomerImport) }
|
25
|
+
it { expect(subject.response_errors).to eq({}) }
|
26
|
+
it { expect(subject.attributes.keys).to match_array(["created_rows", "enqueued_at", "failed_to_create_rows", "failed_to_update_rows", "finished_at", "id", "import_errors", "processed_at", "processed_rows", "records_count", "source", "source_content_type", "source_file_name", "source_file_size", "source_updated_at", "started_at", "status", "total_rows", "updated_rows"]) }
|
27
|
+
end
|
28
|
+
context 'invalid parameters' do
|
29
|
+
context 'empty bank_billet' do
|
30
|
+
subject {
|
31
|
+
VCR.use_cassette('resources/customer_import/create/invalid_root') do
|
32
|
+
BoletoSimples::CustomerImport.create({})
|
33
|
+
end
|
34
|
+
}
|
35
|
+
it { expect(subject.response_errors).to eq({:customer_import=>["não pode ficar em branco"]}) }
|
36
|
+
end
|
37
|
+
context 'invalid params' do
|
38
|
+
subject {
|
39
|
+
VCR.use_cassette('resources/customer_import/create/invalid_params') do
|
40
|
+
BoletoSimples::CustomerImport.create({source: ''})
|
41
|
+
end
|
42
|
+
}
|
43
|
+
it { expect(subject.response_errors).to eq(source: ["não pode ficar em branco"]) }
|
44
|
+
end
|
45
|
+
end
|
46
|
+
end
|
47
|
+
describe 'find', vcr: { cassette_name: 'resources/customer_import/find'} do
|
48
|
+
subject { BoletoSimples::CustomerImport.find(@customer_import.id) }
|
49
|
+
it { expect(subject).to be_a_kind_of(BoletoSimples::CustomerImport) }
|
50
|
+
end
|
51
|
+
describe 'all', vcr: { cassette_name: 'resources/customer_import/all'} do
|
52
|
+
subject { BoletoSimples::CustomerImport.all }
|
53
|
+
it { expect(subject.first).to be_a_kind_of(BoletoSimples::CustomerImport) }
|
54
|
+
end
|
55
|
+
end
|
56
|
+
end
|
@@ -0,0 +1,56 @@
|
|
1
|
+
# encoding: UTF-8
|
2
|
+
|
3
|
+
require 'spec_helper'
|
4
|
+
|
5
|
+
# Before running this spec again, you need to set environment variable BOLETOSIMPLES_ACCESS_TOKEN
|
6
|
+
RSpec.describe BoletoSimples::CustomerSubscriptionImport do
|
7
|
+
before {
|
8
|
+
BoletoSimples.configure do |c|
|
9
|
+
c.application_id = nil
|
10
|
+
c.application_secret = nil
|
11
|
+
end
|
12
|
+
}
|
13
|
+
describe 'methods' do
|
14
|
+
before {
|
15
|
+
VCR.use_cassette('resources/customer_subscription_import/create/valid') do
|
16
|
+
@customer_subscription_import = BoletoSimples::CustomerSubscriptionImport.create({
|
17
|
+
source: Faraday::UploadIO.new(File.join(File.dirname(__FILE__), '..', '..', 'fixtures', 'customer_subscription_imports.csv'), 'text/csv', 'customer_subscriptions.csv')
|
18
|
+
})
|
19
|
+
end
|
20
|
+
}
|
21
|
+
describe 'create' do
|
22
|
+
context 'valid parameters' do
|
23
|
+
subject { @customer_subscription_import }
|
24
|
+
it { expect(subject).to be_a_kind_of(BoletoSimples::CustomerSubscriptionImport) }
|
25
|
+
it { expect(subject.response_errors).to eq({}) }
|
26
|
+
it { expect(subject.attributes.keys).to match_array(["created_rows", "enqueued_at", "failed_to_create_rows", "failed_to_update_rows", "finished_at", "id", "import_errors", "processed_at", "processed_rows", "records_count", "source", "source_content_type", "source_file_name", "source_file_size", "source_updated_at", "started_at", "status", "total_rows", "updated_rows"]) }
|
27
|
+
end
|
28
|
+
context 'invalid parameters' do
|
29
|
+
context 'empty bank_billet' do
|
30
|
+
subject {
|
31
|
+
VCR.use_cassette('resources/customer_subscription_import/create/invalid_root') do
|
32
|
+
BoletoSimples::CustomerSubscriptionImport.create({})
|
33
|
+
end
|
34
|
+
}
|
35
|
+
it { expect(subject.response_errors).to eq({:customer_subscription_import=>["não pode ficar em branco"]}) }
|
36
|
+
end
|
37
|
+
context 'invalid params' do
|
38
|
+
subject {
|
39
|
+
VCR.use_cassette('resources/customer_subscription_import/create/invalid_params') do
|
40
|
+
BoletoSimples::CustomerSubscriptionImport.create({source: ''})
|
41
|
+
end
|
42
|
+
}
|
43
|
+
it { expect(subject.response_errors).to eq(source: ["não pode ficar em branco"]) }
|
44
|
+
end
|
45
|
+
end
|
46
|
+
end
|
47
|
+
describe 'find', vcr: { cassette_name: 'resources/customer_subscription_import/find'} do
|
48
|
+
subject { BoletoSimples::CustomerSubscriptionImport.find(@customer_subscription_import.id) }
|
49
|
+
it { expect(subject).to be_a_kind_of(BoletoSimples::CustomerSubscriptionImport) }
|
50
|
+
end
|
51
|
+
describe 'all', vcr: { cassette_name: 'resources/customer_subscription_import/all'} do
|
52
|
+
subject { BoletoSimples::CustomerSubscriptionImport.all }
|
53
|
+
it { expect(subject.first).to be_a_kind_of(BoletoSimples::CustomerSubscriptionImport) }
|
54
|
+
end
|
55
|
+
end
|
56
|
+
end
|
@@ -0,0 +1 @@
|
|
1
|
+
Nome/Razao Social,Apelido/Nome Fantasia,CNPJ/CPF,E-mail,CEP,Endereço,Numero do Endereco,Complemento,Bairro,Cidade,Estado,Telefone (com DDD),DDD do Celular,Numero do Celular,E-mail opcional
|
@@ -0,0 +1 @@
|
|
1
|
+
ID,ID do Cliente,ID da Carteira,ID do Modelo,CNPJ/CPF do Cliente,Ciclo da Assinatura,Quantia *,Primeira Cobrança,Antecedência,Parar em,Demonstrativo *,Instruções para o Caixa,Multa por Atraso,Juros de Mora Mensal,E-mail,Observações
|
@@ -0,0 +1,91 @@
|
|
1
|
+
---
|
2
|
+
http_interactions:
|
3
|
+
- request:
|
4
|
+
method: get
|
5
|
+
uri: https://sandbox.boletosimples.com.br/api/v1/imports/customers?access_token=BOLETOSIMPLES_ACCESS_TOKEN
|
6
|
+
body:
|
7
|
+
encoding: US-ASCII
|
8
|
+
string: ''
|
9
|
+
headers:
|
10
|
+
User-Agent:
|
11
|
+
- BoletoSimples Ruby Client v0.4.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
|
+
Connection:
|
24
|
+
- keep-alive
|
25
|
+
Content-Type:
|
26
|
+
- 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
|
+
Date:
|
34
|
+
- Fri, 16 Jun 2017 03:50:17 GMT
|
35
|
+
Vary:
|
36
|
+
- Origin,Accept-Encoding
|
37
|
+
Strict-Transport-Security:
|
38
|
+
- max-age=631138519
|
39
|
+
X-Permitted-Cross-Domain-Policies:
|
40
|
+
- none
|
41
|
+
X-Xss-Protection:
|
42
|
+
- 1; mode=block
|
43
|
+
X-Request-Id:
|
44
|
+
- b7c0a074-5f03-49b9-af71-78e4a22ef7af
|
45
|
+
Content-Security-Policy-Report-Only:
|
46
|
+
- 'default-src ''self''; child-src ''self'' www.googleadservices.com googleads.g.doubleclick.net
|
47
|
+
www.google.com www.google.com.br app.popupdomination.com; connect-src ''self''
|
48
|
+
ws: wss: *.intercom.io ws.pusherapp.com hn.inspectlet.com *.pusher.com boletosimples.com.br
|
49
|
+
*.boletosimples.com.br boletosimples.zendesk.com; font-src ''self'' fonts.googleapis.com
|
50
|
+
fonts.gstatic.com js.intercomcdn.com data: v2.zopim.com d25j7wj0q61kjj.cloudfront.net;
|
51
|
+
img-src ''self'' https: data: maps.googleapis.com dev.bole.to:5001 bole.to
|
52
|
+
boletosimples-sandbox.s3.amazonaws.com; script-src ''self'' ''unsafe-inline''
|
53
|
+
static.intercomcdn.com cdn.inspectlet.com widget.intercom.io js.intercomcdn.com
|
54
|
+
js.pusher.com stats.pusher.com zapier.com www.google-analytics.com www.googleadservices.com
|
55
|
+
doug1izaerwt3.cloudfront.net app.popupdomination.com cdn.ywxi.net www.draw.io
|
56
|
+
tag.getdrip.com www.getdrip.com js-agent.newrelic.com bam.nr-data.net cdnjs.cloudflare.com
|
57
|
+
widget.pluga.co www.google.com www.gstatic.com boletosimples.zendesk.com assets.zendesk.com
|
58
|
+
v2.zopim.com d25j7wj0q61kjj.cloudfront.net; style-src ''self'' ''unsafe-inline''
|
59
|
+
fonts.googleapis.com d25j7wj0q61kjj.cloudfront.net; report-uri https://boletosimples.report-uri.io/r/default/csp/reportOnly'
|
60
|
+
Total:
|
61
|
+
- '6'
|
62
|
+
X-Download-Options:
|
63
|
+
- noopen
|
64
|
+
Etag:
|
65
|
+
- W/"1f7b18205f2c944fb3c09298b8477dd7"
|
66
|
+
X-Runtime:
|
67
|
+
- '0.040018'
|
68
|
+
X-Frame-Options:
|
69
|
+
- sameorigin
|
70
|
+
X-Content-Type-Options:
|
71
|
+
- nosniff
|
72
|
+
X-Rack-Cache:
|
73
|
+
- miss
|
74
|
+
X-Powered-By:
|
75
|
+
- Phusion Passenger 5.1.4
|
76
|
+
Server:
|
77
|
+
- nginx/1.10.3 + Phusion Passenger 5.1.4
|
78
|
+
Via:
|
79
|
+
- 1.1 vegur
|
80
|
+
body:
|
81
|
+
encoding: UTF-8
|
82
|
+
string: '[{"id":1,"created_rows":0,"records_count":null,"enqueued_at":"2017-06-15T23:02:55-03:00","started_at":"2017-06-15T23:02:56-03:00","finished_at":"2017-06-15T23:02:56-03:00","processed_at":null,"failed_to_create_rows":0,"failed_to_update_rows":0,"import_errors":[],"processed_rows":0,"total_rows":0,"updated_rows":0,"source_content_type":"text/plain","source_file_name":"cobregratis-customers.csv","source_file_size":210,"source_updated_at":"2017-06-15T23:02:55-03:00","status":"done"},{"id":2,"created_rows":0,"records_count":null,"enqueued_at":"2017-06-15T23:15:30-03:00","started_at":"2017-06-15T23:15:30-03:00","finished_at":"2017-06-15T23:15:30-03:00","processed_at":null,"failed_to_create_rows":1,"failed_to_update_rows":0,"import_errors":[[1,{"CEP":"não
|
83
|
+
pode ficar em branco","Bairro":"não pode ficar em branco","Cidade":"não pode
|
84
|
+
ficar em branco","Estado":"não está incluído na lista","Endereço":"não pode
|
85
|
+
ficar em branco","E-mail opcional":"não é válido","Nome/Razao Social":"não
|
86
|
+
pode ficar em branco","Numero do Celular":"não é um número de celular"}]],"processed_rows":1,"total_rows":1,"updated_rows":0,"source_content_type":"text/plain","source_file_name":"cobregratis-customers.csv","source_file_size":398,"source_updated_at":"2017-06-15T23:15:30-03:00","status":"done"},{"id":3,"created_rows":0,"records_count":null,"enqueued_at":"2017-06-15T23:22:46-03:00","started_at":"2017-06-15T23:22:46-03:00","finished_at":"2017-06-15T23:22:46-03:00","processed_at":null,"failed_to_create_rows":1,"failed_to_update_rows":0,"import_errors":[[1,{"Numero
|
87
|
+
do Celular":"não é um número de celular"}]],"processed_rows":1,"total_rows":1,"updated_rows":0,"source_content_type":"text/plain","source_file_name":"cobregratis-customers.csv","source_file_size":422,"source_updated_at":"2017-06-15T23:22:46-03:00","status":"done"},{"id":4,"created_rows":1,"records_count":1,"enqueued_at":"2017-06-15T23:23:24-03:00","started_at":"2017-06-15T23:23:24-03:00","finished_at":"2017-06-15T23:23:24-03:00","processed_at":null,"failed_to_create_rows":0,"failed_to_update_rows":0,"import_errors":[],"processed_rows":1,"total_rows":1,"updated_rows":0,"source_content_type":"text/plain","source_file_name":"cobregratis-customers.csv","source_file_size":423,"source_updated_at":"2017-06-15T23:23:24-03:00","status":"done"},{"id":5,"created_rows":2,"records_count":2,"enqueued_at":"2017-06-16T00:44:55-03:00","started_at":"2017-06-16T00:44:56-03:00","finished_at":"2017-06-16T00:44:56-03:00","processed_at":null,"failed_to_create_rows":2,"failed_to_update_rows":0,"import_errors":[[1,{"E-mail":"não
|
88
|
+
é válido"}],[2,{"CNPJ/CPF":"não pode ficar em branco"}]],"processed_rows":4,"total_rows":4,"updated_rows":0,"source_content_type":"text/plain","source_file_name":"customers.csv","source_file_size":810,"source_updated_at":"2017-06-16T00:44:55-03:00","status":"done"},{"id":6,"created_rows":0,"records_count":null,"enqueued_at":"2017-06-16T00:50:16-03:00","started_at":"2017-06-16T00:50:16-03:00","finished_at":"2017-06-16T00:50:16-03:00","processed_at":null,"failed_to_create_rows":0,"failed_to_update_rows":0,"import_errors":[],"processed_rows":0,"total_rows":0,"updated_rows":0,"source_content_type":"text/plain","source_file_name":"customers.csv","source_file_size":190,"source_updated_at":"2017-06-16T00:50:16-03:00","status":"done"}]'
|
89
|
+
http_version:
|
90
|
+
recorded_at: Fri, 16 Jun 2017 03:50:17 GMT
|
91
|
+
recorded_with: VCR 3.0.3
|
@@ -0,0 +1,83 @@
|
|
1
|
+
---
|
2
|
+
http_interactions:
|
3
|
+
- request:
|
4
|
+
method: post
|
5
|
+
uri: https://sandbox.boletosimples.com.br/api/v1/imports/customers?access_token=BOLETOSIMPLES_ACCESS_TOKEN
|
6
|
+
body:
|
7
|
+
encoding: UTF-8
|
8
|
+
string: customer_import%5Bsource%5D=
|
9
|
+
headers:
|
10
|
+
User-Agent:
|
11
|
+
- BoletoSimples Ruby Client v0.4.1 (contato@boletosimples.com.br)
|
12
|
+
Authorization:
|
13
|
+
- Token token="BOLETOSIMPLES_ACCESS_TOKEN"
|
14
|
+
Content-Type:
|
15
|
+
- application/x-www-form-urlencoded
|
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: 422
|
23
|
+
message: Unprocessable Entity
|
24
|
+
headers:
|
25
|
+
Connection:
|
26
|
+
- keep-alive
|
27
|
+
Content-Type:
|
28
|
+
- application/json; charset=utf-8
|
29
|
+
Transfer-Encoding:
|
30
|
+
- chunked
|
31
|
+
Status:
|
32
|
+
- 422 Unprocessable Entity
|
33
|
+
Cache-Control:
|
34
|
+
- no-cache
|
35
|
+
Date:
|
36
|
+
- Fri, 16 Jun 2017 03:50:18 GMT
|
37
|
+
Vary:
|
38
|
+
- Origin,Accept-Encoding
|
39
|
+
Strict-Transport-Security:
|
40
|
+
- max-age=631138519
|
41
|
+
X-Permitted-Cross-Domain-Policies:
|
42
|
+
- none
|
43
|
+
X-Xss-Protection:
|
44
|
+
- 1; mode=block
|
45
|
+
X-Request-Id:
|
46
|
+
- 4e7c7036-adc2-4945-a815-af270bd40723
|
47
|
+
Content-Security-Policy-Report-Only:
|
48
|
+
- 'default-src ''self''; child-src ''self'' www.googleadservices.com googleads.g.doubleclick.net
|
49
|
+
www.google.com www.google.com.br app.popupdomination.com; connect-src ''self''
|
50
|
+
ws: wss: *.intercom.io ws.pusherapp.com hn.inspectlet.com *.pusher.com boletosimples.com.br
|
51
|
+
*.boletosimples.com.br boletosimples.zendesk.com; font-src ''self'' fonts.googleapis.com
|
52
|
+
fonts.gstatic.com js.intercomcdn.com data: v2.zopim.com d25j7wj0q61kjj.cloudfront.net;
|
53
|
+
img-src ''self'' https: data: maps.googleapis.com dev.bole.to:5001 bole.to
|
54
|
+
boletosimples-sandbox.s3.amazonaws.com; script-src ''self'' ''unsafe-inline''
|
55
|
+
static.intercomcdn.com cdn.inspectlet.com widget.intercom.io js.intercomcdn.com
|
56
|
+
js.pusher.com stats.pusher.com zapier.com www.google-analytics.com www.googleadservices.com
|
57
|
+
doug1izaerwt3.cloudfront.net app.popupdomination.com cdn.ywxi.net www.draw.io
|
58
|
+
tag.getdrip.com www.getdrip.com js-agent.newrelic.com bam.nr-data.net cdnjs.cloudflare.com
|
59
|
+
widget.pluga.co www.google.com www.gstatic.com boletosimples.zendesk.com assets.zendesk.com
|
60
|
+
v2.zopim.com d25j7wj0q61kjj.cloudfront.net; style-src ''self'' ''unsafe-inline''
|
61
|
+
fonts.googleapis.com d25j7wj0q61kjj.cloudfront.net; report-uri https://boletosimples.report-uri.io/r/default/csp/reportOnly'
|
62
|
+
X-Download-Options:
|
63
|
+
- noopen
|
64
|
+
X-Runtime:
|
65
|
+
- '0.033045'
|
66
|
+
X-Frame-Options:
|
67
|
+
- sameorigin
|
68
|
+
X-Content-Type-Options:
|
69
|
+
- nosniff
|
70
|
+
X-Rack-Cache:
|
71
|
+
- invalidate, pass
|
72
|
+
X-Powered-By:
|
73
|
+
- Phusion Passenger 5.1.4
|
74
|
+
Server:
|
75
|
+
- nginx/1.10.3 + Phusion Passenger 5.1.4
|
76
|
+
Via:
|
77
|
+
- 1.1 vegur
|
78
|
+
body:
|
79
|
+
encoding: UTF-8
|
80
|
+
string: '{"errors":{"source":["não pode ficar em branco"]}}'
|
81
|
+
http_version:
|
82
|
+
recorded_at: Fri, 16 Jun 2017 03:50:18 GMT
|
83
|
+
recorded_with: VCR 3.0.3
|