|
|
|
|
@ -2,9 +2,6 @@
@@ -2,9 +2,6 @@
|
|
|
|
|
{-# LANGUAGE FlexibleContexts #-} |
|
|
|
|
{-# LANGUAGE GeneralizedNewtypeDeriving #-} |
|
|
|
|
{-# LANGUAGE MultiParamTypeClasses #-} |
|
|
|
|
{-# LANGUAGE OverloadedLabels #-} |
|
|
|
|
{-# LANGUAGE RecordWildCards #-} |
|
|
|
|
{-# LANGUAGE TypeApplications #-} |
|
|
|
|
|
|
|
|
|
module TXMLConnector |
|
|
|
|
( |
|
|
|
|
@ -431,8 +428,22 @@ workThread = do
@@ -431,8 +428,22 @@ workThread = do
|
|
|
|
|
modifyTVar' (bsOrderTransactionIdMap brState) (BM.insert (orderId order) (TransactionId transactionId)) |
|
|
|
|
resp <- readTMVar respVar |
|
|
|
|
putTMVar resp ResponseOrderSubmitted |
|
|
|
|
maybeCb <- liftIO $ readTVarIO (bsNotificationCallback brState) |
|
|
|
|
case maybeCb of |
|
|
|
|
Just cb -> do |
|
|
|
|
let notif = BackendOrderNotification (orderId order) Submitted |
|
|
|
|
liftIO $ cb notif |
|
|
|
|
_ -> pure () |
|
|
|
|
log Debug "TXMLConnector.WorkThread" $ "Inserting orderid: " <> |
|
|
|
|
(T.pack . show) (orderId order) <> " <-> " <> (T.pack . show) transactionId |
|
|
|
|
Just (TransaqResponseResult (ResponseFailure err)) -> do |
|
|
|
|
log Debug "TXMLConnector.WorkThread" $ "Order submission failure: " <> err |
|
|
|
|
maybeCb <- liftIO $ readTVarIO (bsNotificationCallback brState) |
|
|
|
|
case maybeCb of |
|
|
|
|
Just cb -> do |
|
|
|
|
let notif = BackendOrderNotification (orderId order) Rejected |
|
|
|
|
liftIO $ cb notif |
|
|
|
|
_ -> pure () |
|
|
|
|
_ -> log Warning "TXMLConnector.WorkThread" "Unable to parse result" |
|
|
|
|
Right _ -> do |
|
|
|
|
log Warning "TXMLConnector.WorkThread" "Expected result, got nothing" |
|
|
|
|
|