{-# LANGUAGE MultiWayIf #-}
-- CHANGE WITH CAUTION: This is a generated code file generated by https://github.com/Haskell-OpenAPI-Code-Generator/Haskell-OpenAPI-Client-Code-Generator.
{-# LANGUAGE OverloadedStrings #-}

-- | Contains the types generated from the schema PaymentMethodDetailsInteracPresentReceipt
module StripeAPI.Types.PaymentMethodDetailsInteracPresentReceipt where

import qualified Control.Monad.Fail
import qualified Data.Aeson
import qualified Data.Aeson as Data.Aeson.Encoding.Internal
import qualified Data.Aeson as Data.Aeson.Types
import qualified Data.Aeson as Data.Aeson.Types.FromJSON
import qualified Data.Aeson as Data.Aeson.Types.Internal
import qualified Data.Aeson as Data.Aeson.Types.ToJSON
import qualified Data.ByteString.Char8
import qualified Data.ByteString.Char8 as Data.ByteString.Internal
import qualified Data.Functor
import qualified Data.Scientific
import qualified Data.Text
import qualified Data.Text.Internal
import qualified Data.Time.Calendar as Data.Time.Calendar.Days
import qualified Data.Time.LocalTime as Data.Time.LocalTime.Internal.ZonedTime
import qualified GHC.Base
import qualified GHC.Classes
import qualified GHC.Int
import qualified GHC.Show
import qualified GHC.Types
import qualified StripeAPI.Common
import StripeAPI.TypeAlias
import qualified Prelude as GHC.Integer.Type
import qualified Prelude as GHC.Maybe

-- | Defines the object schema located at @components.schemas.payment_method_details_interac_present_receipt@ in the specification.
data PaymentMethodDetailsInteracPresentReceipt = PaymentMethodDetailsInteracPresentReceipt
  { -- | account_type: The type of account being debited or credited
    PaymentMethodDetailsInteracPresentReceipt
-> Maybe PaymentMethodDetailsInteracPresentReceiptAccountType'
paymentMethodDetailsInteracPresentReceiptAccountType :: (GHC.Maybe.Maybe PaymentMethodDetailsInteracPresentReceiptAccountType'),
    -- | application_cryptogram: EMV tag 9F26, cryptogram generated by the integrated circuit chip.
    --
    -- Constraints:
    --
    -- * Maximum length of 5000
    PaymentMethodDetailsInteracPresentReceipt -> Maybe Text
paymentMethodDetailsInteracPresentReceiptApplicationCryptogram :: (GHC.Maybe.Maybe Data.Text.Internal.Text),
    -- | application_preferred_name: Mnenomic of the Application Identifier.
    --
    -- Constraints:
    --
    -- * Maximum length of 5000
    PaymentMethodDetailsInteracPresentReceipt -> Maybe Text
paymentMethodDetailsInteracPresentReceiptApplicationPreferredName :: (GHC.Maybe.Maybe Data.Text.Internal.Text),
    -- | authorization_code: Identifier for this transaction.
    --
    -- Constraints:
    --
    -- * Maximum length of 5000
    PaymentMethodDetailsInteracPresentReceipt -> Maybe Text
paymentMethodDetailsInteracPresentReceiptAuthorizationCode :: (GHC.Maybe.Maybe Data.Text.Internal.Text),
    -- | authorization_response_code: EMV tag 8A. A code returned by the card issuer.
    --
    -- Constraints:
    --
    -- * Maximum length of 5000
    PaymentMethodDetailsInteracPresentReceipt -> Maybe Text
paymentMethodDetailsInteracPresentReceiptAuthorizationResponseCode :: (GHC.Maybe.Maybe Data.Text.Internal.Text),
    -- | cardholder_verification_method: How the cardholder verified ownership of the card.
    --
    -- Constraints:
    --
    -- * Maximum length of 5000
    PaymentMethodDetailsInteracPresentReceipt -> Maybe Text
paymentMethodDetailsInteracPresentReceiptCardholderVerificationMethod :: (GHC.Maybe.Maybe Data.Text.Internal.Text),
    -- | dedicated_file_name: EMV tag 84. Similar to the application identifier stored on the integrated circuit chip.
    --
    -- Constraints:
    --
    -- * Maximum length of 5000
    PaymentMethodDetailsInteracPresentReceipt -> Maybe Text
paymentMethodDetailsInteracPresentReceiptDedicatedFileName :: (GHC.Maybe.Maybe Data.Text.Internal.Text),
    -- | terminal_verification_results: The outcome of a series of EMV functions performed by the card reader.
    --
    -- Constraints:
    --
    -- * Maximum length of 5000
    PaymentMethodDetailsInteracPresentReceipt -> Maybe Text
paymentMethodDetailsInteracPresentReceiptTerminalVerificationResults :: (GHC.Maybe.Maybe Data.Text.Internal.Text),
    -- | transaction_status_information: An indication of various EMV functions performed during the transaction.
    --
    -- Constraints:
    --
    -- * Maximum length of 5000
    PaymentMethodDetailsInteracPresentReceipt -> Maybe Text
paymentMethodDetailsInteracPresentReceiptTransactionStatusInformation :: (GHC.Maybe.Maybe Data.Text.Internal.Text)
  }
  deriving
    ( Int -> PaymentMethodDetailsInteracPresentReceipt -> ShowS
[PaymentMethodDetailsInteracPresentReceipt] -> ShowS
PaymentMethodDetailsInteracPresentReceipt -> String
(Int -> PaymentMethodDetailsInteracPresentReceipt -> ShowS)
-> (PaymentMethodDetailsInteracPresentReceipt -> String)
-> ([PaymentMethodDetailsInteracPresentReceipt] -> ShowS)
-> Show PaymentMethodDetailsInteracPresentReceipt
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [PaymentMethodDetailsInteracPresentReceipt] -> ShowS
$cshowList :: [PaymentMethodDetailsInteracPresentReceipt] -> ShowS
show :: PaymentMethodDetailsInteracPresentReceipt -> String
$cshow :: PaymentMethodDetailsInteracPresentReceipt -> String
showsPrec :: Int -> PaymentMethodDetailsInteracPresentReceipt -> ShowS
$cshowsPrec :: Int -> PaymentMethodDetailsInteracPresentReceipt -> ShowS
GHC.Show.Show,
      PaymentMethodDetailsInteracPresentReceipt
-> PaymentMethodDetailsInteracPresentReceipt -> Bool
(PaymentMethodDetailsInteracPresentReceipt
 -> PaymentMethodDetailsInteracPresentReceipt -> Bool)
-> (PaymentMethodDetailsInteracPresentReceipt
    -> PaymentMethodDetailsInteracPresentReceipt -> Bool)
-> Eq PaymentMethodDetailsInteracPresentReceipt
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: PaymentMethodDetailsInteracPresentReceipt
-> PaymentMethodDetailsInteracPresentReceipt -> Bool
$c/= :: PaymentMethodDetailsInteracPresentReceipt
-> PaymentMethodDetailsInteracPresentReceipt -> Bool
== :: PaymentMethodDetailsInteracPresentReceipt
-> PaymentMethodDetailsInteracPresentReceipt -> Bool
$c== :: PaymentMethodDetailsInteracPresentReceipt
-> PaymentMethodDetailsInteracPresentReceipt -> Bool
GHC.Classes.Eq
    )

instance Data.Aeson.Types.ToJSON.ToJSON PaymentMethodDetailsInteracPresentReceipt where
  toJSON :: PaymentMethodDetailsInteracPresentReceipt -> Value
toJSON PaymentMethodDetailsInteracPresentReceipt
obj = [Pair] -> Value
Data.Aeson.Types.Internal.object (Text
"account_type" Text
-> Maybe PaymentMethodDetailsInteracPresentReceiptAccountType'
-> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= PaymentMethodDetailsInteracPresentReceipt
-> Maybe PaymentMethodDetailsInteracPresentReceiptAccountType'
paymentMethodDetailsInteracPresentReceiptAccountType PaymentMethodDetailsInteracPresentReceipt
obj Pair -> [Pair] -> [Pair]
forall a. a -> [a] -> [a]
: Text
"application_cryptogram" Text -> Maybe Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= PaymentMethodDetailsInteracPresentReceipt -> Maybe Text
paymentMethodDetailsInteracPresentReceiptApplicationCryptogram PaymentMethodDetailsInteracPresentReceipt
obj Pair -> [Pair] -> [Pair]
forall a. a -> [a] -> [a]
: Text
"application_preferred_name" Text -> Maybe Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= PaymentMethodDetailsInteracPresentReceipt -> Maybe Text
paymentMethodDetailsInteracPresentReceiptApplicationPreferredName PaymentMethodDetailsInteracPresentReceipt
obj Pair -> [Pair] -> [Pair]
forall a. a -> [a] -> [a]
: Text
"authorization_code" Text -> Maybe Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= PaymentMethodDetailsInteracPresentReceipt -> Maybe Text
paymentMethodDetailsInteracPresentReceiptAuthorizationCode PaymentMethodDetailsInteracPresentReceipt
obj Pair -> [Pair] -> [Pair]
forall a. a -> [a] -> [a]
: Text
"authorization_response_code" Text -> Maybe Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= PaymentMethodDetailsInteracPresentReceipt -> Maybe Text
paymentMethodDetailsInteracPresentReceiptAuthorizationResponseCode PaymentMethodDetailsInteracPresentReceipt
obj Pair -> [Pair] -> [Pair]
forall a. a -> [a] -> [a]
: Text
"cardholder_verification_method" Text -> Maybe Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= PaymentMethodDetailsInteracPresentReceipt -> Maybe Text
paymentMethodDetailsInteracPresentReceiptCardholderVerificationMethod PaymentMethodDetailsInteracPresentReceipt
obj Pair -> [Pair] -> [Pair]
forall a. a -> [a] -> [a]
: Text
"dedicated_file_name" Text -> Maybe Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= PaymentMethodDetailsInteracPresentReceipt -> Maybe Text
paymentMethodDetailsInteracPresentReceiptDedicatedFileName PaymentMethodDetailsInteracPresentReceipt
obj Pair -> [Pair] -> [Pair]
forall a. a -> [a] -> [a]
: Text
"terminal_verification_results" Text -> Maybe Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= PaymentMethodDetailsInteracPresentReceipt -> Maybe Text
paymentMethodDetailsInteracPresentReceiptTerminalVerificationResults PaymentMethodDetailsInteracPresentReceipt
obj Pair -> [Pair] -> [Pair]
forall a. a -> [a] -> [a]
: Text
"transaction_status_information" Text -> Maybe Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= PaymentMethodDetailsInteracPresentReceipt -> Maybe Text
paymentMethodDetailsInteracPresentReceiptTransactionStatusInformation PaymentMethodDetailsInteracPresentReceipt
obj Pair -> [Pair] -> [Pair]
forall a. a -> [a] -> [a]
: [Pair]
forall a. Monoid a => a
GHC.Base.mempty)
  toEncoding :: PaymentMethodDetailsInteracPresentReceipt -> Encoding
toEncoding PaymentMethodDetailsInteracPresentReceipt
obj = Series -> Encoding
Data.Aeson.Encoding.Internal.pairs ((Text
"account_type" Text
-> Maybe PaymentMethodDetailsInteracPresentReceiptAccountType'
-> Series
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= PaymentMethodDetailsInteracPresentReceipt
-> Maybe PaymentMethodDetailsInteracPresentReceiptAccountType'
paymentMethodDetailsInteracPresentReceiptAccountType PaymentMethodDetailsInteracPresentReceipt
obj) Series -> Series -> Series
forall a. Semigroup a => a -> a -> a
GHC.Base.<> ((Text
"application_cryptogram" Text -> Maybe Text -> Series
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= PaymentMethodDetailsInteracPresentReceipt -> Maybe Text
paymentMethodDetailsInteracPresentReceiptApplicationCryptogram PaymentMethodDetailsInteracPresentReceipt
obj) Series -> Series -> Series
forall a. Semigroup a => a -> a -> a
GHC.Base.<> ((Text
"application_preferred_name" Text -> Maybe Text -> Series
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= PaymentMethodDetailsInteracPresentReceipt -> Maybe Text
paymentMethodDetailsInteracPresentReceiptApplicationPreferredName PaymentMethodDetailsInteracPresentReceipt
obj) Series -> Series -> Series
forall a. Semigroup a => a -> a -> a
GHC.Base.<> ((Text
"authorization_code" Text -> Maybe Text -> Series
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= PaymentMethodDetailsInteracPresentReceipt -> Maybe Text
paymentMethodDetailsInteracPresentReceiptAuthorizationCode PaymentMethodDetailsInteracPresentReceipt
obj) Series -> Series -> Series
forall a. Semigroup a => a -> a -> a
GHC.Base.<> ((Text
"authorization_response_code" Text -> Maybe Text -> Series
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= PaymentMethodDetailsInteracPresentReceipt -> Maybe Text
paymentMethodDetailsInteracPresentReceiptAuthorizationResponseCode PaymentMethodDetailsInteracPresentReceipt
obj) Series -> Series -> Series
forall a. Semigroup a => a -> a -> a
GHC.Base.<> ((Text
"cardholder_verification_method" Text -> Maybe Text -> Series
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= PaymentMethodDetailsInteracPresentReceipt -> Maybe Text
paymentMethodDetailsInteracPresentReceiptCardholderVerificationMethod PaymentMethodDetailsInteracPresentReceipt
obj) Series -> Series -> Series
forall a. Semigroup a => a -> a -> a
GHC.Base.<> ((Text
"dedicated_file_name" Text -> Maybe Text -> Series
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= PaymentMethodDetailsInteracPresentReceipt -> Maybe Text
paymentMethodDetailsInteracPresentReceiptDedicatedFileName PaymentMethodDetailsInteracPresentReceipt
obj) Series -> Series -> Series
forall a. Semigroup a => a -> a -> a
GHC.Base.<> ((Text
"terminal_verification_results" Text -> Maybe Text -> Series
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= PaymentMethodDetailsInteracPresentReceipt -> Maybe Text
paymentMethodDetailsInteracPresentReceiptTerminalVerificationResults PaymentMethodDetailsInteracPresentReceipt
obj) Series -> Series -> Series
forall a. Semigroup a => a -> a -> a
GHC.Base.<> (Text
"transaction_status_information" Text -> Maybe Text -> Series
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= PaymentMethodDetailsInteracPresentReceipt -> Maybe Text
paymentMethodDetailsInteracPresentReceiptTransactionStatusInformation PaymentMethodDetailsInteracPresentReceipt
obj)))))))))

instance Data.Aeson.Types.FromJSON.FromJSON PaymentMethodDetailsInteracPresentReceipt where
  parseJSON :: Value -> Parser PaymentMethodDetailsInteracPresentReceipt
parseJSON = String
-> (Object -> Parser PaymentMethodDetailsInteracPresentReceipt)
-> Value
-> Parser PaymentMethodDetailsInteracPresentReceipt
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.Aeson.Types.FromJSON.withObject String
"PaymentMethodDetailsInteracPresentReceipt" (\Object
obj -> (((((((((Maybe PaymentMethodDetailsInteracPresentReceiptAccountType'
 -> Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> PaymentMethodDetailsInteracPresentReceipt)
-> Parser
     (Maybe PaymentMethodDetailsInteracPresentReceiptAccountType'
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> PaymentMethodDetailsInteracPresentReceipt)
forall (f :: * -> *) a. Applicative f => a -> f a
GHC.Base.pure Maybe PaymentMethodDetailsInteracPresentReceiptAccountType'
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> PaymentMethodDetailsInteracPresentReceipt
PaymentMethodDetailsInteracPresentReceipt Parser
  (Maybe PaymentMethodDetailsInteracPresentReceiptAccountType'
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> PaymentMethodDetailsInteracPresentReceipt)
-> Parser
     (Maybe PaymentMethodDetailsInteracPresentReceiptAccountType')
-> Parser
     (Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> PaymentMethodDetailsInteracPresentReceipt)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
GHC.Base.<*> (Object
obj Object
-> Text
-> Parser
     (Maybe PaymentMethodDetailsInteracPresentReceiptAccountType')
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Data.Aeson.Types.FromJSON..:? Text
"account_type")) Parser
  (Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> PaymentMethodDetailsInteracPresentReceipt)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> PaymentMethodDetailsInteracPresentReceipt)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
GHC.Base.<*> (Object
obj Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Data.Aeson.Types.FromJSON..:? Text
"application_cryptogram")) Parser
  (Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> PaymentMethodDetailsInteracPresentReceipt)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> PaymentMethodDetailsInteracPresentReceipt)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
GHC.Base.<*> (Object
obj Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Data.Aeson.Types.FromJSON..:? Text
"application_preferred_name")) Parser
  (Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> PaymentMethodDetailsInteracPresentReceipt)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> PaymentMethodDetailsInteracPresentReceipt)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
GHC.Base.<*> (Object
obj Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Data.Aeson.Types.FromJSON..:? Text
"authorization_code")) Parser
  (Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> PaymentMethodDetailsInteracPresentReceipt)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> PaymentMethodDetailsInteracPresentReceipt)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
GHC.Base.<*> (Object
obj Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Data.Aeson.Types.FromJSON..:? Text
"authorization_response_code")) Parser
  (Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> PaymentMethodDetailsInteracPresentReceipt)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> PaymentMethodDetailsInteracPresentReceipt)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
GHC.Base.<*> (Object
obj Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Data.Aeson.Types.FromJSON..:? Text
"cardholder_verification_method")) Parser
  (Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> PaymentMethodDetailsInteracPresentReceipt)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe Text -> PaymentMethodDetailsInteracPresentReceipt)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
GHC.Base.<*> (Object
obj Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Data.Aeson.Types.FromJSON..:? Text
"dedicated_file_name")) Parser
  (Maybe Text
   -> Maybe Text -> PaymentMethodDetailsInteracPresentReceipt)
-> Parser (Maybe Text)
-> Parser (Maybe Text -> PaymentMethodDetailsInteracPresentReceipt)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
GHC.Base.<*> (Object
obj Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Data.Aeson.Types.FromJSON..:? Text
"terminal_verification_results")) Parser (Maybe Text -> PaymentMethodDetailsInteracPresentReceipt)
-> Parser (Maybe Text)
-> Parser PaymentMethodDetailsInteracPresentReceipt
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
GHC.Base.<*> (Object
obj Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Data.Aeson.Types.FromJSON..:? Text
"transaction_status_information"))

-- | Create a new 'PaymentMethodDetailsInteracPresentReceipt' with all required fields.
mkPaymentMethodDetailsInteracPresentReceipt :: PaymentMethodDetailsInteracPresentReceipt
mkPaymentMethodDetailsInteracPresentReceipt :: PaymentMethodDetailsInteracPresentReceipt
mkPaymentMethodDetailsInteracPresentReceipt =
  PaymentMethodDetailsInteracPresentReceipt :: Maybe PaymentMethodDetailsInteracPresentReceiptAccountType'
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> PaymentMethodDetailsInteracPresentReceipt
PaymentMethodDetailsInteracPresentReceipt
    { paymentMethodDetailsInteracPresentReceiptAccountType :: Maybe PaymentMethodDetailsInteracPresentReceiptAccountType'
paymentMethodDetailsInteracPresentReceiptAccountType = Maybe PaymentMethodDetailsInteracPresentReceiptAccountType'
forall a. Maybe a
GHC.Maybe.Nothing,
      paymentMethodDetailsInteracPresentReceiptApplicationCryptogram :: Maybe Text
paymentMethodDetailsInteracPresentReceiptApplicationCryptogram = Maybe Text
forall a. Maybe a
GHC.Maybe.Nothing,
      paymentMethodDetailsInteracPresentReceiptApplicationPreferredName :: Maybe Text
paymentMethodDetailsInteracPresentReceiptApplicationPreferredName = Maybe Text
forall a. Maybe a
GHC.Maybe.Nothing,
      paymentMethodDetailsInteracPresentReceiptAuthorizationCode :: Maybe Text
paymentMethodDetailsInteracPresentReceiptAuthorizationCode = Maybe Text
forall a. Maybe a
GHC.Maybe.Nothing,
      paymentMethodDetailsInteracPresentReceiptAuthorizationResponseCode :: Maybe Text
paymentMethodDetailsInteracPresentReceiptAuthorizationResponseCode = Maybe Text
forall a. Maybe a
GHC.Maybe.Nothing,
      paymentMethodDetailsInteracPresentReceiptCardholderVerificationMethod :: Maybe Text
paymentMethodDetailsInteracPresentReceiptCardholderVerificationMethod = Maybe Text
forall a. Maybe a
GHC.Maybe.Nothing,
      paymentMethodDetailsInteracPresentReceiptDedicatedFileName :: Maybe Text
paymentMethodDetailsInteracPresentReceiptDedicatedFileName = Maybe Text
forall a. Maybe a
GHC.Maybe.Nothing,
      paymentMethodDetailsInteracPresentReceiptTerminalVerificationResults :: Maybe Text
paymentMethodDetailsInteracPresentReceiptTerminalVerificationResults = Maybe Text
forall a. Maybe a
GHC.Maybe.Nothing,
      paymentMethodDetailsInteracPresentReceiptTransactionStatusInformation :: Maybe Text
paymentMethodDetailsInteracPresentReceiptTransactionStatusInformation = Maybe Text
forall a. Maybe a
GHC.Maybe.Nothing
    }

-- | Defines the enum schema located at @components.schemas.payment_method_details_interac_present_receipt.properties.account_type@ in the specification.
--
-- The type of account being debited or credited
data PaymentMethodDetailsInteracPresentReceiptAccountType'
  = -- | This case is used if the value encountered during decoding does not match any of the provided cases in the specification.
    PaymentMethodDetailsInteracPresentReceiptAccountType'Other Data.Aeson.Types.Internal.Value
  | -- | This constructor can be used to send values to the server which are not present in the specification yet.
    PaymentMethodDetailsInteracPresentReceiptAccountType'Typed Data.Text.Internal.Text
  | -- | Represents the JSON value @"checking"@
    PaymentMethodDetailsInteracPresentReceiptAccountType'EnumChecking
  | -- | Represents the JSON value @"savings"@
    PaymentMethodDetailsInteracPresentReceiptAccountType'EnumSavings
  | -- | Represents the JSON value @"unknown"@
    PaymentMethodDetailsInteracPresentReceiptAccountType'EnumUnknown
  deriving (Int
-> PaymentMethodDetailsInteracPresentReceiptAccountType' -> ShowS
[PaymentMethodDetailsInteracPresentReceiptAccountType'] -> ShowS
PaymentMethodDetailsInteracPresentReceiptAccountType' -> String
(Int
 -> PaymentMethodDetailsInteracPresentReceiptAccountType' -> ShowS)
-> (PaymentMethodDetailsInteracPresentReceiptAccountType'
    -> String)
-> ([PaymentMethodDetailsInteracPresentReceiptAccountType']
    -> ShowS)
-> Show PaymentMethodDetailsInteracPresentReceiptAccountType'
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [PaymentMethodDetailsInteracPresentReceiptAccountType'] -> ShowS
$cshowList :: [PaymentMethodDetailsInteracPresentReceiptAccountType'] -> ShowS
show :: PaymentMethodDetailsInteracPresentReceiptAccountType' -> String
$cshow :: PaymentMethodDetailsInteracPresentReceiptAccountType' -> String
showsPrec :: Int
-> PaymentMethodDetailsInteracPresentReceiptAccountType' -> ShowS
$cshowsPrec :: Int
-> PaymentMethodDetailsInteracPresentReceiptAccountType' -> ShowS
GHC.Show.Show, PaymentMethodDetailsInteracPresentReceiptAccountType'
-> PaymentMethodDetailsInteracPresentReceiptAccountType' -> Bool
(PaymentMethodDetailsInteracPresentReceiptAccountType'
 -> PaymentMethodDetailsInteracPresentReceiptAccountType' -> Bool)
-> (PaymentMethodDetailsInteracPresentReceiptAccountType'
    -> PaymentMethodDetailsInteracPresentReceiptAccountType' -> Bool)
-> Eq PaymentMethodDetailsInteracPresentReceiptAccountType'
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: PaymentMethodDetailsInteracPresentReceiptAccountType'
-> PaymentMethodDetailsInteracPresentReceiptAccountType' -> Bool
$c/= :: PaymentMethodDetailsInteracPresentReceiptAccountType'
-> PaymentMethodDetailsInteracPresentReceiptAccountType' -> Bool
== :: PaymentMethodDetailsInteracPresentReceiptAccountType'
-> PaymentMethodDetailsInteracPresentReceiptAccountType' -> Bool
$c== :: PaymentMethodDetailsInteracPresentReceiptAccountType'
-> PaymentMethodDetailsInteracPresentReceiptAccountType' -> Bool
GHC.Classes.Eq)

instance Data.Aeson.Types.ToJSON.ToJSON PaymentMethodDetailsInteracPresentReceiptAccountType' where
  toJSON :: PaymentMethodDetailsInteracPresentReceiptAccountType' -> Value
toJSON (PaymentMethodDetailsInteracPresentReceiptAccountType'Other Value
val) = Value
val
  toJSON (PaymentMethodDetailsInteracPresentReceiptAccountType'Typed Text
val) = Text -> Value
forall a. ToJSON a => a -> Value
Data.Aeson.Types.ToJSON.toJSON Text
val
  toJSON (PaymentMethodDetailsInteracPresentReceiptAccountType'
PaymentMethodDetailsInteracPresentReceiptAccountType'EnumChecking) = Value
"checking"
  toJSON (PaymentMethodDetailsInteracPresentReceiptAccountType'
PaymentMethodDetailsInteracPresentReceiptAccountType'EnumSavings) = Value
"savings"
  toJSON (PaymentMethodDetailsInteracPresentReceiptAccountType'
PaymentMethodDetailsInteracPresentReceiptAccountType'EnumUnknown) = Value
"unknown"

instance Data.Aeson.Types.FromJSON.FromJSON PaymentMethodDetailsInteracPresentReceiptAccountType' where
  parseJSON :: Value
-> Parser PaymentMethodDetailsInteracPresentReceiptAccountType'
parseJSON Value
val =
    PaymentMethodDetailsInteracPresentReceiptAccountType'
-> Parser PaymentMethodDetailsInteracPresentReceiptAccountType'
forall (f :: * -> *) a. Applicative f => a -> f a
GHC.Base.pure
      ( if
            | Value
val Value -> Value -> Bool
forall a. Eq a => a -> a -> Bool
GHC.Classes.== Value
"checking" -> PaymentMethodDetailsInteracPresentReceiptAccountType'
PaymentMethodDetailsInteracPresentReceiptAccountType'EnumChecking
            | Value
val Value -> Value -> Bool
forall a. Eq a => a -> a -> Bool
GHC.Classes.== Value
"savings" -> PaymentMethodDetailsInteracPresentReceiptAccountType'
PaymentMethodDetailsInteracPresentReceiptAccountType'EnumSavings
            | Value
val Value -> Value -> Bool
forall a. Eq a => a -> a -> Bool
GHC.Classes.== Value
"unknown" -> PaymentMethodDetailsInteracPresentReceiptAccountType'
PaymentMethodDetailsInteracPresentReceiptAccountType'EnumUnknown
            | Bool
GHC.Base.otherwise -> Value -> PaymentMethodDetailsInteracPresentReceiptAccountType'
PaymentMethodDetailsInteracPresentReceiptAccountType'Other Value
val
      )