InputInvoiceMessageContent
extends InputMessageContent
in package
This file is generated from spec/openapi.json (Bot API 10.3) by tools/generate.php.
Do not edit it by hand - run composer spec:build instead.
Represents the content of an invoice message to be sent as the result of an inline query.
Tags
Table of Contents
Constants
- DISCRIMINATOR : mixed = null
- The attribute whose value names the concrete subtype.
- SUBTYPES : array<string, Part>>|array<int, Part>> = []
- The concrete classes a union parent may resolve to - keyed by discriminator value when there is one, a plain list otherwise. Empty on ordinary parts.
Properties
- $currency : string
- $description : string
- $is_flexible : bool|null
- $max_tip_amount : int|null
- $need_email : bool|null
- $need_name : bool|null
- $need_phone_number : bool|null
- $need_shipping_address : bool|null
- $payload : string
- $photo_height : int|null
- $photo_size : int|null
- $photo_url : string|null
- $photo_width : int|null
- $prices : Collection<string|int, LabeledPrice>
- $provider_data : string|null
- $provider_token : string|null
- $send_email_to_provider : bool|null
- $send_phone_number_to_provider : bool|null
- $suggested_tip_amounts : array<int, int>|null
- $title : string
- $casts : array<string, string>
- $dates : array<int, string>
- Attribute names holding Unix timestamps, read back as {@see CarbonImmutable}.
- $fillable : array<int, string>
- $telegram : Telegram
Methods
- __construct() : mixed
- __debugInfo() : array<string, mixed>
- __get() : mixed
- __isset() : bool
- __set() : void
- __toString() : string
- attributeExists() : bool
- fill() : void
- getAttribute() : mixed
- getCasts() : array<string, string>
- getFillable() : array<int, string>
- getRawAttributes() : array<string, mixed>
- getTelegram() : Telegram
- jsonSerialize() : array<string, mixed>
- The payload this part would be sent back to Telegram as - nested parts and collections flattened, timestamps left as the integers they arrived as.
- offsetExists() : bool
- offsetGet() : mixed
- offsetSet() : void
- offsetUnset() : void
- resolveSubtype() : Part>
- The concrete class an incoming payload belongs to, for a union parent.
- setAttribute() : void
- factory() : Factory
- Builds another part from the same client - for nested objects.
- getRawAttribute() : mixed
- Reads straight from the attribute bag, skipping the `get{Key}Attribute` hook.
- setRawAttribute() : void
- Writes straight to the attribute bag, skipping the `set{Key}Attribute` hook and any cast. For use *inside* a mutator, which would otherwise have no way to store its shaped value without recursing through {@see setAttribute()}.
Constants
DISCRIMINATOR
The attribute whose value names the concrete subtype.
public
mixed
DISCRIMINATOR
= null
SUBTYPES
The concrete classes a union parent may resolve to - keyed by discriminator value when there is one, a plain list otherwise. Empty on ordinary parts.
public
array<string, Part>>|array<int, Part>>
SUBTYPES
= []
Properties
$currency
public
string
$currency
Three-letter ISO 4217 currency code, see more on currencies. Pass "XTR" for payments in Telegram Stars.
$description
public
string
$description
Product description, 1-255 characters
$is_flexible
public
bool|null
$is_flexible
Optional. Pass True if the final price depends on the shipping method. Ignored for payments in Telegram Stars.
$max_tip_amount
public
int|null
$max_tip_amount
Optional. The maximum accepted amount for tips in the smallest units of the currency (integer, not float/double). For example, for a maximum tip of US$ 1.45 pass max_tip_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). Defaults to 0. Not supported for payments in Telegram Stars.
$need_email
public
bool|null
$need_email
Optional. Pass True if you require the user's email address to complete the order. Ignored for payments in Telegram Stars.
$need_name
public
bool|null
$need_name
Optional. Pass True if you require the user's full name to complete the order. Ignored for payments in Telegram Stars.
$need_phone_number
public
bool|null
$need_phone_number
Optional. Pass True if you require the user's phone number to complete the order. Ignored for payments in Telegram Stars.
$need_shipping_address
public
bool|null
$need_shipping_address
Optional. Pass True if you require the user's shipping address to complete the order. Ignored for payments in Telegram Stars.
$payload
public
string
$payload
Bot-defined invoice payload, 1-128 bytes. This will not be displayed to the user, use it for your internal processes.
$photo_height
public
int|null
$photo_height
Optional. Photo height
$photo_size
public
int|null
$photo_size
Optional. Photo size in bytes
$photo_url
public
string|null
$photo_url
Optional. URL of the product photo for the invoice. Can be a photo of the goods or a marketing image for a service.
$photo_width
public
int|null
$photo_width
Optional. Photo width
$prices
public
Collection<string|int, LabeledPrice>
$prices
Price breakdown, a JSON-serialized list of components (e.g. product price, tax, discount, delivery cost, delivery tax, bonus, etc.). Must contain exactly one item for payments in Telegram Stars.
$provider_data
public
string|null
$provider_data
Optional. A JSON-serialized object for data about the invoice, which will be shared with the payment provider. A detailed description of the required fields should be provided by the payment provider.
$provider_token
public
string|null
$provider_token
Optional. Payment provider token, obtained via @BotFather. Pass an empty string for payments in Telegram Stars.
$send_email_to_provider
public
bool|null
$send_email_to_provider
Optional. Pass True if the user's email address should be sent to the provider. Ignored for payments in Telegram Stars.
$send_phone_number_to_provider
public
bool|null
$send_phone_number_to_provider
Optional. Pass True if the user's phone number should be sent to the provider. Ignored for payments in Telegram Stars.
$suggested_tip_amounts
public
array<int, int>|null
$suggested_tip_amounts
Optional. A JSON-serialized Array of suggested amounts of tip in the smallest units of the currency (integer, not float/double). At most 4 suggested tip amounts can be specified. The suggested tip amounts must be positive, passed in a strictly increased order and must not exceed max_tip_amount.
$title
public
string
$title
Product name, 1-32 characters
$casts
protected
array<string, string>
$casts
= ['prices' => 'Array of LabeledPrice', 'suggested_tip_amounts' => 'Array of Integer']
$dates
Attribute names holding Unix timestamps, read back as {@see CarbonImmutable}.
protected
array<int, string>
$dates
= []
$fillable
protected
array<int, string>
$fillable
= ['title', 'description', 'payload', 'provider_token', 'currency', 'prices', 'max_tip_amount', 'suggested_tip_amounts', 'provider_data', 'photo_url', 'photo_size', 'photo_width', 'photo_height', 'need_name', 'need_phone_number', 'need_email', 'need_shipping_address', 'send_phone_number_to_provider', 'send_email_to_provider', 'is_flexible']
$telegram read-only
protected
Telegram
$telegram
Methods
__construct()
public
__construct(Telegram $telegram[, array<string, mixed>|object $attributes = [] ]) : mixed
Parameters
- $telegram : Telegram
- $attributes : array<string, mixed>|object = []
__debugInfo()
public
__debugInfo() : array<string, mixed>
Return values
array<string, mixed>__get()
public
__get(string $name) : mixed
Parameters
- $name : string
__isset()
public
__isset(string $name) : bool
Parameters
- $name : string
Return values
bool__set()
public
__set(string $name, mixed $value) : void
Parameters
- $name : string
- $value : mixed
__toString()
public
__toString() : string
Return values
stringattributeExists()
public
attributeExists(string $key) : bool
Parameters
- $key : string
Return values
boolfill()
public
fill(array<string, mixed> $attributes) : void
Parameters
- $attributes : array<string, mixed>
getAttribute()
public
getAttribute(string $key) : mixed
Parameters
- $key : string
getCasts()
public
getCasts() : array<string, string>
Return values
array<string, string>getFillable()
public
getFillable() : array<int, string>
Return values
array<int, string>getRawAttributes()
public
getRawAttributes() : array<string, mixed>
Return values
array<string, mixed>getTelegram()
public
getTelegram() : Telegram
Return values
TelegramjsonSerialize()
The payload this part would be sent back to Telegram as - nested parts and collections flattened, timestamps left as the integers they arrived as.
public
jsonSerialize() : array<string, mixed>
Return values
array<string, mixed>offsetExists()
public
offsetExists(mixed $offset) : bool
Parameters
- $offset : mixed
Return values
booloffsetGet()
public
offsetGet(mixed $offset) : mixed
Parameters
- $offset : mixed
offsetSet()
public
offsetSet(mixed $offset, mixed $value) : void
Parameters
- $offset : mixed
- $value : mixed
offsetUnset()
public
offsetUnset(mixed $offset) : void
Parameters
- $offset : mixed
resolveSubtype()
The concrete class an incoming payload belongs to, for a union parent.
public
static resolveSubtype(array<string, mixed> $attributes) : Part>
Tagged unions resolve on their discriminator. The handful Telegram leaves
untagged (InputMessageContent, and the rest), and any payload whose tag
this build does not recognise - a member added to the Bot API since it was
generated - resolve instead to the subtype whose attributes the payload
matches most closely.
Parameters
- $attributes : array<string, mixed>
Tags
Return values
Part>setAttribute()
public
setAttribute(string $key, mixed $value) : void
Parameters
- $key : string
- $value : mixed
factory()
Builds another part from the same client - for nested objects.
protected
factory() : Factory
Return values
FactorygetRawAttribute()
Reads straight from the attribute bag, skipping the `get{Key}Attribute` hook.
protected
getRawAttribute(string $key) : mixed
Parameters
- $key : string
setRawAttribute()
Writes straight to the attribute bag, skipping the `set{Key}Attribute` hook and any cast. For use *inside* a mutator, which would otherwise have no way to store its shaped value without recursing through {@see setAttribute()}.
protected
setRawAttribute(string $key, mixed $value) : void
Parameters
- $key : string
- $value : mixed