correios_sigep 1.0.0 → 1.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (53) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +1 -1
  3. data/correios_sigep.gemspec +1 -1
  4. data/lib/correios_sigep/logistic_reverse/base_client.rb +3 -4
  5. data/lib/correios_sigep/version.rb +1 -1
  6. metadata +4 -90
  7. data/.gitignore +0 -14
  8. data/.rspec +0 -3
  9. data/.rubocop.yml +0 -1160
  10. data/.ruby-gemset +0 -1
  11. data/.ruby-version +0 -1
  12. data/.travis.yml +0 -16
  13. data/Gemfile +0 -8
  14. data/Rakefile +0 -15
  15. data/bin/rake +0 -16
  16. data/spec/correios_sigep/builders/xml/request_collect_number_spec.rb +0 -22
  17. data/spec/correios_sigep/builders/xml/request_spec.rb +0 -34
  18. data/spec/correios_sigep/builders/xml/request_sro_spec.rb +0 -17
  19. data/spec/correios_sigep/configuration_spec.rb +0 -87
  20. data/spec/correios_sigep/logistic_reverse/base_client_spec.rb +0 -93
  21. data/spec/correios_sigep/logistic_reverse/request_collect_number_spec.rb +0 -106
  22. data/spec/correios_sigep/logistic_reverse/request_sro_spec.rb +0 -86
  23. data/spec/correios_sigep/models/collect_spec.rb +0 -149
  24. data/spec/correios_sigep/models/logistic_reverse_spec.rb +0 -221
  25. data/spec/correios_sigep/models/object_spec.rb +0 -53
  26. data/spec/correios_sigep/models/product_spec.rb +0 -37
  27. data/spec/correios_sigep/models/recipient_spec.rb +0 -108
  28. data/spec/correios_sigep/models/sender_spec.rb +0 -141
  29. data/spec/correios_sigep/models/sro_spec.rb +0 -40
  30. data/spec/correios_sigep_spec.rb +0 -27
  31. data/spec/fixtures/builders/logistic_reverse.xml +0 -66
  32. data/spec/fixtures/builders/request_collect_number.xml +0 -64
  33. data/spec/fixtures/builders/request_sro.xml +0 -4
  34. data/spec/fixtures/correios/request_collect_number/response_already_in_use.xml +0 -14
  35. data/spec/fixtures/correios/request_collect_number/response_inexistent_zipcode.xml +0 -14
  36. data/spec/fixtures/correios/request_collect_number/response_not_answered_for_zipcode.xml +0 -14
  37. data/spec/fixtures/correios/request_collect_number/response_not_configured_client.xml +0 -14
  38. data/spec/fixtures/correios/request_collect_number/response_success.xml +0 -27
  39. data/spec/fixtures/correios/request_collect_number/response_unavailable_house_collect.xml +0 -14
  40. data/spec/fixtures/correios/request_collect_number/response_unavailable_service.xml +0 -14
  41. data/spec/fixtures/correios/request_collect_number/response_unexpected.xml +0 -14
  42. data/spec/fixtures/correios/request_sro/response_array_success.xml +0 -38
  43. data/spec/fixtures/correios/request_sro/response_collect_number_not_found.xml +0 -13
  44. data/spec/fixtures/correios/request_sro/response_required_fields.xml +0 -13
  45. data/spec/fixtures/correios/request_sro/response_sro_not_ready.xml +0 -30
  46. data/spec/fixtures/correios/request_sro/response_success.xml +0 -30
  47. data/spec/fixtures/correios/request_sro/response_unknown_error.xml +0 -13
  48. data/spec/fixtures/correios/wsdl.xml +0 -650
  49. data/spec/fixtures/requests/collect_number_request.xml +0 -66
  50. data/spec/fixtures/requests/sro_request.xml +0 -6
  51. data/spec/spec_helper.rb +0 -39
  52. data/spec/support/fixture_helper.rb +0 -13
  53. data/spec/support/logistic_reverse_helper.rb +0 -15
@@ -1,66 +0,0 @@
1
- <?xml version="1.0" encoding="UTF-8"?><env:Envelope xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:tns="http://service.logisticareversa.correios.com.br/" xmlns:env="http://schemas.xmlsoap.org/soap/envelope/"><env:Body><tns:solicitarPostagemReversa><cartao>0057018901</cartao><codigo_servico>41076</codigo_servico><codAdministrativo>08082650</codAdministrativo>
2
- <destinatario>
3
- <nome>ESTABELECIMENT W*M</nome>
4
- <logradouro>ESTRADA DE ACESSO A JANDIRA</logradouro>
5
- <numero>1400</numero>
6
- <complemento>G4</complemento>
7
- <bairro>FAZENDA ITAQUI</bairro>
8
- <referencia>REFERENCE</referencia>
9
- <cidade>BARUERI</cidade>
10
- <uf>SP</uf>
11
- <cep>06442130</cep>
12
- <ddd>11</ddd>
13
- <telefone>21683228</telefone>
14
- <email>teste@example.com</email>
15
- </destinatario>
16
- <coletas_solicitadas>
17
- <tipo>CA</tipo>
18
- <id_cliente>1405670</id_cliente>
19
- <valor_declarado>100.5</valor_declarado>
20
- <descricao>teste</descricao>
21
- <cklist>cklist</cklist>
22
- <numero>1</numero>
23
- <ag>1</ag>
24
- <cartao>1234</cartao>
25
- <servico_adicional>20.5</servico_adicional>
26
- <ar>2</ar>
27
- <remetente>
28
- <nome>JEFERSON VAZ DOS SANTOS</nome>
29
- <logradouro>RUA BLA BLA BLA</logradouro>
30
- <numero>666</numero>
31
- <complemento>APT 100</complemento>
32
- <bairro>PINHEIROS</bairro>
33
- <referencia>REFERENCE</referencia>
34
- <cidade>S&#xC3;O PAULO</cidade>
35
- <uf>SP</uf>
36
- <cep>05427020</cep>
37
- <ddd>16</ddd>
38
- <telefone>41606809</telefone>
39
- <email>jeff@example.com</email>
40
- <identificacao/>
41
- <ddd_celular/>
42
- <celular/>
43
- <sms/>
44
- </remetente>
45
- <produto>
46
- <codigo>code</codigo>
47
- <tipo>type</tipo>
48
- <qtd>3</qtd>
49
- </produto>
50
- <obj_col>
51
- <item>127078</item>
52
- <id>1405670</id>
53
- <desc>Pen Drive SAndisk 16GB SDCZ50-016G-A95</desc>
54
- <entrega>ship</entrega>
55
- <num>1</num>
56
- </obj_col>
57
- <obj_col>
58
- <item>277574</item>
59
- <id>1405670</id>
60
- <desc>Chip unico claro Pre pago</desc>
61
- <entrega>ship</entrega>
62
- <num>2</num>
63
- </obj_col>
64
- </coletas_solicitadas>
65
-
66
- </tns:solicitarPostagemReversa></env:Body></env:Envelope>
@@ -1,6 +0,0 @@
1
- <?xml version="1.0" encoding="UTF-8"?><env:Envelope xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:tns="http://service.logisticareversa.correios.com.br/" xmlns:env="http://schemas.xmlsoap.org/soap/envelope/"><env:Body><tns:acompanharPedido><codAdministrativo>08082650</codAdministrativo>
2
- <tipoBusca>H</tipoBusca>
3
- <tipoSolicitacao>A</tipoSolicitacao>
4
- <numeroPedido>1234</numeroPedido>
5
-
6
- </tns:acompanharPedido></env:Body></env:Envelope>
data/spec/spec_helper.rb DELETED
@@ -1,39 +0,0 @@
1
- ENV['GEM_ENV'] = 'test'
2
- require 'coveralls'
3
- require 'pry'
4
- require 'simplecov'
5
- require 'support/logistic_reverse_helper'
6
- require 'support/fixture_helper'
7
- require 'webmock/rspec'
8
- Coveralls.wear!
9
-
10
- File.expand_path(File.dirname(File.dirname(__FILE__)))
11
-
12
- SimpleCov.start do
13
- add_filter "/spec/"
14
- end
15
-
16
- require 'correios_sigep'
17
-
18
- RSpec.configure do |config|
19
- config.expect_with :rspec do |expectations|
20
- expectations.include_chain_clauses_in_custom_matcher_descriptions = true
21
- end
22
-
23
- config.mock_with :rspec do |mocks|
24
- mocks.verify_partial_doubles = true
25
- end
26
-
27
- config.include LogisticReverseHelper
28
- config.include FixtureHelper
29
-
30
- config.before do
31
- CorreiosSigep.configure do |config|
32
- config.administrative_code = '08082650'
33
- config.card = '0057018901'
34
- config.service_code = '41076'
35
- config.user = 'user'
36
- config.password = 'pass'
37
- end
38
- end
39
- end
@@ -1,13 +0,0 @@
1
- module FixtureHelper
2
- def correios_fixture(filename)
3
- File.open("./spec/fixtures/correios/#{filename}")
4
- end
5
-
6
- def builders_fixture(filename)
7
- File.read("./spec/fixtures/builders/#{filename}")
8
- end
9
-
10
- def request_fixture(filename)
11
- File.read("./spec/fixtures/requests/#{filename}")
12
- end
13
- end
@@ -1,15 +0,0 @@
1
- module LogisticReverseHelper
2
- def seed_logistic_reverse(logistic_reverse)
3
- recipient = CorreiosSigep::Models::Recipient.new(name: "ESTABELECIMENT W*M", address: "ESTRADA DE ACESSO A JANDIRA", number: 1400, complement: "G4", neighborhood: "FAZENDA ITAQUI", reference: "REFERENCE", city: "BARUERI", state: "SP", postal_code: "06442130", area_code: 11, phone: "21683228", email: "teste@example.com")
4
-
5
- sender = CorreiosSigep::Models::Sender.new(name: "JEFERSON VAZ DOS SANTOS", address: "RUA BLA BLA BLA", number: 666, complement: "APT 100", neighborhood: "PINHEIROS", city: "SÃO PAULO", state: "SP", postal_code: "05427020", reference: "REFERENCE", area_code: 16, phone: "41606809", email: "jeff@example.com")
6
- object1 = CorreiosSigep::Models::Object.new(item: "127078", id: "1405670", description: "Pen Drive SAndisk 16GB SDCZ50-016G-A95", ship: "ship", num: 1)
7
- object2 = CorreiosSigep::Models::Object.new(item: "277574", id: "1405670", description: "Chip unico claro Pre pago", ship: "ship", num: 2)
8
- product = CorreiosSigep::Models::Product.new(code: "code", type: "type", quantity: 3)
9
-
10
- collect = CorreiosSigep::Models::Collect.new(type: "CA", number: 1, client_id: "1405670", ag: "1", card: "1234", declared_value: "100.5", aditional_service: "20.5", description: "teste", ar: "2", checklist: "cklist", sender: sender, objects: [object1, object2], product: product)
11
-
12
- logistic_reverse.recipient = recipient
13
- logistic_reverse.collect = collect
14
- end
15
- end