Unified Address support #8

Merged
pitmutt merged 61 commits from dev18 into master 2023-10-28 12:24:28 +00:00
2 changed files with 21 additions and 20 deletions
Showing only changes of commit 1c3dfd2da1 - Show all commits

View file

@ -21,6 +21,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Removed ### Removed
- `api/orderx` endpoint.
- `makeZcashCall` function moved to the generic `zcash-haskell` library. - `makeZcashCall` function moved to the generic `zcash-haskell` library.
- `RpcResponse`, `RpcCall` types moved to the generic `zcash-haskell` library. - `RpcResponse`, `RpcCall` types moved to the generic `zcash-haskell` library.

View file

@ -1400,26 +1400,26 @@ routes pipe config = do
, "order" .= toJSON (pOrder :: ZGoOrder) , "order" .= toJSON (pOrder :: ZGoOrder)
]) ])
--Upsert xero order --Upsert xero order
post "/api/orderx" $ do {-post "/api/orderx" $ do-}
newOrder <- jsonData {-newOrder <- jsonData-}
let q = payload (newOrder :: Payload ZGoOrder) {-let q = payload (newOrder :: Payload ZGoOrder)-}
_ <- liftIO $ run (upsertXeroOrder q) {-_ <- liftIO $ run (upsertXeroOrder q)-}
myOrder <- {-myOrder <--}
liftAndCatchIO $ {-liftAndCatchIO $-}
run (findXeroOrder (qaddress q) (qexternalInvoice q) (qshortCode q)) {-run (findXeroOrder (qaddress q) (qexternalInvoice q) (qshortCode q))-}
case myOrder of {-case myOrder of-}
Nothing -> status noContent204 {-Nothing -> status noContent204-}
Just o -> do {-Just o -> do-}
let o' = cast' (Doc o) {-let o' = cast' (Doc o)-}
case o' of {-case o' of-}
Nothing -> status internalServerError500 {-Nothing -> status internalServerError500-}
Just pOrder -> do {-Just pOrder -> do-}
status created201 {-status created201-}
Web.Scotty.json {-Web.Scotty.json-}
(object {-(object-}
[ "message" .= ("Order found!" :: String) {-[ "message" .= ("Order found!" :: String)-}
, "order" .= toJSON (pOrder :: ZGoOrder) {-, "order" .= toJSON (pOrder :: ZGoOrder)-}
]) {-])-}
-- Upsert order -- Upsert order
post "/api/order" $ do post "/api/order" $ do
newOrder <- jsonData newOrder <- jsonData