Module: JaslTenpay::Service

Defined in:
lib/jasl_tenpay/service.rb

Constant Summary collapse

GATEWAY_URL =
'https://gw.tenpay.com/gateway/pay.htm'
CREATE_INTERACTIVE_MODE_REQUIRED_OPTIONS =
%w(body return_url notify_url partner out_trade_no total_fee fee_type spbill_create_ip)

Class Method Summary collapse

Class Method Details

.create_interactive_mode_url(options) ⇒ Object



9
10
11
12
13
14
15
16
17
18
19
# File 'lib/jasl_tenpay/service.rb', line 9

def self.create_interactive_mode_url(options)
  options = {
      'input_charset' => 'UTF-8',
      'partner' => JaslTenpay.pid,
      'fee_type' => '1'
  }.merge(Utils.stringify_keys(options))

  check_required_options(options, CREATE_INTERACTIVE_MODE_REQUIRED_OPTIONS)

  "#{GATEWAY_URL}?#{Utils.make_query_string(options)}"
end