mirror of
https://github.com/aiogram/aiogram.git
synced 2025-12-13 02:19:54 +00:00
Payments.
This commit is contained in:
parent
d5d4e9c90e
commit
f3723ba378
6 changed files with 57 additions and 7 deletions
|
|
@ -22,6 +22,7 @@ from .inline_query_result import InlineQueryResult, InlineQueryResultArticle, In
|
|||
InputLocationMessageContent, InputMessageContent, InputTextMessageContent, InputTextMessageContent, \
|
||||
InputVenueMessageContent, InputVenueMessageContent
|
||||
from .invoice import Invoice
|
||||
from .labeled_price import LabeledPrice
|
||||
from .location import Location
|
||||
from .message import Message, ContentType, ParseMode
|
||||
from .message_entity import MessageEntity
|
||||
|
|
@ -30,6 +31,7 @@ from .photo_size import PhotoSize
|
|||
from .pre_checkout_query import PreCheckoutQuery
|
||||
from .reply_keyboard import KeyboardButton, ReplyKeyboardMarkup, ReplyKeyboardRemove
|
||||
from .shipping_address import ShippingAddress
|
||||
from .shipping_option import ShippingOption
|
||||
from .shipping_query import ShippingQuery
|
||||
from .sticker import Sticker
|
||||
from .successful_payment import SuccessfulPayment
|
||||
|
|
@ -96,6 +98,7 @@ __all__ = [
|
|||
'InputVenueMessageContent',
|
||||
'Invoice',
|
||||
'KeyboardButton',
|
||||
'LabeledPrice',
|
||||
'Location',
|
||||
'Message',
|
||||
'MessageEntity',
|
||||
|
|
@ -106,6 +109,7 @@ __all__ = [
|
|||
'ReplyKeyboardMarkup',
|
||||
'ReplyKeyboardRemove',
|
||||
'ShippingAddress',
|
||||
'ShippingOption',
|
||||
'ShippingQuery',
|
||||
'Sticker',
|
||||
'SuccessfulPayment',
|
||||
|
|
|
|||
|
|
@ -18,10 +18,10 @@ class Serializable:
|
|||
"""
|
||||
Returns a JSON string representation of this class.
|
||||
|
||||
This function must be overridden by subclasses.
|
||||
:return: a JSON formatted string.
|
||||
:return: a JSON.
|
||||
"""
|
||||
raise NotImplementedError
|
||||
return {k: v.to_json() if hasattr(v, 'to_json') else v for k, v in self.__dict__.items() if
|
||||
not k.startswith('_')}
|
||||
|
||||
|
||||
class Deserializable:
|
||||
|
|
|
|||
7
aiogram/types/labeled_price.py
Normal file
7
aiogram/types/labeled_price.py
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
from .base import Serializable
|
||||
|
||||
|
||||
class LabeledPrice(Serializable):
|
||||
def __init__(self, label, amount):
|
||||
self.label = label
|
||||
self.amount = amount
|
||||
8
aiogram/types/shipping_option.py
Normal file
8
aiogram/types/shipping_option.py
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
from .base import Serializable
|
||||
|
||||
|
||||
class ShippingOption(Serializable):
|
||||
def __init__(self, id, title, prices):
|
||||
self.id = id
|
||||
self.title = title
|
||||
self.prices = prices
|
||||
Loading…
Add table
Add a link
Reference in a new issue