Update WooCommerce endpoint

This commit is contained in:
Rene Vergara 2023-06-23 11:26:03 -05:00
parent ac0e74c818
commit 7672cdc083
Signed by: pitmutt
GPG key ID: 65122AD495A7F5B2

View file

@ -1001,6 +1001,7 @@ routes pipe config = do
Just o -> Just o ->
if opaid o if opaid o
then do then do
tk <- liftIO generateToken
let newOrder = let newOrder =
ZGoOrder ZGoOrder
Nothing Nothing
@ -1027,10 +1028,11 @@ routes pipe config = do
(T.concat (T.concat
[T.pack sUrl, "-", ordId, "-", orderKey]) [T.pack sUrl, "-", ordId, "-", orderKey])
"" ""
"" (T.pack tk)
newId <- liftAndCatchIO $ run (insertWooOrder newOrder) newId <- liftAndCatchIO $ run (insertWooOrder newOrder)
status ok200 status ok200
Web.Scotty.json (object ["order" .= show newId]) Web.Scotty.json
(object ["order" .= show newId, "token" .= tk])
else do else do
status accepted202 status accepted202
Web.Scotty.json Web.Scotty.json