yesod-mangopay 1.5 → 1.6
raw patch · 3 files changed
+15/−4 lines, 3 filesdep ~mangopaydep ~persistent-template
Dependency ranges changed: mangopay, persistent-template
Files
- app/Handler/Home.hs +5/−2
- src/Yesod/MangoPay.hs +7/−0
- yesod-mangopay.cabal +3/−2
app/Handler/Home.hs view
@@ -7,6 +7,7 @@ import Yesod.MangoPay import Web.MangoPay import Data.IORef (modifyIORef, readIORef)+import Control.Monad (when) -- | Home page getHomeR :: Handler Html@@ -26,8 +27,10 @@ getMPHookR = do evt<-parseMPNotification site <- getYesod- -- prepend event to list- liftIO $ modifyIORef (appEvents site) (evt :)+ ok <- runYesodMPTToken $ checkEvent evt+ when ok $ + -- prepend event to list+ liftIO $ modifyIORef (appEvents site) (evt :) -- send simple response sendResponse ("ok"::Text)
src/Yesod/MangoPay.hs view
@@ -13,6 +13,7 @@ import qualified Data.Map as M import Control.Monad (void) import qualified Control.Exception.Lifted as L+import Database.Persist.TH (derivePersistField) -- | The 'YesodMangoPay' class for foundation datatypes that -- support running 'MangoPayT' actions.@@ -146,3 +147,9 @@ Y.MonadBaseControl IO m => m a -> (MpException -> m a) -> m a catchMP=L.catch++-----------------------------------------------------------------------------------------------+-- Instances for MangoPay types that may be useful in a Persistent/Yesod context++$(derivePersistField "KindOfAuthentication")+
yesod-mangopay.cabal view
@@ -1,5 +1,5 @@ name: yesod-mangopay-version: 1.5+version: 1.6 cabal-version: >= 1.8 build-type: Simple author: JP Moresmau <jpmoresmau@gmail.com>@@ -37,7 +37,7 @@ hs-source-dirs: src build-depends: base >= 4 && < 5- , mangopay == 1.5.*+ , mangopay == 1.6.* , containers >= 0.5 && < 0.6 , http-conduit >= 2.0 && < 2.2 , http-types >= 0.8.2 && < 0.9@@ -46,6 +46,7 @@ , time >= 1.4.0 && < 1.5 , yesod >= 1.2.5 && < 1.3 , yesod-core >= 1.2 && < 1.3+ , persistent-template >=1.3.1 && <1.4 exposed-modules: Yesod.MangoPay, Yesod.MangoPay.Util