shopify_transporter 2.4.0 → 2.4.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: d74afe8f2cffa7be367716d17ee580cb69e793f4
4
- data.tar.gz: 5193dbb1507a03df56e4c945f07fedfa29fdc2f1
3
+ metadata.gz: 823030a7648b9b678e18cb921609e0edb03030bd
4
+ data.tar.gz: 79dfaf0eba75e19ec062f07587595512e46fd877
5
5
  SHA512:
6
- metadata.gz: 3a0fc07d7ab1c33b3d5556c9a3464c5a120b89e71b48072b0579e9098093c20933c29e3a152ba8ea59c678bf4a0952e968c07736babad5418aa90f318a7453ae
7
- data.tar.gz: c7d9751cfd089ee8d73383ac09635350a6a72b1555ddd8aec67c23a9b5607d80ff895492e1d0fc49b487857cedeb20a46a8a491363d39d12989542cc3cccdcac
6
+ metadata.gz: ab3dc89742dacbeb311125ea2b01d9560f16b2a268b715b12e870fb937d61ee62f7c7077c8b8e574fafc0e0fc305ebe9633b5a2265ff5bc564cf6dc585dd9785
7
+ data.tar.gz: 22e0a658fcc3e7848152d7e377d123daf2c5afb4e5a1c86cd9ea9a9e3205a723d838bd5cb6a272ca9a59c8e1ed751f6f56d9a311c4ea9d8c905444c8cc3fdca5
@@ -7,6 +7,13 @@ module ShopifyTransporter
7
7
  module Exporters
8
8
  module Magento
9
9
  class Soap
10
+ class FailedLoginError < Exporters::ExportError
11
+ def initialize(error_message)
12
+ sep = $INPUT_RECORD_SEPARATOR
13
+ super("Unable to obtain SOAP session ID from server.#{sep + sep}Details:#{sep + error_message}")
14
+ end
15
+ end
16
+
10
17
  RETRY_SLEEP_TIME = 0.1
11
18
  MAX_RETRIES = 4
12
19
 
@@ -74,13 +81,20 @@ module ShopifyTransporter
74
81
  end
75
82
 
76
83
  def soap_session_id
77
- @soap_session_id ||= soap_client.call(
84
+ return @soap_session_id if @soap_session_id.present?
85
+
86
+ result = soap_client.call(
78
87
  :login,
79
88
  message: {
80
89
  username: @username,
81
90
  api_key: @api_key,
82
91
  }
83
- ).body[:login_response][:login_return]
92
+ ).body
93
+
94
+ session_id = result&.dig(:login_response, :login_return)
95
+ raise FailedLoginError, result.to_s unless session_id.present?
96
+
97
+ @soap_session_id ||= session_id
84
98
  end
85
99
 
86
100
  def batching_filter(starting_id, ending_id, batch_index_column)
@@ -8,7 +8,7 @@ module ShopifyTransporter
8
8
  module Order
9
9
  class ShippingLines < Pipeline::Stage
10
10
  def convert(input, record)
11
- record.merge(
11
+ record.merge!(
12
12
  {
13
13
  shipping_lines: shipping_lines(input),
14
14
  }.stringify_keys
@@ -1,4 +1,4 @@
1
1
  # frozen_string_literal: true
2
2
  module ShopifyTransporter
3
- VERSION = '2.4.0'
3
+ VERSION = '2.4.1'
4
4
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: shopify_transporter
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.4.0
4
+ version: 2.4.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Shopify
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2018-10-31 00:00:00.000000000 Z
11
+ date: 2018-11-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler