From ed9ba07a321f596996099c311a954dab728b18c0 Mon Sep 17 00:00:00 2001 From: John Preston Date: Tue, 7 Feb 2023 20:18:17 +0400 Subject: [PATCH] Disable local card number validation. Some cards are reported invalid there that are valid. --- .../payments/stripe/stripe_card_validator.cpp | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/Telegram/SourceFiles/payments/stripe/stripe_card_validator.cpp b/Telegram/SourceFiles/payments/stripe/stripe_card_validator.cpp index 139ab6b62..5b91b7062 100644 --- a/Telegram/SourceFiles/payments/stripe/stripe_card_validator.cpp +++ b/Telegram/SourceFiles/payments/stripe/stripe_card_validator.cpp @@ -193,11 +193,12 @@ CardValidationResult ValidateCard(const QString &number) { } const auto range = MostSpecificBinRangeForNumber(sanitized); const auto brand = range.brand; - if (sanitized.size() > range.length) { - return { .state = ValidationState::Invalid, .brand = brand }; - } else if (sanitized.size() < range.length) { - return { .state = ValidationState::Incomplete, .brand = brand }; - } else if (!IsValidLuhn(sanitized)) { + //if (sanitized.size() > range.length) { + // return { .state = ValidationState::Invalid, .brand = brand }; + //} else if (sanitized.size() < range.length) { + // return { .state = ValidationState::Incomplete, .brand = brand }; + //} else + if (!IsValidLuhn(sanitized)) { return { .state = ValidationState::Invalid, .brand = brand }; } return {