|
@@ -85,6 +85,18 @@ module Ebaytr
|
|
|
puts "└---------------------------------------"
|
|
|
|
|
|
res = https.request(req)
|
|
|
+
|
|
|
+ # 特例 (attr 解析)
|
|
|
+ if request_name==:GetOrders
|
|
|
+ #e.g. "USD\">151.96"
|
|
|
+ tmp_str = res.body[res.body.index('<Subtotal currencyID').to_i+22..res.body.index('</Subtotal>').to_i-1]
|
|
|
+ if tmp_str.present?
|
|
|
+ #e.g. "USD"
|
|
|
+ attr_currency = tmp_str.split('"').first
|
|
|
+ res.body = res.body.insert(res.body.index('<Subtotal currencyID').to_i, "<SubtotalAttrCurrencyID>#{attr_currency}</SubtotalAttrCurrencyID>")
|
|
|
+ end
|
|
|
+ end
|
|
|
+
|
|
|
object_hash = Hash.from_xml(res.body)["#{request_name}Response"]
|
|
|
object_hash
|
|
|
end
|