Class: Sisow::Api::Callback
- Inherits:
-
Object
- Object
- Sisow::Api::Callback
- Defined in:
- lib/sisow/api/callback.rb
Instance Attribute Summary collapse
-
#entrance_code ⇒ Object
Returns the value of attribute entrance_code.
- #merchant_id ⇒ Object
- #merchant_key ⇒ Object
-
#sha1 ⇒ Object
Returns the value of attribute sha1.
-
#status ⇒ Object
Returns the value of attribute status.
-
#transaction_id ⇒ Object
Returns the value of attribute transaction_id.
Instance Method Summary collapse
- #cancelled? ⇒ Boolean
- #expired? ⇒ Boolean
- #failure? ⇒ Boolean
-
#initialize(attributes = {}) ⇒ Callback
constructor
A new instance of Callback.
- #pending? ⇒ Boolean
- #reversed? ⇒ Boolean
- #success? ⇒ Boolean
- #valid? ⇒ Boolean
- #validate! ⇒ Object
Constructor Details
#initialize(attributes = {}) ⇒ Callback
Returns a new instance of Callback.
13 14 15 16 17 |
# File 'lib/sisow/api/callback.rb', line 13 def initialize(attributes = {}) attributes.each do |k,v| send("#{k}=", v) end end |
Instance Attribute Details
#entrance_code ⇒ Object
Returns the value of attribute entrance_code.
8 9 10 |
# File 'lib/sisow/api/callback.rb', line 8 def entrance_code @entrance_code end |
#merchant_id ⇒ Object
52 53 54 |
# File 'lib/sisow/api/callback.rb', line 52 def merchant_id @merchant_id || Sisow.configuration.merchant_id end |
#merchant_key ⇒ Object
56 57 58 |
# File 'lib/sisow/api/callback.rb', line 56 def merchant_key @merchant_key || Sisow.configuration.merchant_key end |
#sha1 ⇒ Object
Returns the value of attribute sha1.
8 9 10 |
# File 'lib/sisow/api/callback.rb', line 8 def sha1 @sha1 end |
#status ⇒ Object
Returns the value of attribute status.
8 9 10 |
# File 'lib/sisow/api/callback.rb', line 8 def status @status end |
#transaction_id ⇒ Object
Returns the value of attribute transaction_id.
8 9 10 |
# File 'lib/sisow/api/callback.rb', line 8 def transaction_id @transaction_id end |
Instance Method Details
#cancelled? ⇒ Boolean
36 37 38 |
# File 'lib/sisow/api/callback.rb', line 36 def cancelled? @status == 'Cancelled' end |
#expired? ⇒ Boolean
32 33 34 |
# File 'lib/sisow/api/callback.rb', line 32 def expired? @status == 'Expired' end |
#failure? ⇒ Boolean
40 41 42 |
# File 'lib/sisow/api/callback.rb', line 40 def failure? @status == 'Failure' end |
#pending? ⇒ Boolean
44 45 46 |
# File 'lib/sisow/api/callback.rb', line 44 def pending? @status == 'Pending' end |
#reversed? ⇒ Boolean
48 49 50 |
# File 'lib/sisow/api/callback.rb', line 48 def reversed? @status == 'Reversed' end |
#success? ⇒ Boolean
28 29 30 |
# File 'lib/sisow/api/callback.rb', line 28 def success? @status == 'Success' end |
#valid? ⇒ Boolean
19 20 21 |
# File 'lib/sisow/api/callback.rb', line 19 def valid? valid_callback == true end |