Safe Haskell | None |
---|---|
Language | Haskell2010 |
Synopsis
- data PaymentAPI route
- newPayment :: Double -> Text -> Text -> NewPayment
- newRecurringPayment :: Double -> Text -> NewPayment
- createPayment :: PaymentAPI route -> route :- ("payments" :> (ReqBody '[JSON] NewPayment :> Post '[HalJSON] Payment))
- getPayment :: PaymentAPI route -> route :- ("payments" :> (Capture "id" PaymentId :> Get '[HalJSON] Payment))
- getPayments :: PaymentAPI route -> route :- ("payments" :> Get '[HalJSON] (List Payment))
- getPaymentsPaginated :: PaymentAPI route -> route :- ("payments" :> (QueryParam "limit" Int :> (QueryParam "from" PaymentId :> Get '[HalJSON] (List Payment))))
- cancelPayment :: PaymentAPI route -> route :- ("payments" :> (Capture "id" PaymentId :> Delete '[HalJSON] Payment))
Documentation
data PaymentAPI route Source #
Instances
:: Double | _amount |
-> Text | _description |
-> Text | _redirectUrl |
-> NewPayment |
Helper to create a minimal new payment for normal use.
:: 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.
createPayment :: PaymentAPI route -> route :- ("payments" :> (ReqBody '[JSON] NewPayment :> Post '[HalJSON] Payment)) Source #
Handler to create a new payment. See https://docs.mollie.com/reference/v2/payments-api/create-payment
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