{-# 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 PaymentIntentNextAction module StripeAPI.Types.PaymentIntentNextAction 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.PaymentIntentNextActionAlipayHandleRedirect import {-# SOURCE #-} StripeAPI.Types.PaymentIntentNextActionBoleto import {-# SOURCE #-} StripeAPI.Types.PaymentIntentNextActionDisplayOxxoDetails import {-# SOURCE #-} StripeAPI.Types.PaymentIntentNextActionRedirectToUrl import {-# SOURCE #-} StripeAPI.Types.PaymentIntentNextActionVerifyWithMicrodeposits import qualified Prelude as GHC.Integer.Type import qualified Prelude as GHC.Maybe -- | Defines the object schema located at @components.schemas.payment_intent_next_action@ in the specification. data PaymentIntentNextAction = PaymentIntentNextAction { -- | alipay_handle_redirect: paymentIntentNextActionAlipayHandleRedirect :: (GHC.Maybe.Maybe PaymentIntentNextActionAlipayHandleRedirect), -- | boleto_display_details: paymentIntentNextActionBoletoDisplayDetails :: (GHC.Maybe.Maybe PaymentIntentNextActionBoleto), -- | oxxo_display_details: paymentIntentNextActionOxxoDisplayDetails :: (GHC.Maybe.Maybe PaymentIntentNextActionDisplayOxxoDetails), -- | redirect_to_url: paymentIntentNextActionRedirectToUrl :: (GHC.Maybe.Maybe PaymentIntentNextActionRedirectToUrl), -- | type: Type of the next action to perform, one of \`redirect_to_url\`, \`use_stripe_sdk\`, \`alipay_handle_redirect\`, or \`oxxo_display_details\`. -- -- Constraints: -- -- * Maximum length of 5000 paymentIntentNextActionType :: Data.Text.Internal.Text, -- | use_stripe_sdk: When confirming a PaymentIntent with Stripe.js, Stripe.js depends on the contents of this dictionary to invoke authentication flows. The shape of the contents is subject to change and is only intended to be used by Stripe.js. paymentIntentNextActionUseStripeSdk :: (GHC.Maybe.Maybe Data.Aeson.Types.Internal.Object), -- | verify_with_microdeposits: paymentIntentNextActionVerifyWithMicrodeposits :: (GHC.Maybe.Maybe PaymentIntentNextActionVerifyWithMicrodeposits) } deriving ( GHC.Show.Show, GHC.Classes.Eq ) instance Data.Aeson.Types.ToJSON.ToJSON PaymentIntentNextAction where toJSON obj = Data.Aeson.Types.Internal.object ("alipay_handle_redirect" Data.Aeson.Types.ToJSON..= paymentIntentNextActionAlipayHandleRedirect obj : "boleto_display_details" Data.Aeson.Types.ToJSON..= paymentIntentNextActionBoletoDisplayDetails obj : "oxxo_display_details" Data.Aeson.Types.ToJSON..= paymentIntentNextActionOxxoDisplayDetails obj : "redirect_to_url" Data.Aeson.Types.ToJSON..= paymentIntentNextActionRedirectToUrl obj : "type" Data.Aeson.Types.ToJSON..= paymentIntentNextActionType obj : "use_stripe_sdk" Data.Aeson.Types.ToJSON..= paymentIntentNextActionUseStripeSdk obj : "verify_with_microdeposits" Data.Aeson.Types.ToJSON..= paymentIntentNextActionVerifyWithMicrodeposits obj : GHC.Base.mempty) toEncoding obj = Data.Aeson.Encoding.Internal.pairs (("alipay_handle_redirect" Data.Aeson.Types.ToJSON..= paymentIntentNextActionAlipayHandleRedirect obj) GHC.Base.<> (("boleto_display_details" Data.Aeson.Types.ToJSON..= paymentIntentNextActionBoletoDisplayDetails obj) GHC.Base.<> (("oxxo_display_details" Data.Aeson.Types.ToJSON..= paymentIntentNextActionOxxoDisplayDetails obj) GHC.Base.<> (("redirect_to_url" Data.Aeson.Types.ToJSON..= paymentIntentNextActionRedirectToUrl obj) GHC.Base.<> (("type" Data.Aeson.Types.ToJSON..= paymentIntentNextActionType obj) GHC.Base.<> (("use_stripe_sdk" Data.Aeson.Types.ToJSON..= paymentIntentNextActionUseStripeSdk obj) GHC.Base.<> ("verify_with_microdeposits" Data.Aeson.Types.ToJSON..= paymentIntentNextActionVerifyWithMicrodeposits obj))))))) instance Data.Aeson.Types.FromJSON.FromJSON PaymentIntentNextAction where parseJSON = Data.Aeson.Types.FromJSON.withObject "PaymentIntentNextAction" (\obj -> ((((((GHC.Base.pure PaymentIntentNextAction GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:? "alipay_handle_redirect")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:? "boleto_display_details")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:? "oxxo_display_details")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:? "redirect_to_url")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..: "type")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:? "use_stripe_sdk")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:? "verify_with_microdeposits")) -- | Create a new 'PaymentIntentNextAction' with all required fields. mkPaymentIntentNextAction :: -- | 'paymentIntentNextActionType' Data.Text.Internal.Text -> PaymentIntentNextAction mkPaymentIntentNextAction paymentIntentNextActionType = PaymentIntentNextAction { paymentIntentNextActionAlipayHandleRedirect = GHC.Maybe.Nothing, paymentIntentNextActionBoletoDisplayDetails = GHC.Maybe.Nothing, paymentIntentNextActionOxxoDisplayDetails = GHC.Maybe.Nothing, paymentIntentNextActionRedirectToUrl = GHC.Maybe.Nothing, paymentIntentNextActionType = paymentIntentNextActionType, paymentIntentNextActionUseStripeSdk = GHC.Maybe.Nothing, paymentIntentNextActionVerifyWithMicrodeposits = GHC.Maybe.Nothing }