FILE / ScuroNeko/Laniakea
tgapi/payments_types.go
Исходный файл и его история в репозитории.
Add MaybeInaccessibleMessage tests and godoc Update wiki and Bot API docs for the new naming
97 lines
3.4 KiB
Go
97 lines
3.4 KiB
Go
package tgapi
|
|
|
|
// LabeledPrice represents a price portion.
|
|
// See https://core.telegram.org/bots/api#labeledprice
|
|
type LabeledPrice struct {
|
|
Label string `json:"label"`
|
|
Amount int `json:"amount"`
|
|
}
|
|
|
|
type Invoice struct {
|
|
Title string `json:"title"`
|
|
Description string `json:"description"`
|
|
StartParameter string `json:"start_parameter"`
|
|
Currency string `json:"currency"`
|
|
TotalAmount int `json:"total_amount"`
|
|
}
|
|
|
|
// ShippingQuery represents an incoming shipping query.
|
|
// See https://core.telegram.org/bots/api#shippingquery
|
|
type ShippingQuery struct {
|
|
ID string `json:"id"`
|
|
From User `json:"from"`
|
|
InvoicePayload string `json:"invoice_payload"`
|
|
ShippingAddress ShippingAddress `json:"shipping_address"`
|
|
}
|
|
|
|
// ShippingAddress represents a shipping address.
|
|
// See https://core.telegram.org/bots/api#shippingaddress
|
|
type ShippingAddress struct {
|
|
CountryCode string `json:"country_code"`
|
|
State string `json:"state"`
|
|
City string `json:"city"`
|
|
StreetLine1 string `json:"street_line1"`
|
|
StreetLine2 string `json:"street_line2"`
|
|
PostCode string `json:"post_code"`
|
|
}
|
|
|
|
// OrderInfo represents information about an order.
|
|
// See https://core.telegram.org/bots/api#orderinfo
|
|
type OrderInfo struct {
|
|
Name string `json:"name"`
|
|
PhoneNumber string `json:"phone_number"`
|
|
Email string `json:"email"`
|
|
ShippingAddress ShippingAddress `json:"shipping_address"`
|
|
}
|
|
|
|
// PreCheckoutQuery represents an incoming pre-checkout query.
|
|
// 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"`
|
|
}
|
|
|
|
// PaidMediaPurchased represents a purchased paid media.
|
|
// See https://core.telegram.org/bots/api#paidmediapurchased
|
|
type PaidMediaPurchased struct {
|
|
From User `json:"from"`
|
|
PaidMediaPayload string `json:"paid_media_payload"`
|
|
}
|
|
|
|
// ShippingOption represents one shipping option.
|
|
// See https://core.telegram.org/bots/api#shippingoption
|
|
type ShippingOption struct {
|
|
ID string `json:"id"`
|
|
Title string `json:"title"`
|
|
Prices []LabeledPrice `json:"prices"`
|
|
}
|
|
|
|
type SuccessfulPayment struct {
|
|
Currency string `json:"currency"`
|
|
TotalAmount int `json:"total_amount"`
|
|
InvoicePayload string `json:"invoice_payload"`
|
|
|
|
SubscriptionExpirationDate int `json:"subscription_expiration_date,omitempty"`
|
|
IsRecurring bool `json:"is_recurring,omitempty"`
|
|
IsFirstRecurring bool `json:"is_first_recurring,omitempty"`
|
|
ShippingOptionID string `json:"shipping_option_id,omitempty"`
|
|
OrderInfo *OrderInfo `json:"order_info,omitempty"`
|
|
|
|
TelegramPaymentChargeID string `json:"telegram_payment_charge_id"`
|
|
ProviderPaymentChargeID string `json:"proviced_payment_charge_id"`
|
|
}
|
|
|
|
type RefundedPayment struct {
|
|
Currency string `json:"currency"`
|
|
TotalAmount int `json:"total_amount"`
|
|
InvoicePayload string `json:"invoice_payload"`
|
|
|
|
TelegramPaymentChargeID string `json:"telegram_payment_charge_id"`
|
|
ProviderPaymentChargeID string `json:"proviced_payment_charge_id,omitempty"`
|
|
}
|