فهرست منبع

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