浏览代码

Stop refund#calculate from modifying the resource prefix.

Alex Aitken 6 年之前
父节点
当前提交
4fb78decff
共有 1 个文件被更改,包括 4 次插入3 次删除
  1. 4 3
      lib/shopify_api/resources/refund.rb

+ 4 - 3
lib/shopify_api/resources/refund.rb

@@ -4,9 +4,10 @@ module ShopifyAPI
 
     def self.calculate(*args)
       options = { :refund => args[0] }
-      params = options.merge(args[1][:params]) if args[1] && args[1][:params]
-      self.prefix = "/admin/orders/#{params[:order_id]}/"
-      resource = post(:calculate, {}, options.to_json)
+      params = {}
+      params = args[1][:params] if args[1] && args[1][:params]
+
+      resource = post(:calculate, params, options.to_json)
       instantiate_record(format.decode(resource.body), {})
     end
   end