cashless2ecash

cashless2ecash: pay with cards for digital cash (experimental)
Log | Files | Refs | README

commit 477569e5cda84886924b5c2781c02ed382e1d61c
parent 7213c6a528bb17a43d591746a4623dff6c97ea25
Author: Joel-Haeberli <haebu@rubigen.ch>
Date:   Mon,  6 May 2024 21:32:22 +0200

fix: BankWithdrawalOperationStatus

Diffstat:
Mc2ec/api-bank-integration.go | 14++++++++++++--
1 file changed, 12 insertions(+), 2 deletions(-)

diff --git a/c2ec/api-bank-integration.go b/c2ec/api-bank-integration.go @@ -286,6 +286,13 @@ func writeWithdrawalOrError(wopid []byte, res http.ResponseWriter) { return } + operator, err := DB.GetProviderByTerminal(int(*withdrawal.TerminalId)) + if err != nil { + LogError("bank-integration-api", err) + res.WriteHeader(HTTP_INTERNAL_SERVER_ERROR) + return + } + if withdrawal == nil { // not found -> 404 res.WriteHeader(HTTP_NOT_FOUND) @@ -299,8 +306,11 @@ func writeWithdrawalOrError(wopid []byte, res http.ResponseWriter) { return } else { withdrawalStatusBytes, err := NewJsonCodec[BankWithdrawalOperationStatus]().EncodeToBytes(&BankWithdrawalOperationStatus{ - Status: withdrawal.WithdrawalStatus, - Amount: *amount, + Status: withdrawal.WithdrawalStatus, + Amount: *amount, + SenderWire: fmt.Sprintf("payto://%s/%d", operator.PaytoTargetType, withdrawal.ProviderTransactionId), + WireTypes: []string{operator.PaytoTargetType}, + ReservePubKey: EddsaPublicKey((withdrawal.ReservePubKey)), }) if err != nil { LogError("bank-integration-api", err)