mirror of
https://github.com/zkldi/Tachi.git
synced 2026-10-07 14:28:09 +03:00
Allow C12 cards for fervidex integrations
This commit is contained in:
@@ -136,8 +136,11 @@ function FervidexForm({
|
||||
});
|
||||
}}
|
||||
/>
|
||||
{formSettings.cards.some(x => x !== "" && x.length !== 16) && (
|
||||
<div className="text-danger">CardIDs should be 16 characters!</div>
|
||||
{formSettings.cards.some(c => !isCardIDValid(c)) && (
|
||||
<div className="text-danger">
|
||||
CardIDs should be 16 characters, or a <code>C</code> followed by 12
|
||||
characters!
|
||||
</div>
|
||||
)}
|
||||
{formSettings.cards.some(x => x.startsWith("E004")) && (
|
||||
<div className="text-danger">
|
||||
@@ -166,3 +169,15 @@ function FervidexForm({
|
||||
</form>
|
||||
);
|
||||
}
|
||||
|
||||
function isCardIDValid(cardID: string) {
|
||||
if (cardID.startsWith("E004")) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (cardID[0] === "C") {
|
||||
return cardID.length === 13;
|
||||
}
|
||||
|
||||
return cardID.length === 16;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user