Support

Home Forums Event Espresso Premium Wishlist member conflict

Wishlist member conflict

Posted: September 12, 2019 at 2:48 pm

Viewing 10 reply threads


erickao

September 12, 2019 at 2:48 pm

Hello – I am seeing a console error when running the EE4 stripe plugin and wishlist member at the same time: https://cl.ly/3bce55f6eb99 . It says “TypeError: Stripe.setPublishableKey is not a function”. When I deactivated the EE4 Stripe plugin, this page works fine. Please let me know if there is a fix.


Josh

  • Support Staff

September 13, 2019 at 8:15 am

Hi,

Which page is this happening on? The fix would likely involve de-queueing any Stripe related scripts on the Event Espresso checkout page. Can you send a copy of the Wishlist plugin to the “support” address at this domain so we can investigate further?


erickao

September 13, 2019 at 9:19 am

So this is only happening on the page where a wishlist member can update their credit card. It uses Stripe to update the card. It seems that if we could disable all EE4 scripts on this one page, then it would work. Does that make sense? I can send the plugin to you as well.


Josh

  • Support Staff

September 13, 2019 at 10:05 am

Hi,

We received your email but I’m afraid there was no attachment.

With regards to the page in question, it shouldn’t have any Event Espresso Stripe add-on scripts loading on it. The only thing I can think of would be Wishlist is registering its Stripe-related scripts using the same handle that EE’s Stripe add-on uses. That’s only a guess though, because I haven’t looked at the code.

Maybe what you could do is put a copy of the Wishlist plugin into a dropbox or other file share., and drop a link here so we can download.


erickao

September 13, 2019 at 12:48 pm

Just sent an email with the plugin! Sorry about that.


erickao

September 13, 2019 at 12:49 pm

Just kidding – the email got rejected. Here is a link: https://www.dropbox.com/s/8tzrt7e53e63ksz/wishlist-member-v3.0.6309.zip?dl=0


Josh

  • Support Staff

September 13, 2019 at 3:31 pm

I got the plugin and loaded up onto a dev site, and I’m not able to replicate the issue with Wishlist. I also checked the code and Wishlist is using a different Stripe API than Event Espresso uses, so there shouldn’t be any conflict there.

May I ask can you share a url to your site where this is happening so I can check the error in the console to at least see where in the JavaScript the error was triggered?


erickao

September 16, 2019 at 7:24 am

Josh – the URL is here: http://islandnewcomers.org/update-credit-card/ However you need to be logged in as an existing user to see past credit cards. Is this a secure forum that I can share someone’s creds?


Josh

  • Support Staff

September 16, 2019 at 9:40 am

I’m going to advise to not share someone’s credentials.

Can you share the full console error instead? If there’s a specific JS file from the EE stripe add-on that’s contributing to the error, then it can be dequeued from the update-credit-card page. That said, it should not be loading on that page in the first place.


erickao

September 16, 2019 at 2:25 pm

Here is a console screenshot: https://share.getcloudapp.com/eDuoOpGw

And looking at the source code, it seems these are the EE scripts loading in the footer: https://share.getcloudapp.com/BlupwAX0

Thanks for your help!


Tony

  • Support Staff

September 16, 2019 at 3:27 pm

Stripe.setPublishableKey was the function available in v1 and v2 of the Stripe API. The function changed for v3 and this is covered in details in the documentation here: https://stripe.com/docs/stripe-js/reference#stripe-function

The scrips you linked to are not the problem, its happening because EE is loading v3 of Stripe on all pages and that version no longer has the above function, which wishlist is expecting and trying to use.

Stripe themselves actually recommend doing what our add-on is doing here:

https://stripe.com/docs/payments/payment-intents/web#elements

However, we are going to need to change that, for situation like the above.

To best leverage Stripe’s advanced fraud functionality, include this script on every page on your site, not just the checkout page. Including the script on every page allows Stripe to detect anomalous behavior that may be indicative of fraud as users browse your website.

Something that does seem off, is the fact that waitlist has v1, v2 and v3 in the source code – https://monosnap.com/file/rsCgKsNeZtLa3Fzx0K1WS55iXwsSbx

Seems a bit odd to me but I’ve not dug any deeper into it.

To fix this you can use a snippet like this:

https://gist.github.com/Pebblo/4548b955e109540a775389b066299eb4

I’ve set the is_page() check on that function to use update-credit-card but you may need to change that to match the correct slug.

You can add that to a custom functions plugin on your site, we have some documentation on creating one here:

https://eventespresso.com/wiki/create-site-specific-plugin-wordpress-site/

Viewing 10 reply threads

The support post ‘Wishlist member conflict’ is closed to new replies.

Have a question about this support post? Create a new support post in our support forums and include a link to this existing support post so we can help you.

Event Espresso