Order.kt (2068B)
1 /* 2 * This file is part of GNU Taler 3 * (C) 2025 Taler Systems S.A. 4 * 5 * GNU Taler is free software; you can redistribute it and/or modify it under the 6 * terms of the GNU General Public License as published by the Free Software 7 * Foundation; either version 3, or (at your option) any later version. 8 * 9 * GNU Taler is distributed in the hope that it will be useful, but WITHOUT ANY 10 * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR 11 * A PARTICULAR PURPOSE. See the GNU General Public License for more details. 12 * 13 * You should have received a copy of the GNU General Public License along with 14 * GNU Taler; see the file COPYING. If not, see <http://www.gnu.org/licenses/> 15 */ 16 17 package net.taler.common 18 19 import kotlinx.serialization.SerialName 20 import kotlinx.serialization.Serializable 21 import net.taler.common.TalerUtils.getLocalizedString 22 23 // TODO: order v1 support 24 25 @Serializable 26 data class Order( 27 val summary: String, 28 @SerialName("summary_i18n") 29 val summaryI18n: Map<String, String>? = null, 30 val amount: Amount, 31 @SerialName("fulfillment_url") 32 val fulfillmentUrl: String? = null, 33 @SerialName("fulfillment_message") 34 val fulfillmentMessage: String? = null, 35 @SerialName("fulfillment_message_i18n") 36 val fulfillmentMessageI18n: Map <String, String>? = null, 37 val products: List<ContractProduct>? = null, 38 @SerialName("wire_transfer_deadline") 39 val wireTransferDeadline: Timestamp? = null, 40 @SerialName("refund_deadline") 41 val refundDeadline: Timestamp? = null, 42 @SerialName("pay_deadline") 43 val payDeadline: Timestamp? = null 44 ) 45 46 @Serializable 47 abstract class OrderProduct { 48 abstract val productId: String? 49 abstract val productName: String? 50 abstract val description: String 51 abstract val descriptionI18n: Map<String, String>? 52 abstract val price: Amount? 53 abstract val location: String? 54 abstract val image: String? 55 abstract val taxes: Set<Tax>? 56 val localizedDescription: String 57 get() = getLocalizedString(descriptionI18n, description) 58 }