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 s.
(StripeAPI.Common.MonadHTTP m, StripeAPI.Common.SecurityScheme s) =>
-- | The configuration to use in the request
StripeAPI.Common.Configuration s ->
-- | account | Constraints: Maximum length of 5000
Data.Text.Internal.Text ->
-- | The request body to send
PostAccountsAccountRejectRequestBody ->
-- | Monad containing the result of the operation
m (Data.Either.Either Network.HTTP.Client.Types.HttpException (Network.HTTP.Client.Types.Response PostAccountsAccountRejectResponse))
postAccountsAccountReject
config
account
body =
GHC.Base.fmap
( 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.doBodyCallWithConfiguration config (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.Maybe.Just body) StripeAPI.Common.RequestBodyEncodingFormData)
-- | > POST /v1/accounts/{account}/reject
--
-- The same as 'postAccountsAccountReject' but returns the raw 'Data.ByteString.Char8.ByteString'
postAccountsAccountRejectRaw ::
forall m s.
( StripeAPI.Common.MonadHTTP m,
StripeAPI.Common.SecurityScheme s
) =>
StripeAPI.Common.Configuration s ->
Data.Text.Internal.Text ->
PostAccountsAccountRejectRequestBody ->
m
( Data.Either.Either Network.HTTP.Client.Types.HttpException
(Network.HTTP.Client.Types.Response Data.ByteString.Internal.ByteString)
)
postAccountsAccountRejectRaw
config
account
body = GHC.Base.id (StripeAPI.Common.doBodyCallWithConfiguration config (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.Maybe.Just body) StripeAPI.Common.RequestBodyEncodingFormData)
-- | > POST /v1/accounts/{account}/reject
--
-- Monadic version of 'postAccountsAccountReject' (use with 'StripeAPI.Common.runWithConfiguration')
postAccountsAccountRejectM ::
forall m s.
( StripeAPI.Common.MonadHTTP m,
StripeAPI.Common.SecurityScheme s
) =>
Data.Text.Internal.Text ->
PostAccountsAccountRejectRequestBody ->
Control.Monad.Trans.Reader.ReaderT (StripeAPI.Common.Configuration s)
m
( Data.Either.Either Network.HTTP.Client.Types.HttpException
(Network.HTTP.Client.Types.Response PostAccountsAccountRejectResponse)
)
postAccountsAccountRejectM
account
body =
GHC.Base.fmap
( GHC.Base.fmap
( \response_2 ->
GHC.Base.fmap
( Data.Either.either PostAccountsAccountRejectResponseError GHC.Base.id
GHC.Base.. ( \response body ->
if | (\status_3 -> Network.HTTP.Types.Status.statusCode status_3 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_2
)
response_2
)
)
(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.Maybe.Just body) StripeAPI.Common.RequestBodyEncodingFormData)
-- | > POST /v1/accounts/{account}/reject
--
-- Monadic version of 'postAccountsAccountRejectRaw' (use with 'StripeAPI.Common.runWithConfiguration')
postAccountsAccountRejectRawM ::
forall m s.
( StripeAPI.Common.MonadHTTP m,
StripeAPI.Common.SecurityScheme s
) =>
Data.Text.Internal.Text ->
PostAccountsAccountRejectRequestBody ->
Control.Monad.Trans.Reader.ReaderT (StripeAPI.Common.Configuration s)
m
( Data.Either.Either Network.HTTP.Client.Types.HttpException
(Network.HTTP.Client.Types.Response Data.ByteString.Internal.ByteString)
)
postAccountsAccountRejectRawM
account
body = GHC.Base.id (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.Maybe.Just body) StripeAPI.Common.RequestBodyEncodingFormData)
-- | Defines the data type for the schema postAccountsAccountRejectRequestBody
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.ToJSON PostAccountsAccountRejectRequestBody where
toJSON obj = Data.Aeson.object ((Data.Aeson..=) "expand" (postAccountsAccountRejectRequestBodyExpand obj) : (Data.Aeson..=) "reason" (postAccountsAccountRejectRequestBodyReason obj) : [])
toEncoding obj = Data.Aeson.pairs ((Data.Aeson..=) "expand" (postAccountsAccountRejectRequestBodyExpand obj) GHC.Base.<> (Data.Aeson..=) "reason" (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"))
-- | 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)