Submitting credit card info through Stripe and validating

jquery, stripe-payments, validation

Solution

The reason we recommend not putting the name attributes in the form fields, is so that you can be sure that the inputs will never be submitted to your server. This could happen, for example, if there was a JavaScript error in your client-side code capturing the form submit event.

Having said that, it's just a precaution, not a requirement.

Problem

I am following Ryan Bates' Railscast on submitting payments to Stripe. He removes the name attribute of the credit card info so that no credit card info gets submitted to the server, only to Stripe through an ajax call. This doesn't play well with jQuery Validation since it requires a name attribute. I finally decided to go back to using the name attribute but set it to null in the Stripe callback. My question is whether this is still a good, secure practice.

Original source