1
votes

I'm using the stripe api with php, and the basic process is as follows:

  • Submitted with the payment form and a stripe token is created via php stripe sdk.
  • If the customer exists in the local database, I grab their customer_id and fingerprint. Otherwise a new customer is created using the token as the source/card.
  • If the customer and same fingerprint exists in the local database, if the token object response fingerprint and my local database fingerprint different means.
    • I retrieve the customer details using existing customer id and I create a new card using customer source create api($customer->sources->create(array("source" => "tok_18hAe4DdoStEhOoYr2TTQlaL")); ).

Card creation time: how can I validate cvc, expmonth and year?

2
Welcome to Stack Overflow! I edited your question to format the list according to markdown so that it renders properly - please see the editing help for more information on formatting. Please edit in to make clearer what is it that you are asking and add any additional detail that's necessary to identify the specific problem. Good luck!Wtower

2 Answers

0
votes
  • Yes, you can create multiple cards with a single customer in Stripe.
  • To validate the basic card details you can use Stripe.js library. It by default check for CVC, expiry date, and card details. A user is not allowed to enter wrong details.
  • If you are creating token directly from backend code then still Stripe verify the details and not return's the token in case of wrong details.
0
votes

Backend and js also checking cvc length only . Example: If i put my real card details and cvc for 123 means stripe returning the token object.