Class: ZhimaAuth::InitializeRequest
- Inherits:
-
BaseRequest
- Object
- BaseRequest
- ZhimaAuth::InitializeRequest
- Defined in:
- lib/zhima_auth/request.rb
Constant Summary
Constants inherited from BaseRequest
Instance Attribute Summary collapse
-
#cert_name ⇒ Object
Returns the value of attribute cert_name.
-
#cert_no ⇒ Object
Returns the value of attribute cert_no.
-
#transaction_id ⇒ Object
Returns the value of attribute transaction_id.
Instance Method Summary collapse
- #excute ⇒ Object
- #get_biz_no ⇒ Object
-
#initialize(biz_params) ⇒ InitializeRequest
constructor
{ cert_name: “Bran”, cert_no: “3543563267268”, transaction_id: “AIHEHUO20170101000000001” }.
Methods inherited from BaseRequest
#base_params, #params_with_sign, #url
Constructor Details
#initialize(biz_params) ⇒ InitializeRequest
{ cert_name: “Bran”, cert_no: “3543563267268”, transaction_id: “AIHEHUO20170101000000001” }
27 28 29 30 31 32 33 |
# File 'lib/zhima_auth/request.rb', line 27 def initialize(biz_params) Validation.check_initialize_params(biz_params) @cert_name = biz_params[:cert_name] @cert_no = biz_params[:cert_no] @transaction_id = biz_params[:transaction_id] end |
Instance Attribute Details
#cert_name ⇒ Object
Returns the value of attribute cert_name.
25 26 27 |
# File 'lib/zhima_auth/request.rb', line 25 def cert_name @cert_name end |
#cert_no ⇒ Object
Returns the value of attribute cert_no.
25 26 27 |
# File 'lib/zhima_auth/request.rb', line 25 def cert_no @cert_no end |
#transaction_id ⇒ Object
Returns the value of attribute transaction_id.
25 26 27 |
# File 'lib/zhima_auth/request.rb', line 25 def transaction_id @transaction_id end |
Instance Method Details
#excute ⇒ Object
35 36 37 |
# File 'lib/zhima_auth/request.rb', line 35 def excute @response ||= RestClient.post url_with_params, {} end |
#get_biz_no ⇒ Object
39 40 41 42 43 |
# File 'lib/zhima_auth/request.rb', line 39 def get_biz_no res = JSON.parse(excute) Validation.check_initialize_response res res["zhima_customer_certification_initialize_response"]["biz_no"] end |