Problem/Motivation
This module purports to support webforms that are ajax enabled.
This does mostly work, but if you go back to a previous page and re-view the payment element it does not work.
Steps to reproduce
If you add this element to a webform, and enable the webform for ajax, use multiple pages in the webform to create at least 2 pages, and then place this component on the second page.
View the form, complete the first page, view the second page, and then go back to the first page and then forward to the second page.
The payment element does not re-appear, and it's not possible to submit the form.
This is because the JavaScript that's added has a global variable: initStripeHasRun and it checks to see if it's set this variable before, and if it has, it aborts and does nothing.
Proposed resolution
Instead of checking a global variable then maybe this module should check something on the form or the stripe form element itself, so that if the component is added, removed and then comes back, it can be initialised.
Maybe for a more fully-featured solution the code should also 'detach' as well as 'attach' at the right points.
Remaining tasks
Code up a fix, and review it.
User interface changes
None.
API changes
None.
Data model changes
None.