Mangopay / cardregistration-js-kit

Mangopay V2 JS resources for card registration front-end workflow
MIT License
38 stars 34 forks source link

"CVV_FORMAT_ERROR" - Reason Unknown #35

Closed scottwooden closed 7 years ago

scottwooden commented 7 years ago

I'm getting the "CVV_FORMAT_ERROR" even though I'm clearly sending through this object:

cardCvx: "123", cardExpirationDate: "1219", cardNumber: "4706750000000033"

Any thoughts onto what could be going wrong. I'm assuming the cardregistration.init works seeing as it does not throw up an error.

Thanks

yendevy97 commented 7 years ago

me too, do you have fix it??? please help me, thank you so much

mickaelpois commented 7 years ago

Hello @scottwooden, @yendevy97,

Could you tell me what kind of card (CardType property) you are using in trying to register? It will be very helpful. As a reminder, each card type have it own CVV format, which is checked by SDK.

Thanks a lot.

Mickaël

kubami commented 7 years ago

As @mickaelpois said, make sure you send correct CardType. If you don't send it, the https://github.com/Mangopay/cardregistration-js-kit/blob/master/kit/mangopay-kit.js#L299 will always return false.

This parameter is not optional, as it is with the server-side cardRegistration.create https://docs.mangopay.com/endpoints/v2.01/cards#e178_create-a-card-registration

The possible values for the cardType are [MAESTRO, BCMC, AMEX, CB_VISA_MASTERCARD], which is different from possible values for the server-side cardRegistration.create (check in the link above).

Also check carefully the case of the arguments you are passing to all the functions. I had some problems when I directly passed the output of cardRegistration.create from https://github.com/Mangopay/mangopay2-nodejs-sdk/blob/master/docs/CardRegistrations.md to this cardkit. The object returned has capitalized field names (as specified in https://docs.mangopay.com/endpoints/v2.01/cards#e177_the-card-registration-object), and the kit expects lowercase field names. The errors returned are non-obvious.