Class: ECpayPayment::ActParamVerify
- Inherits:
-
PaymentVerifyBase
- Object
- PaymentVerifyBase
- ECpayPayment::ActParamVerify
- Includes:
- ECpayErrorDefinition
- Defined in:
- lib/ecpay_payment/verification.rb
Instance Method Summary collapse
-
#initialize(apiname) ⇒ ActParamVerify
constructor
A new instance of ActParamVerify.
- #verify_act_param(params) ⇒ Object
Methods inherited from PaymentVerifyBase
#get_all_pattern, #get_basic_params, #get_cond_param, #get_depopt_param_pattern, #get_int_param_pattern, #get_opt_param_pattern, #get_param_type, #get_special_encode_param, #get_str_param_pattern, #get_svc_url, #verify_param_by_pattern
Constructor Details
#initialize(apiname) ⇒ ActParamVerify
Returns a new instance of ActParamVerify.
446 447 448 449 450 |
# File 'lib/ecpay_payment/verification.rb', line 446 def initialize(apiname) @aio_basic_param = self.get_basic_params(apiname).freeze @aio_conditional_param = self.get_cond_param(apiname).freeze @all_param_pattern = self.get_all_pattern(apiname).freeze end |
Instance Method Details
#verify_act_param(params) ⇒ Object
452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 |
# File 'lib/ecpay_payment/verification.rb', line 452 def verify_act_param(params) if params.is_a?(Hash) param_diff = @aio_basic_param - params.keys unless param_diff == [] raise ECpayInvalidParam, "Lack required param #{param_diff}" end #Verify Value pattern of each param self.verify_param_by_pattern(params, @all_param_pattern) else raise TypeError, "Recieved argument is not a hash" end end |