packages feed

paypal-adaptive-hoops 0.9.0.0 → 0.10.0.0

raw patch · 2 files changed

+24/−7 lines, 2 filesPVP ok

version bump matches the API change (PVP)

API changes (from Hackage documentation)

Files

Example.hs view
@@ -35,20 +35,37 @@   print r   putStrLn ""   case r of-    Left _        -> putStrLn "Stopping on create payment failure."+    Left _        -> putStrLn "Stopping on payment creation failure."     Right payResp -> do-       let payKey = PP._prPayKey payResp       putStrLn "-- Go here and use the other account's password to approve the payment:"       putStrLn $ PP.approvalUrl client payKey       putStrLn ""-       putStrLn "-- Once that's done press enter ..."       _ <- getLine -      putStrLn "-- Now looking up the payment on PayPal to make sure that succeeded."-      putStrLn "-- If it did _prPayExecStatus will have changed from PeCreated to PeCompleted."-      PP.toPayPal client (PP.LookupPayKey payKey) >>= print+      putStrLn "-- Now looking up the payment on PayPal to make sure it succeeded."+      lookupAttempt <- PP.toPayPal client (PP.LookupPayKey payKey)+      case lookupAttempt of+        Right lookupResp ->+          case PP._prPayInfo lookupResp of+            [info] -> do+              case PP._piTransactionStatus info of+                Just PP.TsCompleted -> putStrLn "Withdrawal complete."+                _ -> do+                  putStrLn "The payment has not gone through yet. Expected the PayInfo in"+                  putStrLn "the response to have a _piTransactionStatus of Just TsCompleted:"+                  putStrLn ""+                  print lookupResp+            _      -> do+              putStrLn "The payment has not gone through yet."+              putStrLn "Expected exactly one PayInfo in the response:"+              putStrLn ""+              print lookupResp+        Left lookupError -> do+          putStrLn "Error getting information about the payment:"+          putStrLn ""+          print lookupError  client :: PP.Client client = PP.Client
paypal-adaptive-hoops.cabal view
@@ -1,5 +1,5 @@ name:                 paypal-adaptive-hoops-version:              0.9.0.0+version:              0.10.0.0 author:               Ian Grant Jeffries maintainer:           ian@housejeffries.com category:             Web