postat 0.0.1 → 0.0.2

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: fbc5fb921e2c840e64f5898d80641eadfd0aeee0
4
- data.tar.gz: 6cc55eef198ebdfe38491975df306432cc1f354a
2
+ SHA256:
3
+ metadata.gz: 5aedca46767504fc502f80ef1881dce529a3dfd4b88ac7ee415329a87ba5e70c
4
+ data.tar.gz: f2deec1775b8b854ee497c7fc37d604f638b2ac8bb742f20d78149eb477d94b3
5
5
  SHA512:
6
- metadata.gz: bd81648edd06753ab585c64c398090d29c13c4f9eda9c31101fd9831c3ff46d334fab4adcdb11d6249a8cded9fde8e1d96136fe119b8e0001a768b58686ba0a6
7
- data.tar.gz: 9a00e643428e73be9c73611552525c681079db95ed7cdb27f0a31e8889798e840c3798f5138599336c8e66384961ee74a1d35875c5664293e1b7c2cd56224665
6
+ metadata.gz: 4135bcdae2852044a12201c694a3352ce188d5cbbd2bdce4accfbb03f422ee89a17d834b1fdb289dc65e276b6253c4e7e764ed4bd6dc833fd6d1e994a2dae8c0
7
+ data.tar.gz: 5ddf55186d6a79dd413d47e60cf3e26657ffc4df5593ce17a3aacc2cc603282853881453a39e8e78a87a2b5e01f23b952b7102e6a94307402e59e9833019cd5f
data/.gitignore CHANGED
@@ -1 +1,2 @@
1
1
  spec/config.yml
2
+ /.idea
data/.rspec ADDED
@@ -0,0 +1,2 @@
1
+ --color
2
+ --format progress
data/Gemfile CHANGED
@@ -1,8 +1,9 @@
1
1
  source :rubygems
2
+ gem 'activesupport'
2
3
  gem 'savon', '~> 2.11.1'
3
4
 
4
5
  group :dev do # not development <-> would add unneeded development dependencies in gemspec
5
6
  gem 'rake'
6
- gem 'rspec', '~>2'
7
+ gem 'rspec'
7
8
  gem 'rubocop'
8
9
  end
@@ -1,45 +1,58 @@
1
1
  GEM
2
2
  remote: http://rubygems.org/
3
3
  specs:
4
+ activesupport (5.2.3)
5
+ concurrent-ruby (~> 1.0, >= 1.0.2)
6
+ i18n (>= 0.7, < 2)
7
+ minitest (~> 5.1)
8
+ tzinfo (~> 1.1)
4
9
  akami (1.3.1)
5
10
  gyoku (>= 0.4.0)
6
11
  nokogiri
7
- ast (2.3.0)
12
+ ast (2.4.0)
8
13
  builder (3.2.3)
9
- diff-lcs (1.1.2)
14
+ concurrent-ruby (1.1.5)
15
+ diff-lcs (1.3)
10
16
  gyoku (1.3.1)
11
17
  builder (>= 2.1.2)
12
- httpi (2.4.2)
18
+ httpi (2.4.4)
13
19
  rack
14
20
  socksify
15
- mini_portile2 (2.3.0)
16
- nokogiri (1.8.1)
17
- mini_portile2 (~> 2.3.0)
21
+ i18n (1.6.0)
22
+ concurrent-ruby (~> 1.0)
23
+ jaro_winkler (1.5.2)
24
+ mini_portile2 (2.4.0)
25
+ minitest (5.11.3)
26
+ nokogiri (1.10.3)
27
+ mini_portile2 (~> 2.4.0)
18
28
  nori (2.6.0)
19
- parallel (1.12.0)
20
- parser (2.4.0.0)
21
- ast (~> 2.2)
22
- powerpack (0.1.1)
23
- rack (2.0.3)
24
- rainbow (2.2.2)
25
- rake
26
- rake (0.8.7)
27
- rspec (2.5.0)
28
- rspec-core (~> 2.5.0)
29
- rspec-expectations (~> 2.5.0)
30
- rspec-mocks (~> 2.5.0)
31
- rspec-core (2.5.1)
32
- rspec-expectations (2.5.0)
33
- diff-lcs (~> 1.1.2)
34
- rspec-mocks (2.5.0)
35
- rubocop (0.51.0)
29
+ parallel (1.17.0)
30
+ parser (2.6.3.0)
31
+ ast (~> 2.4.0)
32
+ rack (2.0.7)
33
+ rainbow (3.0.0)
34
+ rake (12.3.2)
35
+ rspec (3.8.0)
36
+ rspec-core (~> 3.8.0)
37
+ rspec-expectations (~> 3.8.0)
38
+ rspec-mocks (~> 3.8.0)
39
+ rspec-core (3.8.0)
40
+ rspec-support (~> 3.8.0)
41
+ rspec-expectations (3.8.3)
42
+ diff-lcs (>= 1.2.0, < 2.0)
43
+ rspec-support (~> 3.8.0)
44
+ rspec-mocks (3.8.0)
45
+ diff-lcs (>= 1.2.0, < 2.0)
46
+ rspec-support (~> 3.8.0)
47
+ rspec-support (3.8.0)
48
+ rubocop (0.70.0)
49
+ jaro_winkler (~> 1.5.1)
36
50
  parallel (~> 1.10)
37
- parser (>= 2.3.3.1, < 3.0)
38
- powerpack (~> 0.1)
39
- rainbow (>= 2.2.2, < 3.0)
51
+ parser (>= 2.6)
52
+ rainbow (>= 2.2.2, < 4.0)
40
53
  ruby-progressbar (~> 1.7)
41
- unicode-display_width (~> 1.0, >= 1.0.1)
42
- ruby-progressbar (1.9.0)
54
+ unicode-display_width (>= 1.4.0, < 1.7)
55
+ ruby-progressbar (1.10.0)
43
56
  savon (2.11.2)
44
57
  akami (~> 1.2)
45
58
  builder (>= 2.1.2)
@@ -49,7 +62,10 @@ GEM
49
62
  nori (~> 2.4)
50
63
  wasabi (~> 3.4)
51
64
  socksify (1.7.1)
52
- unicode-display_width (1.3.0)
65
+ thread_safe (0.3.6)
66
+ tzinfo (1.2.5)
67
+ thread_safe (~> 0.1)
68
+ unicode-display_width (1.6.0)
53
69
  wasabi (3.5.0)
54
70
  httpi (~> 2.0)
55
71
  nokogiri (>= 1.4.2)
@@ -58,10 +74,11 @@ PLATFORMS
58
74
  ruby
59
75
 
60
76
  DEPENDENCIES
77
+ activesupport
61
78
  rake
62
- rspec (~> 2)
79
+ rspec
63
80
  rubocop
64
81
  savon (~> 2.11.1)
65
82
 
66
83
  BUNDLED WITH
67
- 1.16.0
84
+ 1.17.1
data/Readme.md CHANGED
@@ -1,4 +1,4 @@
1
- # Shipgate-Soap Wrapper for ruby
1
+ # Rylos Post AT Soap Wrapper for ruby
2
2
 
3
3
  ## Installation
4
4
 
@@ -41,12 +41,12 @@ config/postat.yml
41
41
  ```
42
42
 
43
43
  ## Usage
44
- This Gem provides you with a Wrapper for the Shipgate-Soap-Api
44
+ This Gem provides you with a Wrapper for the Rylos PostAT-Soap-Api
45
45
 
46
46
 
47
47
  ## Contributing
48
48
 
49
- Bug reports and pull requests are welcome on GitHub at https://github.com/datyv/postat. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.
49
+ Bug reports and pull requests are welcome on GitHub at https://github.com/ReverseRetail/postat. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.
50
50
 
51
51
 
52
52
  ## License
@@ -1,16 +1,10 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- POSTAT_CONFIG = {
4
- guid: ENV['POSTAT_GUID'] || 'guid',
5
- username: ENV['POSTAT_USERNAME'] || 'username',
6
- password: ENV['POSTAT_PASSWORD'] || 'password',
7
- namespace: ENV['POSTAT_NAMESPACE'] || 'http://example.com/',
8
- wsdl: ENV['POSTAT_WSDL'] || 'http://example.com/soap?WSDL'
9
- }
10
-
3
+ config = {}
11
4
  config_file = File.expand_path("#{Rails.root}/config/postat.yml", __FILE__)
12
5
  if File.exist?(config_file)
13
6
  configs_from_file = YAML.safe_load(File.read(config_file))
14
- POSTAT_CONFIG.merge!(configs_from_file[Rails.env])
15
- POSTAT_CONFIG.symbolize_keys!
7
+ config.merge!(configs_from_file[Rails.env])
8
+ config.symbolize_keys!
16
9
  end
10
+ POSTAT_CONFIG = config
@@ -1,29 +1,29 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  development:
4
- guid: 'guid'
5
- username: 'username'
6
- password: 'password'
7
- namespace: 'http://example.com/'
8
- wsdl: 'http://example.com/soap?WSDL'
4
+ client_id: 'guid'
5
+ org_unit_id: 'username'
6
+ org_unit_guid: 'password'
7
+ endpoint: 'http://example.com/secure'
8
+ wsdl: 'http://example.com/soap?WSDL'
9
9
 
10
10
  test:
11
- guid: 'guid'
12
- username: 'username'
13
- password: 'password'
14
- namespace: 'http://example.com/'
15
- wsdl: 'http://example.com/soap?WSDL'
11
+ client_id: 'guid'
12
+ org_unit_id: 'username'
13
+ org_unit_guid: 'password'
14
+ endpoint: 'http://example.com/secure'
15
+ wsdl: 'http://example.com/soap?WSDL'
16
16
 
17
17
  beta:
18
- guid: 'guid'
19
- username: 'username'
20
- password: 'password'
21
- namespace: 'http://example.com/'
22
- wsdl: 'http://example.com/soap?WSDL'
18
+ client_id: 'guid'
19
+ org_unit_id: 'username'
20
+ org_unit_guid: 'password'
21
+ endpoint: 'http://example.com/secure'
22
+ wsdl: 'http://example.com/soap?WSDL'
23
23
 
24
24
  production:
25
- guid: 'guid'
26
- username: 'username'
27
- password: 'password'
28
- namespace: 'http://example.com/'
29
- wsdl: 'http://example.com/soap?WSDL'
25
+ client_id: 'guid'
26
+ org_unit_id: 'username'
27
+ org_unit_guid: 'password'
28
+ endpoint: 'http://example.com/secure'
29
+ wsdl: 'http://example.com/soap?WSDL'
@@ -6,101 +6,92 @@ class Postat
6
6
  attr_reader :client
7
7
 
8
8
  def initialize
9
- @user = POSTAT_CONFIG[:username] || raise('missing :user')
10
- @password = POSTAT_CONFIG[:password] || raise('missing :password')
11
- @guid = POSTAT_CONFIG[:guid] || raise('missing :guid')
12
- @client = Savon.client wsdl: POSTAT_CONFIG[:wsdl], namespace_identifier: :ryl, convert_request_keys_to: :none
9
+ @client = Savon.client(wsdl: POSTAT_CONFIG[:wsdl],
10
+ convert_request_keys_to: :none,
11
+ env_namespace: :soapenv,
12
+ namespace_identifier: :post,
13
+ log: true,
14
+ pretty_print_xml: true,
15
+ endpoint: POSTAT_CONFIG[:endpoint],
16
+ namespaces: {
17
+ 'xmlns:post' => 'http://post.ondot.at',
18
+ 'xmlns:arr' => 'http://schemas.microsoft.com/2003/10/Serialization/Arrays',
19
+ 'xmlns:core' => 'http://Core.Model',
20
+ 'xmlns:ser' => 'http://schemas.microsoft.com/2003/10/Serialization/'
21
+ }
22
+ )
13
23
  end
14
24
 
15
25
  def delete_label(options = {})
16
- message = add_common_params
26
+ message = []
17
27
  options[:shipments]&.each do |shipment|
18
- message[:Shipments] << { 'CancelRequest.Shipment' => shipment }
28
+ row = init_message
29
+ row['post:Number'] = shipment[:reference_number]
30
+ add_common_params(row)
31
+ message<< { 'post:CancelShipmentRow' => row }
19
32
  end
20
- response = client.call(:delete_label, message: { ShippingRequest: message })
21
- handle_response response
33
+ response = client.call(:cancel_shipments, message: { 'post:shipments' => message })
34
+ handle_response(response, action: :cancel_shipments)
22
35
  end
23
36
 
37
+ # NOTE: be careful with the order of attributes to avoid fake missing attribute errors
24
38
  def generate_label(options = {})
25
- message = add_common_params
26
- message[:DeliveryProductCode] = options[:delivery_code]
27
- message[:ReturnProductCode] = options[:return_code]
28
- message[:Shipments]['Request.Shipment'] = build_shipment(options)
29
- response = client.call(:create_label, message: { ShippingRequest: message },
30
- attributes: { 'xmlns' => 'http://rylos.lu/' })
39
+ message = init_message
40
+ message['post:DeliveryServiceThirdPartyID'] = options[:delivery_code]
41
+ message['post:Number'] = options[:reference_number]
42
+ message['post:ColloList'] = add_packages(options[:package])
43
+ # message['post:ShippingDateTimeFrom'] = (Time.zone.now + 180).iso8601
44
+ message['post:OURecipientAddress'] = add_address(options[:to])
45
+ message['post:OUShipperAddress'] = add_address(options[:from])
46
+ add_common_params(message)
47
+ message['post:PrinterObject'] = add_printing_details
48
+ # TODO: Look for the new attrs names for: PaymentType, Commodities
49
+
50
+ response = client.call(:import_shipment, message: { 'post:row' => message })
31
51
  handle_response response
32
52
  end
33
53
 
34
54
  private
35
55
 
36
- def handle_response(response)
56
+ def handle_response(response, action: :import_shipment)
57
+ action_name = "#{action}_response".to_sym
37
58
  response = response.to_hash
38
- success = response&.dig(:create_label_response, :create_label_result, :was_successful) || false
39
- return response if success
40
- message = response&.dig(:create_label_response, :create_label_result, :messages, :message) || []
41
- raise StandardError, message.values&.join(': ')
59
+ error = response&.dig(action_name, :error_message)
60
+ error ||= response&.dig(action_name, :error_code)
61
+ return response if error.blank?
62
+ raise StandardError, [error]
42
63
  end
43
64
 
44
- def build_shipment(options = {})
45
- shipment = {}
46
- shipment[:Shipper] = add_address(options[:from])
47
- shipment[:Receiver] = add_address(options[:to])
48
- shipment[:Date] = (Time.zone.now + 180).iso8601
49
- shipment[:PaymentType] = 'RECEIVER'
50
- shipment[:CustomerReference] = options[:reference_number] if options[:delivery_code]
51
- shipment[:ReturnReference] = options[:reference_number] if options[:return_code]
52
- shipment[:CurrencyCode] = 'EUR'
53
- shipment[:AdditionalInsurance] = 0
54
- commodities = add_commodities(options[:commodities])
55
- shipment[:Commodities] = commodities unless commodities.empty?
56
- packages = add_packages(options[:package])
57
- shipment[:Packages] = packages unless packages.empty?
58
- shipment[:Label] = { ImageType: 'PDF', PaperFormat: 'A5' }
59
- shipment
65
+ def add_printing_details
66
+ {
67
+ 'post:LanguageID' => 'pdf',
68
+ 'post:LabelFormatID' => '100x200',
69
+ 'post:PaperLayoutID' => 'A5'
70
+ }
60
71
  end
61
72
 
62
- def add_common_params
63
- { Credentials: {
64
- Guid: @guid,
65
- Username: @user,
66
- Password: @password
67
- },
68
- Carrier: 'POSTAT',
69
- Shipments: {} }
73
+ def init_message
74
+ { 'post:ClientID' => POSTAT_CONFIG[:client_id] || raise('postat config missing :client_id') }
70
75
  end
71
76
 
72
- def add_address(address)
73
- { CompanyName: address[:company].to_s,
74
- PersonName: "#{address[:first_name]} #{address[:last_name]}".squish,
75
- CareOf: address[:care_of].to_s,
76
- PhoneNumber: address[:phone].to_s,
77
- EMailAddress: address[:email].to_s,
78
- CountryCode: address[:country].to_s,
79
- StateCode: address[:state_code].to_s,
80
- PostalCode: address[:zip_code].to_s,
81
- CityName: address[:city].to_s,
82
- StreetName: address[:street].to_s,
83
- StreetNo: address[:street_no].to_s }
77
+ def add_common_params(data)
78
+ data['post:OrgUnitGuid'] = POSTAT_CONFIG[:org_unit_guid] || raise('postat config missing :org_unit_guid')
79
+ data['post:OrgUnitID'] = POSTAT_CONFIG[:org_unit_id] || raise('postat config missing :org_unit_id')
84
80
  end
85
81
 
86
- def add_commodities(commodities = [])
87
- commodity_array = []
88
- commodities = [commodities] if commodities.is_a?(Hash)
89
- [*commodities].each_with_index do |commodity, _i|
90
- commodity_array << {
91
- 'Request.Commodity' => {
92
- CountryOfManufacture: commodity[:country_iso].to_s,
93
- CustomsValue: { Amount: commodity[:price], Currency: 'EUR' },
94
- Weight: { Amount: commodity[:weight].to_i, WeightType: 'KG' },
95
- Description: commodity[:category].to_s,
96
- Name: commodity[:name].to_s,
97
- NumberOfPieces: 1,
98
- UnitPrice: { Amount: commodity[:price], Currency: 'EUR' },
99
- Quantity: 1
100
- }
101
- }
102
- end
103
- commodity_array
82
+ def add_address(address)
83
+ {
84
+ 'post:AddressLine1' => address[:street].to_s,
85
+ 'post:City' => address[:city].to_s,
86
+ 'post:CountryID' => address[:country].to_s,
87
+ 'post:HouseNumber' => address[:street_no].to_s,
88
+ 'post:Name1' => "#{address[:first_name]} #{address[:last_name]}".squish,
89
+ 'post:Name2' => address[:company].to_s,
90
+ 'post:PostalCode' => address[:zip_code].to_s,
91
+ 'post:Tel1' => address[:phone].to_s,
92
+ 'post:Email' => address[:email].to_s,
93
+ # TODO: look for the new attrs names: CareOf, StateCode
94
+ }
104
95
  end
105
96
 
106
97
  def add_packages(packages = [])
@@ -108,15 +99,11 @@ class Postat
108
99
  packages = [packages] if packages.is_a?(Hash)
109
100
  [*packages].each_with_index do |package, i|
110
101
  package_array << {
111
- 'Request.Package' => {
112
- SequenceNumber: i += 1,
113
- GroupPackageCount: packages.size,
114
- Weight: { Amount: package[:weight].to_i, WeightType: 'KG' },
115
- Length: package[:length].to_i,
116
- Width: package[:width].to_i,
117
- Height: package[:height].to_i,
118
- DimensionType: 'CM',
119
- PackageType: 'CARTON'
102
+ 'post:ColloRow' => {
103
+ 'post:Weight' => package[:weight].to_i,
104
+ 'post:Length' => package[:length].to_i,
105
+ 'post:Width' => package[:width].to_i,
106
+ 'post:Height' => package[:height].to_i,
120
107
  }
121
108
  }
122
109
  end
@@ -3,26 +3,26 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
3
3
 
4
4
  Gem::Specification.new do |s|
5
5
  s.name = 'postat'
6
- s.version = '0.0.1'
7
- s.authors = ['Datyv']
8
- s.email = ['yvesgoizet@gmail.com']
6
+ s.version = '0.0.2'
7
+ s.authors = ['Yves Goizet','Oewn Peredo']
8
+ s.email = ['it@buddyandselly.com']
9
9
  s.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
10
10
 
11
- s.homepage = 'https://github.com/Datyv/postat'
11
+ s.homepage = 'https://github.com/ReverseRetail/postat'
12
12
  s.license = 'MIT'
13
13
  s.require_paths = ['lib']
14
- s.summary = 'Wrapper for Rylos SOAP Api for PostAt'
14
+ s.summary = 'Wrapper for PostAT SOAP Api'
15
15
  s.test_files = ['spec/postat_spec.rb', 'spec/spec_helper.rb']
16
16
 
17
17
  if s.respond_to? :specification_version
18
18
  s.specification_version = 3
19
19
 
20
20
  if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0')
21
- s.add_runtime_dependency('savon', ['~> 2.10.0'])
21
+ s.add_runtime_dependency('savon', '~> 2.10')
22
22
  else
23
- s.add_dependency('savon', ['~> 2.10.0'])
23
+ s.add_dependency('savon', '~> 2.10')
24
24
  end
25
25
  else
26
- s.add_dependency('savon', ['~> 2.10.0'])
26
+ s.add_dependency('savon', '~> 2.10')
27
27
  end
28
28
  end
@@ -1,16 +1,112 @@
1
1
  require File.expand_path('spec/spec_helper')
2
+ require 'active_support/all'
2
3
 
3
4
  describe Postat do
4
- let(:config) { YAML.load_file('spec/config.yml') }
5
- let(:client) { Postat.new(config) }
5
+ let(:postat) { double(:postat) }
6
+ before { stub_settings }
7
+ before do
8
+ allow(Savon).to receive(:client).and_return(postat)
9
+ allow(Time).to receive(:zone).and_return(Time)
10
+ end
11
+
12
+ describe '#delete_label' do
13
+ it 'success label' do
14
+ data = {
15
+ cancel_shipments_response: { error_message: nil, success: true }
16
+ }
17
+ stub_postat(:cancel_shipments, data)
18
+ res = Postat.new.delete_label(shipments: [{ reference_number: 1 }])
19
+ expect(res[:cancel_shipments_response][:error_message].nil?).to be_truthy
20
+ end
6
21
 
7
- it 'has a VERSION' do
8
- Postat::VERSION.should =~ /^\d+\.\d+\.\d+$/
22
+ it 'error label' do
23
+ data = {
24
+ cancel_shipments_response: { error_message: 'err msg', success: true }
25
+ }
26
+ stub_postat(:cancel_shipments, data)
27
+ expect { Postat.new.delete_label(shipments: [{ reference_number: 1 }]) }
28
+ .to raise_error(StandardError)
29
+ end
9
30
  end
10
31
 
11
- describe :flush do
12
- it 'can do it' do
13
- client.flush(config[:cname], '/foo')
32
+ describe '#generate_label' do
33
+ it 'success label' do
34
+ stub_postat(:import_shipment, success_res_label)
35
+ res = Postat.new.generate_label(label_options)
36
+ expect(res[:import_shipment_response][:error_message].nil?).to be_truthy
14
37
  end
38
+
39
+ it 'error label' do
40
+ data = {
41
+ import_shipment_response: { error_message: 'err msg', success: true }
42
+ }
43
+ stub_postat(:import_shipment, data)
44
+ expect { Postat.new.generate_label(shipments: [{ reference_number: 1 }]) }
45
+ .to raise_error(StandardError)
46
+ end
47
+ end
48
+
49
+ private
50
+
51
+ def stub_postat(action, return_data)
52
+ allow(postat).to receive(:call).with(action, anything)
53
+ .and_return(return_data)
54
+ end
55
+
56
+ def stub_settings
57
+ config = {
58
+ client_id: '1',
59
+ org_unit_id: '1',
60
+ org_unit_guid: '1'
61
+ }
62
+ stub_const('POSTAT_CONFIG', config)
63
+ end
64
+
65
+ def label_options
66
+ package = {
67
+ length: 1,
68
+ width: 1,
69
+ height: 1,
70
+ weight: 1,
71
+ description: 'Clothing'
72
+ }
73
+
74
+ address = {
75
+ first_name: 'lorem',
76
+ last_name: 'ipsum',
77
+ street: 'str',
78
+ street_no: 10,
79
+ zip_code: '0000',
80
+ city: 'Hamburg',
81
+ country: 'de'
82
+ }
83
+
84
+ {
85
+ delivery_code: 28,
86
+ package: [package],
87
+ reference_number: 'Inbound',
88
+ create_shipping_label: true,
89
+ from: address,
90
+ to: address
91
+ }
92
+ end
93
+
94
+ def success_res_label
95
+ data = {
96
+ pdfData: '......',
97
+ import_shipment_result: {
98
+ collo_row: [
99
+ {
100
+ collo_code_list: {
101
+ collo_code_row: {
102
+ code: '010052000000280964922303',
103
+ number_type_id: '0fcbf432-c95b-467d-b397-aef3d862b5a3'
104
+ }
105
+ }
106
+ }
107
+ ]
108
+ }
109
+ }
110
+ { import_shipment_response: data }
15
111
  end
16
112
  end
@@ -1,2 +1,20 @@
1
+ # This file was generated by the `rspec --init` command. Conventionally, all
2
+ # specs live under a `spec` directory, which RSpec adds to the `$LOAD_PATH`.
3
+ # Require this file using `require "spec_helper"` to ensure that it is only
4
+ # loaded once.
5
+ #
6
+ # See http://rubydoc.info/gems/rspec-core/RSpec/Core/Configuration
1
7
  $LOAD_PATH.unshift 'lib'
2
- require 'post_at'
8
+ require 'Postat'
9
+
10
+ RSpec.configure do |config|
11
+ config.treat_symbols_as_metadata_keys_with_true_values = true
12
+ config.run_all_when_everything_filtered = true
13
+ config.filter_run :focus
14
+
15
+ # Run specs in random order to surface order dependencies. If you find an
16
+ # order dependency and want to debug it, you can fix the order by providing
17
+ # the seed, which is printed after each run.
18
+ # --seed 1234
19
+ config.order = 'random'
20
+ end
metadata CHANGED
@@ -1,14 +1,15 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: postat
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  platform: ruby
6
6
  authors:
7
- - Datyv
7
+ - Yves Goizet
8
+ - Oewn Peredo
8
9
  autorequire:
9
10
  bindir: bin
10
11
  cert_chain: []
11
- date: 2017-12-05 00:00:00.000000000 Z
12
+ date: 2019-05-24 00:00:00.000000000 Z
12
13
  dependencies:
13
14
  - !ruby/object:Gem::Dependency
14
15
  name: savon
@@ -16,22 +17,23 @@ dependencies:
16
17
  requirements:
17
18
  - - "~>"
18
19
  - !ruby/object:Gem::Version
19
- version: 2.10.0
20
+ version: '2.10'
20
21
  type: :runtime
21
22
  prerelease: false
22
23
  version_requirements: !ruby/object:Gem::Requirement
23
24
  requirements:
24
25
  - - "~>"
25
26
  - !ruby/object:Gem::Version
26
- version: 2.10.0
27
+ version: '2.10'
27
28
  description:
28
29
  email:
29
- - yvesgoizet@gmail.com
30
+ - it@buddyandselly.com
30
31
  executables: []
31
32
  extensions: []
32
33
  extra_rdoc_files: []
33
34
  files:
34
35
  - ".gitignore"
36
+ - ".rspec"
35
37
  - Gemfile
36
38
  - Gemfile.lock
37
39
  - Rakefile
@@ -43,7 +45,7 @@ files:
43
45
  - postat.gemspec
44
46
  - spec/postat_spec.rb
45
47
  - spec/spec_helper.rb
46
- homepage: https://github.com/Datyv/postat
48
+ homepage: https://github.com/ReverseRetail/postat
47
49
  licenses:
48
50
  - MIT
49
51
  metadata: {}
@@ -63,10 +65,10 @@ required_rubygems_version: !ruby/object:Gem::Requirement
63
65
  version: '0'
64
66
  requirements: []
65
67
  rubyforge_project:
66
- rubygems_version: 2.6.13
68
+ rubygems_version: 2.7.9
67
69
  signing_key:
68
70
  specification_version: 3
69
- summary: Wrapper for Rylos SOAP Api for PostAt
71
+ summary: Wrapper for PostAT SOAP Api
70
72
  test_files:
71
73
  - spec/postat_spec.rb
72
74
  - spec/spec_helper.rb