Module: KuaiJieQian::ClientMethod::MerchantSign

Defined in:
lib/kuai_jie_qian/client_method/merchant_sign.rb

Instance Method Summary collapse

Instance Method Details

#merchant_sign(file_stream, seal_position_info, sign_type = "Key") ⇒ Hash

平台自身签署摘要(文件流)



25
26
27
28
29
30
31
32
33
34
35
36
37
# File 'lib/kuai_jie_qian/client_method/merchant_sign.rb', line 25

def merchant_sign(file_stream, seal_position_info, sign_type="Key")
  path = "tech-sdkwrapper/timevale/sign/selfStreamSign"

  params = {
    :file => file_stream,
    :signType => sign_type,
    :signPos => seal_position_info.to_json,
  }

  result = KuaiJieQian::Http.post(@config[:host], @config[:project_config][:projectId], path, params, nil)

  Base64.decode64(result[:stream])
end

#merchant_sign_with_file(file_info, sign_type, sign_pos) ⇒ Hash

平台自身签署摘要(本地)



60
61
62
63
64
65
66
67
68
69
70
# File 'lib/kuai_jie_qian/client_method/merchant_sign.rb', line 60

def merchant_sign_with_file(file_info, sign_type, sign_pos)
  path = "tech-sdkwrapper/timevale/sign/selfFileSign"

  params = {
    :signPos => sign_pos,
    :signType => sign_type,
    :file => file_info,
  }

  KuaiJieQian::Http.post(@config[:host], @config[:project_config][:projectId], path, params)
end