Class: Tinkoff::Notification
- Inherits:
-
Object
- Object
- Tinkoff::Notification
- Defined in:
- lib/tinkoff/notification.rb
Instance Attribute Summary collapse
-
#amount ⇒ Object
readonly
Returns the value of attribute amount.
-
#card_id ⇒ Object
readonly
Returns the value of attribute card_id.
-
#error_code ⇒ Object
readonly
Returns the value of attribute error_code.
-
#order_id ⇒ Object
readonly
Returns the value of attribute order_id.
-
#pan ⇒ Object
readonly
Returns the value of attribute pan.
-
#payment_id ⇒ Object
readonly
Returns the value of attribute payment_id.
-
#rebill_id ⇒ Object
readonly
Returns the value of attribute rebill_id.
-
#status ⇒ Object
readonly
Returns the value of attribute status.
-
#success ⇒ Object
readonly
Returns the value of attribute success.
-
#terminal_key ⇒ Object
readonly
Returns the value of attribute terminal_key.
-
#token ⇒ Object
readonly
Returns the value of attribute token.
Instance Method Summary collapse
- #failure? ⇒ Boolean
-
#initialize(params) ⇒ Notification
constructor
A new instance of Notification.
- #success? ⇒ Boolean
Constructor Details
#initialize(params) ⇒ Notification
Returns a new instance of Notification.
6 7 8 9 10 11 12 13 14 15 16 17 18 |
# File 'lib/tinkoff/notification.rb', line 6 def initialize(params) @terminal_key = params['TerminalKey'] @order_id = params['OrderId'] @success = params['Success'] == 'true' @status = params['Status'] @payment_id = params['PaymentId'].to_i @error_code = params['ErrorCode'] @amount = params['Amount'].to_i @rebill_id = params['RebillId'].to_i @card_id = params['CardId'].to_i @pan = params['Pan'] @token = params['Token'] end |
Instance Attribute Details
#amount ⇒ Object (readonly)
Returns the value of attribute amount.
3 4 5 |
# File 'lib/tinkoff/notification.rb', line 3 def amount @amount end |
#card_id ⇒ Object (readonly)
Returns the value of attribute card_id.
3 4 5 |
# File 'lib/tinkoff/notification.rb', line 3 def card_id @card_id end |
#error_code ⇒ Object (readonly)
Returns the value of attribute error_code.
3 4 5 |
# File 'lib/tinkoff/notification.rb', line 3 def error_code @error_code end |
#order_id ⇒ Object (readonly)
Returns the value of attribute order_id.
3 4 5 |
# File 'lib/tinkoff/notification.rb', line 3 def order_id @order_id end |
#pan ⇒ Object (readonly)
Returns the value of attribute pan.
3 4 5 |
# File 'lib/tinkoff/notification.rb', line 3 def pan @pan end |
#payment_id ⇒ Object (readonly)
Returns the value of attribute payment_id.
3 4 5 |
# File 'lib/tinkoff/notification.rb', line 3 def payment_id @payment_id end |
#rebill_id ⇒ Object (readonly)
Returns the value of attribute rebill_id.
3 4 5 |
# File 'lib/tinkoff/notification.rb', line 3 def rebill_id @rebill_id end |
#status ⇒ Object (readonly)
Returns the value of attribute status.
3 4 5 |
# File 'lib/tinkoff/notification.rb', line 3 def status @status end |
#success ⇒ Object (readonly)
Returns the value of attribute success.
3 4 5 |
# File 'lib/tinkoff/notification.rb', line 3 def success @success end |
#terminal_key ⇒ Object (readonly)
Returns the value of attribute terminal_key.
3 4 5 |
# File 'lib/tinkoff/notification.rb', line 3 def terminal_key @terminal_key end |
#token ⇒ Object (readonly)
Returns the value of attribute token.
3 4 5 |
# File 'lib/tinkoff/notification.rb', line 3 def token @token end |
Instance Method Details
#failure? ⇒ Boolean
24 25 26 |
# File 'lib/tinkoff/notification.rb', line 24 def failure? !@success end |
#success? ⇒ Boolean
20 21 22 |
# File 'lib/tinkoff/notification.rb', line 20 def success? @success end |