Commit cb635026f6f10f4dc1a20dee111979addfca5251

Authored by houdelin
1 parent faed6706
Exists in master

change out_trade_no or transaction_id warning

Showing 1 changed file with 2 additions and 1 deletions   Show diff stats
lib/wx_pay/service.rb
... ... @@ -94,7 +94,7 @@ module WxPay
94 94 params
95 95 end
96 96  
97   - INVOKE_REFUND_REQUIRED_FIELDS = [:out_refund_no, :total_fee, :refund_fee, :op_user_id, :out_trade_no, :transaction_id]
  97 + INVOKE_REFUND_REQUIRED_FIELDS = [:out_refund_no, :total_fee, :refund_fee, :op_user_id]
98 98 # out_trade_no 和 transaction_id 是二选一(必填)
99 99 def self.invoke_refund(params, options = {})
100 100 params = {
... ... @@ -106,6 +106,7 @@ module WxPay
106 106 params[:op_user_id] ||= params[:mch_id]
107 107  
108 108 check_required_options(params, INVOKE_REFUND_REQUIRED_FIELDS)
  109 + warn("WxPay Warn: missing required option: out_trade_no or transaction_id must have one") if ([:out_trade_no, :transaction_id] & params.keys) == []
109 110  
110 111 options = {
111 112 ssl_client_cert: options.delete(:apiclient_cert) || WxPay.apiclient_cert,
... ...