+96
-36
@@ -4,27 +4,42 @@ package tgapi
|
||||
// Since: Bot API 3.0
|
||||
// See https://core.telegram.org/bots/api#labeledprice
|
||||
type LabeledPrice struct {
|
||||
Label string `json:"label"`
|
||||
Amount int `json:"amount"`
|
||||
// Label Portion label
|
||||
Label string `json:"label"`
|
||||
// Amount Price of the product 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).
|
||||
Amount int `json:"amount"`
|
||||
}
|
||||
|
||||
// Invoice contains basic information about an invoice.
|
||||
// Since: Bot API 3.0
|
||||
type Invoice struct {
|
||||
Title string `json:"title"`
|
||||
Description string `json:"description"`
|
||||
// Title Product name
|
||||
Title string `json:"title"`
|
||||
// Description Product description
|
||||
Description string `json:"description"`
|
||||
// StartParameter Unique bot deep-linking parameter that can be used to generate this invoice
|
||||
StartParameter string `json:"start_parameter"`
|
||||
Currency string `json:"currency"`
|
||||
TotalAmount int `json:"total_amount"`
|
||||
// Currency Three-letter ISO 4217 currency code, or “XTR” for payments in Telegram Stars
|
||||
Currency string `json:"currency"`
|
||||
// TotalAmount 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).
|
||||
TotalAmount int `json:"total_amount"`
|
||||
}
|
||||
|
||||
// ShippingQuery represents an incoming shipping query.
|
||||
// Since: Bot API 3.0
|
||||
// See https://core.telegram.org/bots/api#shippingquery
|
||||
type ShippingQuery struct {
|
||||
ID string `json:"id"`
|
||||
From User `json:"from"`
|
||||
InvoicePayload string `json:"invoice_payload"`
|
||||
// ID Unique query identifier
|
||||
ID string `json:"id"`
|
||||
// From User who sent the query
|
||||
From User `json:"from"`
|
||||
// InvoicePayload Bot-specified invoice payload
|
||||
InvoicePayload string `json:"invoice_payload"`
|
||||
// ShippingAddress User specified shipping address
|
||||
ShippingAddress ShippingAddress `json:"shipping_address"`
|
||||
}
|
||||
|
||||
@@ -32,21 +47,31 @@ type ShippingQuery struct {
|
||||
// Since: Bot API 3.0
|
||||
// See https://core.telegram.org/bots/api#shippingaddress
|
||||
type ShippingAddress struct {
|
||||
// CountryCode Two-letter ISO 3166-1 alpha-2 country code
|
||||
CountryCode string `json:"country_code"`
|
||||
State string `json:"state"`
|
||||
City string `json:"city"`
|
||||
// State State, if applicable
|
||||
State string `json:"state"`
|
||||
// City City
|
||||
City string `json:"city"`
|
||||
// StreetLine1 First line for the address
|
||||
StreetLine1 string `json:"street_line1"`
|
||||
// StreetLine2 Second line for the address
|
||||
StreetLine2 string `json:"street_line2"`
|
||||
PostCode string `json:"post_code"`
|
||||
// PostCode Address post code
|
||||
PostCode string `json:"post_code"`
|
||||
}
|
||||
|
||||
// OrderInfo represents information about an order.
|
||||
// Since: Bot API 3.0
|
||||
// See https://core.telegram.org/bots/api#orderinfo
|
||||
type OrderInfo struct {
|
||||
Name string `json:"name"`
|
||||
PhoneNumber string `json:"phone_number"`
|
||||
Email string `json:"email"`
|
||||
// Name Optional. User name
|
||||
Name string `json:"name"`
|
||||
// PhoneNumber Optional. User's phone number
|
||||
PhoneNumber string `json:"phone_number"`
|
||||
// Email Optional. User email
|
||||
Email string `json:"email"`
|
||||
// ShippingAddress Optional. User shipping address
|
||||
ShippingAddress ShippingAddress `json:"shipping_address"`
|
||||
}
|
||||
|
||||
@@ -54,20 +79,31 @@ type OrderInfo struct {
|
||||
// Since: Bot API 3.0
|
||||
// See https://core.telegram.org/bots/api#precheckoutquery
|
||||
type PreCheckoutQuery struct {
|
||||
ID string `json:"id"`
|
||||
From User `json:"from"`
|
||||
Currency string `json:"currency"`
|
||||
TotalAmount int `json:"total_amount"`
|
||||
InvoicePayload string `json:"invoice_payload"`
|
||||
ShippingOptionID string `json:"shipping_option_id"`
|
||||
OrderInfo *OrderInfo `json:"order_info,omitempty"`
|
||||
// ID Unique query identifier
|
||||
ID string `json:"id"`
|
||||
// From User who sent the query
|
||||
From User `json:"from"`
|
||||
// Currency Three-letter ISO 4217 currency code, or “XTR” for payments in Telegram Stars
|
||||
Currency string `json:"currency"`
|
||||
// TotalAmount 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).
|
||||
TotalAmount int `json:"total_amount"`
|
||||
// InvoicePayload Bot-specified invoice payload
|
||||
InvoicePayload string `json:"invoice_payload"`
|
||||
// ShippingOptionID Optional. Identifier of the shipping option chosen by the user
|
||||
ShippingOptionID string `json:"shipping_option_id"`
|
||||
// OrderInfo Optional. Order information provided by the user
|
||||
OrderInfo *OrderInfo `json:"order_info,omitempty"`
|
||||
}
|
||||
|
||||
// PaidMediaPurchased represents a purchased paid media.
|
||||
// Since: Bot API 7.10
|
||||
// See https://core.telegram.org/bots/api#paidmediapurchased
|
||||
type PaidMediaPurchased struct {
|
||||
From User `json:"from"`
|
||||
// From User who purchased the media
|
||||
From User `json:"from"`
|
||||
// PaidMediaPayload Bot-specified paid media payload
|
||||
PaidMediaPayload string `json:"paid_media_payload"`
|
||||
}
|
||||
|
||||
@@ -75,35 +111,59 @@ type PaidMediaPurchased struct {
|
||||
// Since: Bot API 3.0
|
||||
// See https://core.telegram.org/bots/api#shippingoption
|
||||
type ShippingOption struct {
|
||||
ID string `json:"id"`
|
||||
Title string `json:"title"`
|
||||
// ID Shipping option identifier
|
||||
ID string `json:"id"`
|
||||
// Title Option title
|
||||
Title string `json:"title"`
|
||||
// Prices List of price portions
|
||||
Prices []LabeledPrice `json:"prices"`
|
||||
}
|
||||
|
||||
// SuccessfulPayment contains basic information about a successful payment.
|
||||
// Since: Bot API 3.0
|
||||
type SuccessfulPayment struct {
|
||||
Currency string `json:"currency"`
|
||||
TotalAmount int `json:"total_amount"`
|
||||
// Currency Three-letter ISO 4217 currency code, or “XTR” for payments in Telegram Stars
|
||||
Currency string `json:"currency"`
|
||||
// TotalAmount 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).
|
||||
TotalAmount int `json:"total_amount"`
|
||||
// InvoicePayload Bot-specified invoice payload
|
||||
InvoicePayload string `json:"invoice_payload"`
|
||||
|
||||
SubscriptionExpirationDate int `json:"subscription_expiration_date,omitempty"` // Since: Bot API 8.0
|
||||
IsRecurring bool `json:"is_recurring,omitempty"` // Since: Bot API 8.0
|
||||
IsFirstRecurring bool `json:"is_first_recurring,omitempty"` // Since: Bot API 8.0
|
||||
ShippingOptionID string `json:"shipping_option_id,omitempty"`
|
||||
OrderInfo *OrderInfo `json:"order_info,omitempty"`
|
||||
// SubscriptionExpirationDate Optional. Expiration date of the subscription, in Unix time; for recurring
|
||||
// payments only
|
||||
SubscriptionExpirationDate int `json:"subscription_expiration_date,omitempty"` // Since: Bot API 8.0
|
||||
// IsRecurring Optional. True, if the payment is a recurring payment for a subscription
|
||||
IsRecurring bool `json:"is_recurring,omitempty"` // Since: Bot API 8.0
|
||||
// IsFirstRecurring Optional. True, if the payment is the first payment for a subscription
|
||||
IsFirstRecurring bool `json:"is_first_recurring,omitempty"` // Since: Bot API 8.0
|
||||
// ShippingOptionID Optional. Identifier of the shipping option chosen by the user
|
||||
ShippingOptionID string `json:"shipping_option_id,omitempty"`
|
||||
// OrderInfo Optional. Order information provided by the user
|
||||
OrderInfo *OrderInfo `json:"order_info,omitempty"`
|
||||
|
||||
// TelegramPaymentChargeID Telegram payment identifier
|
||||
TelegramPaymentChargeID string `json:"telegram_payment_charge_id"`
|
||||
ProviderPaymentChargeID string `json:"proviced_payment_charge_id"`
|
||||
// ProviderPaymentChargeID Provider payment identifier
|
||||
ProviderPaymentChargeID string `json:"provider_payment_charge_id"`
|
||||
}
|
||||
|
||||
// RefundedPayment contains basic information about a refunded payment.
|
||||
// Since: Bot API 7.7
|
||||
type RefundedPayment struct {
|
||||
Currency string `json:"currency"`
|
||||
TotalAmount int `json:"total_amount"`
|
||||
// Currency Three-letter ISO 4217 currency code, or “XTR” for payments in Telegram Stars. Currently,
|
||||
// always “XTR”.
|
||||
Currency string `json:"currency"`
|
||||
// TotalAmount Total refunded price in the smallest units of the currency (integer, not float/double). For
|
||||
// example, for a price of US$ 1.45, total_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).
|
||||
TotalAmount int `json:"total_amount"`
|
||||
// InvoicePayload Bot-specified invoice payload
|
||||
InvoicePayload string `json:"invoice_payload"`
|
||||
|
||||
// TelegramPaymentChargeID Telegram payment identifier
|
||||
TelegramPaymentChargeID string `json:"telegram_payment_charge_id"`
|
||||
ProviderPaymentChargeID string `json:"proviced_payment_charge_id,omitempty"`
|
||||
// ProviderPaymentChargeID Optional. Provider payment identifier
|
||||
ProviderPaymentChargeID string `json:"provider_payment_charge_id,omitempty"`
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user