Module: Reapal::Form::DataHelper

Defined in:
lib/reapal/form/form_helper.rb

Instance Method Summary collapse

Instance Method Details

#get_form_data(service, params, post_path) ⇒ Hash

跳转到富民 Form 类的 api,统一返回处理

Parameters:

  • service (String)

    富民的服务

  • params (Hash)

    参数

  • post_path (String)

    post url

Returns:

  • (Hash)

    结果集

    • form_method

      • url

      • method

    • form_data

      • :merchant_id

      • :encryptkey

      • :data



21
22
23
24
25
26
27
28
29
30
31
32
33
# File 'lib/reapal/form/form_helper.rb', line 21

def get_form_data(service, params, post_path)
  Reapal.logger.info params

  request = Http.get_body(service, params, @config)

  {
    form_method: {
      :url => @config[:server_url] + post_path,
      :method => :post,
    },
    form_data: request
  }
end