cashless2ecash

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

commit 07637459789c0e3e9071c870562c50daee3c63e1
parent 46d220c4df5a6cd2a452d3b1da8e056af32f4014
Author: Joel-Haeberli <haebu@rubigen.ch>
Date:   Sat,  1 Jun 2024 10:17:40 +0200

fix: config

Diffstat:
Mc2ec/api-bank-integration.go | 42++++++++++++++++++++++--------------------
Mcli/cli.go | 2+-
Msimulation/c2ec-simulation | 0
Msimulation/sim-wallet.go | 21+++++++++++----------
Awallee-c2ec/app/src/main/java/ch/bfh/habej2/wallee_c2ec/client/taler/model/Amount.kt | 0
Awallee-c2ec/app/src/main/java/ch/bfh/habej2/wallee_c2ec/client/taler/model/CurrencySpecification.kt | 2++
6 files changed, 36 insertions(+), 31 deletions(-)

diff --git a/c2ec/api-bank-integration.go b/c2ec/api-bank-integration.go @@ -52,16 +52,17 @@ type BankWithdrawalOperationPostResponse struct { } type BankWithdrawalOperationStatus struct { - Status WithdrawalOperationStatus `json:"status"` - Amount string `json:"amount"` - CardFees string `json:"card_fees"` - SenderWire string `json:"sender_wire"` - WireTypes []string `json:"wire_types"` - ReservePubKey EddsaPublicKey `json:"selected_reserve_pub"` - RequiredExchange string `json:"required_exchange"` - Aborted bool `json:"aborted"` - SelectionDone bool `json:"selection_done"` - TransferDone bool `json:"transfer_done"` + Status WithdrawalOperationStatus `json:"status"` + Amount string `json:"amount"` + CardFees string `json:"card_fees"` + SenderWire string `json:"sender_wire"` + WireTypes []string `json:"wire_types"` + ReservePubKey EddsaPublicKey `json:"selected_reserve_pub"` + SuggestedExchange string `json:"suggested_exchange"` + RequiredExchange string `json:"required_exchange"` + Aborted bool `json:"aborted"` + SelectionDone bool `json:"selection_done"` + TransferDone bool `json:"transfer_done"` } func bankIntegrationConfig(res http.ResponseWriter, req *http.Request) { @@ -387,16 +388,17 @@ func formatWithdrawalOrErrorStatus(w *Withdrawal) ([]byte, int) { return nil, HTTP_INTERNAL_SERVER_ERROR } else { withdrawalStatusBytes, err := NewJsonCodec[BankWithdrawalOperationStatus]().EncodeToBytes(&BankWithdrawalOperationStatus{ - Status: w.WithdrawalStatus, - Amount: FormatAmount(amount, CONFIG.Server.CurrencyFractionDigits), - CardFees: FormatAmount(fees, CONFIG.Server.CurrencyFractionDigits), - SenderWire: fmt.Sprintf("payto://%s/%d", operator.PaytoTargetType, w.ProviderTransactionId), - WireTypes: []string{operator.PaytoTargetType}, - ReservePubKey: EddsaPublicKey((encodeCrock(w.ReservePubKey))), - RequiredExchange: CONFIG.Server.ExchangeBaseUrl, - Aborted: w.WithdrawalStatus == ABORTED, - SelectionDone: w.WithdrawalStatus == SELECTED, - TransferDone: w.WithdrawalStatus == CONFIRMED, + Status: w.WithdrawalStatus, + Amount: FormatAmount(amount, CONFIG.Server.CurrencyFractionDigits), + CardFees: FormatAmount(fees, CONFIG.Server.CurrencyFractionDigits), + SenderWire: fmt.Sprintf("payto://%s/%d", operator.PaytoTargetType, w.ProviderTransactionId), + WireTypes: []string{operator.PaytoTargetType}, + ReservePubKey: EddsaPublicKey((encodeCrock(w.ReservePubKey))), + SuggestedExchange: CONFIG.Server.ExchangeBaseUrl, + RequiredExchange: CONFIG.Server.ExchangeBaseUrl, + Aborted: w.WithdrawalStatus == ABORTED, + SelectionDone: w.WithdrawalStatus == SELECTED, + TransferDone: w.WithdrawalStatus == CONFIRMED, }) if err != nil { LogError("bank-integration-api", err) diff --git a/cli/cli.go b/cli/cli.go @@ -522,7 +522,7 @@ func showHelp() error { fmt.Println("activate wallee terminal (", ACTION_ACTIVATE_TERMINAL, ")") fmt.Println("setup simulation (", ACTION_SETUP_SIMULATION, ")") fmt.Println("withdrawal information by wopid (", ACTION_WITHDRAWAL_INFOMRATION, ")") - fmt.Println("witdhrawal information by provider transaction id", ACTION_WITHDRAWAL_INFOMRATION_BY_PTID, ")") + fmt.Println("witdhrawal information by provider transaction id (", ACTION_WITHDRAWAL_INFOMRATION_BY_PTID, ")") fmt.Println("connect database (", ACTION_CONNECT_DB, ")") fmt.Println("show help (", ACTION_HELP, ")") fmt.Println("quit (", ACTION_QUIT, ")") diff --git a/simulation/c2ec-simulation b/simulation/c2ec-simulation Binary files differ. diff --git a/simulation/sim-wallet.go b/simulation/sim-wallet.go @@ -173,14 +173,15 @@ type BankWithdrawalOperationPostResponse struct { } type BankWithdrawalOperationStatus struct { - Status WithdrawalOperationStatus `json:"status"` - Amount string `json:"amount"` - CardFees string `json:"card_fees"` - SenderWire string `json:"sender_wire"` - WireTypes []string `json:"wire_types"` - ReservePubKey EddsaPublicKey `json:"selected_reserve_pub"` - RequiredExchange string `json:"required_exchange"` - Aborted bool `json:"aborted"` - SelectionDone bool `json:"selection_done"` - TransferDone bool `json:"transfer_done"` + Status WithdrawalOperationStatus `json:"status"` + Amount string `json:"amount"` + CardFees string `json:"card_fees"` + SenderWire string `json:"sender_wire"` + WireTypes []string `json:"wire_types"` + ReservePubKey EddsaPublicKey `json:"selected_reserve_pub"` + SuggestedExchange string `json:"suggested_exchange"` + RequiredExchange string `json:"required_exchange"` + Aborted bool `json:"aborted"` + SelectionDone bool `json:"selection_done"` + TransferDone bool `json:"transfer_done"` } diff --git a/wallee-c2ec/app/src/main/java/ch/bfh/habej2/wallee_c2ec/client/taler/model/Amount.kt b/wallee-c2ec/app/src/main/java/ch/bfh/habej2/wallee_c2ec/client/taler/model/Amount.kt diff --git a/wallee-c2ec/app/src/main/java/ch/bfh/habej2/wallee_c2ec/client/taler/model/CurrencySpecification.kt b/wallee-c2ec/app/src/main/java/ch/bfh/habej2/wallee_c2ec/client/taler/model/CurrencySpecification.kt @@ -0,0 +1,2 @@ +package ch.bfh.habej2.wallee_c2ec.client.taler.model +