packages feed

mollie-api-haskell 0.1.0.0 → 0.1.0.1

raw patch · 9 files changed

+89/−29 lines, 9 filesPVP ok

version bump matches the API change (PVP)

API changes (from Hackage documentation)

Files

mollie-api-haskell.cabal view
@@ -1,5 +1,5 @@ name:                mollie-api-haskell-version:             0.1.0.0+version:             0.1.0.1 synopsis:            Mollie API client for Haskell http://www.mollie.com description:         Please see README.md homepage:            https://github.com/paramanders/mollie-api-haskell
src/Mollie/API.hs view
@@ -19,7 +19,8 @@    This key should start with either `test_` or `live_`. -}-createEnv :: Text.Text -> IO Env+createEnv :: Text.Text -- ^ key+          -> IO Env createEnv key = HTTP.withOpenSSL $ do     sslContext <- OpenSSL.context     OpenSSL.contextSetVerificationMode sslContext OpenSSL.VerifyPeer
src/Mollie/API/Customers.hs view
@@ -39,7 +39,9 @@ {-|   Helper to create a minimal new customer. -}-newCustomer :: Text.Text -> Text.Text -> NewCustomer+newCustomer :: Text.Text -- ^ name+            -> Text.Text -- ^ email+            -> NewCustomer newCustomer name email = NewCustomer     { newCustomer_name     = name     , newCustomer_email    = email@@ -64,7 +66,8 @@    For more information see: https://www.mollie.com/en/docs/reference/customers/get. -}-getCustomer :: Text.Text -> Mollie (Either ResponseError Customer)+getCustomer :: Text.Text -- ^ customerId+            -> Mollie (Either ResponseError Customer) getCustomer customerId = get path     where         path = Text.intercalate "/" [customersPath, customerId]@@ -74,7 +77,9 @@    For more information see: https://www.mollie.com/en/docs/reference/customers/list. -}-getCustomers :: Int -> Int -> Mollie (Either ResponseError (List Customer))+getCustomers :: Int -- ^ offset+             -> Int -- ^ count+             -> Mollie (Either ResponseError (List Customer)) getCustomers offset count = get path     where         path = customersPath <> query@@ -85,7 +90,8 @@    For more information see: https://www.mollie.com/en/docs/reference/customers/create-payment. -}-createCustomerPayment :: Text.Text -> NewPayment -> Mollie (Either ResponseError Payment)+createCustomerPayment :: Text.Text -- ^ customerId+                      -> NewPayment -> Mollie (Either ResponseError Payment) createCustomerPayment customerId newPayment = do     result <- send HTTP.methodPost path newPayment     return $ decodeResult result@@ -97,7 +103,10 @@    For more information see: https://www.mollie.com/en/docs/reference/customers/list-payments. -}-getCustomerPayments :: Text.Text -> Int -> Int -> Mollie (Either ResponseError (List Payment))+getCustomerPayments :: Text.Text -- ^ customerId+                    -> Int -- ^ offset+                    -> Int -- ^ count+                    -> Mollie (Either ResponseError (List Payment)) getCustomerPayments customerId offset count = get path     where         path = (Text.intercalate "/" [customersPath, customerId, paymentsPath]) <> query
src/Mollie/API/Issuers.hs view
@@ -28,7 +28,8 @@    For more information see: https://www.mollie.com/en/docs/reference/issuers/get. -}-getIssuer :: Text.Text -> Mollie (Either ResponseError Issuer)+getIssuer :: Text.Text -- ^ issuerId+          -> Mollie (Either ResponseError Issuer) getIssuer issuerId = get path     where         path = (Text.intercalate "/" [issuersPath, issuerId])@@ -38,7 +39,9 @@    For more information see: https://www.mollie.com/en/docs/reference/issuers/list. -}-getIssuers :: Int -> Int -> Mollie (Either ResponseError (List Issuer))+getIssuers :: Int -- ^ offset+           -> Int -- ^ count+           -> Mollie (Either ResponseError (List Issuer)) getIssuers offset count = get path     where         path = issuersPath <> query
src/Mollie/API/Mandates.hs view
@@ -33,7 +33,10 @@ mandatesPath :: Text.Text mandatesPath = "mandates" -newMandate :: PaymentMethod -> Text.Text -> Text.Text -> NewMandate+newMandate :: PaymentMethod+           -> Text.Text -- ^ consumerName+           -> Text.Text -- ^ consumerAccount+           -> NewMandate newMandate method consumerName consumerAccount = NewMandate     { newMandate_method           = method     , newMandate_consumerName     = consumerName@@ -48,7 +51,8 @@    For more information see: https://www.mollie.com/en/docs/reference/mandates/create. -}-createCustomerMandate :: Text.Text -> NewMandate -> Mollie (Either ResponseError Mandate)+createCustomerMandate :: Text.Text -- ^ customerId+                      -> NewMandate -> Mollie (Either ResponseError Mandate) createCustomerMandate customerId newMandate = do     result <- send HTTP.methodPost path newMandate     return $ decodeResult result@@ -60,7 +64,9 @@    For more information see: https://www.mollie.com/en/docs/reference/mandates/get. -}-getCustomerMandate :: Text.Text -> Text.Text -> Mollie (Either ResponseError Mandate)+getCustomerMandate :: Text.Text -- ^ customerId+                   -> Text.Text -- ^ mandateId+                   -> Mollie (Either ResponseError Mandate) getCustomerMandate customerId mandateId = get path     where         path = Text.intercalate "/" [customersPath, customerId, mandatesPath, mandateId]@@ -70,7 +76,10 @@    For more information see: https://www.mollie.com/en/docs/reference/mandates/list. -}-getCustomerMandates :: Text.Text -> Int -> Int -> Mollie (Either ResponseError (List Mandate))+getCustomerMandates :: Text.Text -- ^ customerId+                    -> Int -- ^ offset+                    -> Int -- ^ count+                    -> Mollie (Either ResponseError (List Mandate)) getCustomerMandates customerId offset count = get path     where         path = (Text.intercalate "/" [customersPath, customerId, mandatesPath]) <> query
src/Mollie/API/Methods.hs view
@@ -32,7 +32,9 @@    For more information see: https://www.mollie.com/en/docs/reference/methods/get. -}-getMethod :: PaymentMethod -> Text.Text -> Mollie (Either ResponseError Method)+getMethod :: PaymentMethod+          -> Text.Text -- ^ locale+          -> Mollie (Either ResponseError Method) getMethod methodId locale = get path     where         path = (Text.intercalate "/" [methodsPath, toText methodId]) <> query@@ -43,7 +45,10 @@    For more information see: https://www.mollie.com/en/docs/reference/methods/list. -}-getMethods :: Text.Text -> Int -> Int -> Mollie (Either ResponseError (List Method))+getMethods :: Text.Text -- ^ locale+           -> Int -- ^ offset+           -> Int -- ^ count+           -> Mollie (Either ResponseError (List Method)) getMethods locale offset count = get path     where         path = methodsPath <> query
src/Mollie/API/Payments.hs view
@@ -45,7 +45,10 @@ {-|   Helper to create a minimal new payment for normal use. -}-newPayment :: Double -> Text.Text -> Text.Text -> NewPayment+newPayment :: Double -- ^ amount+           -> Text.Text -- ^ description+           -> Text.Text -- ^ redirectUrl+           -> NewPayment newPayment amount description redirectUrl = (newRecurringPayment amount description)     { newPayment_redirectUrl       = Just redirectUrl     , newPayment_recurringType     = Nothing@@ -61,7 +64,9 @@   For a first recurring payment use `newPayment` and set the   recurring type to `First`, because it needs a return url. -}-newRecurringPayment :: Double -> Text.Text -> NewPayment+newRecurringPayment :: Double -- ^ amount+                    -> Text.Text -- ^ description+                    -> NewPayment newRecurringPayment amount description = NewPayment     { newPayment_amount            = amount     , newPayment_description       = description@@ -107,7 +112,8 @@    For more information see: https://www.mollie.com/en/docs/reference/payments/get. -}-getPayment :: Text.Text -> Mollie (Either ResponseError Payment)+getPayment :: Text.Text -- ^ paymentId+           -> Mollie (Either ResponseError Payment) getPayment paymentId = get path     where         path = Text.intercalate "/" [paymentsPath, paymentId]@@ -117,7 +123,9 @@    For more information see: https://www.mollie.com/en/docs/reference/payments/list. -}-getPayments :: Int -> Int -> Mollie (Either ResponseError (List Payment))+getPayments :: Int -- ^ offset+            -> Int -- ^ count+            -> Mollie (Either ResponseError (List Payment)) getPayments offset count = get path     where         path = paymentsPath <> query@@ -137,7 +145,9 @@    For more information see: https://www.mollie.com/en/docs/reference/refunds/create. -}-createPaymentRefund :: Text.Text -> NewRefund -> Mollie (Either ResponseError Refund)+createPaymentRefund :: Text.Text -- ^ paymentId+                    -> NewRefund+                    -> Mollie (Either ResponseError Refund) createPaymentRefund paymentId newRefund = do     result <- send HTTP.methodPost path newRefund     return $ decodeResult result@@ -149,7 +159,9 @@    For more information see: https://www.mollie.com/en/docs/reference/refunds/get. -}-getPaymentRefund :: Text.Text -> Text.Text -> Mollie (Either ResponseError Refund)+getPaymentRefund :: Text.Text -- ^ paymentId+                 -> Text.Text -- ^ refundId+                 -> Mollie (Either ResponseError Refund) getPaymentRefund paymentId refundId = get path     where         path = Text.intercalate "/" [paymentsPath, paymentId, refundsPath, refundId]@@ -161,7 +173,9 @@    For more information see: https://www.mollie.com/en/docs/reference/refunds/delete. -}-cancelPaymentRefund :: Text.Text -> Text.Text -> Mollie (Maybe ResponseError)+cancelPaymentRefund :: Text.Text -- ^ paymentId+                    -> Text.Text -- ^ refundId+                    -> Mollie (Maybe ResponseError) cancelPaymentRefund paymentId refundId = do     result <- delete path     return $ ignoreResult result@@ -173,7 +187,10 @@    For more information see: https://www.mollie.com/en/docs/reference/refunds/list. -}-getPaymentRefunds :: Text.Text -> Int -> Int -> Mollie (Either ResponseError (List Refund))+getPaymentRefunds :: Text.Text -- ^ paymentId+                  -> Int -- ^ offset+                  -> Int -- ^ count+                  -> Mollie (Either ResponseError (List Refund)) getPaymentRefunds paymentId offset count = get path     where         path = (Text.intercalate "/" [paymentsPath, paymentId, refundsPath]) <> query
src/Mollie/API/Refunds.hs view
@@ -27,7 +27,9 @@    For more information see: https://www.mollie.com/en/docs/reference/refunds/list-all. -}-getRefunds :: Int -> Int -> Mollie (Either ResponseError (List Refund))+getRefunds :: Int -- ^ offset+           -> Int -- ^ count+           -> Mollie (Either ResponseError (List Refund)) getRefunds offset count = get path     where         path = refundsPath <> query
src/Mollie/API/Subscriptions.hs view
@@ -33,8 +33,14 @@  {-|   Helper to create a minimal new subscription. Defaults to an ongoing subscription.++  The interval is in human readable format and support the following values:+  `1 day`/`n days`, `1 week`/`n weeks`, `1 month`/`n months` where n > 1. -}-newSubscription :: Double -> Text.Text -> Text.Text -> NewSubscription+newSubscription :: Double -- ^ amount+                -> Text.Text -- ^ interval+                -> Text.Text -- ^ description+                -> NewSubscription newSubscription amount interval description = NewSubscription     { newSubscription_amount      = amount     , newSubscription_times       = Nothing@@ -49,7 +55,8 @@    For more information see: https://www.mollie.com/en/docs/reference/subscriptions/create. -}-createCustomerSubscription :: Text.Text -> NewSubscription -> Mollie (Either ResponseError Subscription)+createCustomerSubscription :: Text.Text -- ^ customerId+                           -> NewSubscription -> Mollie (Either ResponseError Subscription) createCustomerSubscription customerId newSubscription = do     result <- send HTTP.methodPost path newSubscription     return $ decodeResult result@@ -61,7 +68,9 @@    For more information see: https://www.mollie.com/en/docs/reference/subscriptions/get. -}-getCustomerSubscription :: Text.Text -> Text.Text -> Mollie (Either ResponseError Subscription)+getCustomerSubscription :: Text.Text -- ^ customerId+                        -> Text.Text -- ^ subscriptionId+                        -> Mollie (Either ResponseError Subscription) getCustomerSubscription customerId subscriptionId = get path     where         path = Text.intercalate "/" [customersPath, customerId, subscriptionsPath, subscriptionId]@@ -71,7 +80,10 @@    For more information see: https://www.mollie.com/en/docs/reference/subscriptions/list. -}-getCustomerSubscriptions :: Text.Text -> Int -> Int -> Mollie (Either ResponseError (List Subscription))+getCustomerSubscriptions :: Text.Text -- ^ customerId+                         -> Int -- ^ offset+                         -> Int -- ^ count+                         -> Mollie (Either ResponseError (List Subscription)) getCustomerSubscriptions customerId offset count = get path     where         path = (Text.intercalate "/" [customersPath, customerId, subscriptionsPath]) <> query@@ -82,7 +94,9 @@    For more information see: https://www.mollie.com/en/docs/reference/subscriptions/delete. -}-cancelCustomerSubscription :: Text.Text -> Text.Text -> Mollie (Either ResponseError Subscription)+cancelCustomerSubscription :: Text.Text -- ^ customerId+                           -> Text.Text -- ^ subscriptionId+                           -> Mollie (Either ResponseError Subscription) cancelCustomerSubscription customerId subscriptionId = do     result <- delete path     return $ decodeResult result