TerminalsApiModel.kt (3172B)
1 // This file is part of taler-cashless2ecash. 2 // Copyright (C) 2024 Joel Häberli 3 // 4 // taler-cashless2ecash is free software: you can redistribute it and/or modify it 5 // under the terms of the GNU Affero General Public License as published 6 // by the Free Software Foundation, either version 3 of the License, 7 // or (at your option) any later version. 8 // 9 // taler-cashless2ecash is distributed in the hope that it will be useful, but 10 // WITHOUT ANY WARRANTY; without even the implied warranty of 11 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 // Affero General Public License for more details. 13 // 14 // You should have received a copy of the GNU Affero General Public License 15 // along with this program. If not, see <http://www.gnu.org/licenses/>. 16 // 17 // SPDX-License-Identifier: AGPL3.0-or-later 18 19 package ch.bfh.habej2.wallee_c2ec.client.taler.model 20 21 import com.squareup.moshi.Json 22 23 data class TerminalApiConfig( 24 @Json(name = "name") val name: String, 25 @Json(name = "version") val version: String, 26 @Json(name = "provider_name") val providerName: String, 27 @Json(name = "currency") val currency: String, 28 @Json(name = "withdrawal_fees") val exchangeFees: String, 29 @Json(name = "wire_type") val wireType: String 30 ) 31 32 data class TerminalWithdrawalSetup( 33 @Json(name = "request_uid") val requestUid: String, 34 @Json(name = "amount") val amount: String, 35 @Json(name = "suggested_amount") val suggestedAmount: String = "", 36 @Json(name = "provider_transaction_id") val providerTransactionId: String = "", 37 @Json(name = "terminal_fees") val terminalFees: String = "", 38 @Json(name = "user_uuid") val userUuid: String = "", 39 @Json(name = "lock") val lock: String = "" 40 ) 41 42 data class TerminalWithdrawalSetupResponse( 43 @Json(name = "withdrawal_id") val withdrawalId: String 44 ) 45 46 data class TerminalWithdrawalConfirmationRequest( 47 @Json(name = "provider_transaction_id") val providerTransactionId: String, 48 @Json(name = "terminal_fees") val terminalFees: String 49 ) 50 51 enum class WithdrawalOperationStatus(val value: String) { 52 53 pending("pending"), 54 selected("selected"), 55 confirmed("confirmed"), 56 aborted("aborted") 57 } 58 59 data class BankWithdrawalOperationStatus( 60 @Json(name = "status") val status: WithdrawalOperationStatus, 61 @Json(name = "amount") val amount: String, 62 // @Json(name = "suggested_amount") val suggestedAmount: String, 63 // @Json(name = "max_amount") val maxAmount: String, 64 @Json(name = "card_fees") val cardFees: String, 65 @Json(name = "sender_wire") val senderWire: String, 66 @Json(name = "suggested_exchange") val suggestedExchange: String, 67 @Json(name = "required_exchange") val requiredExchange: String, 68 // @Json(name = "confirm_transfer_url") val confirmTransferUrl: String, 69 @Json(name = "wire_types") val wireTypes: Array<String>, 70 @Json(name = "selected_reserve_pub") val selectedReservePub: String, 71 // @Json(name = "selected_exchange_account") val selectedExchangeAccount: String, 72 @Json(name = "aborted") val aborted: Boolean, 73 @Json(name = "selection_done") val selectionDone: Boolean, 74 @Json(name = "transfer_done") val transferDone: Boolean 75 )