mollie-api-haskell-2.0.0.0: Mollie API client for Haskell http://www.mollie.com

Safe HaskellNone
LanguageHaskell2010

Mollie.API.Refunds

Synopsis

Documentation

data RefundAPI route Source #

Instances
Generic (RefundAPI route) Source # 
Instance details

Defined in Mollie.API.Refunds

Associated Types

type Rep (RefundAPI route) :: Type -> Type #

Methods

from :: RefundAPI route -> Rep (RefundAPI route) x #

to :: Rep (RefundAPI route) x -> RefundAPI route #

type Rep (RefundAPI route) Source # 
Instance details

Defined in Mollie.API.Refunds

type Rep (RefundAPI route) = D1 (MetaData "RefundAPI" "Mollie.API.Refunds" "mollie-api-haskell-2.0.0.0-79op8QUDPdyAagRpBQOely" False) (C1 (MetaCons "RefundAPI" PrefixI True) ((S1 (MetaSel (Just "getRefundsPaginated") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 (route :- ("refunds" :> (QueryParam "limit" Int :> (QueryParam "from" RefundId :> Get (HalJSON ': ([] :: [Type])) (List Refund)))))) :*: S1 (MetaSel (Just "getRefunds") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 (route :- ("refunds" :> Get (HalJSON ': ([] :: [Type])) (List Refund))))) :*: (S1 (MetaSel (Just "createPaymentRefund") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 (route :- ("payments" :> (Capture "paymentId" PaymentId :> ("refunds" :> (ReqBody (JSON ': ([] :: [Type])) NewRefund :> Post (HalJSON ': ([] :: [Type])) Refund)))))) :*: (S1 (MetaSel (Just "getPaymentRefund") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 (route :- ("payments" :> (Capture "paymentId" PaymentId :> ("refunds" :> (Capture "id" RefundId :> Get (HalJSON ': ([] :: [Type])) Refund)))))) :*: S1 (MetaSel (Just "cancelPaymentRefund") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 (route :- ("payments" :> (Capture "paymentId" PaymentId :> ("refunds" :> (Capture "id" RefundId :> DeleteNoContent (HalJSON ': ([] :: [Type])) NoContent))))))))))

getRefunds :: RefundAPI route -> route :- ("refunds" :> Get '[HalJSON] (List Refund)) Source #

Handler to get a paginated list of refunds. Applies default pagination for newest 250 customers. See https://docs.mollie.com/reference/v2/refunds-api/list-refunds

getRefundsPaginated :: RefundAPI route -> route :- ("refunds" :> (QueryParam "limit" Int :> (QueryParam "from" RefundId :> Get '[HalJSON] (List Refund)))) Source #

Handler to get a paginated list of refunds. Offset the results by passing the last refund ID in the from query param. The refund with this ID is included in the result set as well. See https://docs.mollie.com/reference/v2/refunds-api/list-refunds

Example for fetching the last 3 refunds:

import Mollie.API
import Mollie.API.Refunds

env <- createEnv "test_mollieapikeyexample"
let refundsResult = runMollie env (getRefundsPaginated refundClient (Just 3) Nothing)

newRefund :: NewRefund Source #

Helper to create a minimal new refund. Defaults to refunding the total amount for the targeted payment.

createPaymentRefund :: RefundAPI route -> route :- ("payments" :> (Capture "paymentId" PaymentId :> ("refunds" :> (ReqBody '[JSON] NewRefund :> Post '[HalJSON] Refund)))) Source #

Handler to create a new refund for a specific payment. See https://docs.mollie.com/reference/v2/refunds-api/create-refund

getPaymentRefund :: RefundAPI route -> route :- ("payments" :> (Capture "paymentId" PaymentId :> ("refunds" :> (Capture "id" RefundId :> Get '[HalJSON] Refund)))) Source #

Handler to get a refund by its identifier for a specific payment. See https://docs.mollie.com/reference/v2/refunds-api/get-refund

cancelPaymentRefund :: RefundAPI route -> route :- ("payments" :> (Capture "paymentId" PaymentId :> ("refunds" :> (Capture "id" RefundId :> DeleteNoContent '[HalJSON] NoContent)))) Source #

Handler to cancel a refund by its identifier for a specific payment. See https://docs.mollie.com/reference/v2/refunds-api/cancel-refund