Method: OpenJd.full_options

Defined in:
lib/open_jd/open_jd.rb

.full_options(params) ⇒ Object

Merge custom parameters with JD system parameters.

System paramters below will be merged.

timestamp
v
format
sign_method
app_key
method
params_key

Current JD API Version is ‘2.0’. format should be json. Only sign_method MD5 is supported so far.



103
104
105
106
107
108
109
110
111
112
113
# File 'lib/open_jd/open_jd.rb', line 103

def full_options(params)
  {
      timestamp:           Time.zone.now.strftime('%F %T'),
      v:                   API_VERSION,
      format:              :json,
      sign_method:         :md5,
      app_key:             config['app_key'],
      method:              params[:method],
      '360buy_param_json': params[:fields].to_json.to_s
  }
end