Module: JytPay::Api::QuickDraw
- Included in:
- Client
- Defined in:
- lib/jyt_pay/api/quick_draw.rb
Constant Summary
- QUICK_DRAW_TRAN_CODE =
"TC1002"
Instance Method Summary collapse
Instance Method Details
#quick_draw(flow_id, money, bank_business_name, card_id, true_name, identity_id, province, city) ⇒ Hash
单笔同步代付
27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 |
# File 'lib/jyt_pay/api/quick_draw.rb', line 27 def quick_draw(flow_id, money, bank_business_name, card_id, true_name, identity_id, province, city) params = { mer_viral_acct: "", agrt_no: "", bank_name: bank_business_name, account_no: card_id, account_name: true_name, account_type: "00", #对私 branch_bank_province: province, branch_bank_city: city, branch_bank_name: "", tran_amt: money, #两位小数 currency: "CNY", bsn_code: "09400", #14900其他费用 cert_type: "01", cert_no: identity_id, mobile: "", remark: "", reserve: "", } xml_str = JytPay::Xml.generate(@merchant_id, QUICK_DRAW_TRAN_CODE, params, flow_id) response = Http.post(@merchant_id, @uris[:draw], QUICK_DRAW_TRAN_CODE, xml_str, @rsa_private_key, @rsa_jyt_public_key) res = { result: 'P', # 默认 pending msg: response[:head][:resp_desc], ret_code: response[:head][:resp_code], flow_id: flow_id, vendor_order_id: nil, # jyt 不会返回他们的订单号 request_body: xml_str, response_body: response[:xml_str], } res[:result] = Http::RetCode.draw_result(response[:head][:resp_code], response[:body][:tran_state]) res end |