Module: Allinpay::Account

Extended by:
ActiveSupport::Concern
Included in:
Client
Defined in:
lib/allinpay/account.rb

Overview

TODO:
  • 添加历史余额查询

  • 账户提现

通联支付 账户查询接口

具体文档请查看 113.108.182.3:8282/techsp/helper/interapi/tlt/interapi1.html

Instance Method Summary collapse

Instance Method Details

#account(account_number = nil) ⇒ Object

账户信息查询 交易代码:300000 查询商户在通联的虚拟账户基本信息

Parameters:

  • account_number (String) (defaults to: nil)

    账户号码



20
21
22
23
24
25
26
# File 'lib/allinpay/account.rb', line 20

def ( = nil)
  params = set_infomation('300000', { REQTIME: timestamps, LEVEL: 9 })
  params[:ACQUERYREQ] = { ACCTNO: } if 
  res = conn.request(params)
  return result_wrap(:fail, res, params) if res["INFO"]["RET_CODE"] != "0000"
  return result_wrap(:success, res, params)
end

#charge(bank_account, amount, business_code = '19900', options = {}) ⇒ Object

账户充值接口

Parameters:

  • bank_account (String)

    银行账户

  • amount (Integer)

    充值金额

  • business_code (String) (defaults to: '19900')

    业务代码 默认 100005

  • options (Hash) (defaults to: {})

    其它

Options Hash (options):

  • :summary (String)

    银行交易2

  • :remark (String)

    商户交易备注



39
40
41
42
43
44
45
46
47
48
49
50
51
52
# File 'lib/allinpay/account.rb', line 39

def charge(, amount, business_code = '19900', options = {})
  params = set_infomation('300006', { REQTIME: timestamps, LEVEL: 9 })
  charge_info = { 
    BUSINESS_CODE: business_code,
    BANKACCT: ,
    AMOUNT: amount
  }
  charge_info[:SUMMARY] = options[:summary] if options[:summary]
  charge_info[:REMARK] = options[:remark] if options[:remark]
  params[:CHARGEREQ] = charge_info
  res = conn.request(params)
  return result_wrap(:fail, res, params) if res["INFO"]["RET_CODE"] != "0000"
  return result_wrap(:success, res, params)
end