feat: notify supplier and client after payment is done

This commit is contained in:
2023-07-19 21:01:35 +02:00
parent b426a36570
commit e80e75cb8c
9 changed files with 161 additions and 39 deletions

View File

@@ -3,6 +3,7 @@ package mail
import (
"net/smtp"
"testing"
"time"
"gitea.urkob.com/urko/btc-pay-checker/kit"
"gitea.urkob.com/urko/btc-pay-checker/kit/cfg"
@@ -29,9 +30,13 @@ func init() {
func Test_mailService_SendOK(t *testing.T) {
dto := SendOK{
Price: 10.2,
Amount: 12.0,
ExplorerUrl: "test",
TxID: "test-hash",
Tx: "test-hash",
CustomerID: "client",
OrderID: "order",
Block: "block",
Timestamp: time.Now(),
To: config.MailTo,
}
@@ -41,9 +46,13 @@ func Test_mailService_SendOK(t *testing.T) {
func Test_mailService_SendConfirm(t *testing.T) {
dto := SendOK{
Amount: 12.0,
ExplorerUrl: "test",
TxID: "test-hash",
BlockHash: "block-hash",
Tx: "test-hash",
CustomerID: "client",
OrderID: "order",
Block: "block",
Timestamp: time.Now(),
To: config.MailTo,
}