1616# You should have received a copy of the GNU Lesser General Public License
1717# along with Pyrogram. If not, see <http://www.gnu.org/licenses/>.
1818
19+ from typing import Optional
20+
1921import pyrogram
2022from pyrogram import raw , types
2123
@@ -25,7 +27,10 @@ async def send_payment_form(
2527 self : "pyrogram.Client" ,
2628 payment_form_id : int ,
2729 input_invoice : "types.InputInvoice" ,
28- credentials : "types.InputCredentials" = None
30+ credentials : "types.InputCredentials" = None ,
31+ requested_info_id : Optional [str ] = None ,
32+ shipping_option_id : Optional [str ] = None ,
33+ tip_amount : Optional [int ] = None
2934 ) -> "types.PaymentResult" :
3035 """Send a filled-out payment form to the bot for final verification.
3136
@@ -42,6 +47,16 @@ async def send_payment_form(
4247 The credentials chosen by user for payment.
4348 Pass None for a payment in Telegram Stars.
4449
50+ requested_info_id (``str``, *optional*):
51+ Identifier of a saved order info, returned by
52+ :meth:`~pyrogram.Client.validate_requested_info`.
53+
54+ shipping_option_id (``str``, *optional*):
55+ Identifier of the chosen shipping option.
56+
57+ tip_amount (``int``, *optional*):
58+ The amount of tip in the smallest units of the currency.
59+
4560 Returns:
4661 :obj:`~pyrogram.types.PaymentResult`: On success, the payment result is returned.
4762
@@ -60,7 +75,7 @@ async def send_payment_form(
6075 payment_form_id=form.id,
6176 input_invoice=invoice,
6277 credentials=types.InputCredentialsNew(
63- data=json.dumps({"token": "...", "type": "card"}), # Pass the token received from the payment provider
78+ data=json.dumps({"token": "...", "type": "card"}),
6479 )
6580 )
6681
@@ -89,7 +104,10 @@ async def send_payment_form(
89104 raw .functions .payments .SendPaymentForm (
90105 form_id = payment_form_id ,
91106 invoice = await input_invoice .write (self ),
92- credentials = await credentials .write (self )
107+ credentials = await credentials .write (self ),
108+ requested_info_id = requested_info_id ,
109+ shipping_option_id = shipping_option_id ,
110+ tip_amount = tip_amount
93111 )
94112 )
95113
0 commit comments