Reputation: 4171
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.
Upvotes: 4
Views: 2809
Reputation: 984
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.
Upvotes: 6
Reputation: 1668
For PCI complacency submitting card details via ajax is not recommended. I deal with card processing quite a lot ant the best course of action is:
you can read more about PCI compliance here: http://www.cisco.com/en/US/netsol/ns625/index.html
do note if you follow the proper PCI compliance requirements the company that processes card details will have no problem becoming PCI compliant. A lot of Banks are already started enforcing their clients to follow PCI compliancy as necessary requirement.
Upvotes: 1