Class: Fonepaisa::Client
- Inherits:
-
Object
- Object
- Fonepaisa::Client
- Defined in:
- lib/fonepaisa/client.rb
Direct Known Subclasses
Constant Summary collapse
- BASE_URL =
'https://api.fonepaisa.com/v2'.freeze
Instance Attribute Summary collapse
-
#params ⇒ Object
readonly
Returns the value of attribute params.
Instance Method Summary collapse
-
#initialize(params) ⇒ Client
constructor
A new instance of Client.
- #response_valid? ⇒ Boolean
Constructor Details
#initialize(params) ⇒ Client
Returns a new instance of Client.
10 11 12 |
# File 'lib/fonepaisa/client.rb', line 10 def initialize(params) @params = params end |
Instance Attribute Details
#params ⇒ Object (readonly)
Returns the value of attribute params.
6 7 8 |
# File 'lib/fonepaisa/client.rb', line 6 def params @params end |
Instance Method Details
#response_valid? ⇒ Boolean
14 15 16 17 18 19 20 21 22 23 |
# File 'lib/fonepaisa/client.rb', line 14 def response_valid? # if hash field is nil then no need to verify response params return true if params[:hash].nil? attributes = params.dup attributes.delete(:hash) hash_key = secure_hash_key(attributes) hash_key == params[:hash] end |