B
B
baurzhan12020-02-15 17:14:01
Python
baurzhan1, 2020-02-15 17:14:01

Payment form in telegram bot, how to do it?

How to create a payment form in Telegram Bot using pyqiwi?
You need to create a payment form. I don't know how to create a payment request. Don't post links to documentation.

def generate_form_link(pid, account, amount, comment):
"""
Generating an autofilled payment form

Parameters
----------
pid : str
Provider ID
account : str
Beneficiary account
amount : float
Payment amount
comment : str
Comment

Returns
-------
str
Link
"""
url = " https://qiwi.com/payment/form/{0} ".format(pid)
params = {"currency": 643}
params = util.merge_dicts(params, util.split_float(amount))
if comment:
params['comment'] = comment
if account:
params['account'] = account

encoded_params = urlencode(params)

return url + '?' + encoded_params

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question