Verify CVC code before creating charge

∥☆過路亽.° 提交于 2019-12-10 18:28:00

问题


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?


回答1:


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.



来源:https://stackoverflow.com/questions/39448503/verify-cvc-code-before-creating-charge

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!