Files
simplex-chat/src/Simplex/Chat/PaymentService.hs
T

31 lines
873 B
Haskell

{-# LANGUAGE DuplicateRecordFields #-}
module Simplex.Chat.PaymentService
( ServiceInvoice (..),
ServicePayment (..),
module Simplex.Chat.PaymentService.Types,
) where
import Data.Text (Text)
import Data.Time.Clock (UTCTime)
import Simplex.Chat.PaymentService.Types
data ServiceInvoice = ServiceInvoice
{ invoiceId :: InvoiceId,
price :: CurrencyAmount,
discount :: Maybe CurrencyAmount, -- discount amount from the price
credit :: Maybe CurrencyAmount, -- credit for upgrade
amount :: CurrencyAmount, -- price - discount - credit
currency :: Text,
expiresAt :: UTCTime,
paymentTo :: ServicePaymentDestination
}
deriving (Show)
data ServicePayment
= SPApple {jws :: Text}
| SPGoogle {token :: Text}
| SPInvoice {invoiceId :: InvoiceId}
| SPReceipt {receipt :: Text} -- transfer of unissued months
deriving (Show)