Method: WechatPay::Ecommerce.query_platform_withdraw

Defined in:
lib/wechat-pay/ecommerce/withdraw.rb

.query_platform_withdraw(params) ⇒ Object

商户平台提现查询

Document: https://pay.weixin.qq.com/wiki/doc/apiv3_partner/apis/chapter7_8_6.shtml

Example:

WechatPay::Ecommerce.query_platform_withdraw(out_request_no: 'P1000')
WechatPay::Ecommerce.query_platform_withdraw(withdraw_id: '12313153')


105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
# File 'lib/wechat-pay/ecommerce/withdraw.rb', line 105

def self.query_platform_withdraw(params)
  if params[:withdraw_id]
    params.delete(:out_request_no)
    withdraw_id = params.delete(:withdraw_id)
    url = "/v3/merchant/fund/withdraw/withdraw-id/#{withdraw_id}"
  else
    params.delete(:withdraw_id)
    out_request_no = params.delete(:out_request_no)
    url = "/v3/merchant/fund/withdraw/out-request-no/#{out_request_no}"
  end

  method = 'GET'

  make_request(
    method: method,
    path: url,
    extra_headers: {
      'Content-Type' => 'application/x-www-form-urlencoded'
    }
  )
end