Layer 220
PaymentsSendPaymentForm
Send compiled payment form
method
Users
payments.sendPaymentForm#2d03522f flags:# form_id:long invoice:InputInvoice requested_info_id:flags.0?string shipping_option_id:flags.1?string credentials:InputPaymentCredentials tip_amount:flags.2?long = payments.PaymentResult;
Parameters
| Name | Type | Description |
|---|---|---|
| Flags | # | Flags, see TL conditional fields |
| FormId | long | Form ID |
| Invoice | InputInvoice | Invoice |
| RequestedInfoId | flags.0?string | ID of saved and validated order info |
| ShippingOptionId | flags.1?string | Chosen shipping option ID |
| Credentials | InputPaymentCredentials | Payment credentials |
| TipAmount | flags.2?long | Tip, in the smallest units of the currency (integer, not float/double). For example, for a price of US$ 1.45 pass amount = 145. See the exp parameter in currencies. json, it shows the number of digits past the decimal point for each currency (2 for the majority of currencies). |
Returns
payments.PaymentResultPossible Errors
| Code | Type | Description |
|---|---|---|
| 400 | FORM_UNSUPPORTED | Please update your client. |
| 400 | INVOICE_INVALID | The specified invoice is invalid. |
| 400 | MESSAGE_ID_INVALID | The provided message id is invalid. |
| 400 | PAYMENT_CREDENTIALS_INVALID | The specified payment credentials are invalid. |
| 400 | PEER_ID_INVALID | The provided peer id is invalid. |
| 400 | TMP_PASSWORD_INVALID | The passed tmp_password is invalid. |
Gogram Example
// PaymentsSendPaymentForm - using Params struct result, err := client.PaymentsSendPaymentForm(&tg.PaymentsSendPaymentFormParams{ FormId: int64(0), Invoice: &tg.InputInvoice{}, Credentials: &tg.InputPaymentCredentials{}, // Optional fields: // RequestedInfoId: "...", // ShippingOptionId: "...", // TipAmount: int64(0), }) if err != nil { // handle error } // result is *tg.PaymentsPaymentResult