Implement enhancements for #3
This commit is contained in:
parent
6a766ee0d8
commit
25fad17363
5 changed files with 9 additions and 5 deletions
|
@ -15,6 +15,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
||||||
## Changed
|
## Changed
|
||||||
|
|
||||||
- Remove old code for PIN generation
|
- Remove old code for PIN generation
|
||||||
|
- Xero reference field to include the amount of ZEC received
|
||||||
|
|
||||||
## [1.2.5] - 2023-02-01
|
## [1.2.5] - 2023-02-01
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
name: zgo-backend
|
name: zgo-backend
|
||||||
version: 1.2.5
|
version: 1.2.6
|
||||||
git: "https://git.vergara.tech/Vergara_Tech/zgo-backend"
|
git: "https://git.vergara.tech/Vergara_Tech/zgo-backend"
|
||||||
license: BOSL
|
license: BOSL
|
||||||
author: "Rene Vergara"
|
author: "Rene Vergara"
|
||||||
|
|
|
@ -410,8 +410,9 @@ getXeroInvoice pipe dbName inv address = do
|
||||||
Right iData -> return $ Just (head $ xir_invs iData)
|
Right iData -> return $ Just (head $ xir_invs iData)
|
||||||
_ -> return Nothing
|
_ -> return Nothing
|
||||||
|
|
||||||
payXeroInvoice :: Pipe -> T.Text -> T.Text -> T.Text -> Double -> IO ()
|
payXeroInvoice ::
|
||||||
payXeroInvoice pipe dbName inv address amt = do
|
Pipe -> T.Text -> T.Text -> T.Text -> Double -> Double -> IO ()
|
||||||
|
payXeroInvoice pipe dbName inv address amt zec = do
|
||||||
token <- access pipe master dbName $ findToken address
|
token <- access pipe master dbName $ findToken address
|
||||||
let aToken = t_access <$> (token >>= cast' . Doc)
|
let aToken = t_access <$> (token >>= cast' . Doc)
|
||||||
let aCode = t_code <$> (token >>= cast' . Doc)
|
let aCode = t_code <$> (token >>= cast' . Doc)
|
||||||
|
@ -426,7 +427,8 @@ payXeroInvoice pipe dbName inv address amt = do
|
||||||
[ "Invoice" .= object ["InvoiceNumber" .= inv]
|
[ "Invoice" .= object ["InvoiceNumber" .= inv]
|
||||||
, "Account" .= object ["Code" .= fromMaybe "" aCode]
|
, "Account" .= object ["Code" .= fromMaybe "" aCode]
|
||||||
, "Date" .= utctDay today
|
, "Date" .= utctDay today
|
||||||
, "Reference" .= ("Paid in Zcash through ZGo" :: String)
|
, "Reference" .=
|
||||||
|
("Paid in Zcash through ZGo: " ++ show zec ++ " ZEC" :: String)
|
||||||
, "Amount" .= amt
|
, "Amount" .= amt
|
||||||
]) $
|
]) $
|
||||||
addRequestHeader "Accept" "application/json" $
|
addRequestHeader "Accept" "application/json" $
|
||||||
|
|
|
@ -1192,6 +1192,7 @@ scanPayments config pipe = do
|
||||||
(qexternalInvoice xO)
|
(qexternalInvoice xO)
|
||||||
(qaddress xO)
|
(qaddress xO)
|
||||||
(qtotal xO)
|
(qtotal xO)
|
||||||
|
(qtotalZec xO)
|
||||||
"WC" -> do
|
"WC" -> do
|
||||||
let wOwner = fst $ head sResult ! 2
|
let wOwner = fst $ head sResult ! 2
|
||||||
wooT <-
|
wooT <-
|
||||||
|
|
|
@ -5,7 +5,7 @@ cabal-version: 1.12
|
||||||
-- see: https://github.com/sol/hpack
|
-- see: https://github.com/sol/hpack
|
||||||
|
|
||||||
name: zgo-backend
|
name: zgo-backend
|
||||||
version: 1.2.5
|
version: 1.2.6
|
||||||
synopsis: Haskell Back-end for the ZGo point-of-sale application
|
synopsis: Haskell Back-end for the ZGo point-of-sale application
|
||||||
description: Please see the README at <https://git.vergara.tech/Vergara_Tech//zgo-backend#readme>
|
description: Please see the README at <https://git.vergara.tech/Vergara_Tech//zgo-backend#readme>
|
||||||
category: Web
|
category: Web
|
||||||
|
|
Loading…
Reference in a new issue