Module: Reapal::Api::User::BindCardQuery

Defined in:
lib/reapal/api/user/bind_card_query.rb

Instance Method Summary collapse

Instance Method Details

#bind_card_query(contracts, type = 'W') ⇒ Hash

1.15 绑卡查询(API)



33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
# File 'lib/reapal/api/user/bind_card_query.rb', line 33

def bind_card_query(contracts, type='W')
  service = 'reapal.trust.bindQuery'
  post_path = '/reagw/user/restApi.htm'

  params = {
    contracts: contracts,
    type: type,
    queryTime: Time.now.strftime('%Y-%m-%d %H:%M:%S')
  }

  res = operate_post(:query, service, params, post_path, Http::ErrorCode.bind_card, ['0000'])

  if 'S' == res[:result] || ('P' == res[:result] && res[:data][:resultCode].nil?)
    res[:result] = 'S'

    res[:data][:bank_cards] = parse_cards_info(res[:data][:bankCards])
  end

  res
end