Class: PreCheckoutQuery

Inherits:
Object
  • Object
show all
Defined in:
lib/objects/pre_checkout_query.rb

Overview

This object contains information about an incoming pre-checkout query.

Instance Method Summary collapse

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

#currencyObject

Three-letter ISO 4217 currency code



24
25
26
# File 'lib/objects/pre_checkout_query.rb', line 24

def currency
  @query.currency
end

#fromObject

User who sent the query.



19
20
21
# File 'lib/objects/pre_checkout_query.rb', line 19

def from
  User.new(@query.from)
end

#idObject

Unique query identifier.



14
15
16
# File 'lib/objects/pre_checkout_query.rb', line 14

def id
  @query.id
end

#invoice_option_idObject

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_infoObject



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_countObject

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