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 ->
|
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
|
||||||
|
|
Loading…
Reference in a new issue