From bcaa59069a8e3982546c1b9d6c4d6fd9bf1e23c5 Mon Sep 17 00:00:00 2001 From: Matt Davis Date: Thu, 5 Sep 2024 09:57:06 -0700 Subject: [PATCH] changing amount to long --- .../src/commonMain/kotlin/me/uma/UmaProtocolHelper.kt | 4 ++-- .../src/commonMain/kotlin/me/uma/protocol/Invoice.kt | 10 +++++----- uma-sdk/src/commonTest/kotlin/me/uma/UmaTests.kt | 2 +- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/uma-sdk/src/commonMain/kotlin/me/uma/UmaProtocolHelper.kt b/uma-sdk/src/commonMain/kotlin/me/uma/UmaProtocolHelper.kt index 34b7315..8bc1ece 100644 --- a/uma-sdk/src/commonMain/kotlin/me/uma/UmaProtocolHelper.kt +++ b/uma-sdk/src/commonMain/kotlin/me/uma/UmaProtocolHelper.kt @@ -906,9 +906,9 @@ class UmaProtocolHelper @JvmOverloads constructor( fun getInvoice( receiverUma: String, invoiceUUID: String, - amount: Int, + amount: Long, receivingCurrency: InvoiceCurrency, - expiration: Int, + expiration: Long, isSubjectToTravelRule: Boolean, commentCharsAllowed: Int? = null, senderUma: String? = null, diff --git a/uma-sdk/src/commonMain/kotlin/me/uma/protocol/Invoice.kt b/uma-sdk/src/commonMain/kotlin/me/uma/protocol/Invoice.kt index 2734d74..e81c61d 100644 --- a/uma-sdk/src/commonMain/kotlin/me/uma/protocol/Invoice.kt +++ b/uma-sdk/src/commonMain/kotlin/me/uma/protocol/Invoice.kt @@ -73,11 +73,11 @@ data class Invoice( /** Invoice UUID Served as both the identifier of the UMA invoice, and the validation of proof of payment.*/ val invoiceUUID: String, /** The amount of invoice to be paid in the smallest unit of the ReceivingCurrency. */ - val amount: Int, + val amount: Long, /** The currency of the invoice */ val receivingCurrency: InvoiceCurrency, /** The unix timestamp the UMA invoice expires */ - val expiration: Number, + val expiration: Long, /** Indicates whether the VASP is a financial institution that requires travel rule information. */ val isSubjectToTravelRule: Boolean, /** RequiredPayerData the data about the payer that the sending VASP must provide in order to send a payment. */ @@ -141,7 +141,7 @@ data class Invoice( when (bytes[offset].toInt()) { 0 -> ib.receiverUma = bytes.getString(offset.valueOffset(), length) 1 -> ib.invoiceUUID = bytes.getString(offset.valueOffset(), length) - 2 -> ib.amount = bytes.getInt(offset.valueOffset(), length) + 2 -> ib.amount = bytes.getLong(offset.valueOffset(), length) 3 -> ib.receivingCurrency = bytes.getTLV(offset.valueOffset(), length, InvoiceCurrency::fromTLV) as InvoiceCurrency @@ -193,9 +193,9 @@ data class Invoice( class InvoiceBuilder { var receiverUma: String? = null var invoiceUUID: String? = null - var amount: Int? = null + var amount: Long? = null var receivingCurrency: InvoiceCurrency? = null - var expiration: Number? = null + var expiration: Long? = null var isSubjectToTravelRule: Boolean? = null var requiredPayerData: CounterPartyDataOptions? = null var umaVersion: String? = null diff --git a/uma-sdk/src/commonTest/kotlin/me/uma/UmaTests.kt b/uma-sdk/src/commonTest/kotlin/me/uma/UmaTests.kt index 1553a89..37d0484 100644 --- a/uma-sdk/src/commonTest/kotlin/me/uma/UmaTests.kt +++ b/uma-sdk/src/commonTest/kotlin/me/uma/UmaTests.kt @@ -276,7 +276,7 @@ class UmaTests { return Invoice( receiverUma = "\$foo@bar.com", invoiceUUID = "c7c07fec-cf00-431c-916f-6c13fc4b69f9", - amount = 1000, + amount = 1000L, receivingCurrency = invoiceCurrency, expiration = timestamp ?: 1000000L, isSubjectToTravelRule = true,