Hi
I can’t find a way to use the form helper to create a suitable payment form for Stripe
Stripe requires an input with no name and i can’t find a way to create an unnamed input
I’ve actually started to wonder if this even matters because my understanding is that the stripe form with unnamed inputs doesn’t get sent to the server anyway
The reason i wanted to use the form helper is that i’m also using the CSRF component and my understanding of that is that it only works on fields created with the form helper.
Anyone out there encountered this issue?
Here’s an excerpt from the docs:
The CsrfComponent works by setting a cookie to the user’s browser. When forms are created with the Cake\View\Helper\FormHelper, a hidden field is added containing the CSRF token. During the Controller.startup event, if the request is a POST, PUT, DELETE, PATCH request the component will compare the request data & cookie value. If either is missing or the two values mismatch the component will throw a Cake\Network\Exception\InvalidCsrfTokenException.
So it sounds to me like it should be fine to use the form helper to add the fields that are actually meant to go to the server for cake to process, and then add in the Stripe fields with HTML because – since they aren’t going to the server anyway – the CSRF component is irrelevant.
Yes? No? Maybe?