Class: Tinkoff::Payment
- Inherits:
-
Object
- Object
- Tinkoff::Payment
- Defined in:
- lib/tinkoff/payment.rb
Instance Attribute Summary collapse
-
#amount ⇒ Object
readonly
Returns the value of attribute amount.
-
#details ⇒ Object
readonly
Returns the value of attribute details.
-
#error_code ⇒ Object
readonly
Returns the value of attribute error_code.
-
#message ⇒ Object
readonly
Returns the value of attribute message.
-
#new_amount ⇒ Object
readonly
Attributes for Cancel method.
-
#order_id ⇒ Object
readonly
Returns the value of attribute order_id.
-
#original_amount ⇒ Object
readonly
Attributes for Cancel method.
-
#payment_id ⇒ Object
readonly
Returns the value of attribute payment_id.
-
#payment_url ⇒ Object
readonly
Returns the value of attribute payment_url.
-
#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.
Instance Method Summary collapse
- #failure? ⇒ Boolean
-
#initialize(response) ⇒ Payment
constructor
A new instance of Payment.
- #success? ⇒ Boolean
Constructor Details
#initialize(response) ⇒ Payment
Returns a new instance of Payment.
9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 |
# File 'lib/tinkoff/payment.rb', line 9 def initialize(response) @terminal_key = response['TerminalKey'] @amount = response['Amount'] @order_id = response['OrderId'] @success = response['Success'] @status = response['Status'] @payment_id = response['PaymentId'] @error_code = response['ErrorCode'] @payment_url = response['PaymentURL'] @message = response['Message'] @details = response['Details'] # Attributes for Cancel method @original_amount = response['OriginalAmount'] @new_amount = response['NewAmount'] end |
Instance Attribute Details
#amount ⇒ Object (readonly)
Returns the value of attribute amount.
3 4 5 |
# File 'lib/tinkoff/payment.rb', line 3 def amount @amount end |
#details ⇒ Object (readonly)
Returns the value of attribute details.
3 4 5 |
# File 'lib/tinkoff/payment.rb', line 3 def details @details end |
#error_code ⇒ Object (readonly)
Returns the value of attribute error_code.
3 4 5 |
# File 'lib/tinkoff/payment.rb', line 3 def error_code @error_code end |
#message ⇒ Object (readonly)
Returns the value of attribute message.
3 4 5 |
# File 'lib/tinkoff/payment.rb', line 3 def @message end |
#new_amount ⇒ Object (readonly)
Attributes for Cancel method
7 8 9 |
# File 'lib/tinkoff/payment.rb', line 7 def new_amount @new_amount end |
#order_id ⇒ Object (readonly)
Returns the value of attribute order_id.
3 4 5 |
# File 'lib/tinkoff/payment.rb', line 3 def order_id @order_id end |
#original_amount ⇒ Object (readonly)
Attributes for Cancel method
7 8 9 |
# File 'lib/tinkoff/payment.rb', line 7 def original_amount @original_amount end |
#payment_id ⇒ Object (readonly)
Returns the value of attribute payment_id.
3 4 5 |
# File 'lib/tinkoff/payment.rb', line 3 def payment_id @payment_id end |
#payment_url ⇒ Object (readonly)
Returns the value of attribute payment_url.
3 4 5 |
# File 'lib/tinkoff/payment.rb', line 3 def payment_url @payment_url end |
#status ⇒ Object (readonly)
Returns the value of attribute status.
3 4 5 |
# File 'lib/tinkoff/payment.rb', line 3 def status @status end |
#success ⇒ Object (readonly)
Returns the value of attribute success.
3 4 5 |
# File 'lib/tinkoff/payment.rb', line 3 def success @success end |
#terminal_key ⇒ Object (readonly)
Returns the value of attribute terminal_key.
3 4 5 |
# File 'lib/tinkoff/payment.rb', line 3 def terminal_key @terminal_key end |
Instance Method Details
#failure? ⇒ Boolean
26 27 28 |
# File 'lib/tinkoff/payment.rb', line 26 def failure? !@success end |
#success? ⇒ Boolean
30 31 32 |
# File 'lib/tinkoff/payment.rb', line 30 def success? !failure? end |