Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The way the paymentMethodID is passed to the JS is not working due to scripts not being loaded yet.
Fixed this by passing it through a data attribute on the button. I also used Spree.ready instead of $(document).ready.
Also I added a way to track which lib hid the save button, because I based another payment system on this gem and they would then override hiding the button between each other (basically one lib would hide the button but the other one would show it back immediately). Although it's not needed for this gem itself it may be helpful to others in similar situation or if I release the other gem.
By the way really thanks for this gem, I can't believe how amateur and shitty the official spree braintree vzero gem is. Looks like they used it as a play project for their juniors to try Ruby or something. Meanwhile this gem hasn't had an update for 3 years and still works great except for this JS error and the SSL issue, but these are not hard to fix.