Add docker deploy
All checks were successful
build docker image / docker-build (push) Successful in 1m32s
All checks were successful
build docker image / docker-build (push) Successful in 1m32s
This commit is contained in:
parent
38b4e89a02
commit
686c46bf78
@ -9,6 +9,10 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
func handleWebhook(w http.ResponseWriter, r *http.Request) {
|
func handleWebhook(w http.ResponseWriter, r *http.Request) {
|
||||||
|
// Parse URL query parameters
|
||||||
|
queryParams := r.URL.Query()
|
||||||
|
isRetry := queryParams.Get("retry") == "true"
|
||||||
|
|
||||||
// read request body bytes
|
// read request body bytes
|
||||||
body, err := io.ReadAll(r.Body)
|
body, err := io.ReadAll(r.Body)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@ -36,7 +40,8 @@ func handleWebhook(w http.ResponseWriter, r *http.Request) {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
// check if transaction hs been logged
|
// only check for logged transaction if not a retry
|
||||||
|
if !isRetry {
|
||||||
isTransactionAlreadyLogged, err := app.LogContainsTransactionID(monobankTransaction.Data.StatementItem.Id)
|
isTransactionAlreadyLogged, err := app.LogContainsTransactionID(monobankTransaction.Data.StatementItem.Id)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
app.LogString(err.Error())
|
app.LogString(err.Error())
|
||||||
@ -45,6 +50,7 @@ func handleWebhook(w http.ResponseWriter, r *http.Request) {
|
|||||||
if isTransactionAlreadyLogged {
|
if isTransactionAlreadyLogged {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
err = app.ImportTransaction(monobankTransaction)
|
err = app.ImportTransaction(monobankTransaction)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user