Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix JS errors #219

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Fix JS errors #219

wants to merge 2 commits into from

Conversation

mrbrdo
Copy link

@mrbrdo mrbrdo commented Mar 11, 2022

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.

…tinue button, allowing other libraries to use the same method of hiding the button.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant