Skip to content

Open source, composable payments platform | PCI compliant | SaaS and Self-host options | Enables connectivity to multiple payment, payout, fraud, vault and tokenization providers | Uplifts authorization with intelligent routing and revenue recovery | Reduce payment processing costs with cost observability | Reduces payment ops with reconciliation

fix(cards): Allow card cvc 000 (#2387)

Vrishab Srivatsaf0dc37438b7a
diff --git a/crates/cards/src/lib.rs b/crates/cards/src/lib.rs
index d47d4f33a1..5308718826 100644
--- a/crates/cards/src/lib.rs
+++ b/crates/cards/src/lib.rs
@@ -15,7 +15,7 @@ pub struct CardSecurityCode(StrongSecret<u16>);
impl TryFrom<u16> for CardSecurityCode {
type Error = error_stack::Report<errors::ValidationError>;
fn try_from(csc: u16) -> Result<Self, Self::Error> {
- if (1..=9999).contains(&csc) {
+ if (0..=9999).contains(&csc) {
Ok(Self(StrongSecret::new(csc)))
} else {
Err(report!(errors::ValidationError::InvalidValue {