GetPaymentFormRequest
Only users can use this request. See code examples.
---functions--- payments.getPaymentForm#37148dbb flags:# invoice:InputInvoice theme_params:flags.0?DataJSON = payments.PaymentForm
Returns
| payments.PaymentForm |
This type can be an instance of either:
| PaymentForm | PaymentFormStarGift |
| PaymentFormStars |
Parameters
| invoice | InputInvoice | |
| theme_params | DataJSON | This argument defaults to None and can be omitted. |
Known RPC errors
This request can cause 1 known error:
MessageIdInvalidError | The specified message ID is invalid or you can't do that operation on such message. |
You can import these from telethon.errors.
Example
from telethon.sync import TelegramClient
from telethon import functions, types
with TelegramClient(name, api_id, api_hash) as client:
result = client(functions.payments.GetPaymentFormRequest(
invoice=types.InputInvoiceMessage(
peer='username',
msg_id=42
),
theme_params=types.DataJSON(
data='some string here'
)
))
print(result.stringify())