solidus_bactracs 3.5.0 → 3.5.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
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3d733c0f761c26283033cc63a123d7104fda4400a5ad918929d525be036a4206
|
4
|
+
data.tar.gz: 30b2aee8a90add793153cf78faa81586915f8b6eb8f452621d6652f5adb758e3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a0bb9e80092aff503373648fffa19326d05a9030e6c0cb0f2ec3c86ae7930f814139af289af5ffdbdd5e73c6460e0d8624b635d961a64d78f0e17be027d180db
|
7
|
+
data.tar.gz: adebc9074bb74fc6e2983e76a55948062485571856164116741a839ef2a6b3327528bbe08549ddaa52ce8c0dbd93ce22061d649ef533a1e0d5433256f8abcbef
|
data/.tool-versions
CHANGED
@@ -1 +1 @@
|
|
1
|
-
ruby 3.1.
|
1
|
+
ruby 3.1.2
|
@@ -29,7 +29,7 @@ module SolidusBactracs
|
|
29
29
|
Rails.logger.info({ event: 'success CreateRMA', rma: shipment.number, response: parse_rma_creation_response(rma_response, "Message")})
|
30
30
|
shipment_synced(shipment)
|
31
31
|
return true
|
32
|
-
elsif rma_exists?(rma_response)
|
32
|
+
elsif rma_exists?(rma_response) or rma_fail?(rma_response)
|
33
33
|
return false
|
34
34
|
else
|
35
35
|
clear_cache
|
@@ -89,7 +89,7 @@ module SolidusBactracs
|
|
89
89
|
|
90
90
|
raise RequestError.from_response(@response) unless @response # just try again for @retries?
|
91
91
|
if "false" == parse_authentication_response(@response, "Result")
|
92
|
-
Rails.logger.
|
92
|
+
Rails.logger.error({ event: 'bactracs auth failed', error: parse_authentication_response(@response, "Message")})
|
93
93
|
raise RequestError.from_response(@response)
|
94
94
|
end
|
95
95
|
sguid = parse_authentication_response(@response, "Message")
|
@@ -110,12 +110,20 @@ module SolidusBactracs
|
|
110
110
|
end
|
111
111
|
|
112
112
|
def rma_exists?(response)
|
113
|
+
if parse_rma_creation_response(response, "Message").match(/failed CreateRMA/)
|
114
|
+
Rails.logger.error({ event: 'bactracs failed CreateRMA', error: parse_rma_creation_response(response, "Message")})
|
115
|
+
return true
|
116
|
+
end
|
117
|
+
end
|
118
|
+
|
119
|
+
def rma_fail?(response)
|
113
120
|
if parse_rma_creation_response(response, "Message").match(/rma .* already exists/)
|
114
|
-
Rails.logger.
|
121
|
+
Rails.logger.error({ event: 'bactracs failed CreateRMA', error: parse_rma_creation_response(response, "Message")})
|
115
122
|
return true
|
116
123
|
end
|
117
124
|
end
|
118
125
|
|
126
|
+
|
119
127
|
def shipment_synced(shipment)
|
120
128
|
shipment.update_attribute(:bactracs_synced_at, Time.zone.now)
|
121
129
|
|
@@ -13,9 +13,6 @@ module SolidusBactracs
|
|
13
13
|
def call(sguid: nil)
|
14
14
|
order = @shipment.order
|
15
15
|
user = @shipment.user
|
16
|
-
rma_type = safe_rma_type
|
17
|
-
rp_location = get_rp_location
|
18
|
-
df_part = get_df_part
|
19
16
|
|
20
17
|
xml = Builder::XmlMarkup.new
|
21
18
|
xml.instruct!(:xml, :encoding => "UTF-8")
|
@@ -26,7 +23,7 @@ module SolidusBactracs
|
|
26
23
|
xml.sGuid sguid
|
27
24
|
xml.NewRMA {
|
28
25
|
xml.RMANumber @shipment.number
|
29
|
-
xml.RMATypeName
|
26
|
+
xml.RMATypeName safe_rma_type
|
30
27
|
xml.RMASubTypeName
|
31
28
|
xml.CustomerRef
|
32
29
|
xml.InboundShippingPriority
|
@@ -72,8 +69,9 @@ module SolidusBactracs
|
|
72
69
|
end
|
73
70
|
end
|
74
71
|
end
|
75
|
-
Rails.logger.info(xml.to_s)
|
76
|
-
xml
|
72
|
+
# Rails.logger.info(xml.to_s)
|
73
|
+
@xml = xml.to_xml.sub(/<to_xml\/>$/,'')
|
74
|
+
return @xml
|
77
75
|
end
|
78
76
|
|
79
77
|
def line_items_xml(xml: nil, line_item: nil, variant: nil, order: nil)
|
@@ -95,8 +93,8 @@ module SolidusBactracs
|
|
95
93
|
xml.WarrantyRepair
|
96
94
|
xml.RMALineTest
|
97
95
|
xml.InboundShipWeight variant.weight.to_f
|
98
|
-
xml.RPLocation
|
99
|
-
xml.DFPart
|
96
|
+
xml.RPLocation get_rp_location
|
97
|
+
xml.DFPart get_df_part
|
100
98
|
}
|
101
99
|
end
|
102
100
|
|
@@ -107,9 +105,8 @@ module SolidusBactracs
|
|
107
105
|
|
108
106
|
def get_rp_location
|
109
107
|
#Double verifing
|
110
|
-
return nil if
|
108
|
+
return nil if safe_rma_type == "4"
|
111
109
|
|
112
|
-
rp_location = @shipment.get_rma_rp_location if @shipment.get_rma_rp_location
|
113
110
|
@config.default_rp_location.call(@shipment)
|
114
111
|
end
|
115
112
|
|
@@ -119,7 +116,7 @@ module SolidusBactracs
|
|
119
116
|
|
120
117
|
def get_df_part
|
121
118
|
df_part =
|
122
|
-
if
|
119
|
+
if safe_rma_type == "4"
|
123
120
|
@shipment.number
|
124
121
|
else
|
125
122
|
nil
|
@@ -36,7 +36,7 @@ module SolidusBactracs
|
|
36
36
|
# resp = @runner.call(:post, '/orders/createorders', [serialize(shipment)])
|
37
37
|
resp = @runner.authenticated_call(shipment: shipment, serializer: @syncer.client.shipment_serializer)
|
38
38
|
if resp
|
39
|
-
@cursor += 1
|
39
|
+
@cursor += 1 if (a_shipment == @shipments[@cursor] || shipment == @shipments[@cursor])
|
40
40
|
return resp
|
41
41
|
end
|
42
42
|
ensure
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: solidus_bactracs
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.5.
|
4
|
+
version: 3.5.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Zeryab Ali
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: exe
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
12
|
+
date: 2023-08-03 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: httparty
|