Support

Home Forums Event Espresso Premium Sending Purchaser's Email from EE to Stripe

Sending Purchaser's Email from EE to Stripe

Posted: April 8, 2024 at 11:29 am

Viewing 2 reply threads


pathwise

April 8, 2024 at 11:29 am

Hello,

We would like to be able to have EE send the purchaser’s email to Stripe when they complete a transaction. Here is a screenshot for your reference: https://snipboard.io/YpLEdI.jpg.

We tried a few different things at our end, but the only way we were able to achieve this outcome is by modifying the stripe-elements.js file in the plugin and correctly targeting the email input in the stipe form just before the credit card info is entered. We have made this change on a development site for testing. We were not able to find this email anywhere in the WordPress database or find a solution that does not involve modifying the plugin directly. Please find below what we have done.

/wp-content/plugins/eea-stripe-gateway/assets/scripts/stripe-elements.js

Line 109

// Comment out this line
// this.cardHolderEmail = $(stripeElementsArgs.billing_selectors.email);

//Replace with this
this.cardHolderEmail = $(‘#stripe-payment-intent-and-elements-form-email’);

As modifying the plugin directly is not something we should be doing, I am wondering if this could be incorporated by your developer. That would be a huge help!


Tony

  • Support Staff

April 9, 2024 at 11:22 am

Hi there,

The change you are making is almost exactly the same as what the original code is using.

So this code:

this.cardHolderEmail = $(stripeElementsArgs.billing_selectors.email);

Sets this.cardHolderEmail to the element found using the value of stripeElementsArgs.billing_selectors.email.

Lets confirm how stripeElementsArgs.billing_selectors.email is set:

https://monosnap.com/file/Ty0M6Xct9eWyWeO74pKntBeMeOsmmu

Ok, so EE sets it using the form itself, then passes the value to wp_localize_script() to add within stripeElementsArgs on the page, so lets output the contents of that (I’m doing this part on your site link to the license):

https://monosnap.com/file/NE4Jx5JkUHpTv2xNe6erRR8G2f7ovf

First line shows me checking stripeElementsArgs.billing_selectors.email value.

Second line shows part of stripeElementsArgs and confirms the value set.

Now lets use both those selectors:

https://monosnap.com/file/7Z7hygMuHzT241je96sITR8WXsNKSu

Both match the value exactly.

So I’m guessing there is something else going on here as my Stripe payments set that value on the charge:

https://monosnap.com/file/xGgaeThQb4JuMCVaiOFfikyQpO9uXv

Any other custom code hooking in here?


pathwise

April 16, 2024 at 3:39 pm

Hi Tony,

It looks like the issue I mentioned before has been resolved in the most recent release which is Version 1.1.13.p. So, I’m going to mark the topic as resolved. Thanks for your help!

Viewing 2 reply threads

The support post ‘Sending Purchaser's Email from EE to Stripe’ 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