Safe Haskell | None |
---|---|
Language | Haskell2010 |
Telegram.Bot.API.Payments
Synopsis
- data SendInvoiceRequest = SendInvoiceRequest {
- sendInvoiceChatId :: ChatId
- sendInvoiceMessageThreadId :: Maybe MessageThreadId
- sendInvoiceTitle :: Text
- sendInvoiceDescription :: Text
- sendInvoicePayload :: Text
- sendInvoiceProviderToken :: Text
- sendInvoiceCurrency :: Text
- sendInvoicePrices :: [LabeledPrice]
- sendInvoiceMaxTipAmount :: Maybe Integer
- sendInvoiceequestSuggestedTipAmounts :: Maybe [Integer]
- sendInvoiceStartParameter :: Maybe Text
- sendInvoiceProviderData :: Maybe Text
- sendInvoicePhotoUrl :: Maybe Text
- sendInvoicePhotoSize :: Maybe Int
- sendInvoicePhotoWidth :: Maybe Int
- sendInvoicePhotoHeight :: Maybe Int
- sendInvoiceNeedName :: Maybe Bool
- sendInvoiceNeedPhoneNumber :: Maybe Bool
- sendInvoiceNeedEmail :: Maybe Bool
- sendInvoiceNeedShippingAddress :: Maybe Bool
- sendInvoiceSendPhoneNumberToProvider :: Maybe Bool
- sendInvoiceSendEmailToProvider :: Maybe Bool
- sendInvoiceIsFlexible :: Maybe Bool
- sendInvoiceDisableNotification :: Maybe Bool
- sendInvoiceProtectContent :: Maybe Bool
- sendInvoiceMessageEffectId :: Maybe Text
- sendInvoiceReplyToMessageId :: Maybe MessageId
- sendInvoiceReplyParameters :: Maybe ReplyParameters
- sendInvoiceReplyMarkup :: Maybe InlineKeyboardMarkup
- type SendInvoice = "sendInvoice" :> (ReqBody '[JSON] SendInvoiceRequest :> Post '[JSON] (Response Message))
- sendInvoice :: SendInvoiceRequest -> ClientM (Response Message)
- data CreateInvoiceLinkRequest = CreateInvoiceLinkRequest {
- createInvoiceLinkTitle :: Text
- createInvoiceLinkDescription :: Text
- createInvoiceLinkPayload :: Text
- createInvoiceLinkProviderToken :: Text
- createInvoiceLinkCurrency :: Text
- createInvoiceLinkPrices :: [LabeledPrice]
- createInvoiceLinkMaxTipAmount :: Maybe Integer
- createInvoiceLinkSuggestedTipAmounts :: Maybe [Integer]
- createInvoiceLinkProviderData :: Maybe Text
- createInvoiceLinkPhotoUrl :: Maybe Text
- createInvoiceLinkPhotoSize :: Maybe Int
- createInvoiceLinkPhotoWidth :: Maybe Int
- createInvoiceLinkPhotoHeight :: Maybe Int
- createInvoiceLinkNeedName :: Maybe Bool
- createInvoiceLinkNeedPhoneNumber :: Maybe Bool
- createInvoiceLinkNeedEmail :: Maybe Bool
- createInvoiceLinkNeedShippingAddress :: Maybe Bool
- createInvoiceLinkSendPhoneNumberToProvider :: Maybe Bool
- createInvoiceLinkSendEmailToProvider :: Maybe Bool
- createInvoiceLinkIsFlexible :: Maybe Bool
- type CreateInvoiceLink = "createInvoiceLink" :> (ReqBody '[JSON] CreateInvoiceLinkRequest :> Post '[JSON] (Response Text))
- createInvoiceLink :: CreateInvoiceLinkRequest -> ClientM (Response Text)
- data AnswerShippingQueryRequest = AnswerShippingQueryRequest {}
- type AnswerShippingQuery = "answerShippingQuery" :> (ReqBody '[JSON] AnswerShippingQueryRequest :> Post '[JSON] (Response Bool))
- answerShippingQuery :: AnswerShippingQueryRequest -> ClientM (Response Bool)
- data AnswerPreCheckoutQueryRequest = AnswerPreCheckoutQueryRequest {}
- type AnswerPreCheckoutQuery = "answerPreCheckoutQuery" :> (ReqBody '[JSON] AnswerPreCheckoutQueryRequest :> Post '[JSON] (Response Bool))
- answerPreCheckoutQuery :: AnswerPreCheckoutQueryRequest -> ClientM (Response Bool)
- data RefundStarPaymentRequest = RefundStarPaymentRequest {}
- type RefundStarPayment = "refundStarPayment" :> (ReqBody '[JSON] RefundStarPaymentRequest :> Post '[JSON] (Response Bool))
- refundStarPayment :: RefundStarPaymentRequest -> ClientM (Response Bool)
- defSendInvoice :: ChatId -> Text -> Text -> Text -> Text -> Text -> [LabeledPrice] -> SendInvoiceRequest
- defCreateInvoiceLink :: Text -> Text -> Text -> Text -> Text -> [LabeledPrice] -> CreateInvoiceLinkRequest
- defAnswerShippingQuery :: Text -> Bool -> AnswerShippingQueryRequest
- defAnswerPreCheckoutQuery :: Text -> Bool -> AnswerPreCheckoutQueryRequest
Methods
sendInvoice
data SendInvoiceRequest Source #
Constructors
SendInvoiceRequest | |
Fields
|
Instances
type SendInvoice = "sendInvoice" :> (ReqBody '[JSON] SendInvoiceRequest :> Post '[JSON] (Response Message)) Source #
sendInvoice :: SendInvoiceRequest -> ClientM (Response Message) Source #
Use this method to send invoices. On success, the sent Message
is returned.
createInvoiceLink
data CreateInvoiceLinkRequest Source #
Constructors
CreateInvoiceLinkRequest | |
Fields
|
Instances
FromJSON CreateInvoiceLinkRequest Source # | |||||
Defined in Telegram.Bot.API.Payments Methods parseJSON :: Value -> Parser CreateInvoiceLinkRequest # parseJSONList :: Value -> Parser [CreateInvoiceLinkRequest] # | |||||
ToJSON CreateInvoiceLinkRequest Source # | |||||
Defined in Telegram.Bot.API.Payments Methods toJSON :: CreateInvoiceLinkRequest -> Value # toEncoding :: CreateInvoiceLinkRequest -> Encoding # toJSONList :: [CreateInvoiceLinkRequest] -> Value # | |||||
Generic CreateInvoiceLinkRequest Source # | |||||
Defined in Telegram.Bot.API.Payments Associated Types
Methods from :: CreateInvoiceLinkRequest -> Rep CreateInvoiceLinkRequest x # to :: Rep CreateInvoiceLinkRequest x -> CreateInvoiceLinkRequest # | |||||
Show CreateInvoiceLinkRequest Source # | |||||
Defined in Telegram.Bot.API.Payments Methods showsPrec :: Int -> CreateInvoiceLinkRequest -> ShowS # show :: CreateInvoiceLinkRequest -> String # showList :: [CreateInvoiceLinkRequest] -> ShowS # | |||||
type Rep CreateInvoiceLinkRequest Source # | |||||
Defined in Telegram.Bot.API.Payments type Rep CreateInvoiceLinkRequest = D1 ('MetaData "CreateInvoiceLinkRequest" "Telegram.Bot.API.Payments" "telegram-bot-api-7.4.5-3jQ5DZXJgaRBfeOQcXTvdw" 'False) (C1 ('MetaCons "CreateInvoiceLinkRequest" 'PrefixI 'True) ((((S1 ('MetaSel ('Just "createInvoiceLinkTitle") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Text) :*: S1 ('MetaSel ('Just "createInvoiceLinkDescription") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Text)) :*: (S1 ('MetaSel ('Just "createInvoiceLinkPayload") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Text) :*: (S1 ('MetaSel ('Just "createInvoiceLinkProviderToken") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Text) :*: S1 ('MetaSel ('Just "createInvoiceLinkCurrency") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Text)))) :*: ((S1 ('MetaSel ('Just "createInvoiceLinkPrices") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [LabeledPrice]) :*: S1 ('MetaSel ('Just "createInvoiceLinkMaxTipAmount") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe Integer))) :*: (S1 ('MetaSel ('Just "createInvoiceLinkSuggestedTipAmounts") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe [Integer])) :*: (S1 ('MetaSel ('Just "createInvoiceLinkProviderData") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe Text)) :*: S1 ('MetaSel ('Just "createInvoiceLinkPhotoUrl") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe Text)))))) :*: (((S1 ('MetaSel ('Just "createInvoiceLinkPhotoSize") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe Int)) :*: S1 ('MetaSel ('Just "createInvoiceLinkPhotoWidth") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe Int))) :*: (S1 ('MetaSel ('Just "createInvoiceLinkPhotoHeight") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe Int)) :*: (S1 ('MetaSel ('Just "createInvoiceLinkNeedName") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe Bool)) :*: S1 ('MetaSel ('Just "createInvoiceLinkNeedPhoneNumber") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe Bool))))) :*: ((S1 ('MetaSel ('Just "createInvoiceLinkNeedEmail") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe Bool)) :*: S1 ('MetaSel ('Just "createInvoiceLinkNeedShippingAddress") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe Bool))) :*: (S1 ('MetaSel ('Just "createInvoiceLinkSendPhoneNumberToProvider") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe Bool)) :*: (S1 ('MetaSel ('Just "createInvoiceLinkSendEmailToProvider") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe Bool)) :*: S1 ('MetaSel ('Just "createInvoiceLinkIsFlexible") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe Bool)))))))) |
type CreateInvoiceLink = "createInvoiceLink" :> (ReqBody '[JSON] CreateInvoiceLinkRequest :> Post '[JSON] (Response Text)) Source #
createInvoiceLink :: CreateInvoiceLinkRequest -> ClientM (Response Text) Source #
Use this method to create a link for an invoice. Returns the created invoice link as Text
on success.
answerShippingQuery
data AnswerShippingQueryRequest Source #
Constructors
AnswerShippingQueryRequest | |
Fields
|
Instances
FromJSON AnswerShippingQueryRequest Source # | |||||
Defined in Telegram.Bot.API.Payments | |||||
ToJSON AnswerShippingQueryRequest Source # | |||||
Defined in Telegram.Bot.API.Payments Methods toJSON :: AnswerShippingQueryRequest -> Value # toEncoding :: AnswerShippingQueryRequest -> Encoding # toJSONList :: [AnswerShippingQueryRequest] -> Value # toEncodingList :: [AnswerShippingQueryRequest] -> Encoding # | |||||
Generic AnswerShippingQueryRequest Source # | |||||
Defined in Telegram.Bot.API.Payments Associated Types
Methods from :: AnswerShippingQueryRequest -> Rep AnswerShippingQueryRequest x # to :: Rep AnswerShippingQueryRequest x -> AnswerShippingQueryRequest # | |||||
Show AnswerShippingQueryRequest Source # | |||||
Defined in Telegram.Bot.API.Payments Methods showsPrec :: Int -> AnswerShippingQueryRequest -> ShowS # show :: AnswerShippingQueryRequest -> String # showList :: [AnswerShippingQueryRequest] -> ShowS # | |||||
type Rep AnswerShippingQueryRequest Source # | |||||
Defined in Telegram.Bot.API.Payments type Rep AnswerShippingQueryRequest = D1 ('MetaData "AnswerShippingQueryRequest" "Telegram.Bot.API.Payments" "telegram-bot-api-7.4.5-3jQ5DZXJgaRBfeOQcXTvdw" 'False) (C1 ('MetaCons "AnswerShippingQueryRequest" 'PrefixI 'True) ((S1 ('MetaSel ('Just "answerShippingQueryShippingQueryId") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Text) :*: S1 ('MetaSel ('Just "answerShippingQueryOk") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Bool)) :*: (S1 ('MetaSel ('Just "answerShippingQueryShippingOptions") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe [ShippingOption])) :*: S1 ('MetaSel ('Just "answerShippingQueryErrorMessage") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe Text))))) |
type AnswerShippingQuery = "answerShippingQuery" :> (ReqBody '[JSON] AnswerShippingQueryRequest :> Post '[JSON] (Response Bool)) Source #
answerShippingQuery :: AnswerShippingQueryRequest -> ClientM (Response Bool) Source #
If you sent an invoice requesting a shipping address and the parameter is_flexible
was specified, the Bot API will send an Update
with a shipping_query
field to the bot. Use this method to reply to shipping queries. On success, True is returned.
answerPreCheckoutQuery
data AnswerPreCheckoutQueryRequest Source #
Constructors
AnswerPreCheckoutQueryRequest | |
Fields
|
Instances
FromJSON AnswerPreCheckoutQueryRequest Source # | |||||
Defined in Telegram.Bot.API.Payments | |||||
ToJSON AnswerPreCheckoutQueryRequest Source # | |||||
Defined in Telegram.Bot.API.Payments | |||||
Generic AnswerPreCheckoutQueryRequest Source # | |||||
Defined in Telegram.Bot.API.Payments Associated Types
| |||||
Show AnswerPreCheckoutQueryRequest Source # | |||||
Defined in Telegram.Bot.API.Payments Methods showsPrec :: Int -> AnswerPreCheckoutQueryRequest -> ShowS # show :: AnswerPreCheckoutQueryRequest -> String # showList :: [AnswerPreCheckoutQueryRequest] -> ShowS # | |||||
type Rep AnswerPreCheckoutQueryRequest Source # | |||||
Defined in Telegram.Bot.API.Payments type Rep AnswerPreCheckoutQueryRequest = D1 ('MetaData "AnswerPreCheckoutQueryRequest" "Telegram.Bot.API.Payments" "telegram-bot-api-7.4.5-3jQ5DZXJgaRBfeOQcXTvdw" 'False) (C1 ('MetaCons "AnswerPreCheckoutQueryRequest" 'PrefixI 'True) (S1 ('MetaSel ('Just "answerPreCheckoutQueryPreCheckoutQueryId") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Text) :*: (S1 ('MetaSel ('Just "answerPreCheckoutQueryOk") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Bool) :*: S1 ('MetaSel ('Just "answerPreCheckoutQueryErrorMessage") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe Text))))) |
type AnswerPreCheckoutQuery = "answerPreCheckoutQuery" :> (ReqBody '[JSON] AnswerPreCheckoutQueryRequest :> Post '[JSON] (Response Bool)) Source #
answerPreCheckoutQuery :: AnswerPreCheckoutQueryRequest -> ClientM (Response Bool) Source #
Once the user has confirmed their payment and shipping details, the Bot API sends the final confirmation in the form of an Update with the field pre_checkout_query. Use this method to respond to such pre-checkout queries. On success, True
is returned. Note: The Bot API must receive an answer within 10 seconds after the pre-checkout query was sent.
refundStarPayment
data RefundStarPaymentRequest Source #
Constructors
RefundStarPaymentRequest | |
Fields
|
Instances
FromJSON RefundStarPaymentRequest Source # | |||||
Defined in Telegram.Bot.API.Payments Methods parseJSON :: Value -> Parser RefundStarPaymentRequest # parseJSONList :: Value -> Parser [RefundStarPaymentRequest] # | |||||
ToJSON RefundStarPaymentRequest Source # | |||||
Defined in Telegram.Bot.API.Payments Methods toJSON :: RefundStarPaymentRequest -> Value # toEncoding :: RefundStarPaymentRequest -> Encoding # toJSONList :: [RefundStarPaymentRequest] -> Value # | |||||
Generic RefundStarPaymentRequest Source # | |||||
Defined in Telegram.Bot.API.Payments Associated Types
Methods from :: RefundStarPaymentRequest -> Rep RefundStarPaymentRequest x # to :: Rep RefundStarPaymentRequest x -> RefundStarPaymentRequest # | |||||
Show RefundStarPaymentRequest Source # | |||||
Defined in Telegram.Bot.API.Payments Methods showsPrec :: Int -> RefundStarPaymentRequest -> ShowS # show :: RefundStarPaymentRequest -> String # showList :: [RefundStarPaymentRequest] -> ShowS # | |||||
type Rep RefundStarPaymentRequest Source # | |||||
Defined in Telegram.Bot.API.Payments type Rep RefundStarPaymentRequest = D1 ('MetaData "RefundStarPaymentRequest" "Telegram.Bot.API.Payments" "telegram-bot-api-7.4.5-3jQ5DZXJgaRBfeOQcXTvdw" 'False) (C1 ('MetaCons "RefundStarPaymentRequest" 'PrefixI 'True) (S1 ('MetaSel ('Just "refundStarPaymentUserId") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 UserId) :*: S1 ('MetaSel ('Just "refundStarPaymentTelegramPaymentChargeId") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Text))) |
type RefundStarPayment = "refundStarPayment" :> (ReqBody '[JSON] RefundStarPaymentRequest :> Post '[JSON] (Response Bool)) Source #
refundStarPayment :: RefundStarPaymentRequest -> ClientM (Response Bool) Source #
Refunds a successful payment in Telegram Stars. Returns True
on success.
defSendInvoice :: ChatId -> Text -> Text -> Text -> Text -> Text -> [LabeledPrice] -> SendInvoiceRequest Source #
defCreateInvoiceLink :: Text -> Text -> Text -> Text -> Text -> [LabeledPrice] -> CreateInvoiceLinkRequest Source #