use super::ErrorReason;
#[derive(Debug, Clone, PartialEq, Eq)]
pub struct PaymentProblem {
reason: ErrorReason,
details: String,
}
impl PaymentProblem {
#[must_use]
pub const fn new(reason: ErrorReason, details: String) -> Self {
Self { reason, details }
}
#[must_use]
pub fn reason(&self) -> ErrorReason {
self.reason.clone()
}
#[must_use]
pub const fn reason_ref(&self) -> &ErrorReason {
&self.reason
}
#[must_use]
pub fn details(&self) -> &str {
&self.details
}
}
pub trait AsPaymentProblem {
fn as_payment_problem(&self) -> PaymentProblem;
}