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

Safe HaskellNone
LanguageHaskell2010

Mollie.API.Payments

Synopsis

Documentation

data PaymentAPI route Source #

Instances
Generic (PaymentAPI route) Source # 
Instance details

Defined in Mollie.API.Payments

Associated Types

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

Methods

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

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

type Rep (PaymentAPI route) Source # 
Instance details

Defined in Mollie.API.Payments

type Rep (PaymentAPI route) = D1 (MetaData "PaymentAPI" "Mollie.API.Payments" "mollie-api-haskell-2.0.0.0-79op8QUDPdyAagRpBQOely" False) (C1 (MetaCons "PaymentAPI" PrefixI True) ((S1 (MetaSel (Just "getPaymentsPaginated") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 (route :- ("payments" :> (QueryParam "limit" Int :> (QueryParam "from" PaymentId :> Get (HalJSON ': ([] :: [Type])) (List Payment)))))) :*: S1 (MetaSel (Just "getPayments") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 (route :- ("payments" :> Get (HalJSON ': ([] :: [Type])) (List Payment))))) :*: (S1 (MetaSel (Just "createPayment") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 (route :- ("payments" :> (ReqBody (JSON ': ([] :: [Type])) NewPayment :> Post (HalJSON ': ([] :: [Type])) Payment)))) :*: (S1 (MetaSel (Just "getPayment") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 (route :- ("payments" :> (Capture "id" PaymentId :> Get (HalJSON ': ([] :: [Type])) Payment)))) :*: S1 (MetaSel (Just "cancelPayment") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 (route :- ("payments" :> (Capture "id" PaymentId :> Delete (HalJSON ': ([] :: [Type])) Payment))))))))

newPayment Source #

Arguments

:: Double

_amount

-> Text

_description

-> Text

_redirectUrl

-> NewPayment 

Helper to create a minimal new payment for normal use.

newRecurringPayment Source #

Arguments

:: Double

_amount

-> Text

_description

-> NewPayment 

Helper to create a minimal new payment for recurring use.

A payment created with this helper should be sent with the createCustomerPayment from Customers or have the customerId set.

For a first recurring payment use newPayment and set the recurring type to First, because it needs a return url.

getPayment :: PaymentAPI route -> route :- ("payments" :> (Capture "id" PaymentId :> Get '[HalJSON] Payment)) Source #

Handler to get a payment by its identifier. See https://docs.mollie.com/reference/v2/payments-api/create-payment

getPayments :: PaymentAPI route -> route :- ("payments" :> Get '[HalJSON] (List Payment)) Source #

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

getPaymentsPaginated :: PaymentAPI route -> route :- ("payments" :> (QueryParam "limit" Int :> (QueryParam "from" PaymentId :> Get '[HalJSON] (List Payment)))) Source #

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

Example for fetching the last 10 payments:

import Mollie.API
import Mollie.API.Payments

env <- createEnv "test_mollieapikeyexample"
let paymentsResult = runMollie env (getPaymentsPaginated paymentClient (Just 10) Nothing)

cancelPayment :: PaymentAPI route -> route :- ("payments" :> (Capture "id" PaymentId :> Delete '[HalJSON] Payment)) Source #

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