module Tourmaline::Client::PaymentMethods

Included Modules

Direct including types

Defined in:

Constant Summary

Log = ::Log.for("tourmaline.client.payment_methods")

Instance Method Summary

Instance Method Detail

def answer_pre_checkout_query(pre_checkout_query_id, ok, error_message = nil) #

Once the user has confirmed their payment and shipping details, the Client API sends the final confirmation in the form of a Update with the field pre_checkout_query. Use this method to respond to such pre-checkout queries. On success, true is returned.

Note: The Client API must receive an answer within 10 seconds after the > pre-checkout query was sent.

def answer_shipping_query(shipping_query_id, ok, shipping_options = nil, error_message = nil) #

If you sent an invoice requesting a shipping address and the parameter is_flexible was specified, the Client API will send a Update with a shipping_query field to the bot. Use this method to reply to shipping queries. On success, true is returned.


def labeled_prices(lp : Array(NamedTuple())) #

Convenience method to create and Array of LabledPrice from an Array of NamedTuple(label: String, amount: Int32).

TODO Replace with a builder of some kind


def send_invoice(chat, title, description, payload, provider_token, start_parameter, currency, prices, provider_data = nil, photo_url = nil, photo_size = nil, photo_width = nil, photo_height = nil, need_name = nil, need_shipping_address = nil, send_phone_number_to_provider = nil, send_email_to_provider = nil, is_flexible = nil, disable_notification = nil, reply_to_message = nil, reply_markup = nil) #

Use this method to send invoices. On success, the sent Message is returned.


def shipping_options(options : Array(NamedTuple())) #

Convenience method to create an Array of ShippingOption from a NamedTuple(id: String, title: String, prices: Array(LabeledPrice)).

TODO Replace with a builder of some kind