From b5270579dff07e1a4d644237648a0f42d18c60d0 Mon Sep 17 00:00:00 2001
From: GitHub Action Params: JSON object with the following fields: Sent by the client to report the payment status of an invoice obtained from a Params: a JSON object with the following fields: Normal webapps can be opened from: To open them, clients should call messages.requestWebView, and then open a webview using the After loading the webview, until it is closed by a web_app_close event, the user client must invoke messages.prolongWebView every 60 seconds. Used to initiate payment of an invoice ». The message will also have a replyInlineMarkup keyboard attached to it.
The the first button of the keyboard will always be a keyboardButtonBuy button.invoice_closed
-
+slug
- Invoice slugstatus
- slug
- Invoice identifierstatus
- One of the following values:
+
+paid
– The invoice was paid successfullycancelled
– The user closed this invoice without payingfailed
– The user tried to pay, but the payment was failedpending
– The payment is still processing. The bot will receive a service message about a successful payment when the payment is successfully paid.web_app_open_invoice
event. viewport_changed
@@ -149,8 +156,8 @@
from_bot_menu
flag should be set)start_attach
flag should be populated)url
contained in the returned webViewResultUrl. Invoice links
+t.me
syntax:
@@ -833,7 +834,7 @@ t.me/$<slug>
t.me/invoice/<slug>
t.me/$<slug>
diff --git a/data/web/corefork.telegram.org/api/payments.html b/data/web/corefork.telegram.org/api/payments.html
index 933529fc1b..9f3db90826 100644
--- a/data/web/corefork.telegram.org/api/payments.html
+++ b/data/web/corefork.telegram.org/api/payments.html
@@ -94,7 +94,10 @@ You can also attach an inline keyboard to the message using the slug
Required
-
+ The invoice slug to be passed to payments.getPaymentForm with an inputInvoiceSlug.
reply_mark
2.2 Getting invoice info about the product
-invoice#3e85a91b flags:# test:flags.0?true name_requested:flags.1?true phone_requested:flags.2?true email_requested:flags.3?true shipping_address_requested:flags.4?true flexible:flags.5?true phone_to_provider:flags.6?true email_to_provider:flags.7?true recurring:flags.9?true currency:string prices:Vector<LabeledPrice> max_tip_amount:flags.8?long suggested_tip_amounts:flags.8?Vector<long> recurring_terms_url:flags.9?string = Invoice;
+
inputInvoiceMessage#c5b56859 peer:InputPeer msg_id:int = InputInvoice;
+inputInvoiceSlug#c326caef slug:string = InputInvoice;
+
+invoice#3e85a91b flags:# test:flags.0?true name_requested:flags.1?true phone_requested:flags.2?true email_requested:flags.3?true shipping_address_requested:flags.4?true flexible:flags.5?true phone_to_provider:flags.6?true email_to_provider:flags.7?true recurring:flags.9?true currency:string prices:Vector<LabeledPrice> max_tip_amount:flags.8?long suggested_tip_amounts:flags.8?Vector<long> recurring_terms_url:flags.9?string = Invoice;
paymentRequestedInfo#909c3f94 flags:# name:flags.0?string phone:flags.1?string email:flags.2?string shipping_address:flags.3?PostAddress = PaymentRequestedInfo;
@@ -105,7 +108,19 @@ The the first button of the keyboard will always be a keyboardButtonBuy button, the client proceeds to call payments.getPaymentForm with the message ID of the invoice preview message to get the payment form.
payments.getPaymentForm is used to return a payment form from an invoice, providing the following invoice
parameter:
slug
parameterweb_app_open_invoice
event from a web apppremium_invoice_slug
app config parameter »The returned form will contain fields that should be passed to the payment provider along with the full invoice. The payment form also contains info about previously saved payment credentials and order information (name, phone number, email, shipping address & so on).
The full invoice contains info about the information required for the order, the price and the currency, and whether this is a test
order.
'*'<
Event data: a JSON object with a string path_full
field, containing the path+query component of a t.me deep link.
Used to open a t.me deep link. The Web App will be closed.
web_app_open_invoice
-Event data: a JSON object with a string slug
field
+Event data: a JSON object with a string slug
field.
+Used to initiate payment of an invoice », invoking payments.getPaymentForm with an inputInvoiceSlug, containing the slug
.
+The Web App will not be closed.
+The payment status should be reported back to the web app using invoice_closed.
web_app_expand
No event payload.
Expands the web app to the maximum available height.