Method: LeshuaPay::Service.scan_code_pay

Defined in:
lib/leshua_pay/service.rb

.scan_code_pay(opt) ⇒ Object



11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
# File 'lib/leshua_pay/service.rb', line 11

def scan_code_pay opt
  options = {
    merchant_id: Config.mch_id,
    nonce_str: SecureRandom.hex(16),
    service: 'get_tdcode',
    pay_way: 'WXZF',
    appid: Config.app_id,
    body: 'LeshuaPay',
    jspay_flag: 3,
  }

  ext_opt = opt.slice(
    :pay_way, :sub_openid, :jspay_flag, :third_order_id, :body, :client_ip, :amount, :notify_url,
     :callback_url, :goods_tag, :limit_pay, :shop_no, :pos_no, :attach, :app_id)

  options = options.merge ext_opt

  http_post(Config::LEPOS_PAY_GATEWAY_URL, Sign.signature(options))
end