diff --git a/data/web/corefork.telegram.org/api/bots/webapps.html b/data/web/corefork.telegram.org/api/bots/webapps.html index cc38fcb011..9a1d3af4f9 100644 --- a/data/web/corefork.telegram.org/api/bots/webapps.html +++ b/data/web/corefork.telegram.org/api/bots/webapps.html @@ -67,9 +67,16 @@
invoice_closed
Params: JSON object with the following fields:
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.Sent by the client to report the payment status of an invoice obtained from a web_app_open_invoice
event.
viewport_changed
Params: a JSON object with the following fields:
Normal webapps can be opened from:
from_bot_menu
flag should be set)start_attach
flag should be populated)To open them, clients should call messages.requestWebView, and then open a webview using the url
contained in the returned webViewResultUrl.
After loading the webview, until it is closed by a web_app_close event, the user client must invoke messages.prolongWebView every 60 seconds.
diff --git a/data/web/corefork.telegram.org/api/links.html b/data/web/corefork.telegram.org/api/links.html index 8603a24d70..d7298dfa7e 100644 --- a/data/web/corefork.telegram.org/api/links.html +++ b/data/web/corefork.telegram.org/api/links.html @@ -815,6 +815,7 @@ tg://resolve?domain=<bot_username>&startgroup&admin=<permissionUsed to initiate payment of an invoice ».
t.me
syntax:
t.me/invoice/<slug>
t.me/$<slug>
@@ -833,7 +834,7 @@ t.me/$<slug>
slug
reply_mark
The message will also have a replyInlineMarkup keyboard attached to it.
The the first button of the keyboard will always be a keyboardButtonBuy button.
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:
+
+- inputInvoiceMessage
+- Used if the user clicks on the keyboardButtonBuy button, contains the message ID of the invoice preview message.
+
+
+- inputInvoiceSlug
+- If the user opens an invoice deep link contains the
slug
parameter
+- If the client receives a
web_app_open_invoice
event from a web app
+- If the client has to process a Telegram Premium payment, using the
premium_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.
diff --git a/data/web/corefork.telegram.org/api/web-events.html b/data/web/corefork.telegram.org/api/web-events.html
index 0a7b551411..c4c4fb6703 100644
--- a/data/web/corefork.telegram.org/api/web-events.html
+++ b/data/web/corefork.telegram.org/api/web-events.html
@@ -140,7 +140,10 @@ The GamingCommunication and bot web app libraries by default will use '*'<
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.