Class: Validations
- Inherits:
-
Object
- Object
- Validations
- Defined in:
- lib/compropago_sdk/tools/validations.rb
Class Method Summary collapse
Class Method Details
.eval_auth(client) ⇒ Object
3 4 5 6 7 8 9 10 11 12 |
# File 'lib/compropago_sdk/tools/validations.rb', line 3 def self.eval_auth(client) response = EasyRequest::get(client.deploy_uri+'users/auth/', user: client.get_user, pass: client.get_pass) info = Factory.get_instance_of('EvalAuthInfo', response) if info.code == 200 return info else raise 'Error :'+info. end end |
.validate_gateway(client) ⇒ Object
14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 |
# File 'lib/compropago_sdk/tools/validations.rb', line 14 def self.validate_gateway(client) unless client raise 'Client object is not valid' end client_mode = client.live auth_info = Validations::eval_auth client if auth_info.mode_key != auth_info.livemode raise 'Keys are diferent of store mode.' end if client_mode != auth_info.livemode raise 'Client mode is diferent of store mode' end if client_mode != auth_info.mode_key raise 'Client mode is diferent of keys mode' end end |