Skip to content

Commit

Permalink
changing amount to long
Browse files Browse the repository at this point in the history
  • Loading branch information
Matt Davis committed Sep 5, 2024
1 parent cbf8e31 commit bcaa590
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions uma-sdk/src/commonMain/kotlin/me/uma/UmaProtocolHelper.kt
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
10 changes: 5 additions & 5 deletions uma-sdk/src/commonMain/kotlin/me/uma/protocol/Invoice.kt
Original file line number Diff line number Diff line change
Expand Up @@ -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. */
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion uma-sdk/src/commonTest/kotlin/me/uma/UmaTests.kt
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,7 @@ class UmaTests {
return Invoice(
receiverUma = "\$[email protected]",
invoiceUUID = "c7c07fec-cf00-431c-916f-6c13fc4b69f9",
amount = 1000,
amount = 1000L,
receivingCurrency = invoiceCurrency,
expiration = timestamp ?: 1000000L,
isSubjectToTravelRule = true,
Expand Down

0 comments on commit bcaa590

Please sign in to comment.