commit 26079545c10a178c5cc61bb8fe0f5764bb6c9d6e
parent a16532ce8766960478d2ed72cb6df7f738940312
Author: Marc Stibane <marc@taler.net>
Date: Mon, 22 Jun 2026 09:10:17 +0200
MerchantInfo
Diffstat:
3 files changed, 12 insertions(+), 5 deletions(-)
diff --git a/TalerWallet1/Backend/WalletBackendRequest.swift b/TalerWallet1/Backend/WalletBackendRequest.swift
@@ -92,7 +92,7 @@ struct ScopeInfo: Codable, Hashable {
}
// MARK: -
/// A billing or mailing location.
-struct Location: Codable {
+struct Location: Codable, Equatable, Hashable {
var country: String?
var country_subdivision: String?
var district: String?
@@ -106,10 +106,17 @@ struct Location: Codable {
}
/// Information identifying a merchant.
-struct Merchant: Codable {
+struct MerchantInfo: Identifiable, Codable, Hashable, Sendable {
var name: String
+ var email: String?
+ var website: String?
+ var logo: String? // ImageDataUrl
var address: Location?
var jurisdiction: Location?
+
+ var id: String {
+ return name + (email ?? EMPTYSTRING)
+ }
}
/// A tax made on a payment.
@@ -137,7 +144,7 @@ struct Product: Codable, Identifiable {
/// Brief information about an order.
struct OrderShortInfo: Codable {
var orderId: String
- var merchant: Merchant
+ var merchant: MerchantInfo
var summary: String
var summary_i18n: I18nDict?
var products: [Product]?
diff --git a/TalerWallet1/Model/Model+Payment.swift b/TalerWallet1/Model/Model+Payment.swift
@@ -177,7 +177,7 @@ struct MerchantContractTerms: Codable {
let wireTransferDeadline: Timestamp?// Deadline for the wire transfer
let merchantPub: String // Public key of the merchant
let merchantBaseURL: String // Base URL of the merchant's backend
- let merchant: Merchant
+ let merchant: MerchantInfo
let hWire: String // Hash of the merchant's wire details
let wireMethod: String // merchant wants to use
let exchanges: [ExchangeForPay]
diff --git a/TalerWallet1/Views/Transactions/TransactionRowView.swift b/TalerWallet1/Views/Transactions/TransactionRowView.swift
@@ -393,7 +393,7 @@ extension TalerTransaction { // for PreViews
withdrawalDetails: withdrawalDetails)
self = .withdrawal(WithdrawalTransaction(common: common, details: wDetails))
} else {
- let merchant = Merchant(name: "some random shop")
+ let merchant = MerchantInfo(name: "some random shop")
let info = OrderShortInfo(orderId: "some order ID",
merchant: merchant,
summary: "some product summary",