{-# LANGUAGE DeriveGeneric #-}
module Telegram.Bot.API.Types.SuccessfulPayment where
import Data.Aeson (FromJSON (..), ToJSON (..))
import Data.Text (Text)
import GHC.Generics (Generic)
import Telegram.Bot.API.Types.Common
import Telegram.Bot.API.Types.OrderInfo
import Telegram.Bot.API.Internal.Utils
data SuccessfulPayment = SuccessfulPayment
{ SuccessfulPayment -> Text
successfulPaymentCurrency :: Text
, SuccessfulPayment -> Int
successfulPaymentTotalAmount :: Int
, SuccessfulPayment -> Text
successfulPaymentInvoicePayload :: Text
, SuccessfulPayment -> Maybe ShippingOptionId
successfulPaymentShippingOptionId :: Maybe ShippingOptionId
, SuccessfulPayment -> Maybe OrderInfo
successfulPaymentOrderInfo :: Maybe OrderInfo
, SuccessfulPayment -> Text
successfulPaymentTelegramPaymentChargeId :: Text
, SuccessfulPayment -> Text
successfulPaymentProviderPaymentChargeId :: Text
}
deriving (forall x. Rep SuccessfulPayment x -> SuccessfulPayment
forall x. SuccessfulPayment -> Rep SuccessfulPayment x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep SuccessfulPayment x -> SuccessfulPayment
$cfrom :: forall x. SuccessfulPayment -> Rep SuccessfulPayment x
Generic, Int -> SuccessfulPayment -> ShowS
[SuccessfulPayment] -> ShowS
SuccessfulPayment -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [SuccessfulPayment] -> ShowS
$cshowList :: [SuccessfulPayment] -> ShowS
show :: SuccessfulPayment -> String
$cshow :: SuccessfulPayment -> String
showsPrec :: Int -> SuccessfulPayment -> ShowS
$cshowsPrec :: Int -> SuccessfulPayment -> ShowS
Show)
instance ToJSON SuccessfulPayment where toJSON :: SuccessfulPayment -> Value
toJSON = forall a (d :: Meta) (f :: * -> *).
(Generic a, GToJSON Zero (Rep a), Rep a ~ D1 d f, Datatype d) =>
a -> Value
gtoJSON
instance FromJSON SuccessfulPayment where parseJSON :: Value -> Parser SuccessfulPayment
parseJSON = forall a (d :: Meta) (f :: * -> *).
(Generic a, GFromJSON Zero (Rep a), Rep a ~ D1 d f, Datatype d) =>
Value -> Parser a
gparseJSON