{-# 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 Charge module StripeAPI.Types.Charge 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.Account import {-# SOURCE #-} StripeAPI.Types.Address import {-# SOURCE #-} StripeAPI.Types.Application import {-# SOURCE #-} StripeAPI.Types.ApplicationFee import {-# SOURCE #-} StripeAPI.Types.BalanceTransaction import {-# SOURCE #-} StripeAPI.Types.BillingDetails import {-# SOURCE #-} StripeAPI.Types.ChargeFraudDetails import {-# SOURCE #-} StripeAPI.Types.ChargeOutcome import {-# SOURCE #-} StripeAPI.Types.ChargeTransferData import {-# SOURCE #-} StripeAPI.Types.Customer import {-# SOURCE #-} StripeAPI.Types.DeletedCustomer import {-# SOURCE #-} StripeAPI.Types.Invoice import {-# SOURCE #-} StripeAPI.Types.Order import {-# SOURCE #-} StripeAPI.Types.PaymentFlowsPrivatePaymentMethodsAlipayDetails import {-# SOURCE #-} StripeAPI.Types.PaymentIntent import {-# SOURCE #-} StripeAPI.Types.PaymentMethodDetails import {-# SOURCE #-} StripeAPI.Types.PaymentMethodDetailsAchCreditTransfer import {-# SOURCE #-} StripeAPI.Types.PaymentMethodDetailsAchDebit import {-# SOURCE #-} StripeAPI.Types.PaymentMethodDetailsAcssDebit import {-# SOURCE #-} StripeAPI.Types.PaymentMethodDetailsAfterpayClearpay import {-# SOURCE #-} StripeAPI.Types.PaymentMethodDetailsAuBecsDebit import {-# SOURCE #-} StripeAPI.Types.PaymentMethodDetailsBacsDebit import {-# SOURCE #-} StripeAPI.Types.PaymentMethodDetailsBancontact import {-# SOURCE #-} StripeAPI.Types.PaymentMethodDetailsBoleto import {-# SOURCE #-} StripeAPI.Types.PaymentMethodDetailsCard import {-# SOURCE #-} StripeAPI.Types.PaymentMethodDetailsCardPresent import {-# SOURCE #-} StripeAPI.Types.PaymentMethodDetailsEps import {-# SOURCE #-} StripeAPI.Types.PaymentMethodDetailsFpx import {-# SOURCE #-} StripeAPI.Types.PaymentMethodDetailsGiropay import {-# SOURCE #-} StripeAPI.Types.PaymentMethodDetailsGrabpay import {-# SOURCE #-} StripeAPI.Types.PaymentMethodDetailsIdeal import {-# SOURCE #-} StripeAPI.Types.PaymentMethodDetailsInteracPresent import {-# SOURCE #-} StripeAPI.Types.PaymentMethodDetailsMultibanco import {-# SOURCE #-} StripeAPI.Types.PaymentMethodDetailsOxxo import {-# SOURCE #-} StripeAPI.Types.PaymentMethodDetailsP24 import {-# SOURCE #-} StripeAPI.Types.PaymentMethodDetailsSepaDebit import {-# SOURCE #-} StripeAPI.Types.PaymentMethodDetailsSofort import {-# SOURCE #-} StripeAPI.Types.Refund import {-# SOURCE #-} StripeAPI.Types.Review import {-# SOURCE #-} StripeAPI.Types.Rule import {-# SOURCE #-} StripeAPI.Types.Shipping import {-# SOURCE #-} StripeAPI.Types.Transfer import qualified Prelude as GHC.Integer.Type import qualified Prelude as GHC.Maybe -- | Defines the object schema located at @components.schemas.charge@ in the specification. -- -- To charge a credit or a debit card, you create a \`Charge\` object. You can -- retrieve and refund individual charges as well as list all charges. Charges -- are identified by a unique, random ID. -- -- Related guide: [Accept a payment with the Charges API](https:\/\/stripe.com\/docs\/payments\/accept-a-payment-charges). data Charge = Charge { -- | amount: Amount intended to be collected by this payment. A positive integer representing how much to charge in the [smallest currency unit](https:\/\/stripe.com\/docs\/currencies\#zero-decimal) (e.g., 100 cents to charge \$1.00 or 100 to charge ¥100, a zero-decimal currency). The minimum amount is \$0.50 US or [equivalent in charge currency](https:\/\/stripe.com\/docs\/currencies\#minimum-and-maximum-charge-amounts). The amount value supports up to eight digits (e.g., a value of 99999999 for a USD charge of \$999,999.99). chargeAmount :: GHC.Types.Int, -- | amount_captured: Amount in %s captured (can be less than the amount attribute on the charge if a partial capture was made). chargeAmountCaptured :: GHC.Types.Int, -- | amount_refunded: Amount in %s refunded (can be less than the amount attribute on the charge if a partial refund was issued). chargeAmountRefunded :: GHC.Types.Int, -- | application: ID of the Connect application that created the charge. chargeApplication :: (GHC.Maybe.Maybe ChargeApplication'Variants), -- | application_fee: The application fee (if any) for the charge. [See the Connect documentation](https:\/\/stripe.com\/docs\/connect\/direct-charges\#collecting-fees) for details. chargeApplicationFee :: (GHC.Maybe.Maybe ChargeApplicationFee'Variants), -- | application_fee_amount: The amount of the application fee (if any) requested for the charge. [See the Connect documentation](https:\/\/stripe.com\/docs\/connect\/direct-charges\#collecting-fees) for details. chargeApplicationFeeAmount :: (GHC.Maybe.Maybe GHC.Types.Int), -- | balance_transaction: ID of the balance transaction that describes the impact of this charge on your account balance (not including refunds or disputes). chargeBalanceTransaction :: (GHC.Maybe.Maybe ChargeBalanceTransaction'Variants), -- | billing_details: chargeBillingDetails :: BillingDetails, -- | calculated_statement_descriptor: The full statement descriptor that is passed to card networks, and that is displayed on your customers\' credit card and bank statements. Allows you to see what the statement descriptor looks like after the static and dynamic portions are combined. -- -- Constraints: -- -- * Maximum length of 5000 chargeCalculatedStatementDescriptor :: (GHC.Maybe.Maybe Data.Text.Internal.Text), -- | captured: If the charge was created without capturing, this Boolean represents whether it is still uncaptured or has since been captured. chargeCaptured :: GHC.Types.Bool, -- | created: Time at which the object was created. Measured in seconds since the Unix epoch. chargeCreated :: GHC.Types.Int, -- | currency: Three-letter [ISO currency code](https:\/\/www.iso.org\/iso-4217-currency-codes.html), in lowercase. Must be a [supported currency](https:\/\/stripe.com\/docs\/currencies). chargeCurrency :: Data.Text.Internal.Text, -- | customer: ID of the customer this charge is for if one exists. chargeCustomer :: (GHC.Maybe.Maybe ChargeCustomer'Variants), -- | description: An arbitrary string attached to the object. Often useful for displaying to users. -- -- Constraints: -- -- * Maximum length of 40000 chargeDescription :: (GHC.Maybe.Maybe Data.Text.Internal.Text), -- | disputed: Whether the charge has been disputed. chargeDisputed :: GHC.Types.Bool, -- | failure_code: Error code explaining reason for charge failure if available (see [the errors section](https:\/\/stripe.com\/docs\/api\#errors) for a list of codes). -- -- Constraints: -- -- * Maximum length of 5000 chargeFailureCode :: (GHC.Maybe.Maybe Data.Text.Internal.Text), -- | failure_message: Message to user further explaining reason for charge failure if available. -- -- Constraints: -- -- * Maximum length of 5000 chargeFailureMessage :: (GHC.Maybe.Maybe Data.Text.Internal.Text), -- | fraud_details: Information on fraud assessments for the charge. chargeFraudDetails :: (GHC.Maybe.Maybe ChargeFraudDetails'), -- | id: Unique identifier for the object. -- -- Constraints: -- -- * Maximum length of 5000 chargeId :: Data.Text.Internal.Text, -- | invoice: ID of the invoice this charge is for if one exists. chargeInvoice :: (GHC.Maybe.Maybe ChargeInvoice'Variants), -- | livemode: Has the value \`true\` if the object exists in live mode or the value \`false\` if the object exists in test mode. chargeLivemode :: GHC.Types.Bool, -- | metadata: Set of [key-value pairs](https:\/\/stripe.com\/docs\/api\/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. chargeMetadata :: Data.Aeson.Types.Internal.Object, -- | on_behalf_of: The account (if any) the charge was made on behalf of without triggering an automatic transfer. See the [Connect documentation](https:\/\/stripe.com\/docs\/connect\/charges-transfers) for details. chargeOnBehalfOf :: (GHC.Maybe.Maybe ChargeOnBehalfOf'Variants), -- | order: ID of the order this charge is for if one exists. chargeOrder :: (GHC.Maybe.Maybe ChargeOrder'Variants), -- | outcome: Details about whether the payment was accepted, and why. See [understanding declines](https:\/\/stripe.com\/docs\/declines) for details. chargeOutcome :: (GHC.Maybe.Maybe ChargeOutcome'), -- | paid: \`true\` if the charge succeeded, or was successfully authorized for later capture. chargePaid :: GHC.Types.Bool, -- | payment_intent: ID of the PaymentIntent associated with this charge, if one exists. chargePaymentIntent :: (GHC.Maybe.Maybe ChargePaymentIntent'Variants), -- | payment_method: ID of the payment method used in this charge. -- -- Constraints: -- -- * Maximum length of 5000 chargePaymentMethod :: (GHC.Maybe.Maybe Data.Text.Internal.Text), -- | payment_method_details: Details about the payment method at the time of the transaction. chargePaymentMethodDetails :: (GHC.Maybe.Maybe ChargePaymentMethodDetails'), -- | receipt_email: This is the email address that the receipt for this charge was sent to. -- -- Constraints: -- -- * Maximum length of 5000 chargeReceiptEmail :: (GHC.Maybe.Maybe Data.Text.Internal.Text), -- | receipt_number: This is the transaction number that appears on email receipts sent for this charge. This attribute will be \`null\` until a receipt has been sent. -- -- Constraints: -- -- * Maximum length of 5000 chargeReceiptNumber :: (GHC.Maybe.Maybe Data.Text.Internal.Text), -- | receipt_url: This is the URL to view the receipt for this charge. The receipt is kept up-to-date to the latest state of the charge, including any refunds. If the charge is for an Invoice, the receipt will be stylized as an Invoice receipt. -- -- Constraints: -- -- * Maximum length of 5000 chargeReceiptUrl :: (GHC.Maybe.Maybe Data.Text.Internal.Text), -- | refunded: Whether the charge has been fully refunded. If the charge is only partially refunded, this attribute will still be false. chargeRefunded :: GHC.Types.Bool, -- | refunds: A list of refunds that have been applied to the charge. chargeRefunds :: ChargeRefunds', -- | review: ID of the review associated with this charge if one exists. chargeReview :: (GHC.Maybe.Maybe ChargeReview'Variants), -- | shipping: Shipping information for the charge. chargeShipping :: (GHC.Maybe.Maybe ChargeShipping'), -- | source_transfer: The transfer ID which created this charge. Only present if the charge came from another Stripe account. [See the Connect documentation](https:\/\/stripe.com\/docs\/connect\/destination-charges) for details. chargeSourceTransfer :: (GHC.Maybe.Maybe ChargeSourceTransfer'Variants), -- | statement_descriptor: For card charges, use \`statement_descriptor_suffix\` instead. Otherwise, you can use this value as the complete description of a charge on your customers’ statements. Must contain at least one letter, maximum 22 characters. -- -- Constraints: -- -- * Maximum length of 5000 chargeStatementDescriptor :: (GHC.Maybe.Maybe Data.Text.Internal.Text), -- | statement_descriptor_suffix: Provides information about the charge that customers see on their statements. Concatenated with the prefix (shortened descriptor) or statement descriptor that’s set on the account to form the complete statement descriptor. Maximum 22 characters for the concatenated descriptor. -- -- Constraints: -- -- * Maximum length of 5000 chargeStatementDescriptorSuffix :: (GHC.Maybe.Maybe Data.Text.Internal.Text), -- | status: The status of the payment is either \`succeeded\`, \`pending\`, or \`failed\`. -- -- Constraints: -- -- * Maximum length of 5000 chargeStatus :: Data.Text.Internal.Text, -- | transfer: ID of the transfer to the \`destination\` account (only applicable if the charge was created using the \`destination\` parameter). chargeTransfer :: (GHC.Maybe.Maybe ChargeTransfer'Variants), -- | transfer_data: An optional dictionary including the account to automatically transfer to as part of a destination charge. [See the Connect documentation](https:\/\/stripe.com\/docs\/connect\/destination-charges) for details. chargeTransferData :: (GHC.Maybe.Maybe ChargeTransferData'), -- | transfer_group: A string that identifies this transaction as part of a group. See the [Connect documentation](https:\/\/stripe.com\/docs\/connect\/charges-transfers\#transfer-options) for details. -- -- Constraints: -- -- * Maximum length of 5000 chargeTransferGroup :: (GHC.Maybe.Maybe Data.Text.Internal.Text) } deriving ( GHC.Show.Show, GHC.Classes.Eq ) instance Data.Aeson.Types.ToJSON.ToJSON Charge where toJSON obj = Data.Aeson.Types.Internal.object ("amount" Data.Aeson.Types.ToJSON..= chargeAmount obj : "amount_captured" Data.Aeson.Types.ToJSON..= chargeAmountCaptured obj : "amount_refunded" Data.Aeson.Types.ToJSON..= chargeAmountRefunded obj : "application" Data.Aeson.Types.ToJSON..= chargeApplication obj : "application_fee" Data.Aeson.Types.ToJSON..= chargeApplicationFee obj : "application_fee_amount" Data.Aeson.Types.ToJSON..= chargeApplicationFeeAmount obj : "balance_transaction" Data.Aeson.Types.ToJSON..= chargeBalanceTransaction obj : "billing_details" Data.Aeson.Types.ToJSON..= chargeBillingDetails obj : "calculated_statement_descriptor" Data.Aeson.Types.ToJSON..= chargeCalculatedStatementDescriptor obj : "captured" Data.Aeson.Types.ToJSON..= chargeCaptured obj : "created" Data.Aeson.Types.ToJSON..= chargeCreated obj : "currency" Data.Aeson.Types.ToJSON..= chargeCurrency obj : "customer" Data.Aeson.Types.ToJSON..= chargeCustomer obj : "description" Data.Aeson.Types.ToJSON..= chargeDescription obj : "disputed" Data.Aeson.Types.ToJSON..= chargeDisputed obj : "failure_code" Data.Aeson.Types.ToJSON..= chargeFailureCode obj : "failure_message" Data.Aeson.Types.ToJSON..= chargeFailureMessage obj : "fraud_details" Data.Aeson.Types.ToJSON..= chargeFraudDetails obj : "id" Data.Aeson.Types.ToJSON..= chargeId obj : "invoice" Data.Aeson.Types.ToJSON..= chargeInvoice obj : "livemode" Data.Aeson.Types.ToJSON..= chargeLivemode obj : "metadata" Data.Aeson.Types.ToJSON..= chargeMetadata obj : "on_behalf_of" Data.Aeson.Types.ToJSON..= chargeOnBehalfOf obj : "order" Data.Aeson.Types.ToJSON..= chargeOrder obj : "outcome" Data.Aeson.Types.ToJSON..= chargeOutcome obj : "paid" Data.Aeson.Types.ToJSON..= chargePaid obj : "payment_intent" Data.Aeson.Types.ToJSON..= chargePaymentIntent obj : "payment_method" Data.Aeson.Types.ToJSON..= chargePaymentMethod obj : "payment_method_details" Data.Aeson.Types.ToJSON..= chargePaymentMethodDetails obj : "receipt_email" Data.Aeson.Types.ToJSON..= chargeReceiptEmail obj : "receipt_number" Data.Aeson.Types.ToJSON..= chargeReceiptNumber obj : "receipt_url" Data.Aeson.Types.ToJSON..= chargeReceiptUrl obj : "refunded" Data.Aeson.Types.ToJSON..= chargeRefunded obj : "refunds" Data.Aeson.Types.ToJSON..= chargeRefunds obj : "review" Data.Aeson.Types.ToJSON..= chargeReview obj : "shipping" Data.Aeson.Types.ToJSON..= chargeShipping obj : "source_transfer" Data.Aeson.Types.ToJSON..= chargeSourceTransfer obj : "statement_descriptor" Data.Aeson.Types.ToJSON..= chargeStatementDescriptor obj : "statement_descriptor_suffix" Data.Aeson.Types.ToJSON..= chargeStatementDescriptorSuffix obj : "status" Data.Aeson.Types.ToJSON..= chargeStatus obj : "transfer" Data.Aeson.Types.ToJSON..= chargeTransfer obj : "transfer_data" Data.Aeson.Types.ToJSON..= chargeTransferData obj : "transfer_group" Data.Aeson.Types.ToJSON..= chargeTransferGroup obj : "object" Data.Aeson.Types.ToJSON..= Data.Aeson.Types.Internal.String "charge" : GHC.Base.mempty) toEncoding obj = Data.Aeson.Encoding.Internal.pairs (("amount" Data.Aeson.Types.ToJSON..= chargeAmount obj) GHC.Base.<> (("amount_captured" Data.Aeson.Types.ToJSON..= chargeAmountCaptured obj) GHC.Base.<> (("amount_refunded" Data.Aeson.Types.ToJSON..= chargeAmountRefunded obj) GHC.Base.<> (("application" Data.Aeson.Types.ToJSON..= chargeApplication obj) GHC.Base.<> (("application_fee" Data.Aeson.Types.ToJSON..= chargeApplicationFee obj) GHC.Base.<> (("application_fee_amount" Data.Aeson.Types.ToJSON..= chargeApplicationFeeAmount obj) GHC.Base.<> (("balance_transaction" Data.Aeson.Types.ToJSON..= chargeBalanceTransaction obj) GHC.Base.<> (("billing_details" Data.Aeson.Types.ToJSON..= chargeBillingDetails obj) GHC.Base.<> (("calculated_statement_descriptor" Data.Aeson.Types.ToJSON..= chargeCalculatedStatementDescriptor obj) GHC.Base.<> (("captured" Data.Aeson.Types.ToJSON..= chargeCaptured obj) GHC.Base.<> (("created" Data.Aeson.Types.ToJSON..= chargeCreated obj) GHC.Base.<> (("currency" Data.Aeson.Types.ToJSON..= chargeCurrency obj) GHC.Base.<> (("customer" Data.Aeson.Types.ToJSON..= chargeCustomer obj) GHC.Base.<> (("description" Data.Aeson.Types.ToJSON..= chargeDescription obj) GHC.Base.<> (("disputed" Data.Aeson.Types.ToJSON..= chargeDisputed obj) GHC.Base.<> (("failure_code" Data.Aeson.Types.ToJSON..= chargeFailureCode obj) GHC.Base.<> (("failure_message" Data.Aeson.Types.ToJSON..= chargeFailureMessage obj) GHC.Base.<> (("fraud_details" Data.Aeson.Types.ToJSON..= chargeFraudDetails obj) GHC.Base.<> (("id" Data.Aeson.Types.ToJSON..= chargeId obj) GHC.Base.<> (("invoice" Data.Aeson.Types.ToJSON..= chargeInvoice obj) GHC.Base.<> (("livemode" Data.Aeson.Types.ToJSON..= chargeLivemode obj) GHC.Base.<> (("metadata" Data.Aeson.Types.ToJSON..= chargeMetadata obj) GHC.Base.<> (("on_behalf_of" Data.Aeson.Types.ToJSON..= chargeOnBehalfOf obj) GHC.Base.<> (("order" Data.Aeson.Types.ToJSON..= chargeOrder obj) GHC.Base.<> (("outcome" Data.Aeson.Types.ToJSON..= chargeOutcome obj) GHC.Base.<> (("paid" Data.Aeson.Types.ToJSON..= chargePaid obj) GHC.Base.<> (("payment_intent" Data.Aeson.Types.ToJSON..= chargePaymentIntent obj) GHC.Base.<> (("payment_method" Data.Aeson.Types.ToJSON..= chargePaymentMethod obj) GHC.Base.<> (("payment_method_details" Data.Aeson.Types.ToJSON..= chargePaymentMethodDetails obj) GHC.Base.<> (("receipt_email" Data.Aeson.Types.ToJSON..= chargeReceiptEmail obj) GHC.Base.<> (("receipt_number" Data.Aeson.Types.ToJSON..= chargeReceiptNumber obj) GHC.Base.<> (("receipt_url" Data.Aeson.Types.ToJSON..= chargeReceiptUrl obj) GHC.Base.<> (("refunded" Data.Aeson.Types.ToJSON..= chargeRefunded obj) GHC.Base.<> (("refunds" Data.Aeson.Types.ToJSON..= chargeRefunds obj) GHC.Base.<> (("review" Data.Aeson.Types.ToJSON..= chargeReview obj) GHC.Base.<> (("shipping" Data.Aeson.Types.ToJSON..= chargeShipping obj) GHC.Base.<> (("source_transfer" Data.Aeson.Types.ToJSON..= chargeSourceTransfer obj) GHC.Base.<> (("statement_descriptor" Data.Aeson.Types.ToJSON..= chargeStatementDescriptor obj) GHC.Base.<> (("statement_descriptor_suffix" Data.Aeson.Types.ToJSON..= chargeStatementDescriptorSuffix obj) GHC.Base.<> (("status" Data.Aeson.Types.ToJSON..= chargeStatus obj) GHC.Base.<> (("transfer" Data.Aeson.Types.ToJSON..= chargeTransfer obj) GHC.Base.<> (("transfer_data" Data.Aeson.Types.ToJSON..= chargeTransferData obj) GHC.Base.<> (("transfer_group" Data.Aeson.Types.ToJSON..= chargeTransferGroup obj) GHC.Base.<> ("object" Data.Aeson.Types.ToJSON..= Data.Aeson.Types.Internal.String "charge")))))))))))))))))))))))))))))))))))))))))))) instance Data.Aeson.Types.FromJSON.FromJSON Charge where parseJSON = Data.Aeson.Types.FromJSON.withObject "Charge" (\obj -> ((((((((((((((((((((((((((((((((((((((((((GHC.Base.pure Charge GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..: "amount")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..: "amount_captured")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..: "amount_refunded")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:? "application")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:? "application_fee")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:? "application_fee_amount")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:? "balance_transaction")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..: "billing_details")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:? "calculated_statement_descriptor")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..: "captured")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..: "created")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..: "currency")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:? "customer")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:? "description")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..: "disputed")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:? "failure_code")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:? "failure_message")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:? "fraud_details")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..: "id")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:? "invoice")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..: "livemode")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..: "metadata")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:? "on_behalf_of")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:? "order")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:? "outcome")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..: "paid")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:? "payment_intent")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:? "payment_method")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:? "payment_method_details")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:? "receipt_email")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:? "receipt_number")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:? "receipt_url")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..: "refunded")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..: "refunds")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:? "review")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:? "shipping")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:? "source_transfer")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:? "statement_descriptor")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:? "statement_descriptor_suffix")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..: "status")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:? "transfer")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:? "transfer_data")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:? "transfer_group")) -- | Create a new 'Charge' with all required fields. mkCharge :: -- | 'chargeAmount' GHC.Types.Int -> -- | 'chargeAmountCaptured' GHC.Types.Int -> -- | 'chargeAmountRefunded' GHC.Types.Int -> -- | 'chargeBillingDetails' BillingDetails -> -- | 'chargeCaptured' GHC.Types.Bool -> -- | 'chargeCreated' GHC.Types.Int -> -- | 'chargeCurrency' Data.Text.Internal.Text -> -- | 'chargeDisputed' GHC.Types.Bool -> -- | 'chargeId' Data.Text.Internal.Text -> -- | 'chargeLivemode' GHC.Types.Bool -> -- | 'chargeMetadata' Data.Aeson.Types.Internal.Object -> -- | 'chargePaid' GHC.Types.Bool -> -- | 'chargeRefunded' GHC.Types.Bool -> -- | 'chargeRefunds' ChargeRefunds' -> -- | 'chargeStatus' Data.Text.Internal.Text -> Charge mkCharge chargeAmount chargeAmountCaptured chargeAmountRefunded chargeBillingDetails chargeCaptured chargeCreated chargeCurrency chargeDisputed chargeId chargeLivemode chargeMetadata chargePaid chargeRefunded chargeRefunds chargeStatus = Charge { chargeAmount = chargeAmount, chargeAmountCaptured = chargeAmountCaptured, chargeAmountRefunded = chargeAmountRefunded, chargeApplication = GHC.Maybe.Nothing, chargeApplicationFee = GHC.Maybe.Nothing, chargeApplicationFeeAmount = GHC.Maybe.Nothing, chargeBalanceTransaction = GHC.Maybe.Nothing, chargeBillingDetails = chargeBillingDetails, chargeCalculatedStatementDescriptor = GHC.Maybe.Nothing, chargeCaptured = chargeCaptured, chargeCreated = chargeCreated, chargeCurrency = chargeCurrency, chargeCustomer = GHC.Maybe.Nothing, chargeDescription = GHC.Maybe.Nothing, chargeDisputed = chargeDisputed, chargeFailureCode = GHC.Maybe.Nothing, chargeFailureMessage = GHC.Maybe.Nothing, chargeFraudDetails = GHC.Maybe.Nothing, chargeId = chargeId, chargeInvoice = GHC.Maybe.Nothing, chargeLivemode = chargeLivemode, chargeMetadata = chargeMetadata, chargeOnBehalfOf = GHC.Maybe.Nothing, chargeOrder = GHC.Maybe.Nothing, chargeOutcome = GHC.Maybe.Nothing, chargePaid = chargePaid, chargePaymentIntent = GHC.Maybe.Nothing, chargePaymentMethod = GHC.Maybe.Nothing, chargePaymentMethodDetails = GHC.Maybe.Nothing, chargeReceiptEmail = GHC.Maybe.Nothing, chargeReceiptNumber = GHC.Maybe.Nothing, chargeReceiptUrl = GHC.Maybe.Nothing, chargeRefunded = chargeRefunded, chargeRefunds = chargeRefunds, chargeReview = GHC.Maybe.Nothing, chargeShipping = GHC.Maybe.Nothing, chargeSourceTransfer = GHC.Maybe.Nothing, chargeStatementDescriptor = GHC.Maybe.Nothing, chargeStatementDescriptorSuffix = GHC.Maybe.Nothing, chargeStatus = chargeStatus, chargeTransfer = GHC.Maybe.Nothing, chargeTransferData = GHC.Maybe.Nothing, chargeTransferGroup = GHC.Maybe.Nothing } -- | Defines the oneOf schema located at @components.schemas.charge.properties.application.anyOf@ in the specification. -- -- ID of the Connect application that created the charge. data ChargeApplication'Variants = ChargeApplication'Text Data.Text.Internal.Text | ChargeApplication'Application Application deriving (GHC.Show.Show, GHC.Classes.Eq) instance Data.Aeson.Types.ToJSON.ToJSON ChargeApplication'Variants where toJSON (ChargeApplication'Text a) = Data.Aeson.Types.ToJSON.toJSON a toJSON (ChargeApplication'Application a) = Data.Aeson.Types.ToJSON.toJSON a instance Data.Aeson.Types.FromJSON.FromJSON ChargeApplication'Variants where parseJSON val = case (ChargeApplication'Text Data.Functor.<$> Data.Aeson.Types.FromJSON.fromJSON val) GHC.Base.<|> ((ChargeApplication'Application Data.Functor.<$> Data.Aeson.Types.FromJSON.fromJSON val) GHC.Base.<|> Data.Aeson.Types.Internal.Error "No variant matched") of Data.Aeson.Types.Internal.Success a -> GHC.Base.pure a Data.Aeson.Types.Internal.Error a -> Control.Monad.Fail.fail a -- | Defines the oneOf schema located at @components.schemas.charge.properties.application_fee.anyOf@ in the specification. -- -- The application fee (if any) for the charge. [See the Connect documentation](https:\/\/stripe.com\/docs\/connect\/direct-charges\#collecting-fees) for details. data ChargeApplicationFee'Variants = ChargeApplicationFee'Text Data.Text.Internal.Text | ChargeApplicationFee'ApplicationFee ApplicationFee deriving (GHC.Show.Show, GHC.Classes.Eq) instance Data.Aeson.Types.ToJSON.ToJSON ChargeApplicationFee'Variants where toJSON (ChargeApplicationFee'Text a) = Data.Aeson.Types.ToJSON.toJSON a toJSON (ChargeApplicationFee'ApplicationFee a) = Data.Aeson.Types.ToJSON.toJSON a instance Data.Aeson.Types.FromJSON.FromJSON ChargeApplicationFee'Variants where parseJSON val = case (ChargeApplicationFee'Text Data.Functor.<$> Data.Aeson.Types.FromJSON.fromJSON val) GHC.Base.<|> ((ChargeApplicationFee'ApplicationFee Data.Functor.<$> Data.Aeson.Types.FromJSON.fromJSON val) GHC.Base.<|> Data.Aeson.Types.Internal.Error "No variant matched") of Data.Aeson.Types.Internal.Success a -> GHC.Base.pure a Data.Aeson.Types.Internal.Error a -> Control.Monad.Fail.fail a -- | Defines the oneOf schema located at @components.schemas.charge.properties.balance_transaction.anyOf@ in the specification. -- -- ID of the balance transaction that describes the impact of this charge on your account balance (not including refunds or disputes). data ChargeBalanceTransaction'Variants = ChargeBalanceTransaction'Text Data.Text.Internal.Text | ChargeBalanceTransaction'BalanceTransaction BalanceTransaction deriving (GHC.Show.Show, GHC.Classes.Eq) instance Data.Aeson.Types.ToJSON.ToJSON ChargeBalanceTransaction'Variants where toJSON (ChargeBalanceTransaction'Text a) = Data.Aeson.Types.ToJSON.toJSON a toJSON (ChargeBalanceTransaction'BalanceTransaction a) = Data.Aeson.Types.ToJSON.toJSON a instance Data.Aeson.Types.FromJSON.FromJSON ChargeBalanceTransaction'Variants where parseJSON val = case (ChargeBalanceTransaction'Text Data.Functor.<$> Data.Aeson.Types.FromJSON.fromJSON val) GHC.Base.<|> ((ChargeBalanceTransaction'BalanceTransaction Data.Functor.<$> Data.Aeson.Types.FromJSON.fromJSON val) GHC.Base.<|> Data.Aeson.Types.Internal.Error "No variant matched") of Data.Aeson.Types.Internal.Success a -> GHC.Base.pure a Data.Aeson.Types.Internal.Error a -> Control.Monad.Fail.fail a -- | Defines the oneOf schema located at @components.schemas.charge.properties.customer.anyOf@ in the specification. -- -- ID of the customer this charge is for if one exists. data ChargeCustomer'Variants = ChargeCustomer'Text Data.Text.Internal.Text | ChargeCustomer'Customer Customer | ChargeCustomer'DeletedCustomer DeletedCustomer deriving (GHC.Show.Show, GHC.Classes.Eq) instance Data.Aeson.Types.ToJSON.ToJSON ChargeCustomer'Variants where toJSON (ChargeCustomer'Text a) = Data.Aeson.Types.ToJSON.toJSON a toJSON (ChargeCustomer'Customer a) = Data.Aeson.Types.ToJSON.toJSON a toJSON (ChargeCustomer'DeletedCustomer a) = Data.Aeson.Types.ToJSON.toJSON a instance Data.Aeson.Types.FromJSON.FromJSON ChargeCustomer'Variants where parseJSON val = case (ChargeCustomer'Text Data.Functor.<$> Data.Aeson.Types.FromJSON.fromJSON val) GHC.Base.<|> ((ChargeCustomer'Customer Data.Functor.<$> Data.Aeson.Types.FromJSON.fromJSON val) GHC.Base.<|> ((ChargeCustomer'DeletedCustomer Data.Functor.<$> Data.Aeson.Types.FromJSON.fromJSON val) GHC.Base.<|> Data.Aeson.Types.Internal.Error "No variant matched")) of Data.Aeson.Types.Internal.Success a -> GHC.Base.pure a Data.Aeson.Types.Internal.Error a -> Control.Monad.Fail.fail a -- | Defines the object schema located at @components.schemas.charge.properties.fraud_details.anyOf@ in the specification. -- -- Information on fraud assessments for the charge. data ChargeFraudDetails' = ChargeFraudDetails' { -- | stripe_report: Assessments from Stripe. If set, the value is \`fraudulent\`. -- -- Constraints: -- -- * Maximum length of 5000 chargeFraudDetails'StripeReport :: (GHC.Maybe.Maybe Data.Text.Internal.Text), -- | user_report: Assessments reported by you. If set, possible values of are \`safe\` and \`fraudulent\`. -- -- Constraints: -- -- * Maximum length of 5000 chargeFraudDetails'UserReport :: (GHC.Maybe.Maybe Data.Text.Internal.Text) } deriving ( GHC.Show.Show, GHC.Classes.Eq ) instance Data.Aeson.Types.ToJSON.ToJSON ChargeFraudDetails' where toJSON obj = Data.Aeson.Types.Internal.object ("stripe_report" Data.Aeson.Types.ToJSON..= chargeFraudDetails'StripeReport obj : "user_report" Data.Aeson.Types.ToJSON..= chargeFraudDetails'UserReport obj : GHC.Base.mempty) toEncoding obj = Data.Aeson.Encoding.Internal.pairs (("stripe_report" Data.Aeson.Types.ToJSON..= chargeFraudDetails'StripeReport obj) GHC.Base.<> ("user_report" Data.Aeson.Types.ToJSON..= chargeFraudDetails'UserReport obj)) instance Data.Aeson.Types.FromJSON.FromJSON ChargeFraudDetails' where parseJSON = Data.Aeson.Types.FromJSON.withObject "ChargeFraudDetails'" (\obj -> (GHC.Base.pure ChargeFraudDetails' GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:? "stripe_report")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:? "user_report")) -- | Create a new 'ChargeFraudDetails'' with all required fields. mkChargeFraudDetails' :: ChargeFraudDetails' mkChargeFraudDetails' = ChargeFraudDetails' { chargeFraudDetails'StripeReport = GHC.Maybe.Nothing, chargeFraudDetails'UserReport = GHC.Maybe.Nothing } -- | Defines the oneOf schema located at @components.schemas.charge.properties.invoice.anyOf@ in the specification. -- -- ID of the invoice this charge is for if one exists. data ChargeInvoice'Variants = ChargeInvoice'Text Data.Text.Internal.Text | ChargeInvoice'Invoice Invoice deriving (GHC.Show.Show, GHC.Classes.Eq) instance Data.Aeson.Types.ToJSON.ToJSON ChargeInvoice'Variants where toJSON (ChargeInvoice'Text a) = Data.Aeson.Types.ToJSON.toJSON a toJSON (ChargeInvoice'Invoice a) = Data.Aeson.Types.ToJSON.toJSON a instance Data.Aeson.Types.FromJSON.FromJSON ChargeInvoice'Variants where parseJSON val = case (ChargeInvoice'Text Data.Functor.<$> Data.Aeson.Types.FromJSON.fromJSON val) GHC.Base.<|> ((ChargeInvoice'Invoice Data.Functor.<$> Data.Aeson.Types.FromJSON.fromJSON val) GHC.Base.<|> Data.Aeson.Types.Internal.Error "No variant matched") of Data.Aeson.Types.Internal.Success a -> GHC.Base.pure a Data.Aeson.Types.Internal.Error a -> Control.Monad.Fail.fail a -- | Defines the oneOf schema located at @components.schemas.charge.properties.on_behalf_of.anyOf@ in the specification. -- -- The account (if any) the charge was made on behalf of without triggering an automatic transfer. See the [Connect documentation](https:\/\/stripe.com\/docs\/connect\/charges-transfers) for details. data ChargeOnBehalfOf'Variants = ChargeOnBehalfOf'Text Data.Text.Internal.Text | ChargeOnBehalfOf'Account Account deriving (GHC.Show.Show, GHC.Classes.Eq) instance Data.Aeson.Types.ToJSON.ToJSON ChargeOnBehalfOf'Variants where toJSON (ChargeOnBehalfOf'Text a) = Data.Aeson.Types.ToJSON.toJSON a toJSON (ChargeOnBehalfOf'Account a) = Data.Aeson.Types.ToJSON.toJSON a instance Data.Aeson.Types.FromJSON.FromJSON ChargeOnBehalfOf'Variants where parseJSON val = case (ChargeOnBehalfOf'Text Data.Functor.<$> Data.Aeson.Types.FromJSON.fromJSON val) GHC.Base.<|> ((ChargeOnBehalfOf'Account Data.Functor.<$> Data.Aeson.Types.FromJSON.fromJSON val) GHC.Base.<|> Data.Aeson.Types.Internal.Error "No variant matched") of Data.Aeson.Types.Internal.Success a -> GHC.Base.pure a Data.Aeson.Types.Internal.Error a -> Control.Monad.Fail.fail a -- | Defines the oneOf schema located at @components.schemas.charge.properties.order.anyOf@ in the specification. -- -- ID of the order this charge is for if one exists. data ChargeOrder'Variants = ChargeOrder'Text Data.Text.Internal.Text | ChargeOrder'Order Order deriving (GHC.Show.Show, GHC.Classes.Eq) instance Data.Aeson.Types.ToJSON.ToJSON ChargeOrder'Variants where toJSON (ChargeOrder'Text a) = Data.Aeson.Types.ToJSON.toJSON a toJSON (ChargeOrder'Order a) = Data.Aeson.Types.ToJSON.toJSON a instance Data.Aeson.Types.FromJSON.FromJSON ChargeOrder'Variants where parseJSON val = case (ChargeOrder'Text Data.Functor.<$> Data.Aeson.Types.FromJSON.fromJSON val) GHC.Base.<|> ((ChargeOrder'Order Data.Functor.<$> Data.Aeson.Types.FromJSON.fromJSON val) GHC.Base.<|> Data.Aeson.Types.Internal.Error "No variant matched") of Data.Aeson.Types.Internal.Success a -> GHC.Base.pure a Data.Aeson.Types.Internal.Error a -> Control.Monad.Fail.fail a -- | Defines the object schema located at @components.schemas.charge.properties.outcome.anyOf@ in the specification. -- -- Details about whether the payment was accepted, and why. See [understanding declines](https:\\\/\\\/stripe.com\\\/docs\\\/declines) for details. data ChargeOutcome' = ChargeOutcome' { -- | network_status: Possible values are \`approved_by_network\`, \`declined_by_network\`, \`not_sent_to_network\`, and \`reversed_after_approval\`. The value \`reversed_after_approval\` indicates the payment was [blocked by Stripe](https:\/\/stripe.com\/docs\/declines\#blocked-payments) after bank authorization, and may temporarily appear as \"pending\" on a cardholder\'s statement. -- -- Constraints: -- -- * Maximum length of 5000 chargeOutcome'NetworkStatus :: (GHC.Maybe.Maybe Data.Text.Internal.Text), -- | reason: An enumerated value providing a more detailed explanation of the outcome\'s \`type\`. Charges blocked by Radar\'s default block rule have the value \`highest_risk_level\`. Charges placed in review by Radar\'s default review rule have the value \`elevated_risk_level\`. Charges authorized, blocked, or placed in review by custom rules have the value \`rule\`. See [understanding declines](https:\/\/stripe.com\/docs\/declines) for more details. -- -- Constraints: -- -- * Maximum length of 5000 chargeOutcome'Reason :: (GHC.Maybe.Maybe Data.Text.Internal.Text), -- | risk_level: Stripe Radar\'s evaluation of the riskiness of the payment. Possible values for evaluated payments are \`normal\`, \`elevated\`, \`highest\`. For non-card payments, and card-based payments predating the public assignment of risk levels, this field will have the value \`not_assessed\`. In the event of an error in the evaluation, this field will have the value \`unknown\`. This field is only available with Radar. -- -- Constraints: -- -- * Maximum length of 5000 chargeOutcome'RiskLevel :: (GHC.Maybe.Maybe Data.Text.Internal.Text), -- | risk_score: Stripe Radar\'s evaluation of the riskiness of the payment. Possible values for evaluated payments are between 0 and 100. For non-card payments, card-based payments predating the public assignment of risk scores, or in the event of an error during evaluation, this field will not be present. This field is only available with Radar for Fraud Teams. chargeOutcome'RiskScore :: (GHC.Maybe.Maybe GHC.Types.Int), -- | rule: The ID of the Radar rule that matched the payment, if applicable. chargeOutcome'Rule :: (GHC.Maybe.Maybe ChargeOutcome'Rule'Variants), -- | seller_message: A human-readable description of the outcome type and reason, designed for you (the recipient of the payment), not your customer. -- -- Constraints: -- -- * Maximum length of 5000 chargeOutcome'SellerMessage :: (GHC.Maybe.Maybe Data.Text.Internal.Text), -- | type: Possible values are \`authorized\`, \`manual_review\`, \`issuer_declined\`, \`blocked\`, and \`invalid\`. See [understanding declines](https:\/\/stripe.com\/docs\/declines) and [Radar reviews](https:\/\/stripe.com\/docs\/radar\/reviews) for details. -- -- Constraints: -- -- * Maximum length of 5000 chargeOutcome'Type :: (GHC.Maybe.Maybe Data.Text.Internal.Text) } deriving ( GHC.Show.Show, GHC.Classes.Eq ) instance Data.Aeson.Types.ToJSON.ToJSON ChargeOutcome' where toJSON obj = Data.Aeson.Types.Internal.object ("network_status" Data.Aeson.Types.ToJSON..= chargeOutcome'NetworkStatus obj : "reason" Data.Aeson.Types.ToJSON..= chargeOutcome'Reason obj : "risk_level" Data.Aeson.Types.ToJSON..= chargeOutcome'RiskLevel obj : "risk_score" Data.Aeson.Types.ToJSON..= chargeOutcome'RiskScore obj : "rule" Data.Aeson.Types.ToJSON..= chargeOutcome'Rule obj : "seller_message" Data.Aeson.Types.ToJSON..= chargeOutcome'SellerMessage obj : "type" Data.Aeson.Types.ToJSON..= chargeOutcome'Type obj : GHC.Base.mempty) toEncoding obj = Data.Aeson.Encoding.Internal.pairs (("network_status" Data.Aeson.Types.ToJSON..= chargeOutcome'NetworkStatus obj) GHC.Base.<> (("reason" Data.Aeson.Types.ToJSON..= chargeOutcome'Reason obj) GHC.Base.<> (("risk_level" Data.Aeson.Types.ToJSON..= chargeOutcome'RiskLevel obj) GHC.Base.<> (("risk_score" Data.Aeson.Types.ToJSON..= chargeOutcome'RiskScore obj) GHC.Base.<> (("rule" Data.Aeson.Types.ToJSON..= chargeOutcome'Rule obj) GHC.Base.<> (("seller_message" Data.Aeson.Types.ToJSON..= chargeOutcome'SellerMessage obj) GHC.Base.<> ("type" Data.Aeson.Types.ToJSON..= chargeOutcome'Type obj))))))) instance Data.Aeson.Types.FromJSON.FromJSON ChargeOutcome' where parseJSON = Data.Aeson.Types.FromJSON.withObject "ChargeOutcome'" (\obj -> ((((((GHC.Base.pure ChargeOutcome' GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:? "network_status")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:? "reason")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:? "risk_level")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:? "risk_score")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:? "rule")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:? "seller_message")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:? "type")) -- | Create a new 'ChargeOutcome'' with all required fields. mkChargeOutcome' :: ChargeOutcome' mkChargeOutcome' = ChargeOutcome' { chargeOutcome'NetworkStatus = GHC.Maybe.Nothing, chargeOutcome'Reason = GHC.Maybe.Nothing, chargeOutcome'RiskLevel = GHC.Maybe.Nothing, chargeOutcome'RiskScore = GHC.Maybe.Nothing, chargeOutcome'Rule = GHC.Maybe.Nothing, chargeOutcome'SellerMessage = GHC.Maybe.Nothing, chargeOutcome'Type = GHC.Maybe.Nothing } -- | Defines the oneOf schema located at @components.schemas.charge.properties.outcome.anyOf.properties.rule.anyOf@ in the specification. -- -- The ID of the Radar rule that matched the payment, if applicable. data ChargeOutcome'Rule'Variants = ChargeOutcome'Rule'Text Data.Text.Internal.Text | ChargeOutcome'Rule'Rule Rule deriving (GHC.Show.Show, GHC.Classes.Eq) instance Data.Aeson.Types.ToJSON.ToJSON ChargeOutcome'Rule'Variants where toJSON (ChargeOutcome'Rule'Text a) = Data.Aeson.Types.ToJSON.toJSON a toJSON (ChargeOutcome'Rule'Rule a) = Data.Aeson.Types.ToJSON.toJSON a instance Data.Aeson.Types.FromJSON.FromJSON ChargeOutcome'Rule'Variants where parseJSON val = case (ChargeOutcome'Rule'Text Data.Functor.<$> Data.Aeson.Types.FromJSON.fromJSON val) GHC.Base.<|> ((ChargeOutcome'Rule'Rule Data.Functor.<$> Data.Aeson.Types.FromJSON.fromJSON val) GHC.Base.<|> Data.Aeson.Types.Internal.Error "No variant matched") of Data.Aeson.Types.Internal.Success a -> GHC.Base.pure a Data.Aeson.Types.Internal.Error a -> Control.Monad.Fail.fail a -- | Defines the oneOf schema located at @components.schemas.charge.properties.payment_intent.anyOf@ in the specification. -- -- ID of the PaymentIntent associated with this charge, if one exists. data ChargePaymentIntent'Variants = ChargePaymentIntent'Text Data.Text.Internal.Text | ChargePaymentIntent'PaymentIntent PaymentIntent deriving (GHC.Show.Show, GHC.Classes.Eq) instance Data.Aeson.Types.ToJSON.ToJSON ChargePaymentIntent'Variants where toJSON (ChargePaymentIntent'Text a) = Data.Aeson.Types.ToJSON.toJSON a toJSON (ChargePaymentIntent'PaymentIntent a) = Data.Aeson.Types.ToJSON.toJSON a instance Data.Aeson.Types.FromJSON.FromJSON ChargePaymentIntent'Variants where parseJSON val = case (ChargePaymentIntent'Text Data.Functor.<$> Data.Aeson.Types.FromJSON.fromJSON val) GHC.Base.<|> ((ChargePaymentIntent'PaymentIntent Data.Functor.<$> Data.Aeson.Types.FromJSON.fromJSON val) GHC.Base.<|> Data.Aeson.Types.Internal.Error "No variant matched") of Data.Aeson.Types.Internal.Success a -> GHC.Base.pure a Data.Aeson.Types.Internal.Error a -> Control.Monad.Fail.fail a -- | Defines the object schema located at @components.schemas.charge.properties.payment_method_details.anyOf@ in the specification. -- -- Details about the payment method at the time of the transaction. data ChargePaymentMethodDetails' = ChargePaymentMethodDetails' { -- | ach_credit_transfer: chargePaymentMethodDetails'AchCreditTransfer :: (GHC.Maybe.Maybe PaymentMethodDetailsAchCreditTransfer), -- | ach_debit: chargePaymentMethodDetails'AchDebit :: (GHC.Maybe.Maybe PaymentMethodDetailsAchDebit), -- | acss_debit: chargePaymentMethodDetails'AcssDebit :: (GHC.Maybe.Maybe PaymentMethodDetailsAcssDebit), -- | afterpay_clearpay: chargePaymentMethodDetails'AfterpayClearpay :: (GHC.Maybe.Maybe PaymentMethodDetailsAfterpayClearpay), -- | alipay: chargePaymentMethodDetails'Alipay :: (GHC.Maybe.Maybe PaymentFlowsPrivatePaymentMethodsAlipayDetails), -- | au_becs_debit: chargePaymentMethodDetails'AuBecsDebit :: (GHC.Maybe.Maybe PaymentMethodDetailsAuBecsDebit), -- | bacs_debit: chargePaymentMethodDetails'BacsDebit :: (GHC.Maybe.Maybe PaymentMethodDetailsBacsDebit), -- | bancontact: chargePaymentMethodDetails'Bancontact :: (GHC.Maybe.Maybe PaymentMethodDetailsBancontact), -- | boleto: chargePaymentMethodDetails'Boleto :: (GHC.Maybe.Maybe PaymentMethodDetailsBoleto), -- | card: chargePaymentMethodDetails'Card :: (GHC.Maybe.Maybe PaymentMethodDetailsCard), -- | card_present: chargePaymentMethodDetails'CardPresent :: (GHC.Maybe.Maybe PaymentMethodDetailsCardPresent), -- | eps: chargePaymentMethodDetails'Eps :: (GHC.Maybe.Maybe PaymentMethodDetailsEps), -- | fpx: chargePaymentMethodDetails'Fpx :: (GHC.Maybe.Maybe PaymentMethodDetailsFpx), -- | giropay: chargePaymentMethodDetails'Giropay :: (GHC.Maybe.Maybe PaymentMethodDetailsGiropay), -- | grabpay: chargePaymentMethodDetails'Grabpay :: (GHC.Maybe.Maybe PaymentMethodDetailsGrabpay), -- | ideal: chargePaymentMethodDetails'Ideal :: (GHC.Maybe.Maybe PaymentMethodDetailsIdeal), -- | interac_present: chargePaymentMethodDetails'InteracPresent :: (GHC.Maybe.Maybe PaymentMethodDetailsInteracPresent), -- | klarna: chargePaymentMethodDetails'Klarna :: (GHC.Maybe.Maybe PaymentMethodDetailsKlarna), -- | multibanco: chargePaymentMethodDetails'Multibanco :: (GHC.Maybe.Maybe PaymentMethodDetailsMultibanco), -- | oxxo: chargePaymentMethodDetails'Oxxo :: (GHC.Maybe.Maybe PaymentMethodDetailsOxxo), -- | p24: chargePaymentMethodDetails'P24 :: (GHC.Maybe.Maybe PaymentMethodDetailsP24), -- | sepa_debit: chargePaymentMethodDetails'SepaDebit :: (GHC.Maybe.Maybe PaymentMethodDetailsSepaDebit), -- | sofort: chargePaymentMethodDetails'Sofort :: (GHC.Maybe.Maybe PaymentMethodDetailsSofort), -- | stripe_account: chargePaymentMethodDetails'StripeAccount :: (GHC.Maybe.Maybe PaymentMethodDetailsStripeAccount), -- | type: The type of transaction-specific details of the payment method used in the payment, one of \`ach_credit_transfer\`, \`ach_debit\`, \`acss_debit\`, \`alipay\`, \`au_becs_debit\`, \`bancontact\`, \`card\`, \`card_present\`, \`eps\`, \`giropay\`, \`ideal\`, \`klarna\`, \`multibanco\`, \`p24\`, \`sepa_debit\`, \`sofort\`, \`stripe_account\`, or \`wechat\`. -- An additional hash is included on \`payment_method_details\` with a name matching this value. -- It contains information specific to the payment method. -- -- Constraints: -- -- * Maximum length of 5000 chargePaymentMethodDetails'Type :: (GHC.Maybe.Maybe Data.Text.Internal.Text), -- | wechat: chargePaymentMethodDetails'Wechat :: (GHC.Maybe.Maybe PaymentMethodDetailsWechat) } deriving ( GHC.Show.Show, GHC.Classes.Eq ) instance Data.Aeson.Types.ToJSON.ToJSON ChargePaymentMethodDetails' where toJSON obj = Data.Aeson.Types.Internal.object ("ach_credit_transfer" Data.Aeson.Types.ToJSON..= chargePaymentMethodDetails'AchCreditTransfer obj : "ach_debit" Data.Aeson.Types.ToJSON..= chargePaymentMethodDetails'AchDebit obj : "acss_debit" Data.Aeson.Types.ToJSON..= chargePaymentMethodDetails'AcssDebit obj : "afterpay_clearpay" Data.Aeson.Types.ToJSON..= chargePaymentMethodDetails'AfterpayClearpay obj : "alipay" Data.Aeson.Types.ToJSON..= chargePaymentMethodDetails'Alipay obj : "au_becs_debit" Data.Aeson.Types.ToJSON..= chargePaymentMethodDetails'AuBecsDebit obj : "bacs_debit" Data.Aeson.Types.ToJSON..= chargePaymentMethodDetails'BacsDebit obj : "bancontact" Data.Aeson.Types.ToJSON..= chargePaymentMethodDetails'Bancontact obj : "boleto" Data.Aeson.Types.ToJSON..= chargePaymentMethodDetails'Boleto obj : "card" Data.Aeson.Types.ToJSON..= chargePaymentMethodDetails'Card obj : "card_present" Data.Aeson.Types.ToJSON..= chargePaymentMethodDetails'CardPresent obj : "eps" Data.Aeson.Types.ToJSON..= chargePaymentMethodDetails'Eps obj : "fpx" Data.Aeson.Types.ToJSON..= chargePaymentMethodDetails'Fpx obj : "giropay" Data.Aeson.Types.ToJSON..= chargePaymentMethodDetails'Giropay obj : "grabpay" Data.Aeson.Types.ToJSON..= chargePaymentMethodDetails'Grabpay obj : "ideal" Data.Aeson.Types.ToJSON..= chargePaymentMethodDetails'Ideal obj : "interac_present" Data.Aeson.Types.ToJSON..= chargePaymentMethodDetails'InteracPresent obj : "klarna" Data.Aeson.Types.ToJSON..= chargePaymentMethodDetails'Klarna obj : "multibanco" Data.Aeson.Types.ToJSON..= chargePaymentMethodDetails'Multibanco obj : "oxxo" Data.Aeson.Types.ToJSON..= chargePaymentMethodDetails'Oxxo obj : "p24" Data.Aeson.Types.ToJSON..= chargePaymentMethodDetails'P24 obj : "sepa_debit" Data.Aeson.Types.ToJSON..= chargePaymentMethodDetails'SepaDebit obj : "sofort" Data.Aeson.Types.ToJSON..= chargePaymentMethodDetails'Sofort obj : "stripe_account" Data.Aeson.Types.ToJSON..= chargePaymentMethodDetails'StripeAccount obj : "type" Data.Aeson.Types.ToJSON..= chargePaymentMethodDetails'Type obj : "wechat" Data.Aeson.Types.ToJSON..= chargePaymentMethodDetails'Wechat obj : GHC.Base.mempty) toEncoding obj = Data.Aeson.Encoding.Internal.pairs (("ach_credit_transfer" Data.Aeson.Types.ToJSON..= chargePaymentMethodDetails'AchCreditTransfer obj) GHC.Base.<> (("ach_debit" Data.Aeson.Types.ToJSON..= chargePaymentMethodDetails'AchDebit obj) GHC.Base.<> (("acss_debit" Data.Aeson.Types.ToJSON..= chargePaymentMethodDetails'AcssDebit obj) GHC.Base.<> (("afterpay_clearpay" Data.Aeson.Types.ToJSON..= chargePaymentMethodDetails'AfterpayClearpay obj) GHC.Base.<> (("alipay" Data.Aeson.Types.ToJSON..= chargePaymentMethodDetails'Alipay obj) GHC.Base.<> (("au_becs_debit" Data.Aeson.Types.ToJSON..= chargePaymentMethodDetails'AuBecsDebit obj) GHC.Base.<> (("bacs_debit" Data.Aeson.Types.ToJSON..= chargePaymentMethodDetails'BacsDebit obj) GHC.Base.<> (("bancontact" Data.Aeson.Types.ToJSON..= chargePaymentMethodDetails'Bancontact obj) GHC.Base.<> (("boleto" Data.Aeson.Types.ToJSON..= chargePaymentMethodDetails'Boleto obj) GHC.Base.<> (("card" Data.Aeson.Types.ToJSON..= chargePaymentMethodDetails'Card obj) GHC.Base.<> (("card_present" Data.Aeson.Types.ToJSON..= chargePaymentMethodDetails'CardPresent obj) GHC.Base.<> (("eps" Data.Aeson.Types.ToJSON..= chargePaymentMethodDetails'Eps obj) GHC.Base.<> (("fpx" Data.Aeson.Types.ToJSON..= chargePaymentMethodDetails'Fpx obj) GHC.Base.<> (("giropay" Data.Aeson.Types.ToJSON..= chargePaymentMethodDetails'Giropay obj) GHC.Base.<> (("grabpay" Data.Aeson.Types.ToJSON..= chargePaymentMethodDetails'Grabpay obj) GHC.Base.<> (("ideal" Data.Aeson.Types.ToJSON..= chargePaymentMethodDetails'Ideal obj) GHC.Base.<> (("interac_present" Data.Aeson.Types.ToJSON..= chargePaymentMethodDetails'InteracPresent obj) GHC.Base.<> (("klarna" Data.Aeson.Types.ToJSON..= chargePaymentMethodDetails'Klarna obj) GHC.Base.<> (("multibanco" Data.Aeson.Types.ToJSON..= chargePaymentMethodDetails'Multibanco obj) GHC.Base.<> (("oxxo" Data.Aeson.Types.ToJSON..= chargePaymentMethodDetails'Oxxo obj) GHC.Base.<> (("p24" Data.Aeson.Types.ToJSON..= chargePaymentMethodDetails'P24 obj) GHC.Base.<> (("sepa_debit" Data.Aeson.Types.ToJSON..= chargePaymentMethodDetails'SepaDebit obj) GHC.Base.<> (("sofort" Data.Aeson.Types.ToJSON..= chargePaymentMethodDetails'Sofort obj) GHC.Base.<> (("stripe_account" Data.Aeson.Types.ToJSON..= chargePaymentMethodDetails'StripeAccount obj) GHC.Base.<> (("type" Data.Aeson.Types.ToJSON..= chargePaymentMethodDetails'Type obj) GHC.Base.<> ("wechat" Data.Aeson.Types.ToJSON..= chargePaymentMethodDetails'Wechat obj)))))))))))))))))))))))))) instance Data.Aeson.Types.FromJSON.FromJSON ChargePaymentMethodDetails' where parseJSON = Data.Aeson.Types.FromJSON.withObject "ChargePaymentMethodDetails'" (\obj -> (((((((((((((((((((((((((GHC.Base.pure ChargePaymentMethodDetails' GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:? "ach_credit_transfer")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:? "ach_debit")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:? "acss_debit")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:? "afterpay_clearpay")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:? "alipay")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:? "au_becs_debit")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:? "bacs_debit")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:? "bancontact")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:? "boleto")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:? "card")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:? "card_present")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:? "eps")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:? "fpx")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:? "giropay")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:? "grabpay")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:? "ideal")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:? "interac_present")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:? "klarna")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:? "multibanco")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:? "oxxo")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:? "p24")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:? "sepa_debit")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:? "sofort")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:? "stripe_account")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:? "type")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:? "wechat")) -- | Create a new 'ChargePaymentMethodDetails'' with all required fields. mkChargePaymentMethodDetails' :: ChargePaymentMethodDetails' mkChargePaymentMethodDetails' = ChargePaymentMethodDetails' { chargePaymentMethodDetails'AchCreditTransfer = GHC.Maybe.Nothing, chargePaymentMethodDetails'AchDebit = GHC.Maybe.Nothing, chargePaymentMethodDetails'AcssDebit = GHC.Maybe.Nothing, chargePaymentMethodDetails'AfterpayClearpay = GHC.Maybe.Nothing, chargePaymentMethodDetails'Alipay = GHC.Maybe.Nothing, chargePaymentMethodDetails'AuBecsDebit = GHC.Maybe.Nothing, chargePaymentMethodDetails'BacsDebit = GHC.Maybe.Nothing, chargePaymentMethodDetails'Bancontact = GHC.Maybe.Nothing, chargePaymentMethodDetails'Boleto = GHC.Maybe.Nothing, chargePaymentMethodDetails'Card = GHC.Maybe.Nothing, chargePaymentMethodDetails'CardPresent = GHC.Maybe.Nothing, chargePaymentMethodDetails'Eps = GHC.Maybe.Nothing, chargePaymentMethodDetails'Fpx = GHC.Maybe.Nothing, chargePaymentMethodDetails'Giropay = GHC.Maybe.Nothing, chargePaymentMethodDetails'Grabpay = GHC.Maybe.Nothing, chargePaymentMethodDetails'Ideal = GHC.Maybe.Nothing, chargePaymentMethodDetails'InteracPresent = GHC.Maybe.Nothing, chargePaymentMethodDetails'Klarna = GHC.Maybe.Nothing, chargePaymentMethodDetails'Multibanco = GHC.Maybe.Nothing, chargePaymentMethodDetails'Oxxo = GHC.Maybe.Nothing, chargePaymentMethodDetails'P24 = GHC.Maybe.Nothing, chargePaymentMethodDetails'SepaDebit = GHC.Maybe.Nothing, chargePaymentMethodDetails'Sofort = GHC.Maybe.Nothing, chargePaymentMethodDetails'StripeAccount = GHC.Maybe.Nothing, chargePaymentMethodDetails'Type = GHC.Maybe.Nothing, chargePaymentMethodDetails'Wechat = GHC.Maybe.Nothing } -- | Defines the object schema located at @components.schemas.charge.properties.refunds@ in the specification. -- -- A list of refunds that have been applied to the charge. data ChargeRefunds' = ChargeRefunds' { -- | data: Details about each object. chargeRefunds'Data :: ([Refund]), -- | has_more: True if this list has another page of items after this one that can be fetched. chargeRefunds'HasMore :: GHC.Types.Bool, -- | url: The URL where this list can be accessed. -- -- Constraints: -- -- * Maximum length of 5000 chargeRefunds'Url :: Data.Text.Internal.Text } deriving ( GHC.Show.Show, GHC.Classes.Eq ) instance Data.Aeson.Types.ToJSON.ToJSON ChargeRefunds' where toJSON obj = Data.Aeson.Types.Internal.object ("data" Data.Aeson.Types.ToJSON..= chargeRefunds'Data obj : "has_more" Data.Aeson.Types.ToJSON..= chargeRefunds'HasMore obj : "url" Data.Aeson.Types.ToJSON..= chargeRefunds'Url obj : "object" Data.Aeson.Types.ToJSON..= Data.Aeson.Types.Internal.String "list" : GHC.Base.mempty) toEncoding obj = Data.Aeson.Encoding.Internal.pairs (("data" Data.Aeson.Types.ToJSON..= chargeRefunds'Data obj) GHC.Base.<> (("has_more" Data.Aeson.Types.ToJSON..= chargeRefunds'HasMore obj) GHC.Base.<> (("url" Data.Aeson.Types.ToJSON..= chargeRefunds'Url obj) GHC.Base.<> ("object" Data.Aeson.Types.ToJSON..= Data.Aeson.Types.Internal.String "list")))) instance Data.Aeson.Types.FromJSON.FromJSON ChargeRefunds' where parseJSON = Data.Aeson.Types.FromJSON.withObject "ChargeRefunds'" (\obj -> ((GHC.Base.pure ChargeRefunds' GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..: "data")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..: "has_more")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..: "url")) -- | Create a new 'ChargeRefunds'' with all required fields. mkChargeRefunds' :: -- | 'chargeRefunds'Data' [Refund] -> -- | 'chargeRefunds'HasMore' GHC.Types.Bool -> -- | 'chargeRefunds'Url' Data.Text.Internal.Text -> ChargeRefunds' mkChargeRefunds' chargeRefunds'Data chargeRefunds'HasMore chargeRefunds'Url = ChargeRefunds' { chargeRefunds'Data = chargeRefunds'Data, chargeRefunds'HasMore = chargeRefunds'HasMore, chargeRefunds'Url = chargeRefunds'Url } -- | Defines the oneOf schema located at @components.schemas.charge.properties.review.anyOf@ in the specification. -- -- ID of the review associated with this charge if one exists. data ChargeReview'Variants = ChargeReview'Text Data.Text.Internal.Text | ChargeReview'Review Review deriving (GHC.Show.Show, GHC.Classes.Eq) instance Data.Aeson.Types.ToJSON.ToJSON ChargeReview'Variants where toJSON (ChargeReview'Text a) = Data.Aeson.Types.ToJSON.toJSON a toJSON (ChargeReview'Review a) = Data.Aeson.Types.ToJSON.toJSON a instance Data.Aeson.Types.FromJSON.FromJSON ChargeReview'Variants where parseJSON val = case (ChargeReview'Text Data.Functor.<$> Data.Aeson.Types.FromJSON.fromJSON val) GHC.Base.<|> ((ChargeReview'Review Data.Functor.<$> Data.Aeson.Types.FromJSON.fromJSON val) GHC.Base.<|> Data.Aeson.Types.Internal.Error "No variant matched") of Data.Aeson.Types.Internal.Success a -> GHC.Base.pure a Data.Aeson.Types.Internal.Error a -> Control.Monad.Fail.fail a -- | Defines the object schema located at @components.schemas.charge.properties.shipping.anyOf@ in the specification. -- -- Shipping information for the charge. data ChargeShipping' = ChargeShipping' { -- | address: chargeShipping'Address :: (GHC.Maybe.Maybe Address), -- | carrier: The delivery service that shipped a physical product, such as Fedex, UPS, USPS, etc. -- -- Constraints: -- -- * Maximum length of 5000 chargeShipping'Carrier :: (GHC.Maybe.Maybe Data.Text.Internal.Text), -- | name: Recipient name. -- -- Constraints: -- -- * Maximum length of 5000 chargeShipping'Name :: (GHC.Maybe.Maybe Data.Text.Internal.Text), -- | phone: Recipient phone (including extension). -- -- Constraints: -- -- * Maximum length of 5000 chargeShipping'Phone :: (GHC.Maybe.Maybe Data.Text.Internal.Text), -- | tracking_number: The tracking number for a physical product, obtained from the delivery service. If multiple tracking numbers were generated for this purchase, please separate them with commas. -- -- Constraints: -- -- * Maximum length of 5000 chargeShipping'TrackingNumber :: (GHC.Maybe.Maybe Data.Text.Internal.Text) } deriving ( GHC.Show.Show, GHC.Classes.Eq ) instance Data.Aeson.Types.ToJSON.ToJSON ChargeShipping' where toJSON obj = Data.Aeson.Types.Internal.object ("address" Data.Aeson.Types.ToJSON..= chargeShipping'Address obj : "carrier" Data.Aeson.Types.ToJSON..= chargeShipping'Carrier obj : "name" Data.Aeson.Types.ToJSON..= chargeShipping'Name obj : "phone" Data.Aeson.Types.ToJSON..= chargeShipping'Phone obj : "tracking_number" Data.Aeson.Types.ToJSON..= chargeShipping'TrackingNumber obj : GHC.Base.mempty) toEncoding obj = Data.Aeson.Encoding.Internal.pairs (("address" Data.Aeson.Types.ToJSON..= chargeShipping'Address obj) GHC.Base.<> (("carrier" Data.Aeson.Types.ToJSON..= chargeShipping'Carrier obj) GHC.Base.<> (("name" Data.Aeson.Types.ToJSON..= chargeShipping'Name obj) GHC.Base.<> (("phone" Data.Aeson.Types.ToJSON..= chargeShipping'Phone obj) GHC.Base.<> ("tracking_number" Data.Aeson.Types.ToJSON..= chargeShipping'TrackingNumber obj))))) instance Data.Aeson.Types.FromJSON.FromJSON ChargeShipping' where parseJSON = Data.Aeson.Types.FromJSON.withObject "ChargeShipping'" (\obj -> ((((GHC.Base.pure ChargeShipping' GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:? "address")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:? "carrier")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:? "name")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:? "phone")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:? "tracking_number")) -- | Create a new 'ChargeShipping'' with all required fields. mkChargeShipping' :: ChargeShipping' mkChargeShipping' = ChargeShipping' { chargeShipping'Address = GHC.Maybe.Nothing, chargeShipping'Carrier = GHC.Maybe.Nothing, chargeShipping'Name = GHC.Maybe.Nothing, chargeShipping'Phone = GHC.Maybe.Nothing, chargeShipping'TrackingNumber = GHC.Maybe.Nothing } -- | Defines the oneOf schema located at @components.schemas.charge.properties.source_transfer.anyOf@ in the specification. -- -- The transfer ID which created this charge. Only present if the charge came from another Stripe account. [See the Connect documentation](https:\/\/stripe.com\/docs\/connect\/destination-charges) for details. data ChargeSourceTransfer'Variants = ChargeSourceTransfer'Text Data.Text.Internal.Text | ChargeSourceTransfer'Transfer Transfer deriving (GHC.Show.Show, GHC.Classes.Eq) instance Data.Aeson.Types.ToJSON.ToJSON ChargeSourceTransfer'Variants where toJSON (ChargeSourceTransfer'Text a) = Data.Aeson.Types.ToJSON.toJSON a toJSON (ChargeSourceTransfer'Transfer a) = Data.Aeson.Types.ToJSON.toJSON a instance Data.Aeson.Types.FromJSON.FromJSON ChargeSourceTransfer'Variants where parseJSON val = case (ChargeSourceTransfer'Text Data.Functor.<$> Data.Aeson.Types.FromJSON.fromJSON val) GHC.Base.<|> ((ChargeSourceTransfer'Transfer Data.Functor.<$> Data.Aeson.Types.FromJSON.fromJSON val) GHC.Base.<|> Data.Aeson.Types.Internal.Error "No variant matched") of Data.Aeson.Types.Internal.Success a -> GHC.Base.pure a Data.Aeson.Types.Internal.Error a -> Control.Monad.Fail.fail a -- | Defines the oneOf schema located at @components.schemas.charge.properties.transfer.anyOf@ in the specification. -- -- ID of the transfer to the \`destination\` account (only applicable if the charge was created using the \`destination\` parameter). data ChargeTransfer'Variants = ChargeTransfer'Text Data.Text.Internal.Text | ChargeTransfer'Transfer Transfer deriving (GHC.Show.Show, GHC.Classes.Eq) instance Data.Aeson.Types.ToJSON.ToJSON ChargeTransfer'Variants where toJSON (ChargeTransfer'Text a) = Data.Aeson.Types.ToJSON.toJSON a toJSON (ChargeTransfer'Transfer a) = Data.Aeson.Types.ToJSON.toJSON a instance Data.Aeson.Types.FromJSON.FromJSON ChargeTransfer'Variants where parseJSON val = case (ChargeTransfer'Text Data.Functor.<$> Data.Aeson.Types.FromJSON.fromJSON val) GHC.Base.<|> ((ChargeTransfer'Transfer Data.Functor.<$> Data.Aeson.Types.FromJSON.fromJSON val) GHC.Base.<|> Data.Aeson.Types.Internal.Error "No variant matched") of Data.Aeson.Types.Internal.Success a -> GHC.Base.pure a Data.Aeson.Types.Internal.Error a -> Control.Monad.Fail.fail a -- | Defines the object schema located at @components.schemas.charge.properties.transfer_data.anyOf@ in the specification. -- -- An optional dictionary including the account to automatically transfer to as part of a destination charge. [See the Connect documentation](https:\\\/\\\/stripe.com\\\/docs\\\/connect\\\/destination-charges) for details. data ChargeTransferData' = ChargeTransferData' { -- | amount: The amount transferred to the destination account, if specified. By default, the entire charge amount is transferred to the destination account. chargeTransferData'Amount :: (GHC.Maybe.Maybe GHC.Types.Int), -- | destination: ID of an existing, connected Stripe account to transfer funds to if \`transfer_data\` was specified in the charge request. chargeTransferData'Destination :: (GHC.Maybe.Maybe ChargeTransferData'Destination'Variants) } deriving ( GHC.Show.Show, GHC.Classes.Eq ) instance Data.Aeson.Types.ToJSON.ToJSON ChargeTransferData' where toJSON obj = Data.Aeson.Types.Internal.object ("amount" Data.Aeson.Types.ToJSON..= chargeTransferData'Amount obj : "destination" Data.Aeson.Types.ToJSON..= chargeTransferData'Destination obj : GHC.Base.mempty) toEncoding obj = Data.Aeson.Encoding.Internal.pairs (("amount" Data.Aeson.Types.ToJSON..= chargeTransferData'Amount obj) GHC.Base.<> ("destination" Data.Aeson.Types.ToJSON..= chargeTransferData'Destination obj)) instance Data.Aeson.Types.FromJSON.FromJSON ChargeTransferData' where parseJSON = Data.Aeson.Types.FromJSON.withObject "ChargeTransferData'" (\obj -> (GHC.Base.pure ChargeTransferData' GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:? "amount")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:? "destination")) -- | Create a new 'ChargeTransferData'' with all required fields. mkChargeTransferData' :: ChargeTransferData' mkChargeTransferData' = ChargeTransferData' { chargeTransferData'Amount = GHC.Maybe.Nothing, chargeTransferData'Destination = GHC.Maybe.Nothing } -- | Defines the oneOf schema located at @components.schemas.charge.properties.transfer_data.anyOf.properties.destination.anyOf@ in the specification. -- -- ID of an existing, connected Stripe account to transfer funds to if \`transfer_data\` was specified in the charge request. data ChargeTransferData'Destination'Variants = ChargeTransferData'Destination'Text Data.Text.Internal.Text | ChargeTransferData'Destination'Account Account deriving (GHC.Show.Show, GHC.Classes.Eq) instance Data.Aeson.Types.ToJSON.ToJSON ChargeTransferData'Destination'Variants where toJSON (ChargeTransferData'Destination'Text a) = Data.Aeson.Types.ToJSON.toJSON a toJSON (ChargeTransferData'Destination'Account a) = Data.Aeson.Types.ToJSON.toJSON a instance Data.Aeson.Types.FromJSON.FromJSON ChargeTransferData'Destination'Variants where parseJSON val = case (ChargeTransferData'Destination'Text Data.Functor.<$> Data.Aeson.Types.FromJSON.fromJSON val) GHC.Base.<|> ((ChargeTransferData'Destination'Account Data.Functor.<$> Data.Aeson.Types.FromJSON.fromJSON val) GHC.Base.<|> Data.Aeson.Types.Internal.Error "No variant matched") of Data.Aeson.Types.Internal.Success a -> GHC.Base.pure a Data.Aeson.Types.Internal.Error a -> Control.Monad.Fail.fail a