I am working this API https://developer-eu.elavon.com/docs/opayo/spec/api-reference-0#operation/createCi.
In this link, they said
cardholderName
required
string <= 45 characters
The name of the card holder
cardNumber
required
string <= 16 characters
The number of the card
expiryDate
required
string 4 characters
The expiry date of the card in MMYY format
securityCode
required
string [ 3 .. 4 ] characters
The card security code, also known as CV2, CVV, or CVC. This is used in CV2 checks.
I added for string length validation as
[Required]
[StringLength(45)]
public string CardholderName { get; set; }
In this API, they validate securityCode is a requiredstring [ 3 .. 4 ] characters for a POST request.
How to add a validation for
securityCode required string [ 3 .. 4 ] characters?