braintree / braintree-web

A suite of tools for integrating Braintree in the browser
https://developer.paypal.com/braintree/docs/start/hello-client/javascript/v3
MIT License
444 stars 134 forks source link

Can I allow for amex cvv validation required length 3 #686

Open ArtjomsFomins opened 1 year ago

ArtjomsFomins commented 1 year ago

Is it possible that for amex cvv rules, I could set required length 3 and 4, so it would possible to pass validation with 3 or 4 length I tried with maxlength: 3 but it didn't help

Errors that I have if type cvv length 3 state.cards[0]

code: {name: "CID",  size:4},
niceType : "American Express"
supported : true
type: "american-express"

Braintree error:

code: "HOSTED_FIELDS_FIELDS_INVALID"
deitals: {
 invalidFieldKeys: ['cvv']
},
message: "Some payment input fields are invalid. Cannot tokenize invalid card fields.",
name : "BraintreeError",
type: "CUSTOMER"
hollabaq86 commented 1 year ago

👋 @ArtjomsFomins thanks for reaching out. We use set values for CVV length based on the derived card type, for Amex the default length is 4.

You mentioned trying setting the maxLength to 3, have you tried setting minLength to 3 as well?