diff options
Diffstat (limited to 'TalerWallet1/Model/Model+Refund.swift')
-rw-r--r-- | TalerWallet1/Model/Model+Refund.swift | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/TalerWallet1/Model/Model+Refund.swift b/TalerWallet1/Model/Model+Refund.swift new file mode 100644 index 0000000..dfdd2ff --- /dev/null +++ b/TalerWallet1/Model/Model+Refund.swift @@ -0,0 +1,26 @@ +// +// Model+Refund.swift +// TalerWallet +// +// Created by Ivan Avalos on 31/10/23. +// Copyright © 2023 Taler. All rights reserved. +// + +import Foundation + +fileprivate let ASYNCDELAY: UInt = 0 //set e.g to 6 or 9 seconds for debugging + +extension WalletModel { + @MainActor + func prepareRefundForUriM(url: String) async throws -> PrepareRefundRequest.Response { + let request = PrepareRefundRequest(talerRefundUri: url) + let response = try await sendRequest(request, ASYNCDELAY) + return response + } + + @MainActor + func startRefundM(transactionId: String) async throws { + let request = StartRefundQueryRequest(transactionId: transactionId) + let _ = try await sendRequest(request, ASYNCDELAY) + } +} |