mirror of
https://github.com/InsanusMokrassar/TelegramBotAPI.git
synced 2024-11-26 03:58:44 +00:00
add send invoice extensions
This commit is contained in:
parent
dfe5595fd3
commit
0dd632eb46
@ -1,6 +1,7 @@
|
||||
package com.github.insanusmokrassar.TelegramBotAPI.requests.send.payments
|
||||
|
||||
import com.github.insanusmokrassar.TelegramBotAPI.CommonAbstracts.types.*
|
||||
import com.github.insanusmokrassar.TelegramBotAPI.bot.RequestsExecutor
|
||||
import com.github.insanusmokrassar.TelegramBotAPI.requests.send.abstracts.SendMessageRequest
|
||||
import com.github.insanusmokrassar.TelegramBotAPI.types.*
|
||||
import com.github.insanusmokrassar.TelegramBotAPI.types.buttons.InlineKeyboardMarkup
|
||||
@ -101,3 +102,49 @@ data class SendInvoice(
|
||||
photoHeight = null
|
||||
}
|
||||
}
|
||||
|
||||
suspend fun RequestsExecutor.sendInvoice(
|
||||
chatId: ChatId,
|
||||
title: String,
|
||||
description: String,
|
||||
payload: String,
|
||||
providerToken: String,
|
||||
startParameter: StartParameter,
|
||||
currency: Currency,
|
||||
prices: List<LabeledPrice>,
|
||||
providerData: String? = null,
|
||||
requireName: Boolean = false,
|
||||
requirePhoneNumber: Boolean = false,
|
||||
requireEmail: Boolean = false,
|
||||
requireShippingAddress: Boolean = false,
|
||||
shouldSendPhoneNumberToProvider: Boolean = false,
|
||||
shouldSendEmailToProvider: Boolean = false,
|
||||
priceDependOnShipAddress: Boolean = false,
|
||||
disableNotification: Boolean = false,
|
||||
replyToMessageId: MessageIdentifier? = null,
|
||||
replyMarkup: InlineKeyboardMarkup? = null
|
||||
) = execute(
|
||||
SendInvoice(chatId, title, description, payload, providerToken, startParameter, currency, prices, providerData, requireName, requirePhoneNumber, requireEmail, requireShippingAddress, shouldSendPhoneNumberToProvider, shouldSendEmailToProvider, priceDependOnShipAddress, disableNotification, replyToMessageId, replyMarkup)
|
||||
)
|
||||
|
||||
suspend fun RequestsExecutor.sendInvoice(
|
||||
user: CommonUser,
|
||||
title: String,
|
||||
description: String,
|
||||
payload: String,
|
||||
providerToken: String,
|
||||
startParameter: StartParameter,
|
||||
currency: Currency,
|
||||
prices: List<LabeledPrice>,
|
||||
providerData: String? = null,
|
||||
requireName: Boolean = false,
|
||||
requirePhoneNumber: Boolean = false,
|
||||
requireEmail: Boolean = false,
|
||||
requireShippingAddress: Boolean = false,
|
||||
shouldSendPhoneNumberToProvider: Boolean = false,
|
||||
shouldSendEmailToProvider: Boolean = false,
|
||||
priceDependOnShipAddress: Boolean = false,
|
||||
disableNotification: Boolean = false,
|
||||
replyToMessageId: MessageIdentifier? = null,
|
||||
replyMarkup: InlineKeyboardMarkup? = null
|
||||
) = sendInvoice(user.id, title, description, payload, providerToken, startParameter, currency, prices, providerData, requireName, requirePhoneNumber, requireEmail, requireShippingAddress, shouldSendPhoneNumberToProvider, shouldSendEmailToProvider, priceDependOnShipAddress, disableNotification, replyToMessageId, replyMarkup)
|
||||
|
Loading…
Reference in New Issue
Block a user