I want to make sure the card the customer has entered is actually a valid card. Stripe.js only validates its format, it doesn't ask for an authorization from the card issuer. But it seems Stripe requires you to create the customer to authorize the card, but this is a bit silly since the logical flow should be this:
- Validate form input via stripe.js, and obtain token if format is valid
- Authorize token via backend API (PHP/Ruby etc)
- If authorized, create card + customer using token, add subscription/charge customer
- If NOT authorized, return to form with appropriate error, and do not create the customer/charge.
How do you actually achieve this in Stripe? Is there a dedicated Stripe\Card::authorize($token)
method or something similar that can be used?