Module: JytPay::Api::AuthCard
- Included in:
- Client
- Defined in:
- lib/jyt_pay/api/auth_card.rb
Constant Summary
- AUTH_CARD_TRAN_CODE =
"TR4003"
Instance Method Summary collapse
Instance Method Details
#auth_card(flow_id, card_id, true_name, identity_id, phone) ⇒ Hash
四要素认证
26 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 |
# File 'lib/jyt_pay/api/auth_card.rb', line 26 def auth_card(flow_id, card_id, true_name, identity_id, phone) params = { bank_card_no: card_id, id_num: identity_id, id_name: true_name, terminal_type: '01', bank_card_type: 'D', phone_no: phone, } xml_str = JytPay::Xml.generate(@merchant_id, AUTH_CARD_TRAN_CODE, params, flow_id) response = Http.post(@merchant_id, @uris[:auth], AUTH_CARD_TRAN_CODE, xml_str, @rsa_private_key, @rsa_jyt_public_key) res = { result: 'S0000000' == response[:head][:resp_code] ? 'S' : 'F', bank_name: response[:body][:bank_name], 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 end |