我正在使用a2z gem来处理亚马逊的产品广告 API,当我尝试在 item_lookup 请求中指定多个 product_id 时,我遇到了 gem 的这个问题。这是我可以解决的问题,还是我必须联系 gem 作者?
can't convert String into Integer
这是我的代码:
def product_lookup
# Check which Retailer this is for
case params[:retailer]
when "amazon"
client = A2z::Client.new(key: ENV["AMAZON_PAAPI_KEY"], secret: ENV["AMAZON_PAAPI_SECRET"], tag: ENV["AMAZON_PAAPI_TAG"])
product_ids = []
product_ids << product_one_id = params[:product_one_id]
product_ids << product_two_id = "B00D43QGPS"
product_ids = product_ids.join(",")
@products = client.item_lookup do
id product_ids
response_group 'Small, Images, OfferListings'
end
render :json => @products
end
end