Connect\<\/a>, you may flag accounts as suspicious.\<\/p>
--
-- \Test-mode Custom and Express accounts can be rejected at any time. Accounts created using live-mode keys may only be rejected once all balances are zero.\<\/p>
postAccountsAccountReject ::
forall m.
StripeAPI.Common.MonadHTTP m =>
-- | account | Constraints: Maximum length of 5000
Data.Text.Internal.Text ->
-- | The request body to send
PostAccountsAccountRejectRequestBody ->
-- | Monadic computation which returns the result of the operation
StripeAPI.Common.ClientT m (Network.HTTP.Client.Types.Response PostAccountsAccountRejectResponse)
postAccountsAccountReject
account
body =
GHC.Base.fmap
( \response_0 ->
GHC.Base.fmap
( Data.Either.either PostAccountsAccountRejectResponseError GHC.Base.id
GHC.Base.. ( \response body ->
if
| (\status_1 -> Network.HTTP.Types.Status.statusCode status_1 GHC.Classes.== 200) (Network.HTTP.Client.Types.responseStatus response) ->
PostAccountsAccountRejectResponse200
Data.Functor.<$> ( Data.Aeson.eitherDecodeStrict body ::
Data.Either.Either
GHC.Base.String
Account
)
| GHC.Base.const GHC.Types.True (Network.HTTP.Client.Types.responseStatus response) ->
PostAccountsAccountRejectResponseDefault
Data.Functor.<$> ( Data.Aeson.eitherDecodeStrict body ::
Data.Either.Either
GHC.Base.String
Error
)
| GHC.Base.otherwise -> Data.Either.Left "Missing default response type"
)
response_0
)
response_0
)
(StripeAPI.Common.doBodyCallWithConfigurationM (Data.Text.toUpper GHC.Base.$ Data.Text.pack "POST") (Data.Text.pack ("/v1/accounts/" GHC.Base.++ (Data.ByteString.Char8.unpack (Network.HTTP.Types.URI.urlEncode GHC.Types.True GHC.Base.$ (Data.ByteString.Char8.pack GHC.Base.$ StripeAPI.Common.stringifyModel account)) GHC.Base.++ "/reject"))) GHC.Base.mempty (GHC.Maybe.Just body) StripeAPI.Common.RequestBodyEncodingFormData)
-- | Defines the object schema located at @paths.\/v1\/accounts\/{account}\/reject.POST.requestBody.content.application\/x-www-form-urlencoded.schema@ in the specification.
data PostAccountsAccountRejectRequestBody = PostAccountsAccountRejectRequestBody
{ -- | expand: Specifies which fields in the response should be expanded.
postAccountsAccountRejectRequestBodyExpand :: (GHC.Maybe.Maybe ([Data.Text.Internal.Text])),
-- | reason: The reason for rejecting the account. Can be \`fraud\`, \`terms_of_service\`, or \`other\`.
--
-- Constraints:
--
-- * Maximum length of 5000
postAccountsAccountRejectRequestBodyReason :: Data.Text.Internal.Text
}
deriving
( GHC.Show.Show,
GHC.Classes.Eq
)
instance Data.Aeson.Types.ToJSON.ToJSON PostAccountsAccountRejectRequestBody where
toJSON obj = Data.Aeson.Types.Internal.object ("expand" Data.Aeson.Types.ToJSON..= postAccountsAccountRejectRequestBodyExpand obj : "reason" Data.Aeson.Types.ToJSON..= postAccountsAccountRejectRequestBodyReason obj : GHC.Base.mempty)
toEncoding obj = Data.Aeson.Encoding.Internal.pairs (("expand" Data.Aeson.Types.ToJSON..= postAccountsAccountRejectRequestBodyExpand obj) GHC.Base.<> ("reason" Data.Aeson.Types.ToJSON..= postAccountsAccountRejectRequestBodyReason obj))
instance Data.Aeson.Types.FromJSON.FromJSON PostAccountsAccountRejectRequestBody where
parseJSON = Data.Aeson.Types.FromJSON.withObject "PostAccountsAccountRejectRequestBody" (\obj -> (GHC.Base.pure PostAccountsAccountRejectRequestBody GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:? "expand")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..: "reason"))
-- | Create a new 'PostAccountsAccountRejectRequestBody' with all required fields.
mkPostAccountsAccountRejectRequestBody ::
-- | 'postAccountsAccountRejectRequestBodyReason'
Data.Text.Internal.Text ->
PostAccountsAccountRejectRequestBody
mkPostAccountsAccountRejectRequestBody postAccountsAccountRejectRequestBodyReason =
PostAccountsAccountRejectRequestBody
{ postAccountsAccountRejectRequestBodyExpand = GHC.Maybe.Nothing,
postAccountsAccountRejectRequestBodyReason = postAccountsAccountRejectRequestBodyReason
}
-- | Represents a response of the operation 'postAccountsAccountReject'.
--
-- The response constructor is chosen by the status code of the response. If no case matches (no specific case for the response code, no range case, no default case), 'PostAccountsAccountRejectResponseError' is used.
data PostAccountsAccountRejectResponse
= -- | Means either no matching case available or a parse error
PostAccountsAccountRejectResponseError GHC.Base.String
| -- | Successful response.
PostAccountsAccountRejectResponse200 Account
| -- | Error response.
PostAccountsAccountRejectResponseDefault Error
deriving (GHC.Show.Show, GHC.Classes.Eq)