diff --git a/src/PaymentServer/Main.hs b/src/PaymentServer/Main.hs index f439a4e419be143af28d974888005d9feeeddea8..941d4c245cc13a5b6f9a76aaaccf75cf2a405122 100644 --- a/src/PaymentServer/Main.hs +++ b/src/PaymentServer/Main.hs @@ -204,7 +204,7 @@ logEndpoint endpoint = getApp :: ServerConfig -> IO Application getApp config = let - getIssuer ServerConfig{ issuer, signingKeyPath } = do + getIssuer ServerConfig{ issuer, signingKeyPath } = case (issuer, signingKeyPath) of (Trivial, Nothing) -> return $ Right trivialIssue (Ristretto, Just keyPath) -> do diff --git a/src/PaymentServer/Processors/Stripe.hs b/src/PaymentServer/Processors/Stripe.hs index 36cc53519cdda3ad4b1b08717efedad7a1f66811..8caef6e85bda6313da43e98ab577e2a63fc73a10 100644 --- a/src/PaymentServer/Processors/Stripe.hs +++ b/src/PaymentServer/Processors/Stripe.hs @@ -174,7 +174,7 @@ charge d key (Charges token voucher amount currency) = do Left StripeError {} -> throwError err400 { errBody = "Stripe charge didn't succeed" } where getCurrency :: Text -> Handler Currency - getCurrency maybeCurrency = do + getCurrency maybeCurrency = case readMaybe (unpack currency) of Just currency' -> return currency' Nothing -> throwError err400 { errBody = "Invalid currency specified" } diff --git a/src/PaymentServer/Server.hs b/src/PaymentServer/Server.hs index 1dd455723151a5b922edd42c286721e469f9ae27..feef0b051330a58568fa88ded64667b74719049a 100644 --- a/src/PaymentServer/Server.hs +++ b/src/PaymentServer/Server.hs @@ -1,6 +1,5 @@ {-# LANGUAGE DataKinds #-} {-# LANGUAGE TypeOperators #-} -{-# LANGUAGE OverloadedStrings #-} -- | This module exposes a Servant-based Network.Wai server for payment -- interactions.