-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathUserPaymentMethodException.kt
More file actions
24 lines (21 loc) · 1000 Bytes
/
UserPaymentMethodException.kt
File metadata and controls
24 lines (21 loc) · 1000 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
package com.inner.circle.exception
sealed class UserPaymentMethodException(
status: HttpStatus,
override val message: String,
override val cause: Throwable? = null
) : AppException(status, message, cause) {
data class InvalidCardNumberException(
val cardNumber: String,
override val message: String = "Invalid card number: $cardNumber",
override val cause: Throwable? = null
) : UserPaymentMethodException(HttpStatus.BAD_REQUEST, message, cause)
data class InvalidCVCException(
override val message: String = "Invalid CVC value.",
override val cause: Throwable? = null
) : UserPaymentMethodException(HttpStatus.BAD_REQUEST, message, cause)
data class InvalidExpirationDateException(
val expirationDate: String,
override val message: String = "Invalid expiration date: $expirationDate",
override val cause: Throwable? = null
) : UserPaymentMethodException(HttpStatus.BAD_REQUEST, message, cause)
}