Skip to content

Commit

Permalink
Renaming EventDetail types for bin and last4 to prefix with 'card' to…
Browse files Browse the repository at this point in the history
… match web and ios
  • Loading branch information
dhudec committed Jan 9, 2023
1 parent 166be50 commit efc5356
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ data class EventDetails(
) {
companion object {
const val CardBrand = "cardBrand"
const val Bin = "bin"
const val Last4 = "last4"
const val CardBin = "cardBin"
const val CardLast4 = "cardLast4"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -71,14 +71,14 @@ class CardNumberElement @JvmOverloads constructor(
if (value != null && isMaskSatisfied) {
eventDetails.add(
EventDetails(
EventDetails.Bin,
EventDetails.CardBin,
value.take(6)
)
)

eventDetails.add(
EventDetails(
EventDetails.Last4,
EventDetails.CardLast4,
value.takeLast(4)
)
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -134,11 +134,11 @@ class CardNumberElementTests {
get { message }.isEqualTo(CardBrands.VISA.label)
}
get { details }.any {
get { type }.isEqualTo(EventDetails.Bin)
get { type }.isEqualTo(EventDetails.CardBin)
get { message }.isEqualTo("411111")
}
get { details }.any {
get { type }.isEqualTo(EventDetails.Last4)
get { type }.isEqualTo(EventDetails.CardLast4)
get { message }.isEqualTo("1111")
}
}
Expand All @@ -160,11 +160,11 @@ class CardNumberElementTests {
get { message }.isEqualTo(CardBrands.VISA.label)
}
get { details }.any {
get { type }.isEqualTo(EventDetails.Bin)
get { type }.isEqualTo(EventDetails.CardBin)
get { message }.isEqualTo("424242")
}
get { details }.any {
get { type }.isEqualTo(EventDetails.Last4)
get { type }.isEqualTo(EventDetails.CardLast4)
get { message }.isEqualTo("4243")
}
}
Expand Down

0 comments on commit efc5356

Please sign in to comment.