Update WooCommerce endpoint
This commit is contained in:
parent
ac0e74c818
commit
7672cdc083
1 changed files with 4 additions and 2 deletions
|
@ -1001,6 +1001,7 @@ routes pipe config = do
|
|||
Just o ->
|
||||
if opaid o
|
||||
then do
|
||||
tk <- liftIO generateToken
|
||||
let newOrder =
|
||||
ZGoOrder
|
||||
Nothing
|
||||
|
@ -1027,10 +1028,11 @@ routes pipe config = do
|
|||
(T.concat
|
||||
[T.pack sUrl, "-", ordId, "-", orderKey])
|
||||
""
|
||||
""
|
||||
(T.pack tk)
|
||||
newId <- liftAndCatchIO $ run (insertWooOrder newOrder)
|
||||
status ok200
|
||||
Web.Scotty.json (object ["order" .= show newId])
|
||||
Web.Scotty.json
|
||||
(object ["order" .= show newId, "token" .= tk])
|
||||
else do
|
||||
status accepted202
|
||||
Web.Scotty.json
|
||||
|
|
Loading…
Reference in a new issue