Class: CCBill::Postback
- Inherits:
-
Object
- Object
- CCBill::Postback
- Defined in:
- lib/ccbill_ruby/postback.rb
Instance Attribute Summary collapse
-
#response_params ⇒ Object
Returns the value of attribute response_params.
Instance Method Summary collapse
- #approval? ⇒ Boolean
- #denial? ⇒ Boolean
-
#initialize(response_params = {}) ⇒ Postback
constructor
A new instance of Postback.
- #verified? ⇒ Boolean
Constructor Details
#initialize(response_params = {}) ⇒ Postback
Returns a new instance of Postback.
5 6 7 |
# File 'lib/ccbill_ruby/postback.rb', line 5 def initialize(response_params = {}) self.response_params = response_params end |
Instance Attribute Details
#response_params ⇒ Object
Returns the value of attribute response_params.
3 4 5 |
# File 'lib/ccbill_ruby/postback.rb', line 3 def response_params @response_params end |
Instance Method Details
#approval? ⇒ Boolean
9 10 11 |
# File 'lib/ccbill_ruby/postback.rb', line 9 def approval? !denial? end |
#denial? ⇒ Boolean
13 14 15 16 17 |
# File 'lib/ccbill_ruby/postback.rb', line 13 def denial? [:reasonForDeclineCode, :reasonForDecline, :denialId].any? do |key| !response_params[key].to_s.strip.empty? end end |
#verified? ⇒ Boolean
19 20 21 22 |
# File 'lib/ccbill_ruby/postback.rb', line 19 def verified? fail 'NOTE: Does not work on test env - Did not check for production.' response_params[:responseDigest] == encode_digest_response end |