yesod-paypal-rest alternatives and similar packages
Based on the "yesod" category.
Alternatively, view yesod-paypal-rest alternatives based on common mentions on social networks and blogs.
-
yesod-dsl
A domain specific language and a code generator desined to create RESTful services for managing an RDBMS with Yesod web framework and Persistent. -
yesod-raml
Generate Yesod framework route definitions, documentaiton, mock-handler, and more from your RAML spec. -
yesod-datatables
Routines for implementing server-side processing for DataTables (jQuery grid) in Haskell -
yesod-auth-hmac-keccak
DISCONTINUED. An account authentication plugin for yesod with encrypted token transfer. -
yesod-s3
DISCONTINUED. Simple Helper Library for using Amazon's Simple Storage Service (S3) with Yesod
CodeRabbit: AI Code Reviews for Developers
Do you think we are missing an alternative of yesod-paypal-rest or a related project?
README
PayPal Client for Yesod
Integration of paypal-rest-client with Yesod.
Build Status
Warning Regarding Stability
The paypal-rest-client library is an experimental package which asks the user to specify an exact version. It is not expected that experimental release changes in that package will affect this package, so we currently only require a version lower than 1.0.0. Please specify an exact version of paypal-rest-client in your application.
Example Usage
The following code demonstrates how to use this package with an example site. It assumes a module named Config exists.
{-# LANGUAGE TemplateHaskell #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE QuasiQuotes #-}
{-# LANGUAGE OverloadedStrings #-}
import qualified Config as Config
import Network.Payments.PayPal
import Network.Payments.PayPal.Environment
import Network.Payments.PayPal.Payments
import Yesod
import Yesod.Payments.PayPal
-- Create site.
data Example = Example YesodPayPalState
-- Create routes.
mkYesod "Example" [parseRoutes|
/ HomeR GET
|]
-- Site is instance of Yesod.
instance Yesod Example where
approot = ApprootStatic "http://localhost:3000"
-- Site will use PayPal.
instance YesodPayPal Example where
yesodPayPalCredentials _ = credentials
yesodPayPalState (Example ppState) = ppState
-- Home page displays information about all transactions.
getHomeR :: Handler Html
getHomeR = do
listResult <- yesodExecPayPal $ listPayments Nothing
case listResult of
Left err -> defaultLayout [whamlet|Error: #{show err}|]
Right result -> defaultLayout [whamlet|Amount of payments: #{show result}|]
-- Start PayPal and start server.
main :: IO ()
main = do
-- Get new PayPal state, including token.
ppStateOrErr <- mkYesodPayPalState credentials
case ppStateOrErr of
Just ppState -> warp 3000 $ Example ppState
Nothing -> error "Could not start server due to missing PayPal token."
-- PayPal credentials.
credentials :: PayPalCredentials
credentials = (sandboxUrl, Config.clientId, Config.secret)