Commit 01d9e84eeb182185dc0c410f397ee7763b0fc72e

Authored by jasl
1 parent 2db6f048
Exists in master

bug fix

Showing 2 changed files with 4 additions and 2 deletions   Show diff stats
lib/wx_pay.rb
... ... @@ -4,7 +4,7 @@ require 'wx_pay/service'
4 4 require 'openssl'
5 5  
6 6 module WxPay
7   - @rest_client_options = {}
  7 + @extra_rest_client_options = {}
8 8  
9 9 class<< self
10 10 attr_accessor :appid, :mch_id, :key, :apiclient_cert, :apiclient_key, :extra_rest_client_options
... ...
lib/wx_pay/service.rb
... ... @@ -173,13 +173,15 @@ module WxPay
173 173 end
174 174  
175 175 def self.invoke_remote(url, payload, options = {})
  176 + options = WxPay.extra_rest_client_options.merge(options)
  177 +
176 178 r = RestClient::Request.execute(
177 179 {
178 180 method: :post,
179 181 url: url,
180 182 payload: payload,
181 183 headers: { content_type: 'application/xml' }
182   - }.merge(WxPay.extra_rest_client_options).merge(options)
  184 + }.merge(options)
183 185 )
184 186  
185 187 if r
... ...