diff --git a/protocol/src/main/kotlin/tbdex/sdk/protocol/models/MessageData.kt b/protocol/src/main/kotlin/tbdex/sdk/protocol/models/MessageData.kt index 12b3dfbc..c9ad7fc5 100644 --- a/protocol/src/main/kotlin/tbdex/sdk/protocol/models/MessageData.kt +++ b/protocol/src/main/kotlin/tbdex/sdk/protocol/models/MessageData.kt @@ -39,7 +39,7 @@ sealed class SelectedPaymentMethod( /** * A data class representing the payin method selected. * - * @property kind type of payment method + * @property kind type of payin method * @property paymentDetails An object containing the properties * defined in an Offering's requiredPaymentDetails json schema * @property amount Amount of currency Alice wants to pay in exchange for payout currency @@ -54,7 +54,7 @@ class SelectedPayinMethod( /** * A data class representing the payout method selected. * - * @property kind type of payment method + * @property kind type of payout method * @property paymentDetails An object containing the properties * defined in an Offering's requiredPaymentDetails json schema */ @@ -123,5 +123,7 @@ class OrderData : MessageData /** * A data class implementing [MessageData] that represents the contents of an [OrderStatus]. + * + * @property orderStatus Current status of Order that's being executed */ class OrderStatusData(val orderStatus: String) : MessageData \ No newline at end of file diff --git a/protocol/src/test/kotlin/tbdex/sdk/protocol/TestData.kt b/protocol/src/test/kotlin/tbdex/sdk/protocol/TestData.kt index 317396cb..2bb51f81 100644 --- a/protocol/src/test/kotlin/tbdex/sdk/protocol/TestData.kt +++ b/protocol/src/test/kotlin/tbdex/sdk/protocol/TestData.kt @@ -114,13 +114,19 @@ object TestData { QuoteData( expiresAt = OffsetDateTime.now().plusDays(1), payin = QuoteDetails( - "AUD", "10.00", "0.01", PaymentInstruction( + currencyCode = "AUD", + amount = "10.00", + fee = "0.01", + paymentInstruction = PaymentInstruction( link = "https://block.xyz", instruction = "payin instruction" ) ), payout = QuoteDetails( - "BTC", "0.12", "0.02", PaymentInstruction( + currencyCode = "BTC", + amount = "0.12", + fee = "0.02", + paymentInstruction = PaymentInstruction( link = "https://block.xyz", instruction = "payout instruction" ) diff --git a/protocol/src/test/kotlin/tbdex/sdk/protocol/ValidatorTest.kt b/protocol/src/test/kotlin/tbdex/sdk/protocol/ValidatorTest.kt index 9a366f10..95f5db81 100644 --- a/protocol/src/test/kotlin/tbdex/sdk/protocol/ValidatorTest.kt +++ b/protocol/src/test/kotlin/tbdex/sdk/protocol/ValidatorTest.kt @@ -83,7 +83,7 @@ class ValidatorTest { }, "data": { "offeringId": "abcd123", - "payinMethod": { + "payin": { "kind": "DEBIT_CARD", "paymentDetails": { "cardNumber": "1234567890123456", @@ -92,7 +92,7 @@ class ValidatorTest { "cvv": "123" } }, - "payoutMethod": { + "payout": { "kind": "BTC_ADDRESS", "paymentDetails": { "btcAddress": "1A1zP1eP5QGefi2DMPTfTL5SLmv7DivfNa" @@ -113,6 +113,6 @@ class ValidatorTest { } assertEquals(1, exception.errors.size) - assertThat(exception.errors).contains("$.payinAmount: is missing but it is required") + assertThat(exception.errors).contains("$.payin.amount: is missing but it is required") } }