{-# 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 ThreeDSecure module StripeAPI.Types.ThreeDSecure 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.Card import qualified Prelude as GHC.Integer.Type import qualified Prelude as GHC.Maybe -- | Defines the object schema located at @components.schemas.three_d_secure@ in the specification. -- -- Cardholder authentication via 3D Secure is initiated by creating a \`3D Secure\` -- object. Once the object has been created, you can use it to authenticate the -- cardholder and create a charge. data ThreeDSecure = ThreeDSecure { -- | amount: Amount of the charge that you will create when authentication completes. threeDSecureAmount :: GHC.Types.Int, -- | authenticated: True if the cardholder went through the authentication flow and their bank indicated that authentication succeeded. threeDSecureAuthenticated :: GHC.Types.Bool, -- | card: You can store multiple cards on a customer in order to charge the customer -- later. You can also store multiple debit cards on a recipient in order to -- transfer to those cards later. -- -- Related guide: [Card Payments with Sources](https:\/\/stripe.com\/docs\/sources\/cards). threeDSecureCard :: Card, -- | created: Time at which the object was created. Measured in seconds since the Unix epoch. threeDSecureCreated :: GHC.Types.Int, -- | currency: Three-letter [ISO currency code](https:\/\/www.iso.org\/iso-4217-currency-codes.html), in lowercase. Must be a [supported currency](https:\/\/stripe.com\/docs\/currencies). -- -- Constraints: -- -- * Maximum length of 5000 threeDSecureCurrency :: Data.Text.Internal.Text, -- | id: Unique identifier for the object. -- -- Constraints: -- -- * Maximum length of 5000 threeDSecureId :: Data.Text.Internal.Text, -- | livemode: Has the value \`true\` if the object exists in live mode or the value \`false\` if the object exists in test mode. threeDSecureLivemode :: GHC.Types.Bool, -- | redirect_url: If present, this is the URL that you should send the cardholder to for authentication. If you are going to use Stripe.js to display the authentication page in an iframe, you should use the value \"_callback\". -- -- Constraints: -- -- * Maximum length of 5000 threeDSecureRedirectUrl :: (GHC.Maybe.Maybe Data.Text.Internal.Text), -- | status: Possible values are \`redirect_pending\`, \`succeeded\`, or \`failed\`. When the cardholder can be authenticated, the object starts with status \`redirect_pending\`. When liability will be shifted to the cardholder\'s bank (either because the cardholder was successfully authenticated, or because the bank has not implemented 3D Secure, the object wlil be in status \`succeeded\`. \`failed\` indicates that authentication was attempted unsuccessfully. -- -- Constraints: -- -- * Maximum length of 5000 threeDSecureStatus :: Data.Text.Internal.Text } deriving ( GHC.Show.Show, GHC.Classes.Eq ) instance Data.Aeson.Types.ToJSON.ToJSON ThreeDSecure where toJSON obj = Data.Aeson.Types.Internal.object ("amount" Data.Aeson.Types.ToJSON..= threeDSecureAmount obj : "authenticated" Data.Aeson.Types.ToJSON..= threeDSecureAuthenticated obj : "card" Data.Aeson.Types.ToJSON..= threeDSecureCard obj : "created" Data.Aeson.Types.ToJSON..= threeDSecureCreated obj : "currency" Data.Aeson.Types.ToJSON..= threeDSecureCurrency obj : "id" Data.Aeson.Types.ToJSON..= threeDSecureId obj : "livemode" Data.Aeson.Types.ToJSON..= threeDSecureLivemode obj : "redirect_url" Data.Aeson.Types.ToJSON..= threeDSecureRedirectUrl obj : "status" Data.Aeson.Types.ToJSON..= threeDSecureStatus obj : "object" Data.Aeson.Types.ToJSON..= Data.Aeson.Types.Internal.String "three_d_secure" : GHC.Base.mempty) toEncoding obj = Data.Aeson.Encoding.Internal.pairs (("amount" Data.Aeson.Types.ToJSON..= threeDSecureAmount obj) GHC.Base.<> (("authenticated" Data.Aeson.Types.ToJSON..= threeDSecureAuthenticated obj) GHC.Base.<> (("card" Data.Aeson.Types.ToJSON..= threeDSecureCard obj) GHC.Base.<> (("created" Data.Aeson.Types.ToJSON..= threeDSecureCreated obj) GHC.Base.<> (("currency" Data.Aeson.Types.ToJSON..= threeDSecureCurrency obj) GHC.Base.<> (("id" Data.Aeson.Types.ToJSON..= threeDSecureId obj) GHC.Base.<> (("livemode" Data.Aeson.Types.ToJSON..= threeDSecureLivemode obj) GHC.Base.<> (("redirect_url" Data.Aeson.Types.ToJSON..= threeDSecureRedirectUrl obj) GHC.Base.<> (("status" Data.Aeson.Types.ToJSON..= threeDSecureStatus obj) GHC.Base.<> ("object" Data.Aeson.Types.ToJSON..= Data.Aeson.Types.Internal.String "three_d_secure")))))))))) instance Data.Aeson.Types.FromJSON.FromJSON ThreeDSecure where parseJSON = Data.Aeson.Types.FromJSON.withObject "ThreeDSecure" (\obj -> ((((((((GHC.Base.pure ThreeDSecure GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..: "amount")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..: "authenticated")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..: "card")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..: "created")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..: "currency")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..: "id")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..: "livemode")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:? "redirect_url")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..: "status")) -- | Create a new 'ThreeDSecure' with all required fields. mkThreeDSecure :: -- | 'threeDSecureAmount' GHC.Types.Int -> -- | 'threeDSecureAuthenticated' GHC.Types.Bool -> -- | 'threeDSecureCard' Card -> -- | 'threeDSecureCreated' GHC.Types.Int -> -- | 'threeDSecureCurrency' Data.Text.Internal.Text -> -- | 'threeDSecureId' Data.Text.Internal.Text -> -- | 'threeDSecureLivemode' GHC.Types.Bool -> -- | 'threeDSecureStatus' Data.Text.Internal.Text -> ThreeDSecure mkThreeDSecure threeDSecureAmount threeDSecureAuthenticated threeDSecureCard threeDSecureCreated threeDSecureCurrency threeDSecureId threeDSecureLivemode threeDSecureStatus = ThreeDSecure { threeDSecureAmount = threeDSecureAmount, threeDSecureAuthenticated = threeDSecureAuthenticated, threeDSecureCard = threeDSecureCard, threeDSecureCreated = threeDSecureCreated, threeDSecureCurrency = threeDSecureCurrency, threeDSecureId = threeDSecureId, threeDSecureLivemode = threeDSecureLivemode, threeDSecureRedirectUrl = GHC.Maybe.Nothing, threeDSecureStatus = threeDSecureStatus }