Module: Reapal::Api::Money::SubAccount

Defined in:
lib/reapal/api/money/sub_account.rb

Instance Method Summary collapse

Instance Method Details

#sub_account(flow_id, sub_type, sub_details, remark = '') ⇒ Hash

2.11 企业分账(API)



29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
# File 'lib/reapal/api/money/sub_account.rb', line 29

def (flow_id, sub_type, sub_details, remark ='')
  service = 'reapal.trust.subAccount'
  post_path = '/reagw/service/depwit.htm'

  params = {
    orderNo: flow_id,
    subType: sub_type,
    subDetails: sub_details,
    remark: remark,
    applyTime: Time.now.strftime('%Y-%m-%d %H:%M:%S'),
  }

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

  if 'S' == res[:result] && '0001' == res[:data][:resultCode]
    res[:result] = 'F'
  end

  res
end