Skip to content

Commit

Permalink
tidying up
Browse files Browse the repository at this point in the history
  • Loading branch information
jiyoonie9 committed Mar 30, 2024
1 parent 18dd13f commit 3aba7dd
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
*/
Expand Down Expand Up @@ -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
10 changes: 8 additions & 2 deletions protocol/src/test/kotlin/tbdex/sdk/protocol/TestData.kt
Original file line number Diff line number Diff line change
Expand Up @@ -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"
)
Expand Down
6 changes: 3 additions & 3 deletions protocol/src/test/kotlin/tbdex/sdk/protocol/ValidatorTest.kt
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ class ValidatorTest {
},
"data": {
"offeringId": "abcd123",
"payinMethod": {
"payin": {
"kind": "DEBIT_CARD",
"paymentDetails": {
"cardNumber": "1234567890123456",
Expand All @@ -92,7 +92,7 @@ class ValidatorTest {
"cvv": "123"
}
},
"payoutMethod": {
"payout": {
"kind": "BTC_ADDRESS",
"paymentDetails": {
"btcAddress": "1A1zP1eP5QGefi2DMPTfTL5SLmv7DivfNa"
Expand All @@ -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")
}
}

0 comments on commit 3aba7dd

Please sign in to comment.