Class: PreCheckoutQuery
- Inherits:
-
Object
- Object
- PreCheckoutQuery
- Defined in:
- lib/objects/pre_checkout_query.rb
Overview
This object contains information about an incoming pre-checkout query.
Instance Method Summary collapse
-
#currency ⇒ Object
Three-letter ISO 4217 currency code.
-
#from ⇒ Object
User who sent the query.
-
#id ⇒ Object
Unique query identifier.
-
#initialize(query) ⇒ PreCheckoutQuery
constructor
:nodoc:.
-
#invoice_option_id ⇒ Object
Bot specified invoice payload.
- #order_info ⇒ Object
-
#total_count ⇒ Object
Total price in the smallest units of the currency (integer, not float/double).
Constructor Details
#initialize(query) ⇒ PreCheckoutQuery
:nodoc:
9 10 11 |
# File 'lib/objects/pre_checkout_query.rb', line 9 def initialize(query) # :nodoc: @query = query end |
Instance Method Details
#currency ⇒ Object
Three-letter ISO 4217 currency code
24 25 26 |
# File 'lib/objects/pre_checkout_query.rb', line 24 def currency @query.currency end |
#from ⇒ Object
User who sent the query.
19 20 21 |
# File 'lib/objects/pre_checkout_query.rb', line 19 def from User.new(@query.from) end |
#id ⇒ Object
Unique query identifier.
14 15 16 |
# File 'lib/objects/pre_checkout_query.rb', line 14 def id @query.id end |
#invoice_option_id ⇒ Object
Bot specified invoice payload.
38 39 40 |
# File 'lib/objects/pre_checkout_query.rb', line 38 def invoice_option_id @query.invoice_option_id end |
#order_info ⇒ Object
42 43 44 45 46 47 |
# File 'lib/objects/pre_checkout_query.rb', line 42 def order_info info = @query.order_info return OrderInfo.new(info) if info false end |
#total_count ⇒ Object
Total price in the smallest units of the currency (integer, not float/double). For example, for a price of US$ 1.45
pass amount = 145 . See the exp parameter in currencies.json,
it shows the number of digits past the decimal point for each currency (2 for the majority of currencies).
33 34 35 |
# File 'lib/objects/pre_checkout_query.rb', line 33 def total_count @query.total_count end |