3

I'm trying to check the user entered cvc code. I have stored stripe customer_id and the stripe card_id. I want to verify the CVC code before charging the user.

Below are code for creating charge.

charge = Stripe::Charge.create(
        :amount => 1000,
        :currency => "usd",
        :customer => "cus_3sAc**************",
        :card => "card_18m*********************",
        :description => "Testing multiple card payment",
        :capture => false # default true,
        :cvc => 125 
      )

But cvc parameter is invalid here. If I remove the cvc, it works fine. But it won't check the CVC verification. How can I check this?

Gagan
  • 573
  • 8
  • 25

1 Answers1

6

You cannot provide the CVC directly in a charge creation request. (Incidentally, if you did provide the CVC directly in the charge creation request sent by your backend server, that would mean your backend server has access to the CVC which would be problematic from a PCI compliance point of view.)

At this time, Stripe doesn't provide a way to check the CVC of saved cards. The CVC is checked once, when you initially create the customer object using the card token, or add a card to an existing customer object. It is not possible (for now) to "revalidate" the CVC at later times.

Ywain
  • 16,854
  • 4
  • 51
  • 67
  • 1
    Could you please comment on whether this feature has become available recently? whether it is planned at all? If not, are there some good ways to liberate our European customers from re-entering CC number, exp. date and CVC on every purchase? CVC are usually mandatory in Europe for every transaction, so storing the number and date without possibility of re-validating CVC is unusable here. Another way could be to retrieve and re-populate number and date fields from an existing Stripe source/card, but I don't think there is a way of doing this now, and whether it is a good idea at all. – Ivan Aksamentov - Drop Feb 05 '18 at 06:38
  • @Drop Still not possible at the moment. I'm fairly sure it's still on the roadmap, though probably at a fairly low priority. You'd have to write to support at https://support.stripe.com/email to get a more precise answer. Note that even in Europe, it's perfectly possible to create charges without a CVC. There are many Stripe users in Europe who are using saved cards without issues. – Ywain Feb 05 '18 at 17:55