{-# 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 InvoicesPaymentSettings module StripeAPI.Types.InvoicesPaymentSettings 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.InvoicePaymentMethodOptionsBancontact import {-# SOURCE #-} StripeAPI.Types.InvoicePaymentMethodOptionsCard import {-# SOURCE #-} StripeAPI.Types.InvoicesPaymentMethodOptions import qualified Prelude as GHC.Integer.Type import qualified Prelude as GHC.Maybe -- | Defines the object schema located at @components.schemas.invoices_payment_settings@ in the specification. data InvoicesPaymentSettings = InvoicesPaymentSettings { -- | payment_method_options: Payment-method-specific configuration to provide to the invoice’s PaymentIntent. invoicesPaymentSettingsPaymentMethodOptions :: (GHC.Maybe.Maybe InvoicesPaymentSettingsPaymentMethodOptions'), -- | payment_method_types: The list of payment method types (e.g. card) to provide to the invoice’s PaymentIntent. If not set, Stripe attempts to automatically determine the types to use by looking at the invoice’s default payment method, the subscription’s default payment method, the customer’s default payment method, and your [invoice template settings](https:\/\/dashboard.stripe.com\/settings\/billing\/invoice). invoicesPaymentSettingsPaymentMethodTypes :: (GHC.Maybe.Maybe ([InvoicesPaymentSettingsPaymentMethodTypes'])) } deriving ( GHC.Show.Show, GHC.Classes.Eq ) instance Data.Aeson.Types.ToJSON.ToJSON InvoicesPaymentSettings where toJSON obj = Data.Aeson.Types.Internal.object ("payment_method_options" Data.Aeson.Types.ToJSON..= invoicesPaymentSettingsPaymentMethodOptions obj : "payment_method_types" Data.Aeson.Types.ToJSON..= invoicesPaymentSettingsPaymentMethodTypes obj : GHC.Base.mempty) toEncoding obj = Data.Aeson.Encoding.Internal.pairs (("payment_method_options" Data.Aeson.Types.ToJSON..= invoicesPaymentSettingsPaymentMethodOptions obj) GHC.Base.<> ("payment_method_types" Data.Aeson.Types.ToJSON..= invoicesPaymentSettingsPaymentMethodTypes obj)) instance Data.Aeson.Types.FromJSON.FromJSON InvoicesPaymentSettings where parseJSON = Data.Aeson.Types.FromJSON.withObject "InvoicesPaymentSettings" (\obj -> (GHC.Base.pure InvoicesPaymentSettings GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:? "payment_method_options")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:? "payment_method_types")) -- | Create a new 'InvoicesPaymentSettings' with all required fields. mkInvoicesPaymentSettings :: InvoicesPaymentSettings mkInvoicesPaymentSettings = InvoicesPaymentSettings { invoicesPaymentSettingsPaymentMethodOptions = GHC.Maybe.Nothing, invoicesPaymentSettingsPaymentMethodTypes = GHC.Maybe.Nothing } -- | Defines the object schema located at @components.schemas.invoices_payment_settings.properties.payment_method_options.anyOf@ in the specification. -- -- Payment-method-specific configuration to provide to the invoice’s PaymentIntent. data InvoicesPaymentSettingsPaymentMethodOptions' = InvoicesPaymentSettingsPaymentMethodOptions' { -- | bancontact: If paying by \`bancontact\`, this sub-hash contains details about the Bancontact payment method options to pass to the invoice’s PaymentIntent. invoicesPaymentSettingsPaymentMethodOptions'Bancontact :: (GHC.Maybe.Maybe InvoicesPaymentSettingsPaymentMethodOptions'Bancontact'), -- | card: If paying by \`card\`, this sub-hash contains details about the Card payment method options to pass to the invoice’s PaymentIntent. invoicesPaymentSettingsPaymentMethodOptions'Card :: (GHC.Maybe.Maybe InvoicesPaymentSettingsPaymentMethodOptions'Card') } deriving ( GHC.Show.Show, GHC.Classes.Eq ) instance Data.Aeson.Types.ToJSON.ToJSON InvoicesPaymentSettingsPaymentMethodOptions' where toJSON obj = Data.Aeson.Types.Internal.object ("bancontact" Data.Aeson.Types.ToJSON..= invoicesPaymentSettingsPaymentMethodOptions'Bancontact obj : "card" Data.Aeson.Types.ToJSON..= invoicesPaymentSettingsPaymentMethodOptions'Card obj : GHC.Base.mempty) toEncoding obj = Data.Aeson.Encoding.Internal.pairs (("bancontact" Data.Aeson.Types.ToJSON..= invoicesPaymentSettingsPaymentMethodOptions'Bancontact obj) GHC.Base.<> ("card" Data.Aeson.Types.ToJSON..= invoicesPaymentSettingsPaymentMethodOptions'Card obj)) instance Data.Aeson.Types.FromJSON.FromJSON InvoicesPaymentSettingsPaymentMethodOptions' where parseJSON = Data.Aeson.Types.FromJSON.withObject "InvoicesPaymentSettingsPaymentMethodOptions'" (\obj -> (GHC.Base.pure InvoicesPaymentSettingsPaymentMethodOptions' GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:? "bancontact")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:? "card")) -- | Create a new 'InvoicesPaymentSettingsPaymentMethodOptions'' with all required fields. mkInvoicesPaymentSettingsPaymentMethodOptions' :: InvoicesPaymentSettingsPaymentMethodOptions' mkInvoicesPaymentSettingsPaymentMethodOptions' = InvoicesPaymentSettingsPaymentMethodOptions' { invoicesPaymentSettingsPaymentMethodOptions'Bancontact = GHC.Maybe.Nothing, invoicesPaymentSettingsPaymentMethodOptions'Card = GHC.Maybe.Nothing } -- | Defines the object schema located at @components.schemas.invoices_payment_settings.properties.payment_method_options.anyOf.properties.bancontact.anyOf@ in the specification. -- -- If paying by \\\`bancontact\\\`, this sub-hash contains details about the Bancontact payment method options to pass to the invoice’s PaymentIntent. data InvoicesPaymentSettingsPaymentMethodOptions'Bancontact' = InvoicesPaymentSettingsPaymentMethodOptions'Bancontact' { -- | preferred_language: Preferred language of the Bancontact authorization page that the customer is redirected to. invoicesPaymentSettingsPaymentMethodOptions'Bancontact'PreferredLanguage :: (GHC.Maybe.Maybe InvoicesPaymentSettingsPaymentMethodOptions'Bancontact'PreferredLanguage') } deriving ( GHC.Show.Show, GHC.Classes.Eq ) instance Data.Aeson.Types.ToJSON.ToJSON InvoicesPaymentSettingsPaymentMethodOptions'Bancontact' where toJSON obj = Data.Aeson.Types.Internal.object ("preferred_language" Data.Aeson.Types.ToJSON..= invoicesPaymentSettingsPaymentMethodOptions'Bancontact'PreferredLanguage obj : GHC.Base.mempty) toEncoding obj = Data.Aeson.Encoding.Internal.pairs ("preferred_language" Data.Aeson.Types.ToJSON..= invoicesPaymentSettingsPaymentMethodOptions'Bancontact'PreferredLanguage obj) instance Data.Aeson.Types.FromJSON.FromJSON InvoicesPaymentSettingsPaymentMethodOptions'Bancontact' where parseJSON = Data.Aeson.Types.FromJSON.withObject "InvoicesPaymentSettingsPaymentMethodOptions'Bancontact'" (\obj -> GHC.Base.pure InvoicesPaymentSettingsPaymentMethodOptions'Bancontact' GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:? "preferred_language")) -- | Create a new 'InvoicesPaymentSettingsPaymentMethodOptions'Bancontact'' with all required fields. mkInvoicesPaymentSettingsPaymentMethodOptions'Bancontact' :: InvoicesPaymentSettingsPaymentMethodOptions'Bancontact' mkInvoicesPaymentSettingsPaymentMethodOptions'Bancontact' = InvoicesPaymentSettingsPaymentMethodOptions'Bancontact' {invoicesPaymentSettingsPaymentMethodOptions'Bancontact'PreferredLanguage = GHC.Maybe.Nothing} -- | Defines the enum schema located at @components.schemas.invoices_payment_settings.properties.payment_method_options.anyOf.properties.bancontact.anyOf.properties.preferred_language@ in the specification. -- -- Preferred language of the Bancontact authorization page that the customer is redirected to. data InvoicesPaymentSettingsPaymentMethodOptions'Bancontact'PreferredLanguage' = -- | This case is used if the value encountered during decoding does not match any of the provided cases in the specification. InvoicesPaymentSettingsPaymentMethodOptions'Bancontact'PreferredLanguage'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. InvoicesPaymentSettingsPaymentMethodOptions'Bancontact'PreferredLanguage'Typed Data.Text.Internal.Text | -- | Represents the JSON value @"de"@ InvoicesPaymentSettingsPaymentMethodOptions'Bancontact'PreferredLanguage'EnumDe | -- | Represents the JSON value @"en"@ InvoicesPaymentSettingsPaymentMethodOptions'Bancontact'PreferredLanguage'EnumEn | -- | Represents the JSON value @"fr"@ InvoicesPaymentSettingsPaymentMethodOptions'Bancontact'PreferredLanguage'EnumFr | -- | Represents the JSON value @"nl"@ InvoicesPaymentSettingsPaymentMethodOptions'Bancontact'PreferredLanguage'EnumNl deriving (GHC.Show.Show, GHC.Classes.Eq) instance Data.Aeson.Types.ToJSON.ToJSON InvoicesPaymentSettingsPaymentMethodOptions'Bancontact'PreferredLanguage' where toJSON (InvoicesPaymentSettingsPaymentMethodOptions'Bancontact'PreferredLanguage'Other val) = val toJSON (InvoicesPaymentSettingsPaymentMethodOptions'Bancontact'PreferredLanguage'Typed val) = Data.Aeson.Types.ToJSON.toJSON val toJSON (InvoicesPaymentSettingsPaymentMethodOptions'Bancontact'PreferredLanguage'EnumDe) = "de" toJSON (InvoicesPaymentSettingsPaymentMethodOptions'Bancontact'PreferredLanguage'EnumEn) = "en" toJSON (InvoicesPaymentSettingsPaymentMethodOptions'Bancontact'PreferredLanguage'EnumFr) = "fr" toJSON (InvoicesPaymentSettingsPaymentMethodOptions'Bancontact'PreferredLanguage'EnumNl) = "nl" instance Data.Aeson.Types.FromJSON.FromJSON InvoicesPaymentSettingsPaymentMethodOptions'Bancontact'PreferredLanguage' where parseJSON val = GHC.Base.pure ( if | val GHC.Classes.== "de" -> InvoicesPaymentSettingsPaymentMethodOptions'Bancontact'PreferredLanguage'EnumDe | val GHC.Classes.== "en" -> InvoicesPaymentSettingsPaymentMethodOptions'Bancontact'PreferredLanguage'EnumEn | val GHC.Classes.== "fr" -> InvoicesPaymentSettingsPaymentMethodOptions'Bancontact'PreferredLanguage'EnumFr | val GHC.Classes.== "nl" -> InvoicesPaymentSettingsPaymentMethodOptions'Bancontact'PreferredLanguage'EnumNl | GHC.Base.otherwise -> InvoicesPaymentSettingsPaymentMethodOptions'Bancontact'PreferredLanguage'Other val ) -- | Defines the object schema located at @components.schemas.invoices_payment_settings.properties.payment_method_options.anyOf.properties.card.anyOf@ in the specification. -- -- If paying by \\\`card\\\`, this sub-hash contains details about the Card payment method options to pass to the invoice’s PaymentIntent. data InvoicesPaymentSettingsPaymentMethodOptions'Card' = InvoicesPaymentSettingsPaymentMethodOptions'Card' { -- | request_three_d_secure: We strongly recommend that you rely on our SCA Engine to automatically prompt your customers for authentication based on risk level and [other requirements](https:\/\/stripe.com\/docs\/strong-customer-authentication). However, if you wish to request 3D Secure based on logic from your own fraud engine, provide this option. Read our guide on [manually requesting 3D Secure](https:\/\/stripe.com\/docs\/payments\/3d-secure\#manual-three-ds) for more information on how this configuration interacts with Radar and our SCA Engine. invoicesPaymentSettingsPaymentMethodOptions'Card'RequestThreeDSecure :: (GHC.Maybe.Maybe InvoicesPaymentSettingsPaymentMethodOptions'Card'RequestThreeDSecure') } deriving ( GHC.Show.Show, GHC.Classes.Eq ) instance Data.Aeson.Types.ToJSON.ToJSON InvoicesPaymentSettingsPaymentMethodOptions'Card' where toJSON obj = Data.Aeson.Types.Internal.object ("request_three_d_secure" Data.Aeson.Types.ToJSON..= invoicesPaymentSettingsPaymentMethodOptions'Card'RequestThreeDSecure obj : GHC.Base.mempty) toEncoding obj = Data.Aeson.Encoding.Internal.pairs ("request_three_d_secure" Data.Aeson.Types.ToJSON..= invoicesPaymentSettingsPaymentMethodOptions'Card'RequestThreeDSecure obj) instance Data.Aeson.Types.FromJSON.FromJSON InvoicesPaymentSettingsPaymentMethodOptions'Card' where parseJSON = Data.Aeson.Types.FromJSON.withObject "InvoicesPaymentSettingsPaymentMethodOptions'Card'" (\obj -> GHC.Base.pure InvoicesPaymentSettingsPaymentMethodOptions'Card' GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:? "request_three_d_secure")) -- | Create a new 'InvoicesPaymentSettingsPaymentMethodOptions'Card'' with all required fields. mkInvoicesPaymentSettingsPaymentMethodOptions'Card' :: InvoicesPaymentSettingsPaymentMethodOptions'Card' mkInvoicesPaymentSettingsPaymentMethodOptions'Card' = InvoicesPaymentSettingsPaymentMethodOptions'Card' {invoicesPaymentSettingsPaymentMethodOptions'Card'RequestThreeDSecure = GHC.Maybe.Nothing} -- | Defines the enum schema located at @components.schemas.invoices_payment_settings.properties.payment_method_options.anyOf.properties.card.anyOf.properties.request_three_d_secure@ in the specification. -- -- We strongly recommend that you rely on our SCA Engine to automatically prompt your customers for authentication based on risk level and [other requirements](https:\/\/stripe.com\/docs\/strong-customer-authentication). However, if you wish to request 3D Secure based on logic from your own fraud engine, provide this option. Read our guide on [manually requesting 3D Secure](https:\/\/stripe.com\/docs\/payments\/3d-secure\#manual-three-ds) for more information on how this configuration interacts with Radar and our SCA Engine. data InvoicesPaymentSettingsPaymentMethodOptions'Card'RequestThreeDSecure' = -- | This case is used if the value encountered during decoding does not match any of the provided cases in the specification. InvoicesPaymentSettingsPaymentMethodOptions'Card'RequestThreeDSecure'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. InvoicesPaymentSettingsPaymentMethodOptions'Card'RequestThreeDSecure'Typed Data.Text.Internal.Text | -- | Represents the JSON value @"any"@ InvoicesPaymentSettingsPaymentMethodOptions'Card'RequestThreeDSecure'EnumAny | -- | Represents the JSON value @"automatic"@ InvoicesPaymentSettingsPaymentMethodOptions'Card'RequestThreeDSecure'EnumAutomatic deriving (GHC.Show.Show, GHC.Classes.Eq) instance Data.Aeson.Types.ToJSON.ToJSON InvoicesPaymentSettingsPaymentMethodOptions'Card'RequestThreeDSecure' where toJSON (InvoicesPaymentSettingsPaymentMethodOptions'Card'RequestThreeDSecure'Other val) = val toJSON (InvoicesPaymentSettingsPaymentMethodOptions'Card'RequestThreeDSecure'Typed val) = Data.Aeson.Types.ToJSON.toJSON val toJSON (InvoicesPaymentSettingsPaymentMethodOptions'Card'RequestThreeDSecure'EnumAny) = "any" toJSON (InvoicesPaymentSettingsPaymentMethodOptions'Card'RequestThreeDSecure'EnumAutomatic) = "automatic" instance Data.Aeson.Types.FromJSON.FromJSON InvoicesPaymentSettingsPaymentMethodOptions'Card'RequestThreeDSecure' where parseJSON val = GHC.Base.pure ( if | val GHC.Classes.== "any" -> InvoicesPaymentSettingsPaymentMethodOptions'Card'RequestThreeDSecure'EnumAny | val GHC.Classes.== "automatic" -> InvoicesPaymentSettingsPaymentMethodOptions'Card'RequestThreeDSecure'EnumAutomatic | GHC.Base.otherwise -> InvoicesPaymentSettingsPaymentMethodOptions'Card'RequestThreeDSecure'Other val ) -- | Defines the enum schema located at @components.schemas.invoices_payment_settings.properties.payment_method_types.items@ in the specification. data InvoicesPaymentSettingsPaymentMethodTypes' = -- | This case is used if the value encountered during decoding does not match any of the provided cases in the specification. InvoicesPaymentSettingsPaymentMethodTypes'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. InvoicesPaymentSettingsPaymentMethodTypes'Typed Data.Text.Internal.Text | -- | Represents the JSON value @"ach_credit_transfer"@ InvoicesPaymentSettingsPaymentMethodTypes'EnumAchCreditTransfer | -- | Represents the JSON value @"ach_debit"@ InvoicesPaymentSettingsPaymentMethodTypes'EnumAchDebit | -- | Represents the JSON value @"au_becs_debit"@ InvoicesPaymentSettingsPaymentMethodTypes'EnumAuBecsDebit | -- | Represents the JSON value @"bacs_debit"@ InvoicesPaymentSettingsPaymentMethodTypes'EnumBacsDebit | -- | Represents the JSON value @"bancontact"@ InvoicesPaymentSettingsPaymentMethodTypes'EnumBancontact | -- | Represents the JSON value @"card"@ InvoicesPaymentSettingsPaymentMethodTypes'EnumCard | -- | Represents the JSON value @"fpx"@ InvoicesPaymentSettingsPaymentMethodTypes'EnumFpx | -- | Represents the JSON value @"giropay"@ InvoicesPaymentSettingsPaymentMethodTypes'EnumGiropay | -- | Represents the JSON value @"ideal"@ InvoicesPaymentSettingsPaymentMethodTypes'EnumIdeal | -- | Represents the JSON value @"sepa_debit"@ InvoicesPaymentSettingsPaymentMethodTypes'EnumSepaDebit | -- | Represents the JSON value @"sofort"@ InvoicesPaymentSettingsPaymentMethodTypes'EnumSofort deriving (GHC.Show.Show, GHC.Classes.Eq) instance Data.Aeson.Types.ToJSON.ToJSON InvoicesPaymentSettingsPaymentMethodTypes' where toJSON (InvoicesPaymentSettingsPaymentMethodTypes'Other val) = val toJSON (InvoicesPaymentSettingsPaymentMethodTypes'Typed val) = Data.Aeson.Types.ToJSON.toJSON val toJSON (InvoicesPaymentSettingsPaymentMethodTypes'EnumAchCreditTransfer) = "ach_credit_transfer" toJSON (InvoicesPaymentSettingsPaymentMethodTypes'EnumAchDebit) = "ach_debit" toJSON (InvoicesPaymentSettingsPaymentMethodTypes'EnumAuBecsDebit) = "au_becs_debit" toJSON (InvoicesPaymentSettingsPaymentMethodTypes'EnumBacsDebit) = "bacs_debit" toJSON (InvoicesPaymentSettingsPaymentMethodTypes'EnumBancontact) = "bancontact" toJSON (InvoicesPaymentSettingsPaymentMethodTypes'EnumCard) = "card" toJSON (InvoicesPaymentSettingsPaymentMethodTypes'EnumFpx) = "fpx" toJSON (InvoicesPaymentSettingsPaymentMethodTypes'EnumGiropay) = "giropay" toJSON (InvoicesPaymentSettingsPaymentMethodTypes'EnumIdeal) = "ideal" toJSON (InvoicesPaymentSettingsPaymentMethodTypes'EnumSepaDebit) = "sepa_debit" toJSON (InvoicesPaymentSettingsPaymentMethodTypes'EnumSofort) = "sofort" instance Data.Aeson.Types.FromJSON.FromJSON InvoicesPaymentSettingsPaymentMethodTypes' where parseJSON val = GHC.Base.pure ( if | val GHC.Classes.== "ach_credit_transfer" -> InvoicesPaymentSettingsPaymentMethodTypes'EnumAchCreditTransfer | val GHC.Classes.== "ach_debit" -> InvoicesPaymentSettingsPaymentMethodTypes'EnumAchDebit | val GHC.Classes.== "au_becs_debit" -> InvoicesPaymentSettingsPaymentMethodTypes'EnumAuBecsDebit | val GHC.Classes.== "bacs_debit" -> InvoicesPaymentSettingsPaymentMethodTypes'EnumBacsDebit | val GHC.Classes.== "bancontact" -> InvoicesPaymentSettingsPaymentMethodTypes'EnumBancontact | val GHC.Classes.== "card" -> InvoicesPaymentSettingsPaymentMethodTypes'EnumCard | val GHC.Classes.== "fpx" -> InvoicesPaymentSettingsPaymentMethodTypes'EnumFpx | val GHC.Classes.== "giropay" -> InvoicesPaymentSettingsPaymentMethodTypes'EnumGiropay | val GHC.Classes.== "ideal" -> InvoicesPaymentSettingsPaymentMethodTypes'EnumIdeal | val GHC.Classes.== "sepa_debit" -> InvoicesPaymentSettingsPaymentMethodTypes'EnumSepaDebit | val GHC.Classes.== "sofort" -> InvoicesPaymentSettingsPaymentMethodTypes'EnumSofort | GHC.Base.otherwise -> InvoicesPaymentSettingsPaymentMethodTypes'Other val )