{-# LANGUAGE MultiWayIf #-}
{-# LANGUAGE OverloadedStrings #-}
module RecurlyClient.Types.PaymentMethod 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
import qualified Data.ByteString as Data.ByteString.Internal
import qualified Data.Foldable
import qualified Data.Functor
import qualified Data.Maybe
import qualified Data.Scientific
import qualified Data.Text
import qualified Data.Text as 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 RecurlyClient.Common
import RecurlyClient.TypeAlias
import qualified Prelude as GHC.Integer.Type
import qualified Prelude as GHC.Maybe
data PaymentMethod = PaymentMethod
{ PaymentMethod -> Maybe PaymentMethodAccount_type
paymentMethodAccount_type :: (GHC.Maybe.Maybe PaymentMethodAccount_type)
, PaymentMethod -> Maybe Text
paymentMethodBilling_agreement_id :: (GHC.Maybe.Maybe Data.Text.Internal.Text)
, PaymentMethod -> Maybe PaymentMethodCard_network_preference
paymentMethodCard_network_preference :: (GHC.Maybe.Maybe PaymentMethodCard_network_preference)
, PaymentMethod -> Maybe PaymentMethodCard_type
paymentMethodCard_type :: (GHC.Maybe.Maybe PaymentMethodCard_type)
, PaymentMethod -> Maybe Text
paymentMethodCc_bin_country :: (GHC.Maybe.Maybe Data.Text.Internal.Text)
, PaymentMethod -> Maybe Int
paymentMethodExp_month :: (GHC.Maybe.Maybe GHC.Types.Int)
, PaymentMethod -> Maybe Int
paymentMethodExp_year :: (GHC.Maybe.Maybe GHC.Types.Int)
, PaymentMethod -> Maybe Text
paymentMethodFirst_six :: (GHC.Maybe.Maybe Data.Text.Internal.Text)
, PaymentMethod -> Maybe PaymentMethodFunding_source
paymentMethodFunding_source :: (GHC.Maybe.Maybe PaymentMethodFunding_source)
, PaymentMethod -> Maybe PaymentMethodGateway_attributes
paymentMethodGateway_attributes :: (GHC.Maybe.Maybe PaymentMethodGateway_attributes)
, PaymentMethod -> Maybe Text
paymentMethodGateway_code :: (GHC.Maybe.Maybe Data.Text.Internal.Text)
, PaymentMethod -> Maybe Text
paymentMethodGateway_token :: (GHC.Maybe.Maybe Data.Text.Internal.Text)
, PaymentMethod -> Maybe Text
paymentMethodLast_four :: (GHC.Maybe.Maybe Data.Text.Internal.Text)
, PaymentMethod -> Maybe Text
paymentMethodLast_two :: (GHC.Maybe.Maybe Data.Text.Internal.Text)
, PaymentMethod -> Maybe Text
paymentMethodName_on_account :: (GHC.Maybe.Maybe Data.Text.Internal.Text)
, PaymentMethod -> Maybe PaymentMethodObject
paymentMethodObject :: (GHC.Maybe.Maybe PaymentMethodObject)
, PaymentMethod -> Maybe Text
paymentMethodRouting_number :: (GHC.Maybe.Maybe Data.Text.Internal.Text)
, PaymentMethod -> Maybe Text
paymentMethodRouting_number_bank :: (GHC.Maybe.Maybe Data.Text.Internal.Text)
, PaymentMethod -> Maybe Text
paymentMethodUsername :: (GHC.Maybe.Maybe Data.Text.Internal.Text)
}
deriving
( Int -> PaymentMethod -> ShowS
[PaymentMethod] -> ShowS
PaymentMethod -> String
(Int -> PaymentMethod -> ShowS)
-> (PaymentMethod -> String)
-> ([PaymentMethod] -> ShowS)
-> Show PaymentMethod
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> PaymentMethod -> ShowS
showsPrec :: Int -> PaymentMethod -> ShowS
$cshow :: PaymentMethod -> String
show :: PaymentMethod -> String
$cshowList :: [PaymentMethod] -> ShowS
showList :: [PaymentMethod] -> ShowS
GHC.Show.Show
, PaymentMethod -> PaymentMethod -> Bool
(PaymentMethod -> PaymentMethod -> Bool)
-> (PaymentMethod -> PaymentMethod -> Bool) -> Eq PaymentMethod
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: PaymentMethod -> PaymentMethod -> Bool
== :: PaymentMethod -> PaymentMethod -> Bool
$c/= :: PaymentMethod -> PaymentMethod -> Bool
/= :: PaymentMethod -> PaymentMethod -> Bool
GHC.Classes.Eq
)
instance Data.Aeson.Types.ToJSON.ToJSON PaymentMethod where
toJSON :: PaymentMethod -> Value
toJSON PaymentMethod
obj = [Pair] -> Value
Data.Aeson.Types.Internal.object ([[Pair]] -> [Pair]
forall (t :: * -> *) a. Foldable t => t [a] -> [a]
Data.Foldable.concat ([Pair]
-> (PaymentMethodAccount_type -> [Pair])
-> Maybe PaymentMethodAccount_type
-> [Pair]
forall b a. b -> (a -> b) -> Maybe a -> b
Data.Maybe.maybe [Pair]
forall a. Monoid a => a
GHC.Base.mempty (Pair -> [Pair]
forall a. a -> [a]
forall (f :: * -> *) a. Applicative f => a -> f a
GHC.Base.pure (Pair -> [Pair])
-> (PaymentMethodAccount_type -> Pair)
-> PaymentMethodAccount_type
-> [Pair]
forall b c a. (b -> c) -> (a -> b) -> a -> c
GHC.Base.. (Key
"account_type" Key -> PaymentMethodAccount_type -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
Data.Aeson.Types.ToJSON..=)) (PaymentMethod -> Maybe PaymentMethodAccount_type
paymentMethodAccount_type PaymentMethod
obj) [Pair] -> [[Pair]] -> [[Pair]]
forall a. a -> [a] -> [a]
: [Pair] -> (Text -> [Pair]) -> Maybe Text -> [Pair]
forall b a. b -> (a -> b) -> Maybe a -> b
Data.Maybe.maybe [Pair]
forall a. Monoid a => a
GHC.Base.mempty (Pair -> [Pair]
forall a. a -> [a]
forall (f :: * -> *) a. Applicative f => a -> f a
GHC.Base.pure (Pair -> [Pair]) -> (Text -> Pair) -> Text -> [Pair]
forall b c a. (b -> c) -> (a -> b) -> a -> c
GHC.Base.. (Key
"billing_agreement_id" Key -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
Data.Aeson.Types.ToJSON..=)) (PaymentMethod -> Maybe Text
paymentMethodBilling_agreement_id PaymentMethod
obj) [Pair] -> [[Pair]] -> [[Pair]]
forall a. a -> [a] -> [a]
: [Pair]
-> (PaymentMethodCard_network_preference -> [Pair])
-> Maybe PaymentMethodCard_network_preference
-> [Pair]
forall b a. b -> (a -> b) -> Maybe a -> b
Data.Maybe.maybe [Pair]
forall a. Monoid a => a
GHC.Base.mempty (Pair -> [Pair]
forall a. a -> [a]
forall (f :: * -> *) a. Applicative f => a -> f a
GHC.Base.pure (Pair -> [Pair])
-> (PaymentMethodCard_network_preference -> Pair)
-> PaymentMethodCard_network_preference
-> [Pair]
forall b c a. (b -> c) -> (a -> b) -> a -> c
GHC.Base.. (Key
"card_network_preference" Key -> PaymentMethodCard_network_preference -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
Data.Aeson.Types.ToJSON..=)) (PaymentMethod -> Maybe PaymentMethodCard_network_preference
paymentMethodCard_network_preference PaymentMethod
obj) [Pair] -> [[Pair]] -> [[Pair]]
forall a. a -> [a] -> [a]
: [Pair]
-> (PaymentMethodCard_type -> [Pair])
-> Maybe PaymentMethodCard_type
-> [Pair]
forall b a. b -> (a -> b) -> Maybe a -> b
Data.Maybe.maybe [Pair]
forall a. Monoid a => a
GHC.Base.mempty (Pair -> [Pair]
forall a. a -> [a]
forall (f :: * -> *) a. Applicative f => a -> f a
GHC.Base.pure (Pair -> [Pair])
-> (PaymentMethodCard_type -> Pair)
-> PaymentMethodCard_type
-> [Pair]
forall b c a. (b -> c) -> (a -> b) -> a -> c
GHC.Base.. (Key
"card_type" Key -> PaymentMethodCard_type -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
Data.Aeson.Types.ToJSON..=)) (PaymentMethod -> Maybe PaymentMethodCard_type
paymentMethodCard_type PaymentMethod
obj) [Pair] -> [[Pair]] -> [[Pair]]
forall a. a -> [a] -> [a]
: [Pair] -> (Text -> [Pair]) -> Maybe Text -> [Pair]
forall b a. b -> (a -> b) -> Maybe a -> b
Data.Maybe.maybe [Pair]
forall a. Monoid a => a
GHC.Base.mempty (Pair -> [Pair]
forall a. a -> [a]
forall (f :: * -> *) a. Applicative f => a -> f a
GHC.Base.pure (Pair -> [Pair]) -> (Text -> Pair) -> Text -> [Pair]
forall b c a. (b -> c) -> (a -> b) -> a -> c
GHC.Base.. (Key
"cc_bin_country" Key -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
Data.Aeson.Types.ToJSON..=)) (PaymentMethod -> Maybe Text
paymentMethodCc_bin_country PaymentMethod
obj) [Pair] -> [[Pair]] -> [[Pair]]
forall a. a -> [a] -> [a]
: [Pair] -> (Int -> [Pair]) -> Maybe Int -> [Pair]
forall b a. b -> (a -> b) -> Maybe a -> b
Data.Maybe.maybe [Pair]
forall a. Monoid a => a
GHC.Base.mempty (Pair -> [Pair]
forall a. a -> [a]
forall (f :: * -> *) a. Applicative f => a -> f a
GHC.Base.pure (Pair -> [Pair]) -> (Int -> Pair) -> Int -> [Pair]
forall b c a. (b -> c) -> (a -> b) -> a -> c
GHC.Base.. (Key
"exp_month" Key -> Int -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
Data.Aeson.Types.ToJSON..=)) (PaymentMethod -> Maybe Int
paymentMethodExp_month PaymentMethod
obj) [Pair] -> [[Pair]] -> [[Pair]]
forall a. a -> [a] -> [a]
: [Pair] -> (Int -> [Pair]) -> Maybe Int -> [Pair]
forall b a. b -> (a -> b) -> Maybe a -> b
Data.Maybe.maybe [Pair]
forall a. Monoid a => a
GHC.Base.mempty (Pair -> [Pair]
forall a. a -> [a]
forall (f :: * -> *) a. Applicative f => a -> f a
GHC.Base.pure (Pair -> [Pair]) -> (Int -> Pair) -> Int -> [Pair]
forall b c a. (b -> c) -> (a -> b) -> a -> c
GHC.Base.. (Key
"exp_year" Key -> Int -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
Data.Aeson.Types.ToJSON..=)) (PaymentMethod -> Maybe Int
paymentMethodExp_year PaymentMethod
obj) [Pair] -> [[Pair]] -> [[Pair]]
forall a. a -> [a] -> [a]
: [Pair] -> (Text -> [Pair]) -> Maybe Text -> [Pair]
forall b a. b -> (a -> b) -> Maybe a -> b
Data.Maybe.maybe [Pair]
forall a. Monoid a => a
GHC.Base.mempty (Pair -> [Pair]
forall a. a -> [a]
forall (f :: * -> *) a. Applicative f => a -> f a
GHC.Base.pure (Pair -> [Pair]) -> (Text -> Pair) -> Text -> [Pair]
forall b c a. (b -> c) -> (a -> b) -> a -> c
GHC.Base.. (Key
"first_six" Key -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
Data.Aeson.Types.ToJSON..=)) (PaymentMethod -> Maybe Text
paymentMethodFirst_six PaymentMethod
obj) [Pair] -> [[Pair]] -> [[Pair]]
forall a. a -> [a] -> [a]
: [Pair]
-> (PaymentMethodFunding_source -> [Pair])
-> Maybe PaymentMethodFunding_source
-> [Pair]
forall b a. b -> (a -> b) -> Maybe a -> b
Data.Maybe.maybe [Pair]
forall a. Monoid a => a
GHC.Base.mempty (Pair -> [Pair]
forall a. a -> [a]
forall (f :: * -> *) a. Applicative f => a -> f a
GHC.Base.pure (Pair -> [Pair])
-> (PaymentMethodFunding_source -> Pair)
-> PaymentMethodFunding_source
-> [Pair]
forall b c a. (b -> c) -> (a -> b) -> a -> c
GHC.Base.. (Key
"funding_source" Key -> PaymentMethodFunding_source -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
Data.Aeson.Types.ToJSON..=)) (PaymentMethod -> Maybe PaymentMethodFunding_source
paymentMethodFunding_source PaymentMethod
obj) [Pair] -> [[Pair]] -> [[Pair]]
forall a. a -> [a] -> [a]
: [Pair]
-> (PaymentMethodGateway_attributes -> [Pair])
-> Maybe PaymentMethodGateway_attributes
-> [Pair]
forall b a. b -> (a -> b) -> Maybe a -> b
Data.Maybe.maybe [Pair]
forall a. Monoid a => a
GHC.Base.mempty (Pair -> [Pair]
forall a. a -> [a]
forall (f :: * -> *) a. Applicative f => a -> f a
GHC.Base.pure (Pair -> [Pair])
-> (PaymentMethodGateway_attributes -> Pair)
-> PaymentMethodGateway_attributes
-> [Pair]
forall b c a. (b -> c) -> (a -> b) -> a -> c
GHC.Base.. (Key
"gateway_attributes" Key -> PaymentMethodGateway_attributes -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
Data.Aeson.Types.ToJSON..=)) (PaymentMethod -> Maybe PaymentMethodGateway_attributes
paymentMethodGateway_attributes PaymentMethod
obj) [Pair] -> [[Pair]] -> [[Pair]]
forall a. a -> [a] -> [a]
: [Pair] -> (Text -> [Pair]) -> Maybe Text -> [Pair]
forall b a. b -> (a -> b) -> Maybe a -> b
Data.Maybe.maybe [Pair]
forall a. Monoid a => a
GHC.Base.mempty (Pair -> [Pair]
forall a. a -> [a]
forall (f :: * -> *) a. Applicative f => a -> f a
GHC.Base.pure (Pair -> [Pair]) -> (Text -> Pair) -> Text -> [Pair]
forall b c a. (b -> c) -> (a -> b) -> a -> c
GHC.Base.. (Key
"gateway_code" Key -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
Data.Aeson.Types.ToJSON..=)) (PaymentMethod -> Maybe Text
paymentMethodGateway_code PaymentMethod
obj) [Pair] -> [[Pair]] -> [[Pair]]
forall a. a -> [a] -> [a]
: [Pair] -> (Text -> [Pair]) -> Maybe Text -> [Pair]
forall b a. b -> (a -> b) -> Maybe a -> b
Data.Maybe.maybe [Pair]
forall a. Monoid a => a
GHC.Base.mempty (Pair -> [Pair]
forall a. a -> [a]
forall (f :: * -> *) a. Applicative f => a -> f a
GHC.Base.pure (Pair -> [Pair]) -> (Text -> Pair) -> Text -> [Pair]
forall b c a. (b -> c) -> (a -> b) -> a -> c
GHC.Base.. (Key
"gateway_token" Key -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
Data.Aeson.Types.ToJSON..=)) (PaymentMethod -> Maybe Text
paymentMethodGateway_token PaymentMethod
obj) [Pair] -> [[Pair]] -> [[Pair]]
forall a. a -> [a] -> [a]
: [Pair] -> (Text -> [Pair]) -> Maybe Text -> [Pair]
forall b a. b -> (a -> b) -> Maybe a -> b
Data.Maybe.maybe [Pair]
forall a. Monoid a => a
GHC.Base.mempty (Pair -> [Pair]
forall a. a -> [a]
forall (f :: * -> *) a. Applicative f => a -> f a
GHC.Base.pure (Pair -> [Pair]) -> (Text -> Pair) -> Text -> [Pair]
forall b c a. (b -> c) -> (a -> b) -> a -> c
GHC.Base.. (Key
"last_four" Key -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
Data.Aeson.Types.ToJSON..=)) (PaymentMethod -> Maybe Text
paymentMethodLast_four PaymentMethod
obj) [Pair] -> [[Pair]] -> [[Pair]]
forall a. a -> [a] -> [a]
: [Pair] -> (Text -> [Pair]) -> Maybe Text -> [Pair]
forall b a. b -> (a -> b) -> Maybe a -> b
Data.Maybe.maybe [Pair]
forall a. Monoid a => a
GHC.Base.mempty (Pair -> [Pair]
forall a. a -> [a]
forall (f :: * -> *) a. Applicative f => a -> f a
GHC.Base.pure (Pair -> [Pair]) -> (Text -> Pair) -> Text -> [Pair]
forall b c a. (b -> c) -> (a -> b) -> a -> c
GHC.Base.. (Key
"last_two" Key -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
Data.Aeson.Types.ToJSON..=)) (PaymentMethod -> Maybe Text
paymentMethodLast_two PaymentMethod
obj) [Pair] -> [[Pair]] -> [[Pair]]
forall a. a -> [a] -> [a]
: [Pair] -> (Text -> [Pair]) -> Maybe Text -> [Pair]
forall b a. b -> (a -> b) -> Maybe a -> b
Data.Maybe.maybe [Pair]
forall a. Monoid a => a
GHC.Base.mempty (Pair -> [Pair]
forall a. a -> [a]
forall (f :: * -> *) a. Applicative f => a -> f a
GHC.Base.pure (Pair -> [Pair]) -> (Text -> Pair) -> Text -> [Pair]
forall b c a. (b -> c) -> (a -> b) -> a -> c
GHC.Base.. (Key
"name_on_account" Key -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
Data.Aeson.Types.ToJSON..=)) (PaymentMethod -> Maybe Text
paymentMethodName_on_account PaymentMethod
obj) [Pair] -> [[Pair]] -> [[Pair]]
forall a. a -> [a] -> [a]
: [Pair]
-> (PaymentMethodObject -> [Pair])
-> Maybe PaymentMethodObject
-> [Pair]
forall b a. b -> (a -> b) -> Maybe a -> b
Data.Maybe.maybe [Pair]
forall a. Monoid a => a
GHC.Base.mempty (Pair -> [Pair]
forall a. a -> [a]
forall (f :: * -> *) a. Applicative f => a -> f a
GHC.Base.pure (Pair -> [Pair])
-> (PaymentMethodObject -> Pair) -> PaymentMethodObject -> [Pair]
forall b c a. (b -> c) -> (a -> b) -> a -> c
GHC.Base.. (Key
"object" Key -> PaymentMethodObject -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
Data.Aeson.Types.ToJSON..=)) (PaymentMethod -> Maybe PaymentMethodObject
paymentMethodObject PaymentMethod
obj) [Pair] -> [[Pair]] -> [[Pair]]
forall a. a -> [a] -> [a]
: [Pair] -> (Text -> [Pair]) -> Maybe Text -> [Pair]
forall b a. b -> (a -> b) -> Maybe a -> b
Data.Maybe.maybe [Pair]
forall a. Monoid a => a
GHC.Base.mempty (Pair -> [Pair]
forall a. a -> [a]
forall (f :: * -> *) a. Applicative f => a -> f a
GHC.Base.pure (Pair -> [Pair]) -> (Text -> Pair) -> Text -> [Pair]
forall b c a. (b -> c) -> (a -> b) -> a -> c
GHC.Base.. (Key
"routing_number" Key -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
Data.Aeson.Types.ToJSON..=)) (PaymentMethod -> Maybe Text
paymentMethodRouting_number PaymentMethod
obj) [Pair] -> [[Pair]] -> [[Pair]]
forall a. a -> [a] -> [a]
: [Pair] -> (Text -> [Pair]) -> Maybe Text -> [Pair]
forall b a. b -> (a -> b) -> Maybe a -> b
Data.Maybe.maybe [Pair]
forall a. Monoid a => a
GHC.Base.mempty (Pair -> [Pair]
forall a. a -> [a]
forall (f :: * -> *) a. Applicative f => a -> f a
GHC.Base.pure (Pair -> [Pair]) -> (Text -> Pair) -> Text -> [Pair]
forall b c a. (b -> c) -> (a -> b) -> a -> c
GHC.Base.. (Key
"routing_number_bank" Key -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
Data.Aeson.Types.ToJSON..=)) (PaymentMethod -> Maybe Text
paymentMethodRouting_number_bank PaymentMethod
obj) [Pair] -> [[Pair]] -> [[Pair]]
forall a. a -> [a] -> [a]
: [Pair] -> (Text -> [Pair]) -> Maybe Text -> [Pair]
forall b a. b -> (a -> b) -> Maybe a -> b
Data.Maybe.maybe [Pair]
forall a. Monoid a => a
GHC.Base.mempty (Pair -> [Pair]
forall a. a -> [a]
forall (f :: * -> *) a. Applicative f => a -> f a
GHC.Base.pure (Pair -> [Pair]) -> (Text -> Pair) -> Text -> [Pair]
forall b c a. (b -> c) -> (a -> b) -> a -> c
GHC.Base.. (Key
"username" Key -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
Data.Aeson.Types.ToJSON..=)) (PaymentMethod -> Maybe Text
paymentMethodUsername PaymentMethod
obj) [Pair] -> [[Pair]] -> [[Pair]]
forall a. a -> [a] -> [a]
: [[Pair]]
forall a. Monoid a => a
GHC.Base.mempty))
toEncoding :: PaymentMethod -> Encoding
toEncoding PaymentMethod
obj = Series -> Encoding
Data.Aeson.Encoding.Internal.pairs ([Series] -> Series
forall a. Monoid a => [a] -> a
GHC.Base.mconcat ([[Series]] -> [Series]
forall (t :: * -> *) a. Foldable t => t [a] -> [a]
Data.Foldable.concat ([Series]
-> (PaymentMethodAccount_type -> [Series])
-> Maybe PaymentMethodAccount_type
-> [Series]
forall b a. b -> (a -> b) -> Maybe a -> b
Data.Maybe.maybe [Series]
forall a. Monoid a => a
GHC.Base.mempty (Series -> [Series]
forall a. a -> [a]
forall (f :: * -> *) a. Applicative f => a -> f a
GHC.Base.pure (Series -> [Series])
-> (PaymentMethodAccount_type -> Series)
-> PaymentMethodAccount_type
-> [Series]
forall b c a. (b -> c) -> (a -> b) -> a -> c
GHC.Base.. (Key
"account_type" Key -> PaymentMethodAccount_type -> Series
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Series
Data.Aeson.Types.ToJSON..=)) (PaymentMethod -> Maybe PaymentMethodAccount_type
paymentMethodAccount_type PaymentMethod
obj) [Series] -> [[Series]] -> [[Series]]
forall a. a -> [a] -> [a]
: [Series] -> (Text -> [Series]) -> Maybe Text -> [Series]
forall b a. b -> (a -> b) -> Maybe a -> b
Data.Maybe.maybe [Series]
forall a. Monoid a => a
GHC.Base.mempty (Series -> [Series]
forall a. a -> [a]
forall (f :: * -> *) a. Applicative f => a -> f a
GHC.Base.pure (Series -> [Series]) -> (Text -> Series) -> Text -> [Series]
forall b c a. (b -> c) -> (a -> b) -> a -> c
GHC.Base.. (Key
"billing_agreement_id" Key -> Text -> Series
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Series
Data.Aeson.Types.ToJSON..=)) (PaymentMethod -> Maybe Text
paymentMethodBilling_agreement_id PaymentMethod
obj) [Series] -> [[Series]] -> [[Series]]
forall a. a -> [a] -> [a]
: [Series]
-> (PaymentMethodCard_network_preference -> [Series])
-> Maybe PaymentMethodCard_network_preference
-> [Series]
forall b a. b -> (a -> b) -> Maybe a -> b
Data.Maybe.maybe [Series]
forall a. Monoid a => a
GHC.Base.mempty (Series -> [Series]
forall a. a -> [a]
forall (f :: * -> *) a. Applicative f => a -> f a
GHC.Base.pure (Series -> [Series])
-> (PaymentMethodCard_network_preference -> Series)
-> PaymentMethodCard_network_preference
-> [Series]
forall b c a. (b -> c) -> (a -> b) -> a -> c
GHC.Base.. (Key
"card_network_preference" Key -> PaymentMethodCard_network_preference -> Series
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Series
Data.Aeson.Types.ToJSON..=)) (PaymentMethod -> Maybe PaymentMethodCard_network_preference
paymentMethodCard_network_preference PaymentMethod
obj) [Series] -> [[Series]] -> [[Series]]
forall a. a -> [a] -> [a]
: [Series]
-> (PaymentMethodCard_type -> [Series])
-> Maybe PaymentMethodCard_type
-> [Series]
forall b a. b -> (a -> b) -> Maybe a -> b
Data.Maybe.maybe [Series]
forall a. Monoid a => a
GHC.Base.mempty (Series -> [Series]
forall a. a -> [a]
forall (f :: * -> *) a. Applicative f => a -> f a
GHC.Base.pure (Series -> [Series])
-> (PaymentMethodCard_type -> Series)
-> PaymentMethodCard_type
-> [Series]
forall b c a. (b -> c) -> (a -> b) -> a -> c
GHC.Base.. (Key
"card_type" Key -> PaymentMethodCard_type -> Series
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Series
Data.Aeson.Types.ToJSON..=)) (PaymentMethod -> Maybe PaymentMethodCard_type
paymentMethodCard_type PaymentMethod
obj) [Series] -> [[Series]] -> [[Series]]
forall a. a -> [a] -> [a]
: [Series] -> (Text -> [Series]) -> Maybe Text -> [Series]
forall b a. b -> (a -> b) -> Maybe a -> b
Data.Maybe.maybe [Series]
forall a. Monoid a => a
GHC.Base.mempty (Series -> [Series]
forall a. a -> [a]
forall (f :: * -> *) a. Applicative f => a -> f a
GHC.Base.pure (Series -> [Series]) -> (Text -> Series) -> Text -> [Series]
forall b c a. (b -> c) -> (a -> b) -> a -> c
GHC.Base.. (Key
"cc_bin_country" Key -> Text -> Series
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Series
Data.Aeson.Types.ToJSON..=)) (PaymentMethod -> Maybe Text
paymentMethodCc_bin_country PaymentMethod
obj) [Series] -> [[Series]] -> [[Series]]
forall a. a -> [a] -> [a]
: [Series] -> (Int -> [Series]) -> Maybe Int -> [Series]
forall b a. b -> (a -> b) -> Maybe a -> b
Data.Maybe.maybe [Series]
forall a. Monoid a => a
GHC.Base.mempty (Series -> [Series]
forall a. a -> [a]
forall (f :: * -> *) a. Applicative f => a -> f a
GHC.Base.pure (Series -> [Series]) -> (Int -> Series) -> Int -> [Series]
forall b c a. (b -> c) -> (a -> b) -> a -> c
GHC.Base.. (Key
"exp_month" Key -> Int -> Series
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Series
Data.Aeson.Types.ToJSON..=)) (PaymentMethod -> Maybe Int
paymentMethodExp_month PaymentMethod
obj) [Series] -> [[Series]] -> [[Series]]
forall a. a -> [a] -> [a]
: [Series] -> (Int -> [Series]) -> Maybe Int -> [Series]
forall b a. b -> (a -> b) -> Maybe a -> b
Data.Maybe.maybe [Series]
forall a. Monoid a => a
GHC.Base.mempty (Series -> [Series]
forall a. a -> [a]
forall (f :: * -> *) a. Applicative f => a -> f a
GHC.Base.pure (Series -> [Series]) -> (Int -> Series) -> Int -> [Series]
forall b c a. (b -> c) -> (a -> b) -> a -> c
GHC.Base.. (Key
"exp_year" Key -> Int -> Series
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Series
Data.Aeson.Types.ToJSON..=)) (PaymentMethod -> Maybe Int
paymentMethodExp_year PaymentMethod
obj) [Series] -> [[Series]] -> [[Series]]
forall a. a -> [a] -> [a]
: [Series] -> (Text -> [Series]) -> Maybe Text -> [Series]
forall b a. b -> (a -> b) -> Maybe a -> b
Data.Maybe.maybe [Series]
forall a. Monoid a => a
GHC.Base.mempty (Series -> [Series]
forall a. a -> [a]
forall (f :: * -> *) a. Applicative f => a -> f a
GHC.Base.pure (Series -> [Series]) -> (Text -> Series) -> Text -> [Series]
forall b c a. (b -> c) -> (a -> b) -> a -> c
GHC.Base.. (Key
"first_six" Key -> Text -> Series
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Series
Data.Aeson.Types.ToJSON..=)) (PaymentMethod -> Maybe Text
paymentMethodFirst_six PaymentMethod
obj) [Series] -> [[Series]] -> [[Series]]
forall a. a -> [a] -> [a]
: [Series]
-> (PaymentMethodFunding_source -> [Series])
-> Maybe PaymentMethodFunding_source
-> [Series]
forall b a. b -> (a -> b) -> Maybe a -> b
Data.Maybe.maybe [Series]
forall a. Monoid a => a
GHC.Base.mempty (Series -> [Series]
forall a. a -> [a]
forall (f :: * -> *) a. Applicative f => a -> f a
GHC.Base.pure (Series -> [Series])
-> (PaymentMethodFunding_source -> Series)
-> PaymentMethodFunding_source
-> [Series]
forall b c a. (b -> c) -> (a -> b) -> a -> c
GHC.Base.. (Key
"funding_source" Key -> PaymentMethodFunding_source -> Series
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Series
Data.Aeson.Types.ToJSON..=)) (PaymentMethod -> Maybe PaymentMethodFunding_source
paymentMethodFunding_source PaymentMethod
obj) [Series] -> [[Series]] -> [[Series]]
forall a. a -> [a] -> [a]
: [Series]
-> (PaymentMethodGateway_attributes -> [Series])
-> Maybe PaymentMethodGateway_attributes
-> [Series]
forall b a. b -> (a -> b) -> Maybe a -> b
Data.Maybe.maybe [Series]
forall a. Monoid a => a
GHC.Base.mempty (Series -> [Series]
forall a. a -> [a]
forall (f :: * -> *) a. Applicative f => a -> f a
GHC.Base.pure (Series -> [Series])
-> (PaymentMethodGateway_attributes -> Series)
-> PaymentMethodGateway_attributes
-> [Series]
forall b c a. (b -> c) -> (a -> b) -> a -> c
GHC.Base.. (Key
"gateway_attributes" Key -> PaymentMethodGateway_attributes -> Series
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Series
Data.Aeson.Types.ToJSON..=)) (PaymentMethod -> Maybe PaymentMethodGateway_attributes
paymentMethodGateway_attributes PaymentMethod
obj) [Series] -> [[Series]] -> [[Series]]
forall a. a -> [a] -> [a]
: [Series] -> (Text -> [Series]) -> Maybe Text -> [Series]
forall b a. b -> (a -> b) -> Maybe a -> b
Data.Maybe.maybe [Series]
forall a. Monoid a => a
GHC.Base.mempty (Series -> [Series]
forall a. a -> [a]
forall (f :: * -> *) a. Applicative f => a -> f a
GHC.Base.pure (Series -> [Series]) -> (Text -> Series) -> Text -> [Series]
forall b c a. (b -> c) -> (a -> b) -> a -> c
GHC.Base.. (Key
"gateway_code" Key -> Text -> Series
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Series
Data.Aeson.Types.ToJSON..=)) (PaymentMethod -> Maybe Text
paymentMethodGateway_code PaymentMethod
obj) [Series] -> [[Series]] -> [[Series]]
forall a. a -> [a] -> [a]
: [Series] -> (Text -> [Series]) -> Maybe Text -> [Series]
forall b a. b -> (a -> b) -> Maybe a -> b
Data.Maybe.maybe [Series]
forall a. Monoid a => a
GHC.Base.mempty (Series -> [Series]
forall a. a -> [a]
forall (f :: * -> *) a. Applicative f => a -> f a
GHC.Base.pure (Series -> [Series]) -> (Text -> Series) -> Text -> [Series]
forall b c a. (b -> c) -> (a -> b) -> a -> c
GHC.Base.. (Key
"gateway_token" Key -> Text -> Series
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Series
Data.Aeson.Types.ToJSON..=)) (PaymentMethod -> Maybe Text
paymentMethodGateway_token PaymentMethod
obj) [Series] -> [[Series]] -> [[Series]]
forall a. a -> [a] -> [a]
: [Series] -> (Text -> [Series]) -> Maybe Text -> [Series]
forall b a. b -> (a -> b) -> Maybe a -> b
Data.Maybe.maybe [Series]
forall a. Monoid a => a
GHC.Base.mempty (Series -> [Series]
forall a. a -> [a]
forall (f :: * -> *) a. Applicative f => a -> f a
GHC.Base.pure (Series -> [Series]) -> (Text -> Series) -> Text -> [Series]
forall b c a. (b -> c) -> (a -> b) -> a -> c
GHC.Base.. (Key
"last_four" Key -> Text -> Series
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Series
Data.Aeson.Types.ToJSON..=)) (PaymentMethod -> Maybe Text
paymentMethodLast_four PaymentMethod
obj) [Series] -> [[Series]] -> [[Series]]
forall a. a -> [a] -> [a]
: [Series] -> (Text -> [Series]) -> Maybe Text -> [Series]
forall b a. b -> (a -> b) -> Maybe a -> b
Data.Maybe.maybe [Series]
forall a. Monoid a => a
GHC.Base.mempty (Series -> [Series]
forall a. a -> [a]
forall (f :: * -> *) a. Applicative f => a -> f a
GHC.Base.pure (Series -> [Series]) -> (Text -> Series) -> Text -> [Series]
forall b c a. (b -> c) -> (a -> b) -> a -> c
GHC.Base.. (Key
"last_two" Key -> Text -> Series
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Series
Data.Aeson.Types.ToJSON..=)) (PaymentMethod -> Maybe Text
paymentMethodLast_two PaymentMethod
obj) [Series] -> [[Series]] -> [[Series]]
forall a. a -> [a] -> [a]
: [Series] -> (Text -> [Series]) -> Maybe Text -> [Series]
forall b a. b -> (a -> b) -> Maybe a -> b
Data.Maybe.maybe [Series]
forall a. Monoid a => a
GHC.Base.mempty (Series -> [Series]
forall a. a -> [a]
forall (f :: * -> *) a. Applicative f => a -> f a
GHC.Base.pure (Series -> [Series]) -> (Text -> Series) -> Text -> [Series]
forall b c a. (b -> c) -> (a -> b) -> a -> c
GHC.Base.. (Key
"name_on_account" Key -> Text -> Series
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Series
Data.Aeson.Types.ToJSON..=)) (PaymentMethod -> Maybe Text
paymentMethodName_on_account PaymentMethod
obj) [Series] -> [[Series]] -> [[Series]]
forall a. a -> [a] -> [a]
: [Series]
-> (PaymentMethodObject -> [Series])
-> Maybe PaymentMethodObject
-> [Series]
forall b a. b -> (a -> b) -> Maybe a -> b
Data.Maybe.maybe [Series]
forall a. Monoid a => a
GHC.Base.mempty (Series -> [Series]
forall a. a -> [a]
forall (f :: * -> *) a. Applicative f => a -> f a
GHC.Base.pure (Series -> [Series])
-> (PaymentMethodObject -> Series)
-> PaymentMethodObject
-> [Series]
forall b c a. (b -> c) -> (a -> b) -> a -> c
GHC.Base.. (Key
"object" Key -> PaymentMethodObject -> Series
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Series
Data.Aeson.Types.ToJSON..=)) (PaymentMethod -> Maybe PaymentMethodObject
paymentMethodObject PaymentMethod
obj) [Series] -> [[Series]] -> [[Series]]
forall a. a -> [a] -> [a]
: [Series] -> (Text -> [Series]) -> Maybe Text -> [Series]
forall b a. b -> (a -> b) -> Maybe a -> b
Data.Maybe.maybe [Series]
forall a. Monoid a => a
GHC.Base.mempty (Series -> [Series]
forall a. a -> [a]
forall (f :: * -> *) a. Applicative f => a -> f a
GHC.Base.pure (Series -> [Series]) -> (Text -> Series) -> Text -> [Series]
forall b c a. (b -> c) -> (a -> b) -> a -> c
GHC.Base.. (Key
"routing_number" Key -> Text -> Series
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Series
Data.Aeson.Types.ToJSON..=)) (PaymentMethod -> Maybe Text
paymentMethodRouting_number PaymentMethod
obj) [Series] -> [[Series]] -> [[Series]]
forall a. a -> [a] -> [a]
: [Series] -> (Text -> [Series]) -> Maybe Text -> [Series]
forall b a. b -> (a -> b) -> Maybe a -> b
Data.Maybe.maybe [Series]
forall a. Monoid a => a
GHC.Base.mempty (Series -> [Series]
forall a. a -> [a]
forall (f :: * -> *) a. Applicative f => a -> f a
GHC.Base.pure (Series -> [Series]) -> (Text -> Series) -> Text -> [Series]
forall b c a. (b -> c) -> (a -> b) -> a -> c
GHC.Base.. (Key
"routing_number_bank" Key -> Text -> Series
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Series
Data.Aeson.Types.ToJSON..=)) (PaymentMethod -> Maybe Text
paymentMethodRouting_number_bank PaymentMethod
obj) [Series] -> [[Series]] -> [[Series]]
forall a. a -> [a] -> [a]
: [Series] -> (Text -> [Series]) -> Maybe Text -> [Series]
forall b a. b -> (a -> b) -> Maybe a -> b
Data.Maybe.maybe [Series]
forall a. Monoid a => a
GHC.Base.mempty (Series -> [Series]
forall a. a -> [a]
forall (f :: * -> *) a. Applicative f => a -> f a
GHC.Base.pure (Series -> [Series]) -> (Text -> Series) -> Text -> [Series]
forall b c a. (b -> c) -> (a -> b) -> a -> c
GHC.Base.. (Key
"username" Key -> Text -> Series
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Series
Data.Aeson.Types.ToJSON..=)) (PaymentMethod -> Maybe Text
paymentMethodUsername PaymentMethod
obj) [Series] -> [[Series]] -> [[Series]]
forall a. a -> [a] -> [a]
: [[Series]]
forall a. Monoid a => a
GHC.Base.mempty)))
instance Data.Aeson.Types.FromJSON.FromJSON PaymentMethod where
parseJSON :: Value -> Parser PaymentMethod
parseJSON = String
-> (Object -> Parser PaymentMethod)
-> Value
-> Parser PaymentMethod
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.Aeson.Types.FromJSON.withObject String
"PaymentMethod" (\Object
obj -> (((((((((((((((((((Maybe PaymentMethodAccount_type
-> Maybe Text
-> Maybe PaymentMethodCard_network_preference
-> Maybe PaymentMethodCard_type
-> Maybe Text
-> Maybe Int
-> Maybe Int
-> Maybe Text
-> Maybe PaymentMethodFunding_source
-> Maybe PaymentMethodGateway_attributes
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe PaymentMethodObject
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> PaymentMethod)
-> Parser
(Maybe PaymentMethodAccount_type
-> Maybe Text
-> Maybe PaymentMethodCard_network_preference
-> Maybe PaymentMethodCard_type
-> Maybe Text
-> Maybe Int
-> Maybe Int
-> Maybe Text
-> Maybe PaymentMethodFunding_source
-> Maybe PaymentMethodGateway_attributes
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe PaymentMethodObject
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> PaymentMethod)
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
GHC.Base.pure Maybe PaymentMethodAccount_type
-> Maybe Text
-> Maybe PaymentMethodCard_network_preference
-> Maybe PaymentMethodCard_type
-> Maybe Text
-> Maybe Int
-> Maybe Int
-> Maybe Text
-> Maybe PaymentMethodFunding_source
-> Maybe PaymentMethodGateway_attributes
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe PaymentMethodObject
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> PaymentMethod
PaymentMethod Parser
(Maybe PaymentMethodAccount_type
-> Maybe Text
-> Maybe PaymentMethodCard_network_preference
-> Maybe PaymentMethodCard_type
-> Maybe Text
-> Maybe Int
-> Maybe Int
-> Maybe Text
-> Maybe PaymentMethodFunding_source
-> Maybe PaymentMethodGateway_attributes
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe PaymentMethodObject
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> PaymentMethod)
-> Parser (Maybe PaymentMethodAccount_type)
-> Parser
(Maybe Text
-> Maybe PaymentMethodCard_network_preference
-> Maybe PaymentMethodCard_type
-> Maybe Text
-> Maybe Int
-> Maybe Int
-> Maybe Text
-> Maybe PaymentMethodFunding_source
-> Maybe PaymentMethodGateway_attributes
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe PaymentMethodObject
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> PaymentMethod)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
GHC.Base.<*> (Object
obj Object -> Key -> Parser (Maybe PaymentMethodAccount_type)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data.Aeson.Types.FromJSON..:? Key
"account_type")) Parser
(Maybe Text
-> Maybe PaymentMethodCard_network_preference
-> Maybe PaymentMethodCard_type
-> Maybe Text
-> Maybe Int
-> Maybe Int
-> Maybe Text
-> Maybe PaymentMethodFunding_source
-> Maybe PaymentMethodGateway_attributes
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe PaymentMethodObject
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> PaymentMethod)
-> Parser (Maybe Text)
-> Parser
(Maybe PaymentMethodCard_network_preference
-> Maybe PaymentMethodCard_type
-> Maybe Text
-> Maybe Int
-> Maybe Int
-> Maybe Text
-> Maybe PaymentMethodFunding_source
-> Maybe PaymentMethodGateway_attributes
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe PaymentMethodObject
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> PaymentMethod)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
GHC.Base.<*> (Object
obj Object -> Key -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data.Aeson.Types.FromJSON..:? Key
"billing_agreement_id")) Parser
(Maybe PaymentMethodCard_network_preference
-> Maybe PaymentMethodCard_type
-> Maybe Text
-> Maybe Int
-> Maybe Int
-> Maybe Text
-> Maybe PaymentMethodFunding_source
-> Maybe PaymentMethodGateway_attributes
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe PaymentMethodObject
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> PaymentMethod)
-> Parser (Maybe PaymentMethodCard_network_preference)
-> Parser
(Maybe PaymentMethodCard_type
-> Maybe Text
-> Maybe Int
-> Maybe Int
-> Maybe Text
-> Maybe PaymentMethodFunding_source
-> Maybe PaymentMethodGateway_attributes
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe PaymentMethodObject
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> PaymentMethod)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
GHC.Base.<*> (Object
obj Object
-> Key -> Parser (Maybe PaymentMethodCard_network_preference)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data.Aeson.Types.FromJSON..:? Key
"card_network_preference")) Parser
(Maybe PaymentMethodCard_type
-> Maybe Text
-> Maybe Int
-> Maybe Int
-> Maybe Text
-> Maybe PaymentMethodFunding_source
-> Maybe PaymentMethodGateway_attributes
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe PaymentMethodObject
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> PaymentMethod)
-> Parser (Maybe PaymentMethodCard_type)
-> Parser
(Maybe Text
-> Maybe Int
-> Maybe Int
-> Maybe Text
-> Maybe PaymentMethodFunding_source
-> Maybe PaymentMethodGateway_attributes
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe PaymentMethodObject
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> PaymentMethod)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
GHC.Base.<*> (Object
obj Object -> Key -> Parser (Maybe PaymentMethodCard_type)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data.Aeson.Types.FromJSON..:? Key
"card_type")) Parser
(Maybe Text
-> Maybe Int
-> Maybe Int
-> Maybe Text
-> Maybe PaymentMethodFunding_source
-> Maybe PaymentMethodGateway_attributes
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe PaymentMethodObject
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> PaymentMethod)
-> Parser (Maybe Text)
-> Parser
(Maybe Int
-> Maybe Int
-> Maybe Text
-> Maybe PaymentMethodFunding_source
-> Maybe PaymentMethodGateway_attributes
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe PaymentMethodObject
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> PaymentMethod)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
GHC.Base.<*> (Object
obj Object -> Key -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data.Aeson.Types.FromJSON..:? Key
"cc_bin_country")) Parser
(Maybe Int
-> Maybe Int
-> Maybe Text
-> Maybe PaymentMethodFunding_source
-> Maybe PaymentMethodGateway_attributes
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe PaymentMethodObject
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> PaymentMethod)
-> Parser (Maybe Int)
-> Parser
(Maybe Int
-> Maybe Text
-> Maybe PaymentMethodFunding_source
-> Maybe PaymentMethodGateway_attributes
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe PaymentMethodObject
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> PaymentMethod)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
GHC.Base.<*> (Object
obj Object -> Key -> Parser (Maybe Int)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data.Aeson.Types.FromJSON..:? Key
"exp_month")) Parser
(Maybe Int
-> Maybe Text
-> Maybe PaymentMethodFunding_source
-> Maybe PaymentMethodGateway_attributes
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe PaymentMethodObject
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> PaymentMethod)
-> Parser (Maybe Int)
-> Parser
(Maybe Text
-> Maybe PaymentMethodFunding_source
-> Maybe PaymentMethodGateway_attributes
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe PaymentMethodObject
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> PaymentMethod)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
GHC.Base.<*> (Object
obj Object -> Key -> Parser (Maybe Int)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data.Aeson.Types.FromJSON..:? Key
"exp_year")) Parser
(Maybe Text
-> Maybe PaymentMethodFunding_source
-> Maybe PaymentMethodGateway_attributes
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe PaymentMethodObject
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> PaymentMethod)
-> Parser (Maybe Text)
-> Parser
(Maybe PaymentMethodFunding_source
-> Maybe PaymentMethodGateway_attributes
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe PaymentMethodObject
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> PaymentMethod)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
GHC.Base.<*> (Object
obj Object -> Key -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data.Aeson.Types.FromJSON..:? Key
"first_six")) Parser
(Maybe PaymentMethodFunding_source
-> Maybe PaymentMethodGateway_attributes
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe PaymentMethodObject
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> PaymentMethod)
-> Parser (Maybe PaymentMethodFunding_source)
-> Parser
(Maybe PaymentMethodGateway_attributes
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe PaymentMethodObject
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> PaymentMethod)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
GHC.Base.<*> (Object
obj Object -> Key -> Parser (Maybe PaymentMethodFunding_source)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data.Aeson.Types.FromJSON..:? Key
"funding_source")) Parser
(Maybe PaymentMethodGateway_attributes
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe PaymentMethodObject
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> PaymentMethod)
-> Parser (Maybe PaymentMethodGateway_attributes)
-> Parser
(Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe PaymentMethodObject
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> PaymentMethod)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
GHC.Base.<*> (Object
obj Object -> Key -> Parser (Maybe PaymentMethodGateway_attributes)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data.Aeson.Types.FromJSON..:? Key
"gateway_attributes")) Parser
(Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe PaymentMethodObject
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> PaymentMethod)
-> Parser (Maybe Text)
-> Parser
(Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe PaymentMethodObject
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> PaymentMethod)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
GHC.Base.<*> (Object
obj Object -> Key -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data.Aeson.Types.FromJSON..:? Key
"gateway_code")) Parser
(Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe PaymentMethodObject
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> PaymentMethod)
-> Parser (Maybe Text)
-> Parser
(Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe PaymentMethodObject
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> PaymentMethod)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
GHC.Base.<*> (Object
obj Object -> Key -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data.Aeson.Types.FromJSON..:? Key
"gateway_token")) Parser
(Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe PaymentMethodObject
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> PaymentMethod)
-> Parser (Maybe Text)
-> Parser
(Maybe Text
-> Maybe Text
-> Maybe PaymentMethodObject
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> PaymentMethod)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
GHC.Base.<*> (Object
obj Object -> Key -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data.Aeson.Types.FromJSON..:? Key
"last_four")) Parser
(Maybe Text
-> Maybe Text
-> Maybe PaymentMethodObject
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> PaymentMethod)
-> Parser (Maybe Text)
-> Parser
(Maybe Text
-> Maybe PaymentMethodObject
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> PaymentMethod)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
GHC.Base.<*> (Object
obj Object -> Key -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data.Aeson.Types.FromJSON..:? Key
"last_two")) Parser
(Maybe Text
-> Maybe PaymentMethodObject
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> PaymentMethod)
-> Parser (Maybe Text)
-> Parser
(Maybe PaymentMethodObject
-> Maybe Text -> Maybe Text -> Maybe Text -> PaymentMethod)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
GHC.Base.<*> (Object
obj Object -> Key -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data.Aeson.Types.FromJSON..:? Key
"name_on_account")) Parser
(Maybe PaymentMethodObject
-> Maybe Text -> Maybe Text -> Maybe Text -> PaymentMethod)
-> Parser (Maybe PaymentMethodObject)
-> Parser (Maybe Text -> Maybe Text -> Maybe Text -> PaymentMethod)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
GHC.Base.<*> (Object
obj Object -> Key -> Parser (Maybe PaymentMethodObject)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data.Aeson.Types.FromJSON..:? Key
"object")) Parser (Maybe Text -> Maybe Text -> Maybe Text -> PaymentMethod)
-> Parser (Maybe Text)
-> Parser (Maybe Text -> Maybe Text -> PaymentMethod)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
GHC.Base.<*> (Object
obj Object -> Key -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data.Aeson.Types.FromJSON..:? Key
"routing_number")) Parser (Maybe Text -> Maybe Text -> PaymentMethod)
-> Parser (Maybe Text) -> Parser (Maybe Text -> PaymentMethod)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
GHC.Base.<*> (Object
obj Object -> Key -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data.Aeson.Types.FromJSON..:? Key
"routing_number_bank")) Parser (Maybe Text -> PaymentMethod)
-> Parser (Maybe Text) -> Parser PaymentMethod
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
GHC.Base.<*> (Object
obj Object -> Key -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data.Aeson.Types.FromJSON..:? Key
"username"))
mkPaymentMethod :: PaymentMethod
mkPaymentMethod :: PaymentMethod
mkPaymentMethod =
PaymentMethod
{ paymentMethodAccount_type :: Maybe PaymentMethodAccount_type
paymentMethodAccount_type = Maybe PaymentMethodAccount_type
forall a. Maybe a
GHC.Maybe.Nothing
, paymentMethodBilling_agreement_id :: Maybe Text
paymentMethodBilling_agreement_id = Maybe Text
forall a. Maybe a
GHC.Maybe.Nothing
, paymentMethodCard_network_preference :: Maybe PaymentMethodCard_network_preference
paymentMethodCard_network_preference = Maybe PaymentMethodCard_network_preference
forall a. Maybe a
GHC.Maybe.Nothing
, paymentMethodCard_type :: Maybe PaymentMethodCard_type
paymentMethodCard_type = Maybe PaymentMethodCard_type
forall a. Maybe a
GHC.Maybe.Nothing
, paymentMethodCc_bin_country :: Maybe Text
paymentMethodCc_bin_country = Maybe Text
forall a. Maybe a
GHC.Maybe.Nothing
, paymentMethodExp_month :: Maybe Int
paymentMethodExp_month = Maybe Int
forall a. Maybe a
GHC.Maybe.Nothing
, paymentMethodExp_year :: Maybe Int
paymentMethodExp_year = Maybe Int
forall a. Maybe a
GHC.Maybe.Nothing
, paymentMethodFirst_six :: Maybe Text
paymentMethodFirst_six = Maybe Text
forall a. Maybe a
GHC.Maybe.Nothing
, paymentMethodFunding_source :: Maybe PaymentMethodFunding_source
paymentMethodFunding_source = Maybe PaymentMethodFunding_source
forall a. Maybe a
GHC.Maybe.Nothing
, paymentMethodGateway_attributes :: Maybe PaymentMethodGateway_attributes
paymentMethodGateway_attributes = Maybe PaymentMethodGateway_attributes
forall a. Maybe a
GHC.Maybe.Nothing
, paymentMethodGateway_code :: Maybe Text
paymentMethodGateway_code = Maybe Text
forall a. Maybe a
GHC.Maybe.Nothing
, paymentMethodGateway_token :: Maybe Text
paymentMethodGateway_token = Maybe Text
forall a. Maybe a
GHC.Maybe.Nothing
, paymentMethodLast_four :: Maybe Text
paymentMethodLast_four = Maybe Text
forall a. Maybe a
GHC.Maybe.Nothing
, paymentMethodLast_two :: Maybe Text
paymentMethodLast_two = Maybe Text
forall a. Maybe a
GHC.Maybe.Nothing
, paymentMethodName_on_account :: Maybe Text
paymentMethodName_on_account = Maybe Text
forall a. Maybe a
GHC.Maybe.Nothing
, paymentMethodObject :: Maybe PaymentMethodObject
paymentMethodObject = Maybe PaymentMethodObject
forall a. Maybe a
GHC.Maybe.Nothing
, paymentMethodRouting_number :: Maybe Text
paymentMethodRouting_number = Maybe Text
forall a. Maybe a
GHC.Maybe.Nothing
, paymentMethodRouting_number_bank :: Maybe Text
paymentMethodRouting_number_bank = Maybe Text
forall a. Maybe a
GHC.Maybe.Nothing
, paymentMethodUsername :: Maybe Text
paymentMethodUsername = Maybe Text
forall a. Maybe a
GHC.Maybe.Nothing
}
data PaymentMethodAccount_type
=
PaymentMethodAccount_typeOther Data.Aeson.Types.Internal.Value
|
PaymentMethodAccount_typeTyped Data.Text.Internal.Text
|
PaymentMethodAccount_typeEnumChecking
|
PaymentMethodAccount_typeEnumSavings
deriving (Int -> PaymentMethodAccount_type -> ShowS
[PaymentMethodAccount_type] -> ShowS
PaymentMethodAccount_type -> String
(Int -> PaymentMethodAccount_type -> ShowS)
-> (PaymentMethodAccount_type -> String)
-> ([PaymentMethodAccount_type] -> ShowS)
-> Show PaymentMethodAccount_type
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> PaymentMethodAccount_type -> ShowS
showsPrec :: Int -> PaymentMethodAccount_type -> ShowS
$cshow :: PaymentMethodAccount_type -> String
show :: PaymentMethodAccount_type -> String
$cshowList :: [PaymentMethodAccount_type] -> ShowS
showList :: [PaymentMethodAccount_type] -> ShowS
GHC.Show.Show, PaymentMethodAccount_type -> PaymentMethodAccount_type -> Bool
(PaymentMethodAccount_type -> PaymentMethodAccount_type -> Bool)
-> (PaymentMethodAccount_type -> PaymentMethodAccount_type -> Bool)
-> Eq PaymentMethodAccount_type
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: PaymentMethodAccount_type -> PaymentMethodAccount_type -> Bool
== :: PaymentMethodAccount_type -> PaymentMethodAccount_type -> Bool
$c/= :: PaymentMethodAccount_type -> PaymentMethodAccount_type -> Bool
/= :: PaymentMethodAccount_type -> PaymentMethodAccount_type -> Bool
GHC.Classes.Eq)
instance Data.Aeson.Types.ToJSON.ToJSON PaymentMethodAccount_type where
toJSON :: PaymentMethodAccount_type -> Value
toJSON (PaymentMethodAccount_typeOther Value
val) = Value
val
toJSON (PaymentMethodAccount_typeTyped Text
val) = Text -> Value
forall a. ToJSON a => a -> Value
Data.Aeson.Types.ToJSON.toJSON Text
val
toJSON (PaymentMethodAccount_type
PaymentMethodAccount_typeEnumChecking) = Value
"checking"
toJSON (PaymentMethodAccount_type
PaymentMethodAccount_typeEnumSavings) = Value
"savings"
instance Data.Aeson.Types.FromJSON.FromJSON PaymentMethodAccount_type where
parseJSON :: Value -> Parser PaymentMethodAccount_type
parseJSON Value
val =
PaymentMethodAccount_type -> Parser PaymentMethodAccount_type
forall a. a -> Parser a
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" -> PaymentMethodAccount_type
PaymentMethodAccount_typeEnumChecking
| Value
val Value -> Value -> Bool
forall a. Eq a => a -> a -> Bool
GHC.Classes.== Value
"savings" -> PaymentMethodAccount_type
PaymentMethodAccount_typeEnumSavings
| Bool
GHC.Base.otherwise -> Value -> PaymentMethodAccount_type
PaymentMethodAccount_typeOther Value
val
)
data PaymentMethodCard_network_preference
=
PaymentMethodCard_network_preferenceOther Data.Aeson.Types.Internal.Value
|
PaymentMethodCard_network_preferenceTyped Data.Text.Internal.Text
|
PaymentMethodCard_network_preferenceEnumBancontact
|
PaymentMethodCard_network_preferenceEnumCartesBancaires
|
PaymentMethodCard_network_preferenceEnumDankort
|
PaymentMethodCard_network_preferenceEnumMasterCard
|
PaymentMethodCard_network_preferenceEnumVisa
deriving (Int -> PaymentMethodCard_network_preference -> ShowS
[PaymentMethodCard_network_preference] -> ShowS
PaymentMethodCard_network_preference -> String
(Int -> PaymentMethodCard_network_preference -> ShowS)
-> (PaymentMethodCard_network_preference -> String)
-> ([PaymentMethodCard_network_preference] -> ShowS)
-> Show PaymentMethodCard_network_preference
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> PaymentMethodCard_network_preference -> ShowS
showsPrec :: Int -> PaymentMethodCard_network_preference -> ShowS
$cshow :: PaymentMethodCard_network_preference -> String
show :: PaymentMethodCard_network_preference -> String
$cshowList :: [PaymentMethodCard_network_preference] -> ShowS
showList :: [PaymentMethodCard_network_preference] -> ShowS
GHC.Show.Show, PaymentMethodCard_network_preference
-> PaymentMethodCard_network_preference -> Bool
(PaymentMethodCard_network_preference
-> PaymentMethodCard_network_preference -> Bool)
-> (PaymentMethodCard_network_preference
-> PaymentMethodCard_network_preference -> Bool)
-> Eq PaymentMethodCard_network_preference
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: PaymentMethodCard_network_preference
-> PaymentMethodCard_network_preference -> Bool
== :: PaymentMethodCard_network_preference
-> PaymentMethodCard_network_preference -> Bool
$c/= :: PaymentMethodCard_network_preference
-> PaymentMethodCard_network_preference -> Bool
/= :: PaymentMethodCard_network_preference
-> PaymentMethodCard_network_preference -> Bool
GHC.Classes.Eq)
instance Data.Aeson.Types.ToJSON.ToJSON PaymentMethodCard_network_preference where
toJSON :: PaymentMethodCard_network_preference -> Value
toJSON (PaymentMethodCard_network_preferenceOther Value
val) = Value
val
toJSON (PaymentMethodCard_network_preferenceTyped Text
val) = Text -> Value
forall a. ToJSON a => a -> Value
Data.Aeson.Types.ToJSON.toJSON Text
val
toJSON (PaymentMethodCard_network_preference
PaymentMethodCard_network_preferenceEnumBancontact) = Value
"Bancontact"
toJSON (PaymentMethodCard_network_preference
PaymentMethodCard_network_preferenceEnumCartesBancaires) = Value
"CartesBancaires"
toJSON (PaymentMethodCard_network_preference
PaymentMethodCard_network_preferenceEnumDankort) = Value
"Dankort"
toJSON (PaymentMethodCard_network_preference
PaymentMethodCard_network_preferenceEnumMasterCard) = Value
"MasterCard"
toJSON (PaymentMethodCard_network_preference
PaymentMethodCard_network_preferenceEnumVisa) = Value
"Visa"
instance Data.Aeson.Types.FromJSON.FromJSON PaymentMethodCard_network_preference where
parseJSON :: Value -> Parser PaymentMethodCard_network_preference
parseJSON Value
val =
PaymentMethodCard_network_preference
-> Parser PaymentMethodCard_network_preference
forall a. a -> Parser a
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
"Bancontact" -> PaymentMethodCard_network_preference
PaymentMethodCard_network_preferenceEnumBancontact
| Value
val Value -> Value -> Bool
forall a. Eq a => a -> a -> Bool
GHC.Classes.== Value
"CartesBancaires" -> PaymentMethodCard_network_preference
PaymentMethodCard_network_preferenceEnumCartesBancaires
| Value
val Value -> Value -> Bool
forall a. Eq a => a -> a -> Bool
GHC.Classes.== Value
"Dankort" -> PaymentMethodCard_network_preference
PaymentMethodCard_network_preferenceEnumDankort
| Value
val Value -> Value -> Bool
forall a. Eq a => a -> a -> Bool
GHC.Classes.== Value
"MasterCard" -> PaymentMethodCard_network_preference
PaymentMethodCard_network_preferenceEnumMasterCard
| Value
val Value -> Value -> Bool
forall a. Eq a => a -> a -> Bool
GHC.Classes.== Value
"Visa" -> PaymentMethodCard_network_preference
PaymentMethodCard_network_preferenceEnumVisa
| Bool
GHC.Base.otherwise -> Value -> PaymentMethodCard_network_preference
PaymentMethodCard_network_preferenceOther Value
val
)
data PaymentMethodCard_type
=
PaymentMethodCard_typeOther Data.Aeson.Types.Internal.Value
|
PaymentMethodCard_typeTyped Data.Text.Internal.Text
|
PaymentMethodCard_typeEnumAmerican_Express
|
PaymentMethodCard_typeEnumDankort
|
PaymentMethodCard_typeEnumDiners_Club
|
PaymentMethodCard_typeEnumDiscover
|
PaymentMethodCard_typeEnumELO
|
PaymentMethodCard_typeEnumForbrugsforeningen
|
PaymentMethodCard_typeEnumHipercard
|
PaymentMethodCard_typeEnumJCB
|
PaymentMethodCard_typeEnumLaser
|
PaymentMethodCard_typeEnumMaestro
|
PaymentMethodCard_typeEnumMasterCard
|
PaymentMethodCard_typeEnumTest_Card
|
PaymentMethodCard_typeEnumUnion_Pay
|
PaymentMethodCard_typeEnumUnknown
|
PaymentMethodCard_typeEnumVisa
|
PaymentMethodCard_typeEnumTarjeta_Naranja
deriving (Int -> PaymentMethodCard_type -> ShowS
[PaymentMethodCard_type] -> ShowS
PaymentMethodCard_type -> String
(Int -> PaymentMethodCard_type -> ShowS)
-> (PaymentMethodCard_type -> String)
-> ([PaymentMethodCard_type] -> ShowS)
-> Show PaymentMethodCard_type
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> PaymentMethodCard_type -> ShowS
showsPrec :: Int -> PaymentMethodCard_type -> ShowS
$cshow :: PaymentMethodCard_type -> String
show :: PaymentMethodCard_type -> String
$cshowList :: [PaymentMethodCard_type] -> ShowS
showList :: [PaymentMethodCard_type] -> ShowS
GHC.Show.Show, PaymentMethodCard_type -> PaymentMethodCard_type -> Bool
(PaymentMethodCard_type -> PaymentMethodCard_type -> Bool)
-> (PaymentMethodCard_type -> PaymentMethodCard_type -> Bool)
-> Eq PaymentMethodCard_type
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: PaymentMethodCard_type -> PaymentMethodCard_type -> Bool
== :: PaymentMethodCard_type -> PaymentMethodCard_type -> Bool
$c/= :: PaymentMethodCard_type -> PaymentMethodCard_type -> Bool
/= :: PaymentMethodCard_type -> PaymentMethodCard_type -> Bool
GHC.Classes.Eq)
instance Data.Aeson.Types.ToJSON.ToJSON PaymentMethodCard_type where
toJSON :: PaymentMethodCard_type -> Value
toJSON (PaymentMethodCard_typeOther Value
val) = Value
val
toJSON (PaymentMethodCard_typeTyped Text
val) = Text -> Value
forall a. ToJSON a => a -> Value
Data.Aeson.Types.ToJSON.toJSON Text
val
toJSON (PaymentMethodCard_type
PaymentMethodCard_typeEnumAmerican_Express) = Value
"American Express"
toJSON (PaymentMethodCard_type
PaymentMethodCard_typeEnumDankort) = Value
"Dankort"
toJSON (PaymentMethodCard_type
PaymentMethodCard_typeEnumDiners_Club) = Value
"Diners Club"
toJSON (PaymentMethodCard_type
PaymentMethodCard_typeEnumDiscover) = Value
"Discover"
toJSON (PaymentMethodCard_type
PaymentMethodCard_typeEnumELO) = Value
"ELO"
toJSON (PaymentMethodCard_type
PaymentMethodCard_typeEnumForbrugsforeningen) = Value
"Forbrugsforeningen"
toJSON (PaymentMethodCard_type
PaymentMethodCard_typeEnumHipercard) = Value
"Hipercard"
toJSON (PaymentMethodCard_type
PaymentMethodCard_typeEnumJCB) = Value
"JCB"
toJSON (PaymentMethodCard_type
PaymentMethodCard_typeEnumLaser) = Value
"Laser"
toJSON (PaymentMethodCard_type
PaymentMethodCard_typeEnumMaestro) = Value
"Maestro"
toJSON (PaymentMethodCard_type
PaymentMethodCard_typeEnumMasterCard) = Value
"MasterCard"
toJSON (PaymentMethodCard_type
PaymentMethodCard_typeEnumTest_Card) = Value
"Test Card"
toJSON (PaymentMethodCard_type
PaymentMethodCard_typeEnumUnion_Pay) = Value
"Union Pay"
toJSON (PaymentMethodCard_type
PaymentMethodCard_typeEnumUnknown) = Value
"Unknown"
toJSON (PaymentMethodCard_type
PaymentMethodCard_typeEnumVisa) = Value
"Visa"
toJSON (PaymentMethodCard_type
PaymentMethodCard_typeEnumTarjeta_Naranja) = Value
"Tarjeta Naranja"
instance Data.Aeson.Types.FromJSON.FromJSON PaymentMethodCard_type where
parseJSON :: Value -> Parser PaymentMethodCard_type
parseJSON Value
val =
PaymentMethodCard_type -> Parser PaymentMethodCard_type
forall a. a -> Parser a
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
"American Express" -> PaymentMethodCard_type
PaymentMethodCard_typeEnumAmerican_Express
| Value
val Value -> Value -> Bool
forall a. Eq a => a -> a -> Bool
GHC.Classes.== Value
"Dankort" -> PaymentMethodCard_type
PaymentMethodCard_typeEnumDankort
| Value
val Value -> Value -> Bool
forall a. Eq a => a -> a -> Bool
GHC.Classes.== Value
"Diners Club" -> PaymentMethodCard_type
PaymentMethodCard_typeEnumDiners_Club
| Value
val Value -> Value -> Bool
forall a. Eq a => a -> a -> Bool
GHC.Classes.== Value
"Discover" -> PaymentMethodCard_type
PaymentMethodCard_typeEnumDiscover
| Value
val Value -> Value -> Bool
forall a. Eq a => a -> a -> Bool
GHC.Classes.== Value
"ELO" -> PaymentMethodCard_type
PaymentMethodCard_typeEnumELO
| Value
val Value -> Value -> Bool
forall a. Eq a => a -> a -> Bool
GHC.Classes.== Value
"Forbrugsforeningen" -> PaymentMethodCard_type
PaymentMethodCard_typeEnumForbrugsforeningen
| Value
val Value -> Value -> Bool
forall a. Eq a => a -> a -> Bool
GHC.Classes.== Value
"Hipercard" -> PaymentMethodCard_type
PaymentMethodCard_typeEnumHipercard
| Value
val Value -> Value -> Bool
forall a. Eq a => a -> a -> Bool
GHC.Classes.== Value
"JCB" -> PaymentMethodCard_type
PaymentMethodCard_typeEnumJCB
| Value
val Value -> Value -> Bool
forall a. Eq a => a -> a -> Bool
GHC.Classes.== Value
"Laser" -> PaymentMethodCard_type
PaymentMethodCard_typeEnumLaser
| Value
val Value -> Value -> Bool
forall a. Eq a => a -> a -> Bool
GHC.Classes.== Value
"Maestro" -> PaymentMethodCard_type
PaymentMethodCard_typeEnumMaestro
| Value
val Value -> Value -> Bool
forall a. Eq a => a -> a -> Bool
GHC.Classes.== Value
"MasterCard" -> PaymentMethodCard_type
PaymentMethodCard_typeEnumMasterCard
| Value
val Value -> Value -> Bool
forall a. Eq a => a -> a -> Bool
GHC.Classes.== Value
"Test Card" -> PaymentMethodCard_type
PaymentMethodCard_typeEnumTest_Card
| Value
val Value -> Value -> Bool
forall a. Eq a => a -> a -> Bool
GHC.Classes.== Value
"Union Pay" -> PaymentMethodCard_type
PaymentMethodCard_typeEnumUnion_Pay
| Value
val Value -> Value -> Bool
forall a. Eq a => a -> a -> Bool
GHC.Classes.== Value
"Unknown" -> PaymentMethodCard_type
PaymentMethodCard_typeEnumUnknown
| Value
val Value -> Value -> Bool
forall a. Eq a => a -> a -> Bool
GHC.Classes.== Value
"Visa" -> PaymentMethodCard_type
PaymentMethodCard_typeEnumVisa
| Value
val Value -> Value -> Bool
forall a. Eq a => a -> a -> Bool
GHC.Classes.== Value
"Tarjeta Naranja" -> PaymentMethodCard_type
PaymentMethodCard_typeEnumTarjeta_Naranja
| Bool
GHC.Base.otherwise -> Value -> PaymentMethodCard_type
PaymentMethodCard_typeOther Value
val
)
data PaymentMethodFunding_source
=
PaymentMethodFunding_sourceOther Data.Aeson.Types.Internal.Value
|
PaymentMethodFunding_sourceTyped Data.Text.Internal.Text
|
PaymentMethodFunding_sourceEnumCredit
|
PaymentMethodFunding_sourceEnumDebit
|
PaymentMethodFunding_sourceEnumCharge
|
PaymentMethodFunding_sourceEnumPrepaid
|
PaymentMethodFunding_sourceEnumDeferred_debit
deriving (Int -> PaymentMethodFunding_source -> ShowS
[PaymentMethodFunding_source] -> ShowS
PaymentMethodFunding_source -> String
(Int -> PaymentMethodFunding_source -> ShowS)
-> (PaymentMethodFunding_source -> String)
-> ([PaymentMethodFunding_source] -> ShowS)
-> Show PaymentMethodFunding_source
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> PaymentMethodFunding_source -> ShowS
showsPrec :: Int -> PaymentMethodFunding_source -> ShowS
$cshow :: PaymentMethodFunding_source -> String
show :: PaymentMethodFunding_source -> String
$cshowList :: [PaymentMethodFunding_source] -> ShowS
showList :: [PaymentMethodFunding_source] -> ShowS
GHC.Show.Show, PaymentMethodFunding_source -> PaymentMethodFunding_source -> Bool
(PaymentMethodFunding_source
-> PaymentMethodFunding_source -> Bool)
-> (PaymentMethodFunding_source
-> PaymentMethodFunding_source -> Bool)
-> Eq PaymentMethodFunding_source
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: PaymentMethodFunding_source -> PaymentMethodFunding_source -> Bool
== :: PaymentMethodFunding_source -> PaymentMethodFunding_source -> Bool
$c/= :: PaymentMethodFunding_source -> PaymentMethodFunding_source -> Bool
/= :: PaymentMethodFunding_source -> PaymentMethodFunding_source -> Bool
GHC.Classes.Eq)
instance Data.Aeson.Types.ToJSON.ToJSON PaymentMethodFunding_source where
toJSON :: PaymentMethodFunding_source -> Value
toJSON (PaymentMethodFunding_sourceOther Value
val) = Value
val
toJSON (PaymentMethodFunding_sourceTyped Text
val) = Text -> Value
forall a. ToJSON a => a -> Value
Data.Aeson.Types.ToJSON.toJSON Text
val
toJSON (PaymentMethodFunding_source
PaymentMethodFunding_sourceEnumCredit) = Value
"credit"
toJSON (PaymentMethodFunding_source
PaymentMethodFunding_sourceEnumDebit) = Value
"debit"
toJSON (PaymentMethodFunding_source
PaymentMethodFunding_sourceEnumCharge) = Value
"charge"
toJSON (PaymentMethodFunding_source
PaymentMethodFunding_sourceEnumPrepaid) = Value
"prepaid"
toJSON (PaymentMethodFunding_source
PaymentMethodFunding_sourceEnumDeferred_debit) = Value
"deferred_debit"
instance Data.Aeson.Types.FromJSON.FromJSON PaymentMethodFunding_source where
parseJSON :: Value -> Parser PaymentMethodFunding_source
parseJSON Value
val =
PaymentMethodFunding_source -> Parser PaymentMethodFunding_source
forall a. a -> Parser a
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
"credit" -> PaymentMethodFunding_source
PaymentMethodFunding_sourceEnumCredit
| Value
val Value -> Value -> Bool
forall a. Eq a => a -> a -> Bool
GHC.Classes.== Value
"debit" -> PaymentMethodFunding_source
PaymentMethodFunding_sourceEnumDebit
| Value
val Value -> Value -> Bool
forall a. Eq a => a -> a -> Bool
GHC.Classes.== Value
"charge" -> PaymentMethodFunding_source
PaymentMethodFunding_sourceEnumCharge
| Value
val Value -> Value -> Bool
forall a. Eq a => a -> a -> Bool
GHC.Classes.== Value
"prepaid" -> PaymentMethodFunding_source
PaymentMethodFunding_sourceEnumPrepaid
| Value
val Value -> Value -> Bool
forall a. Eq a => a -> a -> Bool
GHC.Classes.== Value
"deferred_debit" -> PaymentMethodFunding_source
PaymentMethodFunding_sourceEnumDeferred_debit
| Bool
GHC.Base.otherwise -> Value -> PaymentMethodFunding_source
PaymentMethodFunding_sourceOther Value
val
)
data PaymentMethodGateway_attributes = PaymentMethodGateway_attributes
{ PaymentMethodGateway_attributes -> Maybe Text
paymentMethodGateway_attributesAccount_reference :: (GHC.Maybe.Maybe Data.Text.Internal.Text)
}
deriving
( Int -> PaymentMethodGateway_attributes -> ShowS
[PaymentMethodGateway_attributes] -> ShowS
PaymentMethodGateway_attributes -> String
(Int -> PaymentMethodGateway_attributes -> ShowS)
-> (PaymentMethodGateway_attributes -> String)
-> ([PaymentMethodGateway_attributes] -> ShowS)
-> Show PaymentMethodGateway_attributes
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> PaymentMethodGateway_attributes -> ShowS
showsPrec :: Int -> PaymentMethodGateway_attributes -> ShowS
$cshow :: PaymentMethodGateway_attributes -> String
show :: PaymentMethodGateway_attributes -> String
$cshowList :: [PaymentMethodGateway_attributes] -> ShowS
showList :: [PaymentMethodGateway_attributes] -> ShowS
GHC.Show.Show
, PaymentMethodGateway_attributes
-> PaymentMethodGateway_attributes -> Bool
(PaymentMethodGateway_attributes
-> PaymentMethodGateway_attributes -> Bool)
-> (PaymentMethodGateway_attributes
-> PaymentMethodGateway_attributes -> Bool)
-> Eq PaymentMethodGateway_attributes
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: PaymentMethodGateway_attributes
-> PaymentMethodGateway_attributes -> Bool
== :: PaymentMethodGateway_attributes
-> PaymentMethodGateway_attributes -> Bool
$c/= :: PaymentMethodGateway_attributes
-> PaymentMethodGateway_attributes -> Bool
/= :: PaymentMethodGateway_attributes
-> PaymentMethodGateway_attributes -> Bool
GHC.Classes.Eq
)
instance Data.Aeson.Types.ToJSON.ToJSON PaymentMethodGateway_attributes where
toJSON :: PaymentMethodGateway_attributes -> Value
toJSON PaymentMethodGateway_attributes
obj = [Pair] -> Value
Data.Aeson.Types.Internal.object ([[Pair]] -> [Pair]
forall (t :: * -> *) a. Foldable t => t [a] -> [a]
Data.Foldable.concat ([Pair] -> (Text -> [Pair]) -> Maybe Text -> [Pair]
forall b a. b -> (a -> b) -> Maybe a -> b
Data.Maybe.maybe [Pair]
forall a. Monoid a => a
GHC.Base.mempty (Pair -> [Pair]
forall a. a -> [a]
forall (f :: * -> *) a. Applicative f => a -> f a
GHC.Base.pure (Pair -> [Pair]) -> (Text -> Pair) -> Text -> [Pair]
forall b c a. (b -> c) -> (a -> b) -> a -> c
GHC.Base.. (Key
"account_reference" Key -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
Data.Aeson.Types.ToJSON..=)) (PaymentMethodGateway_attributes -> Maybe Text
paymentMethodGateway_attributesAccount_reference PaymentMethodGateway_attributes
obj) [Pair] -> [[Pair]] -> [[Pair]]
forall a. a -> [a] -> [a]
: [[Pair]]
forall a. Monoid a => a
GHC.Base.mempty))
toEncoding :: PaymentMethodGateway_attributes -> Encoding
toEncoding PaymentMethodGateway_attributes
obj = Series -> Encoding
Data.Aeson.Encoding.Internal.pairs ([Series] -> Series
forall a. Monoid a => [a] -> a
GHC.Base.mconcat ([[Series]] -> [Series]
forall (t :: * -> *) a. Foldable t => t [a] -> [a]
Data.Foldable.concat ([Series] -> (Text -> [Series]) -> Maybe Text -> [Series]
forall b a. b -> (a -> b) -> Maybe a -> b
Data.Maybe.maybe [Series]
forall a. Monoid a => a
GHC.Base.mempty (Series -> [Series]
forall a. a -> [a]
forall (f :: * -> *) a. Applicative f => a -> f a
GHC.Base.pure (Series -> [Series]) -> (Text -> Series) -> Text -> [Series]
forall b c a. (b -> c) -> (a -> b) -> a -> c
GHC.Base.. (Key
"account_reference" Key -> Text -> Series
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Series
Data.Aeson.Types.ToJSON..=)) (PaymentMethodGateway_attributes -> Maybe Text
paymentMethodGateway_attributesAccount_reference PaymentMethodGateway_attributes
obj) [Series] -> [[Series]] -> [[Series]]
forall a. a -> [a] -> [a]
: [[Series]]
forall a. Monoid a => a
GHC.Base.mempty)))
instance Data.Aeson.Types.FromJSON.FromJSON PaymentMethodGateway_attributes where
parseJSON :: Value -> Parser PaymentMethodGateway_attributes
parseJSON = String
-> (Object -> Parser PaymentMethodGateway_attributes)
-> Value
-> Parser PaymentMethodGateway_attributes
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.Aeson.Types.FromJSON.withObject String
"PaymentMethodGateway_attributes" (\Object
obj -> (Maybe Text -> PaymentMethodGateway_attributes)
-> Parser (Maybe Text -> PaymentMethodGateway_attributes)
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
GHC.Base.pure Maybe Text -> PaymentMethodGateway_attributes
PaymentMethodGateway_attributes Parser (Maybe Text -> PaymentMethodGateway_attributes)
-> Parser (Maybe Text) -> Parser PaymentMethodGateway_attributes
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
GHC.Base.<*> (Object
obj Object -> Key -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data.Aeson.Types.FromJSON..:? Key
"account_reference"))
mkPaymentMethodGateway_attributes :: PaymentMethodGateway_attributes
mkPaymentMethodGateway_attributes :: PaymentMethodGateway_attributes
mkPaymentMethodGateway_attributes = PaymentMethodGateway_attributes{paymentMethodGateway_attributesAccount_reference :: Maybe Text
paymentMethodGateway_attributesAccount_reference = Maybe Text
forall a. Maybe a
GHC.Maybe.Nothing}
data PaymentMethodObject
=
PaymentMethodObjectOther Data.Aeson.Types.Internal.Value
|
PaymentMethodObjectTyped Data.Text.Internal.Text
|
PaymentMethodObjectEnumBacs
|
PaymentMethodObjectEnumAmazon
|
PaymentMethodObjectEnumAmazon_billing_agreement
|
PaymentMethodObjectEnumApple_pay
|
PaymentMethodObjectEnumBank_account_info
|
PaymentMethodObjectEnumBraintree_apple_pay
|
PaymentMethodObjectEnumCheck
|
PaymentMethodObjectEnumCredit_card
|
PaymentMethodObjectEnumEft
|
PaymentMethodObjectEnumGateway_token
|
PaymentMethodObjectEnumGoogle_pay
|
PaymentMethodObjectEnumIban_bank_account
|
PaymentMethodObjectEnumMoney_order
|
PaymentMethodObjectEnumOther
|
PaymentMethodObjectEnumPaypal
|
PaymentMethodObjectEnumPaypal_billing_agreement
|
PaymentMethodObjectEnumRoku
|
PaymentMethodObjectEnumSepadirectdebit
|
PaymentMethodObjectEnumVenmo
|
PaymentMethodObjectEnumWire_transfer
|
PaymentMethodObjectEnumBraintree_v_zero
|
PaymentMethodObjectEnumBoleto
|
PaymentMethodObjectEnumCash_app
deriving (Int -> PaymentMethodObject -> ShowS
[PaymentMethodObject] -> ShowS
PaymentMethodObject -> String
(Int -> PaymentMethodObject -> ShowS)
-> (PaymentMethodObject -> String)
-> ([PaymentMethodObject] -> ShowS)
-> Show PaymentMethodObject
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> PaymentMethodObject -> ShowS
showsPrec :: Int -> PaymentMethodObject -> ShowS
$cshow :: PaymentMethodObject -> String
show :: PaymentMethodObject -> String
$cshowList :: [PaymentMethodObject] -> ShowS
showList :: [PaymentMethodObject] -> ShowS
GHC.Show.Show, PaymentMethodObject -> PaymentMethodObject -> Bool
(PaymentMethodObject -> PaymentMethodObject -> Bool)
-> (PaymentMethodObject -> PaymentMethodObject -> Bool)
-> Eq PaymentMethodObject
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: PaymentMethodObject -> PaymentMethodObject -> Bool
== :: PaymentMethodObject -> PaymentMethodObject -> Bool
$c/= :: PaymentMethodObject -> PaymentMethodObject -> Bool
/= :: PaymentMethodObject -> PaymentMethodObject -> Bool
GHC.Classes.Eq)
instance Data.Aeson.Types.ToJSON.ToJSON PaymentMethodObject where
toJSON :: PaymentMethodObject -> Value
toJSON (PaymentMethodObjectOther Value
val) = Value
val
toJSON (PaymentMethodObjectTyped Text
val) = Text -> Value
forall a. ToJSON a => a -> Value
Data.Aeson.Types.ToJSON.toJSON Text
val
toJSON (PaymentMethodObject
PaymentMethodObjectEnumBacs) = Value
"bacs"
toJSON (PaymentMethodObject
PaymentMethodObjectEnumAmazon) = Value
"amazon"
toJSON (PaymentMethodObject
PaymentMethodObjectEnumAmazon_billing_agreement) = Value
"amazon_billing_agreement"
toJSON (PaymentMethodObject
PaymentMethodObjectEnumApple_pay) = Value
"apple_pay"
toJSON (PaymentMethodObject
PaymentMethodObjectEnumBank_account_info) = Value
"bank_account_info"
toJSON (PaymentMethodObject
PaymentMethodObjectEnumBraintree_apple_pay) = Value
"braintree_apple_pay"
toJSON (PaymentMethodObject
PaymentMethodObjectEnumCheck) = Value
"check"
toJSON (PaymentMethodObject
PaymentMethodObjectEnumCredit_card) = Value
"credit_card"
toJSON (PaymentMethodObject
PaymentMethodObjectEnumEft) = Value
"eft"
toJSON (PaymentMethodObject
PaymentMethodObjectEnumGateway_token) = Value
"gateway_token"
toJSON (PaymentMethodObject
PaymentMethodObjectEnumGoogle_pay) = Value
"google_pay"
toJSON (PaymentMethodObject
PaymentMethodObjectEnumIban_bank_account) = Value
"iban_bank_account"
toJSON (PaymentMethodObject
PaymentMethodObjectEnumMoney_order) = Value
"money_order"
toJSON (PaymentMethodObject
PaymentMethodObjectEnumOther) = Value
"other"
toJSON (PaymentMethodObject
PaymentMethodObjectEnumPaypal) = Value
"paypal"
toJSON (PaymentMethodObject
PaymentMethodObjectEnumPaypal_billing_agreement) = Value
"paypal_billing_agreement"
toJSON (PaymentMethodObject
PaymentMethodObjectEnumRoku) = Value
"roku"
toJSON (PaymentMethodObject
PaymentMethodObjectEnumSepadirectdebit) = Value
"sepadirectdebit"
toJSON (PaymentMethodObject
PaymentMethodObjectEnumVenmo) = Value
"venmo"
toJSON (PaymentMethodObject
PaymentMethodObjectEnumWire_transfer) = Value
"wire_transfer"
toJSON (PaymentMethodObject
PaymentMethodObjectEnumBraintree_v_zero) = Value
"braintree_v_zero"
toJSON (PaymentMethodObject
PaymentMethodObjectEnumBoleto) = Value
"boleto"
toJSON (PaymentMethodObject
PaymentMethodObjectEnumCash_app) = Value
"cash_app"
instance Data.Aeson.Types.FromJSON.FromJSON PaymentMethodObject where
parseJSON :: Value -> Parser PaymentMethodObject
parseJSON Value
val =
PaymentMethodObject -> Parser PaymentMethodObject
forall a. a -> Parser a
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
"bacs" -> PaymentMethodObject
PaymentMethodObjectEnumBacs
| Value
val Value -> Value -> Bool
forall a. Eq a => a -> a -> Bool
GHC.Classes.== Value
"amazon" -> PaymentMethodObject
PaymentMethodObjectEnumAmazon
| Value
val Value -> Value -> Bool
forall a. Eq a => a -> a -> Bool
GHC.Classes.== Value
"amazon_billing_agreement" -> PaymentMethodObject
PaymentMethodObjectEnumAmazon_billing_agreement
| Value
val Value -> Value -> Bool
forall a. Eq a => a -> a -> Bool
GHC.Classes.== Value
"apple_pay" -> PaymentMethodObject
PaymentMethodObjectEnumApple_pay
| Value
val Value -> Value -> Bool
forall a. Eq a => a -> a -> Bool
GHC.Classes.== Value
"bank_account_info" -> PaymentMethodObject
PaymentMethodObjectEnumBank_account_info
| Value
val Value -> Value -> Bool
forall a. Eq a => a -> a -> Bool
GHC.Classes.== Value
"braintree_apple_pay" -> PaymentMethodObject
PaymentMethodObjectEnumBraintree_apple_pay
| Value
val Value -> Value -> Bool
forall a. Eq a => a -> a -> Bool
GHC.Classes.== Value
"check" -> PaymentMethodObject
PaymentMethodObjectEnumCheck
| Value
val Value -> Value -> Bool
forall a. Eq a => a -> a -> Bool
GHC.Classes.== Value
"credit_card" -> PaymentMethodObject
PaymentMethodObjectEnumCredit_card
| Value
val Value -> Value -> Bool
forall a. Eq a => a -> a -> Bool
GHC.Classes.== Value
"eft" -> PaymentMethodObject
PaymentMethodObjectEnumEft
| Value
val Value -> Value -> Bool
forall a. Eq a => a -> a -> Bool
GHC.Classes.== Value
"gateway_token" -> PaymentMethodObject
PaymentMethodObjectEnumGateway_token
| Value
val Value -> Value -> Bool
forall a. Eq a => a -> a -> Bool
GHC.Classes.== Value
"google_pay" -> PaymentMethodObject
PaymentMethodObjectEnumGoogle_pay
| Value
val Value -> Value -> Bool
forall a. Eq a => a -> a -> Bool
GHC.Classes.== Value
"iban_bank_account" -> PaymentMethodObject
PaymentMethodObjectEnumIban_bank_account
| Value
val Value -> Value -> Bool
forall a. Eq a => a -> a -> Bool
GHC.Classes.== Value
"money_order" -> PaymentMethodObject
PaymentMethodObjectEnumMoney_order
| Value
val Value -> Value -> Bool
forall a. Eq a => a -> a -> Bool
GHC.Classes.== Value
"other" -> PaymentMethodObject
PaymentMethodObjectEnumOther
| Value
val Value -> Value -> Bool
forall a. Eq a => a -> a -> Bool
GHC.Classes.== Value
"paypal" -> PaymentMethodObject
PaymentMethodObjectEnumPaypal
| Value
val Value -> Value -> Bool
forall a. Eq a => a -> a -> Bool
GHC.Classes.== Value
"paypal_billing_agreement" -> PaymentMethodObject
PaymentMethodObjectEnumPaypal_billing_agreement
| Value
val Value -> Value -> Bool
forall a. Eq a => a -> a -> Bool
GHC.Classes.== Value
"roku" -> PaymentMethodObject
PaymentMethodObjectEnumRoku
| Value
val Value -> Value -> Bool
forall a. Eq a => a -> a -> Bool
GHC.Classes.== Value
"sepadirectdebit" -> PaymentMethodObject
PaymentMethodObjectEnumSepadirectdebit
| Value
val Value -> Value -> Bool
forall a. Eq a => a -> a -> Bool
GHC.Classes.== Value
"venmo" -> PaymentMethodObject
PaymentMethodObjectEnumVenmo
| Value
val Value -> Value -> Bool
forall a. Eq a => a -> a -> Bool
GHC.Classes.== Value
"wire_transfer" -> PaymentMethodObject
PaymentMethodObjectEnumWire_transfer
| Value
val Value -> Value -> Bool
forall a. Eq a => a -> a -> Bool
GHC.Classes.== Value
"braintree_v_zero" -> PaymentMethodObject
PaymentMethodObjectEnumBraintree_v_zero
| Value
val Value -> Value -> Bool
forall a. Eq a => a -> a -> Bool
GHC.Classes.== Value
"boleto" -> PaymentMethodObject
PaymentMethodObjectEnumBoleto
| Value
val Value -> Value -> Bool
forall a. Eq a => a -> a -> Bool
GHC.Classes.== Value
"cash_app" -> PaymentMethodObject
PaymentMethodObjectEnumCash_app
| Bool
GHC.Base.otherwise -> Value -> PaymentMethodObject
PaymentMethodObjectOther Value
val
)