Skip to content

Commit

Permalink
d
Browse files Browse the repository at this point in the history
  • Loading branch information
yigefaxian committed Nov 10, 2024
1 parent 42c8a26 commit 5acd5c6
Showing 1 changed file with 0 additions and 18 deletions.
18 changes: 0 additions & 18 deletions app/apis/wx_pay/api/shared.rb
Original file line number Diff line number Diff line change
Expand Up @@ -17,23 +17,5 @@ def profit_query(transaction_id)
get "/v3/profitsharing/transactions/#{transaction_id}/amounts", origin: BASE
end

def pay_micropay(out_trade_no:, auth_code:, body:, total_fee:, spbill_create_ip:)
opts = {
nonce_str: SecureRandom.hex,
sign_type: 'HMAC-SHA256',
body: body,
out_trade_no: out_trade_no,
total_fee: total_fee,
spbill_create_ip: spbill_create_ip,
auth_code: auth_code,
**v2_common_payee_params
}
opts.merge! sign: WxPay::Sign::Hmac.generate(opts, key: @mch.key)

r = @client.with_options(origin: BASE, debug: Rails.logger.broadcasts[0].instance_values['logdev'].dev, debug_level: 2)
.post('pay/micropay', body: opts.to_xml(root: 'xml', skip_types: true, skip_instruct: true, dasherize: false))
Hash.from_xml(r.to_s)['xml']
end

end
end

0 comments on commit 5acd5c6

Please sign in to comment.