{-# 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 PaymentMethodDetailsInteracPresent
module StripeAPI.Types.PaymentMethodDetailsInteracPresent 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 {-# SOURCE #-} StripeAPI.Types.PaymentMethodDetailsInteracPresentReceipt
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@ in the specification.
data PaymentMethodDetailsInteracPresent = PaymentMethodDetailsInteracPresent
  { -- | brand: Card brand. Can be \`interac\`, \`mastercard\` or \`visa\`.
    --
    -- Constraints:
    --
    -- * Maximum length of 5000
    PaymentMethodDetailsInteracPresent -> Maybe Text
paymentMethodDetailsInteracPresentBrand :: (GHC.Maybe.Maybe Data.Text.Internal.Text),
    -- | cardholder_name: The cardholder name as read from the card, in [ISO 7813](https:\/\/en.wikipedia.org\/wiki\/ISO\/IEC_7813) format. May include alphanumeric characters, special characters and first\/last name separator (\`\/\`).
    --
    -- Constraints:
    --
    -- * Maximum length of 5000
    PaymentMethodDetailsInteracPresent -> Maybe Text
paymentMethodDetailsInteracPresentCardholderName :: (GHC.Maybe.Maybe Data.Text.Internal.Text),
    -- | country: Two-letter ISO code representing the country of the card. You could use this attribute to get a sense of the international breakdown of cards you\'ve collected.
    --
    -- Constraints:
    --
    -- * Maximum length of 5000
    PaymentMethodDetailsInteracPresent -> Maybe Text
paymentMethodDetailsInteracPresentCountry :: (GHC.Maybe.Maybe Data.Text.Internal.Text),
    -- | emv_auth_data: Authorization response cryptogram.
    --
    -- Constraints:
    --
    -- * Maximum length of 5000
    PaymentMethodDetailsInteracPresent -> Maybe Text
paymentMethodDetailsInteracPresentEmvAuthData :: (GHC.Maybe.Maybe Data.Text.Internal.Text),
    -- | exp_month: Two-digit number representing the card\'s expiration month.
    PaymentMethodDetailsInteracPresent -> Int
paymentMethodDetailsInteracPresentExpMonth :: GHC.Types.Int,
    -- | exp_year: Four-digit number representing the card\'s expiration year.
    PaymentMethodDetailsInteracPresent -> Int
paymentMethodDetailsInteracPresentExpYear :: GHC.Types.Int,
    -- | fingerprint: Uniquely identifies this particular card number. You can use this attribute to check whether two customers who’ve signed up with you are using the same card number, for example. For payment methods that tokenize card information (Apple Pay, Google Pay), the tokenized number might be provided instead of the underlying card number.
    --
    -- *Starting May 1, 2021, card fingerprint in India for Connect will change to allow two fingerprints for the same card --- one for India and one for the rest of the world.*
    --
    -- Constraints:
    --
    -- * Maximum length of 5000
    PaymentMethodDetailsInteracPresent -> Maybe Text
paymentMethodDetailsInteracPresentFingerprint :: (GHC.Maybe.Maybe Data.Text.Internal.Text),
    -- | funding: Card funding type. Can be \`credit\`, \`debit\`, \`prepaid\`, or \`unknown\`.
    --
    -- Constraints:
    --
    -- * Maximum length of 5000
    PaymentMethodDetailsInteracPresent -> Maybe Text
paymentMethodDetailsInteracPresentFunding :: (GHC.Maybe.Maybe Data.Text.Internal.Text),
    -- | generated_card: ID of a card PaymentMethod generated from the card_present PaymentMethod that may be attached to a Customer for future transactions. Only present if it was possible to generate a card PaymentMethod.
    --
    -- Constraints:
    --
    -- * Maximum length of 5000
    PaymentMethodDetailsInteracPresent -> Maybe Text
paymentMethodDetailsInteracPresentGeneratedCard :: (GHC.Maybe.Maybe Data.Text.Internal.Text),
    -- | last4: The last four digits of the card.
    --
    -- Constraints:
    --
    -- * Maximum length of 5000
    PaymentMethodDetailsInteracPresent -> Maybe Text
paymentMethodDetailsInteracPresentLast4 :: (GHC.Maybe.Maybe Data.Text.Internal.Text),
    -- | network: Identifies which network this charge was processed on. Can be \`amex\`, \`cartes_bancaires\`, \`diners\`, \`discover\`, \`interac\`, \`jcb\`, \`mastercard\`, \`unionpay\`, \`visa\`, or \`unknown\`.
    --
    -- Constraints:
    --
    -- * Maximum length of 5000
    PaymentMethodDetailsInteracPresent -> Maybe Text
paymentMethodDetailsInteracPresentNetwork :: (GHC.Maybe.Maybe Data.Text.Internal.Text),
    -- | preferred_locales: EMV tag 5F2D. Preferred languages specified by the integrated circuit chip.
    PaymentMethodDetailsInteracPresent -> Maybe [Text]
paymentMethodDetailsInteracPresentPreferredLocales :: (GHC.Maybe.Maybe ([Data.Text.Internal.Text])),
    -- | read_method: How card details were read in this transaction.
    PaymentMethodDetailsInteracPresent
-> Maybe PaymentMethodDetailsInteracPresentReadMethod'
paymentMethodDetailsInteracPresentReadMethod :: (GHC.Maybe.Maybe PaymentMethodDetailsInteracPresentReadMethod'),
    -- | receipt: A collection of fields required to be displayed on receipts. Only required for EMV transactions.
    PaymentMethodDetailsInteracPresent
-> Maybe PaymentMethodDetailsInteracPresentReceipt'
paymentMethodDetailsInteracPresentReceipt :: (GHC.Maybe.Maybe PaymentMethodDetailsInteracPresentReceipt')
  }
  deriving
    ( Int -> PaymentMethodDetailsInteracPresent -> ShowS
[PaymentMethodDetailsInteracPresent] -> ShowS
PaymentMethodDetailsInteracPresent -> String
(Int -> PaymentMethodDetailsInteracPresent -> ShowS)
-> (PaymentMethodDetailsInteracPresent -> String)
-> ([PaymentMethodDetailsInteracPresent] -> ShowS)
-> Show PaymentMethodDetailsInteracPresent
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [PaymentMethodDetailsInteracPresent] -> ShowS
$cshowList :: [PaymentMethodDetailsInteracPresent] -> ShowS
show :: PaymentMethodDetailsInteracPresent -> String
$cshow :: PaymentMethodDetailsInteracPresent -> String
showsPrec :: Int -> PaymentMethodDetailsInteracPresent -> ShowS
$cshowsPrec :: Int -> PaymentMethodDetailsInteracPresent -> ShowS
GHC.Show.Show,
      PaymentMethodDetailsInteracPresent
-> PaymentMethodDetailsInteracPresent -> Bool
(PaymentMethodDetailsInteracPresent
 -> PaymentMethodDetailsInteracPresent -> Bool)
-> (PaymentMethodDetailsInteracPresent
    -> PaymentMethodDetailsInteracPresent -> Bool)
-> Eq PaymentMethodDetailsInteracPresent
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: PaymentMethodDetailsInteracPresent
-> PaymentMethodDetailsInteracPresent -> Bool
$c/= :: PaymentMethodDetailsInteracPresent
-> PaymentMethodDetailsInteracPresent -> Bool
== :: PaymentMethodDetailsInteracPresent
-> PaymentMethodDetailsInteracPresent -> Bool
$c== :: PaymentMethodDetailsInteracPresent
-> PaymentMethodDetailsInteracPresent -> Bool
GHC.Classes.Eq
    )

instance Data.Aeson.Types.ToJSON.ToJSON PaymentMethodDetailsInteracPresent where
  toJSON :: PaymentMethodDetailsInteracPresent -> Value
toJSON PaymentMethodDetailsInteracPresent
obj = [Pair] -> Value
Data.Aeson.Types.Internal.object (Text
"brand" Text -> Maybe Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= PaymentMethodDetailsInteracPresent -> Maybe Text
paymentMethodDetailsInteracPresentBrand PaymentMethodDetailsInteracPresent
obj Pair -> [Pair] -> [Pair]
forall a. a -> [a] -> [a]
: Text
"cardholder_name" Text -> Maybe Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= PaymentMethodDetailsInteracPresent -> Maybe Text
paymentMethodDetailsInteracPresentCardholderName PaymentMethodDetailsInteracPresent
obj Pair -> [Pair] -> [Pair]
forall a. a -> [a] -> [a]
: Text
"country" Text -> Maybe Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= PaymentMethodDetailsInteracPresent -> Maybe Text
paymentMethodDetailsInteracPresentCountry PaymentMethodDetailsInteracPresent
obj Pair -> [Pair] -> [Pair]
forall a. a -> [a] -> [a]
: Text
"emv_auth_data" Text -> Maybe Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= PaymentMethodDetailsInteracPresent -> Maybe Text
paymentMethodDetailsInteracPresentEmvAuthData PaymentMethodDetailsInteracPresent
obj Pair -> [Pair] -> [Pair]
forall a. a -> [a] -> [a]
: Text
"exp_month" Text -> Int -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= PaymentMethodDetailsInteracPresent -> Int
paymentMethodDetailsInteracPresentExpMonth PaymentMethodDetailsInteracPresent
obj Pair -> [Pair] -> [Pair]
forall a. a -> [a] -> [a]
: Text
"exp_year" Text -> Int -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= PaymentMethodDetailsInteracPresent -> Int
paymentMethodDetailsInteracPresentExpYear PaymentMethodDetailsInteracPresent
obj Pair -> [Pair] -> [Pair]
forall a. a -> [a] -> [a]
: Text
"fingerprint" Text -> Maybe Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= PaymentMethodDetailsInteracPresent -> Maybe Text
paymentMethodDetailsInteracPresentFingerprint PaymentMethodDetailsInteracPresent
obj Pair -> [Pair] -> [Pair]
forall a. a -> [a] -> [a]
: Text
"funding" Text -> Maybe Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= PaymentMethodDetailsInteracPresent -> Maybe Text
paymentMethodDetailsInteracPresentFunding PaymentMethodDetailsInteracPresent
obj Pair -> [Pair] -> [Pair]
forall a. a -> [a] -> [a]
: Text
"generated_card" Text -> Maybe Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= PaymentMethodDetailsInteracPresent -> Maybe Text
paymentMethodDetailsInteracPresentGeneratedCard PaymentMethodDetailsInteracPresent
obj Pair -> [Pair] -> [Pair]
forall a. a -> [a] -> [a]
: Text
"last4" Text -> Maybe Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= PaymentMethodDetailsInteracPresent -> Maybe Text
paymentMethodDetailsInteracPresentLast4 PaymentMethodDetailsInteracPresent
obj Pair -> [Pair] -> [Pair]
forall a. a -> [a] -> [a]
: Text
"network" Text -> Maybe Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= PaymentMethodDetailsInteracPresent -> Maybe Text
paymentMethodDetailsInteracPresentNetwork PaymentMethodDetailsInteracPresent
obj Pair -> [Pair] -> [Pair]
forall a. a -> [a] -> [a]
: Text
"preferred_locales" Text -> Maybe [Text] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= PaymentMethodDetailsInteracPresent -> Maybe [Text]
paymentMethodDetailsInteracPresentPreferredLocales PaymentMethodDetailsInteracPresent
obj Pair -> [Pair] -> [Pair]
forall a. a -> [a] -> [a]
: Text
"read_method" Text -> Maybe PaymentMethodDetailsInteracPresentReadMethod' -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= PaymentMethodDetailsInteracPresent
-> Maybe PaymentMethodDetailsInteracPresentReadMethod'
paymentMethodDetailsInteracPresentReadMethod PaymentMethodDetailsInteracPresent
obj Pair -> [Pair] -> [Pair]
forall a. a -> [a] -> [a]
: Text
"receipt" Text -> Maybe PaymentMethodDetailsInteracPresentReceipt' -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= PaymentMethodDetailsInteracPresent
-> Maybe PaymentMethodDetailsInteracPresentReceipt'
paymentMethodDetailsInteracPresentReceipt PaymentMethodDetailsInteracPresent
obj Pair -> [Pair] -> [Pair]
forall a. a -> [a] -> [a]
: [Pair]
forall a. Monoid a => a
GHC.Base.mempty)
  toEncoding :: PaymentMethodDetailsInteracPresent -> Encoding
toEncoding PaymentMethodDetailsInteracPresent
obj = Series -> Encoding
Data.Aeson.Encoding.Internal.pairs ((Text
"brand" Text -> Maybe Text -> Series
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= PaymentMethodDetailsInteracPresent -> Maybe Text
paymentMethodDetailsInteracPresentBrand PaymentMethodDetailsInteracPresent
obj) Series -> Series -> Series
forall a. Semigroup a => a -> a -> a
GHC.Base.<> ((Text
"cardholder_name" Text -> Maybe Text -> Series
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= PaymentMethodDetailsInteracPresent -> Maybe Text
paymentMethodDetailsInteracPresentCardholderName PaymentMethodDetailsInteracPresent
obj) Series -> Series -> Series
forall a. Semigroup a => a -> a -> a
GHC.Base.<> ((Text
"country" Text -> Maybe Text -> Series
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= PaymentMethodDetailsInteracPresent -> Maybe Text
paymentMethodDetailsInteracPresentCountry PaymentMethodDetailsInteracPresent
obj) Series -> Series -> Series
forall a. Semigroup a => a -> a -> a
GHC.Base.<> ((Text
"emv_auth_data" Text -> Maybe Text -> Series
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= PaymentMethodDetailsInteracPresent -> Maybe Text
paymentMethodDetailsInteracPresentEmvAuthData PaymentMethodDetailsInteracPresent
obj) Series -> Series -> Series
forall a. Semigroup a => a -> a -> a
GHC.Base.<> ((Text
"exp_month" Text -> Int -> Series
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= PaymentMethodDetailsInteracPresent -> Int
paymentMethodDetailsInteracPresentExpMonth PaymentMethodDetailsInteracPresent
obj) Series -> Series -> Series
forall a. Semigroup a => a -> a -> a
GHC.Base.<> ((Text
"exp_year" Text -> Int -> Series
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= PaymentMethodDetailsInteracPresent -> Int
paymentMethodDetailsInteracPresentExpYear PaymentMethodDetailsInteracPresent
obj) Series -> Series -> Series
forall a. Semigroup a => a -> a -> a
GHC.Base.<> ((Text
"fingerprint" Text -> Maybe Text -> Series
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= PaymentMethodDetailsInteracPresent -> Maybe Text
paymentMethodDetailsInteracPresentFingerprint PaymentMethodDetailsInteracPresent
obj) Series -> Series -> Series
forall a. Semigroup a => a -> a -> a
GHC.Base.<> ((Text
"funding" Text -> Maybe Text -> Series
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= PaymentMethodDetailsInteracPresent -> Maybe Text
paymentMethodDetailsInteracPresentFunding PaymentMethodDetailsInteracPresent
obj) Series -> Series -> Series
forall a. Semigroup a => a -> a -> a
GHC.Base.<> ((Text
"generated_card" Text -> Maybe Text -> Series
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= PaymentMethodDetailsInteracPresent -> Maybe Text
paymentMethodDetailsInteracPresentGeneratedCard PaymentMethodDetailsInteracPresent
obj) Series -> Series -> Series
forall a. Semigroup a => a -> a -> a
GHC.Base.<> ((Text
"last4" Text -> Maybe Text -> Series
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= PaymentMethodDetailsInteracPresent -> Maybe Text
paymentMethodDetailsInteracPresentLast4 PaymentMethodDetailsInteracPresent
obj) Series -> Series -> Series
forall a. Semigroup a => a -> a -> a
GHC.Base.<> ((Text
"network" Text -> Maybe Text -> Series
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= PaymentMethodDetailsInteracPresent -> Maybe Text
paymentMethodDetailsInteracPresentNetwork PaymentMethodDetailsInteracPresent
obj) Series -> Series -> Series
forall a. Semigroup a => a -> a -> a
GHC.Base.<> ((Text
"preferred_locales" Text -> Maybe [Text] -> Series
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= PaymentMethodDetailsInteracPresent -> Maybe [Text]
paymentMethodDetailsInteracPresentPreferredLocales PaymentMethodDetailsInteracPresent
obj) Series -> Series -> Series
forall a. Semigroup a => a -> a -> a
GHC.Base.<> ((Text
"read_method" Text
-> Maybe PaymentMethodDetailsInteracPresentReadMethod' -> Series
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= PaymentMethodDetailsInteracPresent
-> Maybe PaymentMethodDetailsInteracPresentReadMethod'
paymentMethodDetailsInteracPresentReadMethod PaymentMethodDetailsInteracPresent
obj) Series -> Series -> Series
forall a. Semigroup a => a -> a -> a
GHC.Base.<> (Text
"receipt" Text -> Maybe PaymentMethodDetailsInteracPresentReceipt' -> Series
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= PaymentMethodDetailsInteracPresent
-> Maybe PaymentMethodDetailsInteracPresentReceipt'
paymentMethodDetailsInteracPresentReceipt PaymentMethodDetailsInteracPresent
obj))))))))))))))

instance Data.Aeson.Types.FromJSON.FromJSON PaymentMethodDetailsInteracPresent where
  parseJSON :: Value -> Parser PaymentMethodDetailsInteracPresent
parseJSON = String
-> (Object -> Parser PaymentMethodDetailsInteracPresent)
-> Value
-> Parser PaymentMethodDetailsInteracPresent
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.Aeson.Types.FromJSON.withObject String
"PaymentMethodDetailsInteracPresent" (\Object
obj -> ((((((((((((((Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> Int
 -> Int
 -> Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> Maybe [Text]
 -> Maybe PaymentMethodDetailsInteracPresentReadMethod'
 -> Maybe PaymentMethodDetailsInteracPresentReceipt'
 -> PaymentMethodDetailsInteracPresent)
-> Parser
     (Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Int
      -> Int
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe [Text]
      -> Maybe PaymentMethodDetailsInteracPresentReadMethod'
      -> Maybe PaymentMethodDetailsInteracPresentReceipt'
      -> PaymentMethodDetailsInteracPresent)
forall (f :: * -> *) a. Applicative f => a -> f a
GHC.Base.pure Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Int
-> Int
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe [Text]
-> Maybe PaymentMethodDetailsInteracPresentReadMethod'
-> Maybe PaymentMethodDetailsInteracPresentReceipt'
-> PaymentMethodDetailsInteracPresent
PaymentMethodDetailsInteracPresent Parser
  (Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Int
   -> Int
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe [Text]
   -> Maybe PaymentMethodDetailsInteracPresentReadMethod'
   -> Maybe PaymentMethodDetailsInteracPresentReceipt'
   -> PaymentMethodDetailsInteracPresent)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Int
      -> Int
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe [Text]
      -> Maybe PaymentMethodDetailsInteracPresentReadMethod'
      -> Maybe PaymentMethodDetailsInteracPresentReceipt'
      -> PaymentMethodDetailsInteracPresent)
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
"brand")) Parser
  (Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Int
   -> Int
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe [Text]
   -> Maybe PaymentMethodDetailsInteracPresentReadMethod'
   -> Maybe PaymentMethodDetailsInteracPresentReceipt'
   -> PaymentMethodDetailsInteracPresent)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe Text
      -> Int
      -> Int
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe [Text]
      -> Maybe PaymentMethodDetailsInteracPresentReadMethod'
      -> Maybe PaymentMethodDetailsInteracPresentReceipt'
      -> PaymentMethodDetailsInteracPresent)
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_name")) Parser
  (Maybe Text
   -> Maybe Text
   -> Int
   -> Int
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe [Text]
   -> Maybe PaymentMethodDetailsInteracPresentReadMethod'
   -> Maybe PaymentMethodDetailsInteracPresentReceipt'
   -> PaymentMethodDetailsInteracPresent)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Int
      -> Int
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe [Text]
      -> Maybe PaymentMethodDetailsInteracPresentReadMethod'
      -> Maybe PaymentMethodDetailsInteracPresentReceipt'
      -> PaymentMethodDetailsInteracPresent)
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
"country")) Parser
  (Maybe Text
   -> Int
   -> Int
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe [Text]
   -> Maybe PaymentMethodDetailsInteracPresentReadMethod'
   -> Maybe PaymentMethodDetailsInteracPresentReceipt'
   -> PaymentMethodDetailsInteracPresent)
-> Parser (Maybe Text)
-> Parser
     (Int
      -> Int
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe [Text]
      -> Maybe PaymentMethodDetailsInteracPresentReadMethod'
      -> Maybe PaymentMethodDetailsInteracPresentReceipt'
      -> PaymentMethodDetailsInteracPresent)
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
"emv_auth_data")) Parser
  (Int
   -> Int
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe [Text]
   -> Maybe PaymentMethodDetailsInteracPresentReadMethod'
   -> Maybe PaymentMethodDetailsInteracPresentReceipt'
   -> PaymentMethodDetailsInteracPresent)
-> Parser Int
-> Parser
     (Int
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe [Text]
      -> Maybe PaymentMethodDetailsInteracPresentReadMethod'
      -> Maybe PaymentMethodDetailsInteracPresentReceipt'
      -> PaymentMethodDetailsInteracPresent)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
GHC.Base.<*> (Object
obj Object -> Text -> Parser Int
forall a. FromJSON a => Object -> Text -> Parser a
Data.Aeson.Types.FromJSON..: Text
"exp_month")) Parser
  (Int
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe [Text]
   -> Maybe PaymentMethodDetailsInteracPresentReadMethod'
   -> Maybe PaymentMethodDetailsInteracPresentReceipt'
   -> PaymentMethodDetailsInteracPresent)
-> Parser Int
-> Parser
     (Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe [Text]
      -> Maybe PaymentMethodDetailsInteracPresentReadMethod'
      -> Maybe PaymentMethodDetailsInteracPresentReceipt'
      -> PaymentMethodDetailsInteracPresent)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
GHC.Base.<*> (Object
obj Object -> Text -> Parser Int
forall a. FromJSON a => Object -> Text -> Parser a
Data.Aeson.Types.FromJSON..: Text
"exp_year")) Parser
  (Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe [Text]
   -> Maybe PaymentMethodDetailsInteracPresentReadMethod'
   -> Maybe PaymentMethodDetailsInteracPresentReceipt'
   -> PaymentMethodDetailsInteracPresent)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe [Text]
      -> Maybe PaymentMethodDetailsInteracPresentReadMethod'
      -> Maybe PaymentMethodDetailsInteracPresentReceipt'
      -> PaymentMethodDetailsInteracPresent)
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
"fingerprint")) Parser
  (Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe [Text]
   -> Maybe PaymentMethodDetailsInteracPresentReadMethod'
   -> Maybe PaymentMethodDetailsInteracPresentReceipt'
   -> PaymentMethodDetailsInteracPresent)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe [Text]
      -> Maybe PaymentMethodDetailsInteracPresentReadMethod'
      -> Maybe PaymentMethodDetailsInteracPresentReceipt'
      -> PaymentMethodDetailsInteracPresent)
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
"funding")) Parser
  (Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe [Text]
   -> Maybe PaymentMethodDetailsInteracPresentReadMethod'
   -> Maybe PaymentMethodDetailsInteracPresentReceipt'
   -> PaymentMethodDetailsInteracPresent)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe Text
      -> Maybe [Text]
      -> Maybe PaymentMethodDetailsInteracPresentReadMethod'
      -> Maybe PaymentMethodDetailsInteracPresentReceipt'
      -> PaymentMethodDetailsInteracPresent)
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
"generated_card")) Parser
  (Maybe Text
   -> Maybe Text
   -> Maybe [Text]
   -> Maybe PaymentMethodDetailsInteracPresentReadMethod'
   -> Maybe PaymentMethodDetailsInteracPresentReceipt'
   -> PaymentMethodDetailsInteracPresent)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe [Text]
      -> Maybe PaymentMethodDetailsInteracPresentReadMethod'
      -> Maybe PaymentMethodDetailsInteracPresentReceipt'
      -> PaymentMethodDetailsInteracPresent)
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
"last4")) Parser
  (Maybe Text
   -> Maybe [Text]
   -> Maybe PaymentMethodDetailsInteracPresentReadMethod'
   -> Maybe PaymentMethodDetailsInteracPresentReceipt'
   -> PaymentMethodDetailsInteracPresent)
-> Parser (Maybe Text)
-> Parser
     (Maybe [Text]
      -> Maybe PaymentMethodDetailsInteracPresentReadMethod'
      -> Maybe PaymentMethodDetailsInteracPresentReceipt'
      -> PaymentMethodDetailsInteracPresent)
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
"network")) Parser
  (Maybe [Text]
   -> Maybe PaymentMethodDetailsInteracPresentReadMethod'
   -> Maybe PaymentMethodDetailsInteracPresentReceipt'
   -> PaymentMethodDetailsInteracPresent)
-> Parser (Maybe [Text])
-> Parser
     (Maybe PaymentMethodDetailsInteracPresentReadMethod'
      -> Maybe PaymentMethodDetailsInteracPresentReceipt'
      -> PaymentMethodDetailsInteracPresent)
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
"preferred_locales")) Parser
  (Maybe PaymentMethodDetailsInteracPresentReadMethod'
   -> Maybe PaymentMethodDetailsInteracPresentReceipt'
   -> PaymentMethodDetailsInteracPresent)
-> Parser (Maybe PaymentMethodDetailsInteracPresentReadMethod')
-> Parser
     (Maybe PaymentMethodDetailsInteracPresentReceipt'
      -> PaymentMethodDetailsInteracPresent)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
GHC.Base.<*> (Object
obj Object
-> Text
-> Parser (Maybe PaymentMethodDetailsInteracPresentReadMethod')
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Data.Aeson.Types.FromJSON..:? Text
"read_method")) Parser
  (Maybe PaymentMethodDetailsInteracPresentReceipt'
   -> PaymentMethodDetailsInteracPresent)
-> Parser (Maybe PaymentMethodDetailsInteracPresentReceipt')
-> Parser PaymentMethodDetailsInteracPresent
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
GHC.Base.<*> (Object
obj Object
-> Text
-> Parser (Maybe PaymentMethodDetailsInteracPresentReceipt')
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Data.Aeson.Types.FromJSON..:? Text
"receipt"))

-- | Create a new 'PaymentMethodDetailsInteracPresent' with all required fields.
mkPaymentMethodDetailsInteracPresent ::
  -- | 'paymentMethodDetailsInteracPresentExpMonth'
  GHC.Types.Int ->
  -- | 'paymentMethodDetailsInteracPresentExpYear'
  GHC.Types.Int ->
  PaymentMethodDetailsInteracPresent
mkPaymentMethodDetailsInteracPresent :: Int -> Int -> PaymentMethodDetailsInteracPresent
mkPaymentMethodDetailsInteracPresent Int
paymentMethodDetailsInteracPresentExpMonth Int
paymentMethodDetailsInteracPresentExpYear =
  PaymentMethodDetailsInteracPresent :: Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Int
-> Int
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe [Text]
-> Maybe PaymentMethodDetailsInteracPresentReadMethod'
-> Maybe PaymentMethodDetailsInteracPresentReceipt'
-> PaymentMethodDetailsInteracPresent
PaymentMethodDetailsInteracPresent
    { paymentMethodDetailsInteracPresentBrand :: Maybe Text
paymentMethodDetailsInteracPresentBrand = Maybe Text
forall a. Maybe a
GHC.Maybe.Nothing,
      paymentMethodDetailsInteracPresentCardholderName :: Maybe Text
paymentMethodDetailsInteracPresentCardholderName = Maybe Text
forall a. Maybe a
GHC.Maybe.Nothing,
      paymentMethodDetailsInteracPresentCountry :: Maybe Text
paymentMethodDetailsInteracPresentCountry = Maybe Text
forall a. Maybe a
GHC.Maybe.Nothing,
      paymentMethodDetailsInteracPresentEmvAuthData :: Maybe Text
paymentMethodDetailsInteracPresentEmvAuthData = Maybe Text
forall a. Maybe a
GHC.Maybe.Nothing,
      paymentMethodDetailsInteracPresentExpMonth :: Int
paymentMethodDetailsInteracPresentExpMonth = Int
paymentMethodDetailsInteracPresentExpMonth,
      paymentMethodDetailsInteracPresentExpYear :: Int
paymentMethodDetailsInteracPresentExpYear = Int
paymentMethodDetailsInteracPresentExpYear,
      paymentMethodDetailsInteracPresentFingerprint :: Maybe Text
paymentMethodDetailsInteracPresentFingerprint = Maybe Text
forall a. Maybe a
GHC.Maybe.Nothing,
      paymentMethodDetailsInteracPresentFunding :: Maybe Text
paymentMethodDetailsInteracPresentFunding = Maybe Text
forall a. Maybe a
GHC.Maybe.Nothing,
      paymentMethodDetailsInteracPresentGeneratedCard :: Maybe Text
paymentMethodDetailsInteracPresentGeneratedCard = Maybe Text
forall a. Maybe a
GHC.Maybe.Nothing,
      paymentMethodDetailsInteracPresentLast4 :: Maybe Text
paymentMethodDetailsInteracPresentLast4 = Maybe Text
forall a. Maybe a
GHC.Maybe.Nothing,
      paymentMethodDetailsInteracPresentNetwork :: Maybe Text
paymentMethodDetailsInteracPresentNetwork = Maybe Text
forall a. Maybe a
GHC.Maybe.Nothing,
      paymentMethodDetailsInteracPresentPreferredLocales :: Maybe [Text]
paymentMethodDetailsInteracPresentPreferredLocales = Maybe [Text]
forall a. Maybe a
GHC.Maybe.Nothing,
      paymentMethodDetailsInteracPresentReadMethod :: Maybe PaymentMethodDetailsInteracPresentReadMethod'
paymentMethodDetailsInteracPresentReadMethod = Maybe PaymentMethodDetailsInteracPresentReadMethod'
forall a. Maybe a
GHC.Maybe.Nothing,
      paymentMethodDetailsInteracPresentReceipt :: Maybe PaymentMethodDetailsInteracPresentReceipt'
paymentMethodDetailsInteracPresentReceipt = Maybe PaymentMethodDetailsInteracPresentReceipt'
forall a. Maybe a
GHC.Maybe.Nothing
    }

-- | Defines the enum schema located at @components.schemas.payment_method_details_interac_present.properties.read_method@ in the specification.
--
-- How card details were read in this transaction.
data PaymentMethodDetailsInteracPresentReadMethod'
  = -- | This case is used if the value encountered during decoding does not match any of the provided cases in the specification.
    PaymentMethodDetailsInteracPresentReadMethod'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.
    PaymentMethodDetailsInteracPresentReadMethod'Typed Data.Text.Internal.Text
  | -- | Represents the JSON value @"contact_emv"@
    PaymentMethodDetailsInteracPresentReadMethod'EnumContactEmv
  | -- | Represents the JSON value @"contactless_emv"@
    PaymentMethodDetailsInteracPresentReadMethod'EnumContactlessEmv
  | -- | Represents the JSON value @"contactless_magstripe_mode"@
    PaymentMethodDetailsInteracPresentReadMethod'EnumContactlessMagstripeMode
  | -- | Represents the JSON value @"magnetic_stripe_fallback"@
    PaymentMethodDetailsInteracPresentReadMethod'EnumMagneticStripeFallback
  | -- | Represents the JSON value @"magnetic_stripe_track2"@
    PaymentMethodDetailsInteracPresentReadMethod'EnumMagneticStripeTrack2
  deriving (Int -> PaymentMethodDetailsInteracPresentReadMethod' -> ShowS
[PaymentMethodDetailsInteracPresentReadMethod'] -> ShowS
PaymentMethodDetailsInteracPresentReadMethod' -> String
(Int -> PaymentMethodDetailsInteracPresentReadMethod' -> ShowS)
-> (PaymentMethodDetailsInteracPresentReadMethod' -> String)
-> ([PaymentMethodDetailsInteracPresentReadMethod'] -> ShowS)
-> Show PaymentMethodDetailsInteracPresentReadMethod'
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [PaymentMethodDetailsInteracPresentReadMethod'] -> ShowS
$cshowList :: [PaymentMethodDetailsInteracPresentReadMethod'] -> ShowS
show :: PaymentMethodDetailsInteracPresentReadMethod' -> String
$cshow :: PaymentMethodDetailsInteracPresentReadMethod' -> String
showsPrec :: Int -> PaymentMethodDetailsInteracPresentReadMethod' -> ShowS
$cshowsPrec :: Int -> PaymentMethodDetailsInteracPresentReadMethod' -> ShowS
GHC.Show.Show, PaymentMethodDetailsInteracPresentReadMethod'
-> PaymentMethodDetailsInteracPresentReadMethod' -> Bool
(PaymentMethodDetailsInteracPresentReadMethod'
 -> PaymentMethodDetailsInteracPresentReadMethod' -> Bool)
-> (PaymentMethodDetailsInteracPresentReadMethod'
    -> PaymentMethodDetailsInteracPresentReadMethod' -> Bool)
-> Eq PaymentMethodDetailsInteracPresentReadMethod'
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: PaymentMethodDetailsInteracPresentReadMethod'
-> PaymentMethodDetailsInteracPresentReadMethod' -> Bool
$c/= :: PaymentMethodDetailsInteracPresentReadMethod'
-> PaymentMethodDetailsInteracPresentReadMethod' -> Bool
== :: PaymentMethodDetailsInteracPresentReadMethod'
-> PaymentMethodDetailsInteracPresentReadMethod' -> Bool
$c== :: PaymentMethodDetailsInteracPresentReadMethod'
-> PaymentMethodDetailsInteracPresentReadMethod' -> Bool
GHC.Classes.Eq)

instance Data.Aeson.Types.ToJSON.ToJSON PaymentMethodDetailsInteracPresentReadMethod' where
  toJSON :: PaymentMethodDetailsInteracPresentReadMethod' -> Value
toJSON (PaymentMethodDetailsInteracPresentReadMethod'Other Value
val) = Value
val
  toJSON (PaymentMethodDetailsInteracPresentReadMethod'Typed Text
val) = Text -> Value
forall a. ToJSON a => a -> Value
Data.Aeson.Types.ToJSON.toJSON Text
val
  toJSON (PaymentMethodDetailsInteracPresentReadMethod'
PaymentMethodDetailsInteracPresentReadMethod'EnumContactEmv) = Value
"contact_emv"
  toJSON (PaymentMethodDetailsInteracPresentReadMethod'
PaymentMethodDetailsInteracPresentReadMethod'EnumContactlessEmv) = Value
"contactless_emv"
  toJSON (PaymentMethodDetailsInteracPresentReadMethod'
PaymentMethodDetailsInteracPresentReadMethod'EnumContactlessMagstripeMode) = Value
"contactless_magstripe_mode"
  toJSON (PaymentMethodDetailsInteracPresentReadMethod'
PaymentMethodDetailsInteracPresentReadMethod'EnumMagneticStripeFallback) = Value
"magnetic_stripe_fallback"
  toJSON (PaymentMethodDetailsInteracPresentReadMethod'
PaymentMethodDetailsInteracPresentReadMethod'EnumMagneticStripeTrack2) = Value
"magnetic_stripe_track2"

instance Data.Aeson.Types.FromJSON.FromJSON PaymentMethodDetailsInteracPresentReadMethod' where
  parseJSON :: Value -> Parser PaymentMethodDetailsInteracPresentReadMethod'
parseJSON Value
val =
    PaymentMethodDetailsInteracPresentReadMethod'
-> Parser PaymentMethodDetailsInteracPresentReadMethod'
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
"contact_emv" -> PaymentMethodDetailsInteracPresentReadMethod'
PaymentMethodDetailsInteracPresentReadMethod'EnumContactEmv
            | Value
val Value -> Value -> Bool
forall a. Eq a => a -> a -> Bool
GHC.Classes.== Value
"contactless_emv" -> PaymentMethodDetailsInteracPresentReadMethod'
PaymentMethodDetailsInteracPresentReadMethod'EnumContactlessEmv
            | Value
val Value -> Value -> Bool
forall a. Eq a => a -> a -> Bool
GHC.Classes.== Value
"contactless_magstripe_mode" -> PaymentMethodDetailsInteracPresentReadMethod'
PaymentMethodDetailsInteracPresentReadMethod'EnumContactlessMagstripeMode
            | Value
val Value -> Value -> Bool
forall a. Eq a => a -> a -> Bool
GHC.Classes.== Value
"magnetic_stripe_fallback" -> PaymentMethodDetailsInteracPresentReadMethod'
PaymentMethodDetailsInteracPresentReadMethod'EnumMagneticStripeFallback
            | Value
val Value -> Value -> Bool
forall a. Eq a => a -> a -> Bool
GHC.Classes.== Value
"magnetic_stripe_track2" -> PaymentMethodDetailsInteracPresentReadMethod'
PaymentMethodDetailsInteracPresentReadMethod'EnumMagneticStripeTrack2
            | Bool
GHC.Base.otherwise -> Value -> PaymentMethodDetailsInteracPresentReadMethod'
PaymentMethodDetailsInteracPresentReadMethod'Other Value
val
      )

-- | Defines the object schema located at @components.schemas.payment_method_details_interac_present.properties.receipt.anyOf@ in the specification.
--
-- A collection of fields required to be displayed on receipts. Only required for EMV transactions.
data PaymentMethodDetailsInteracPresentReceipt' = PaymentMethodDetailsInteracPresentReceipt'
  { -- | account_type: The type of account being debited or credited
    PaymentMethodDetailsInteracPresentReceipt'
-> Maybe PaymentMethodDetailsInteracPresentReceipt'AccountType'
paymentMethodDetailsInteracPresentReceipt'AccountType :: (GHC.Maybe.Maybe PaymentMethodDetailsInteracPresentReceipt'AccountType'),
    -- | application_cryptogram: EMV tag 9F26, cryptogram generated by the integrated circuit chip.
    --
    -- Constraints:
    --
    -- * Maximum length of 5000
    PaymentMethodDetailsInteracPresentReceipt' -> Maybe Text
paymentMethodDetailsInteracPresentReceipt'ApplicationCryptogram :: (GHC.Maybe.Maybe Data.Text.Internal.Text),
    -- | application_preferred_name: Mnenomic of the Application Identifier.
    --
    -- Constraints:
    --
    -- * Maximum length of 5000
    PaymentMethodDetailsInteracPresentReceipt' -> Maybe Text
paymentMethodDetailsInteracPresentReceipt'ApplicationPreferredName :: (GHC.Maybe.Maybe Data.Text.Internal.Text),
    -- | authorization_code: Identifier for this transaction.
    --
    -- Constraints:
    --
    -- * Maximum length of 5000
    PaymentMethodDetailsInteracPresentReceipt' -> Maybe Text
paymentMethodDetailsInteracPresentReceipt'AuthorizationCode :: (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
paymentMethodDetailsInteracPresentReceipt'AuthorizationResponseCode :: (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
paymentMethodDetailsInteracPresentReceipt'CardholderVerificationMethod :: (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
paymentMethodDetailsInteracPresentReceipt'DedicatedFileName :: (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
paymentMethodDetailsInteracPresentReceipt'TerminalVerificationResults :: (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
paymentMethodDetailsInteracPresentReceipt'TransactionStatusInformation :: (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 PaymentMethodDetailsInteracPresentReceipt'AccountType'
-> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= PaymentMethodDetailsInteracPresentReceipt'
-> Maybe PaymentMethodDetailsInteracPresentReceipt'AccountType'
paymentMethodDetailsInteracPresentReceipt'AccountType 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
paymentMethodDetailsInteracPresentReceipt'ApplicationCryptogram 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
paymentMethodDetailsInteracPresentReceipt'ApplicationPreferredName 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
paymentMethodDetailsInteracPresentReceipt'AuthorizationCode 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
paymentMethodDetailsInteracPresentReceipt'AuthorizationResponseCode 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
paymentMethodDetailsInteracPresentReceipt'CardholderVerificationMethod 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
paymentMethodDetailsInteracPresentReceipt'DedicatedFileName 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
paymentMethodDetailsInteracPresentReceipt'TerminalVerificationResults 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
paymentMethodDetailsInteracPresentReceipt'TransactionStatusInformation 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 PaymentMethodDetailsInteracPresentReceipt'AccountType'
-> Series
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= PaymentMethodDetailsInteracPresentReceipt'
-> Maybe PaymentMethodDetailsInteracPresentReceipt'AccountType'
paymentMethodDetailsInteracPresentReceipt'AccountType 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
paymentMethodDetailsInteracPresentReceipt'ApplicationCryptogram 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
paymentMethodDetailsInteracPresentReceipt'ApplicationPreferredName 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
paymentMethodDetailsInteracPresentReceipt'AuthorizationCode 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
paymentMethodDetailsInteracPresentReceipt'AuthorizationResponseCode 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
paymentMethodDetailsInteracPresentReceipt'CardholderVerificationMethod 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
paymentMethodDetailsInteracPresentReceipt'DedicatedFileName 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
paymentMethodDetailsInteracPresentReceipt'TerminalVerificationResults 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
paymentMethodDetailsInteracPresentReceipt'TransactionStatusInformation 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 PaymentMethodDetailsInteracPresentReceipt'AccountType'
 -> Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> PaymentMethodDetailsInteracPresentReceipt')
-> Parser
     (Maybe PaymentMethodDetailsInteracPresentReceipt'AccountType'
      -> 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 PaymentMethodDetailsInteracPresentReceipt'AccountType'
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> PaymentMethodDetailsInteracPresentReceipt'
PaymentMethodDetailsInteracPresentReceipt' Parser
  (Maybe PaymentMethodDetailsInteracPresentReceipt'AccountType'
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> PaymentMethodDetailsInteracPresentReceipt')
-> Parser
     (Maybe PaymentMethodDetailsInteracPresentReceipt'AccountType')
-> 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 PaymentMethodDetailsInteracPresentReceipt'AccountType')
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 PaymentMethodDetailsInteracPresentReceipt'AccountType'
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> PaymentMethodDetailsInteracPresentReceipt'
PaymentMethodDetailsInteracPresentReceipt'
    { paymentMethodDetailsInteracPresentReceipt'AccountType :: Maybe PaymentMethodDetailsInteracPresentReceipt'AccountType'
paymentMethodDetailsInteracPresentReceipt'AccountType = Maybe PaymentMethodDetailsInteracPresentReceipt'AccountType'
forall a. Maybe a
GHC.Maybe.Nothing,
      paymentMethodDetailsInteracPresentReceipt'ApplicationCryptogram :: Maybe Text
paymentMethodDetailsInteracPresentReceipt'ApplicationCryptogram = Maybe Text
forall a. Maybe a
GHC.Maybe.Nothing,
      paymentMethodDetailsInteracPresentReceipt'ApplicationPreferredName :: Maybe Text
paymentMethodDetailsInteracPresentReceipt'ApplicationPreferredName = Maybe Text
forall a. Maybe a
GHC.Maybe.Nothing,
      paymentMethodDetailsInteracPresentReceipt'AuthorizationCode :: Maybe Text
paymentMethodDetailsInteracPresentReceipt'AuthorizationCode = Maybe Text
forall a. Maybe a
GHC.Maybe.Nothing,
      paymentMethodDetailsInteracPresentReceipt'AuthorizationResponseCode :: Maybe Text
paymentMethodDetailsInteracPresentReceipt'AuthorizationResponseCode = Maybe Text
forall a. Maybe a
GHC.Maybe.Nothing,
      paymentMethodDetailsInteracPresentReceipt'CardholderVerificationMethod :: Maybe Text
paymentMethodDetailsInteracPresentReceipt'CardholderVerificationMethod = Maybe Text
forall a. Maybe a
GHC.Maybe.Nothing,
      paymentMethodDetailsInteracPresentReceipt'DedicatedFileName :: Maybe Text
paymentMethodDetailsInteracPresentReceipt'DedicatedFileName = Maybe Text
forall a. Maybe a
GHC.Maybe.Nothing,
      paymentMethodDetailsInteracPresentReceipt'TerminalVerificationResults :: Maybe Text
paymentMethodDetailsInteracPresentReceipt'TerminalVerificationResults = Maybe Text
forall a. Maybe a
GHC.Maybe.Nothing,
      paymentMethodDetailsInteracPresentReceipt'TransactionStatusInformation :: Maybe Text
paymentMethodDetailsInteracPresentReceipt'TransactionStatusInformation = Maybe Text
forall a. Maybe a
GHC.Maybe.Nothing
    }

-- | Defines the enum schema located at @components.schemas.payment_method_details_interac_present.properties.receipt.anyOf.properties.account_type@ in the specification.
--
-- The type of account being debited or credited
data PaymentMethodDetailsInteracPresentReceipt'AccountType'
  = -- | This case is used if the value encountered during decoding does not match any of the provided cases in the specification.
    PaymentMethodDetailsInteracPresentReceipt'AccountType'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.
    PaymentMethodDetailsInteracPresentReceipt'AccountType'Typed Data.Text.Internal.Text
  | -- | Represents the JSON value @"checking"@
    PaymentMethodDetailsInteracPresentReceipt'AccountType'EnumChecking
  | -- | Represents the JSON value @"savings"@
    PaymentMethodDetailsInteracPresentReceipt'AccountType'EnumSavings
  | -- | Represents the JSON value @"unknown"@
    PaymentMethodDetailsInteracPresentReceipt'AccountType'EnumUnknown
  deriving (Int
-> PaymentMethodDetailsInteracPresentReceipt'AccountType' -> ShowS
[PaymentMethodDetailsInteracPresentReceipt'AccountType'] -> ShowS
PaymentMethodDetailsInteracPresentReceipt'AccountType' -> String
(Int
 -> PaymentMethodDetailsInteracPresentReceipt'AccountType' -> ShowS)
-> (PaymentMethodDetailsInteracPresentReceipt'AccountType'
    -> String)
-> ([PaymentMethodDetailsInteracPresentReceipt'AccountType']
    -> ShowS)
-> Show PaymentMethodDetailsInteracPresentReceipt'AccountType'
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [PaymentMethodDetailsInteracPresentReceipt'AccountType'] -> ShowS
$cshowList :: [PaymentMethodDetailsInteracPresentReceipt'AccountType'] -> ShowS
show :: PaymentMethodDetailsInteracPresentReceipt'AccountType' -> String
$cshow :: PaymentMethodDetailsInteracPresentReceipt'AccountType' -> String
showsPrec :: Int
-> PaymentMethodDetailsInteracPresentReceipt'AccountType' -> ShowS
$cshowsPrec :: Int
-> PaymentMethodDetailsInteracPresentReceipt'AccountType' -> ShowS
GHC.Show.Show, PaymentMethodDetailsInteracPresentReceipt'AccountType'
-> PaymentMethodDetailsInteracPresentReceipt'AccountType' -> Bool
(PaymentMethodDetailsInteracPresentReceipt'AccountType'
 -> PaymentMethodDetailsInteracPresentReceipt'AccountType' -> Bool)
-> (PaymentMethodDetailsInteracPresentReceipt'AccountType'
    -> PaymentMethodDetailsInteracPresentReceipt'AccountType' -> Bool)
-> Eq PaymentMethodDetailsInteracPresentReceipt'AccountType'
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: PaymentMethodDetailsInteracPresentReceipt'AccountType'
-> PaymentMethodDetailsInteracPresentReceipt'AccountType' -> Bool
$c/= :: PaymentMethodDetailsInteracPresentReceipt'AccountType'
-> PaymentMethodDetailsInteracPresentReceipt'AccountType' -> Bool
== :: PaymentMethodDetailsInteracPresentReceipt'AccountType'
-> PaymentMethodDetailsInteracPresentReceipt'AccountType' -> Bool
$c== :: PaymentMethodDetailsInteracPresentReceipt'AccountType'
-> PaymentMethodDetailsInteracPresentReceipt'AccountType' -> Bool
GHC.Classes.Eq)

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

instance Data.Aeson.Types.FromJSON.FromJSON PaymentMethodDetailsInteracPresentReceipt'AccountType' where
  parseJSON :: Value
-> Parser PaymentMethodDetailsInteracPresentReceipt'AccountType'
parseJSON Value
val =
    PaymentMethodDetailsInteracPresentReceipt'AccountType'
-> Parser PaymentMethodDetailsInteracPresentReceipt'AccountType'
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" -> PaymentMethodDetailsInteracPresentReceipt'AccountType'
PaymentMethodDetailsInteracPresentReceipt'AccountType'EnumChecking
            | Value
val Value -> Value -> Bool
forall a. Eq a => a -> a -> Bool
GHC.Classes.== Value
"savings" -> PaymentMethodDetailsInteracPresentReceipt'AccountType'
PaymentMethodDetailsInteracPresentReceipt'AccountType'EnumSavings
            | Value
val Value -> Value -> Bool
forall a. Eq a => a -> a -> Bool
GHC.Classes.== Value
"unknown" -> PaymentMethodDetailsInteracPresentReceipt'AccountType'
PaymentMethodDetailsInteracPresentReceipt'AccountType'EnumUnknown
            | Bool
GHC.Base.otherwise -> Value -> PaymentMethodDetailsInteracPresentReceipt'AccountType'
PaymentMethodDetailsInteracPresentReceipt'AccountType'Other Value
val
      )