Today’s Stripe how-to is on validating coupon codes entered by the customer.
Here’s a subscription page that asks the customer for a coupon code and uses the simple integration of Stripe Checkout. 
Ideally, we’d like to check that the coupon code is valid and give the customer a chance to fix it before they hit the ‘Pay’ button and Checkout takes over.
Whenever the Coupon Code text field loses focus and has changed, the script will run. The client will validate the coupon code by communicating with your server (which in turn communicates with Stripe), and a message will appear next to the text field.
Not unexpectedly, this is really slow. It would be better to use the custom integration so that you can disable the ‘Pay’ button while the validation is taking place.
In any case, you will still need to handle invalid codes on the server side. While you could put in logic to prevent a form submission if the code is invalid, there’s still the case where the coupon becomes invalid after this check, but before the form is submitted.
You can find the files
validate-coupon.php in my GitHub repository: https://github.com/wsmoak/stripe/tree/master/php.
 See Pete Keen’s advice on Using Stripe Checkout for Subscriptions.