Support

Home Forums Event Espresso Premium Payment Received Notification

Payment Received Notification

Posted: October 30, 2017 at 7:47 am


Devaraj

October 30, 2017 at 7:47 am

Hi, Good day!

I am not sure if this can be done on your end but We need to configure the notifications we get when payments are received, to include the customer name and phone number. Currently they look like this:

Congratulations! You have just received a payment of £170.00. You can view the full details of this payment in your dashboard:

https://dashboard.stripe.com/payments/ch_1BH7klDP4vNwCR14OqHQ7hZ0

==== Charge Summary ====

Charge ID: ch_1BH7klDP4vNwCR14OqHQ7hZ0

Charge description: Rebirthing, Bioenergetics & Emotional Release

———————————————————————————————————-

with a subject line showing the payment amount and the customer email address.

We would like to have, in the Charge Summary if possible, the customer name and phone number if possible.

I had a web chat with a support person who told me to include the Customer’s name as part of the Metadata, which can be included in an API call, found here: https://stripe.com/docs/api#metadata

I have included the Customer’s name as part of the meta data I just don’t know how to get the phone by customer ID via code, can you look into this?

I hope that makes sense; please let me know if not. Thank you!


Tony

  • Support Staff

October 31, 2017 at 3:38 am

Hi there,

The email you’re referring to is the Stripe payment confirmation, there is also an email sent from Event Espresso for payment confirmation. By default that only goes to the user but you can set EE to also send one to the event admin. The reason I mention that is it is easier to edit the payment confirmation sent from EE than it is to edit Stripes email (if you can).

However, a quick question:

I have included the Customer’s name as part of the meta data I just don’t know how to get the phone by customer ID via code, can you look into this?

How have you added the customer name as part of the meta data?


Devaraj

November 2, 2017 at 5:26 am

Hi Tony,

Sorry for the late response, I greatly appreciate your help.

How could we edit the payment confirmation and set it to be sent also on the event admin (info@osholeela.co.uk)? Does it resolve the issue we are having right now?

We added the name on this file Stripe_Onsite
EEG_Stripe_Onsite.gateway.php

Thank you!


Tony

  • Support Staff

November 2, 2017 at 6:25 am

How could we edit the payment confirmation and set it to be sent also on the event admin (info@osholeela.co.uk)?

Go to Event Espresso -> Messages -> Default Messages Templates -> Payment Received -> Event Admin.

You’ll notice the ‘To’ field is empty, which disables that context from sending.

You can either add the email directly to that section and save, or add the [CO_EMAIL] shortcode and EE will use the email address you have set in general settings.

Does it resolve the issue we are having right now?

It depends on what details you need to have, the payment receive email can pull registration details for the primary registrant, including the name and phone number. Is that all the info you need?

We added the name on this file Stripe_Onsite
EEG_Stripe_Onsite.gateway.php

Please don’t modify core files, if you update the Stripe payment method plugin you’ll lose any modifications you’ve made to that plugin anyway and we have multiple hooks through EE and its add-ons. If there isn’t a hook that allows your changes we can always request one is added.

What code did you change? I can check if we need a hook to add the details you need.


Devaraj

November 3, 2017 at 4:12 am

Hi Tony!

Thanks for your suggestion but we really need to receive payment notifications from Stripe only, otherwise we get too many emails.

We just needed the contact number and customer’s name on the Stripe notification we are receiving.

We edit the code here:
/public_html/wp-content/plugins/eea-stripe-gateway/payment_methods/Stripe_Onsite
EEG_Stripe_Onsite.gateway.php

and added the Name on this line of code:

Stripe::setApiKey( $key );
$stripe_data = array(
‘amount’ => str_replace( array(‘,’, ‘.’), ”, number_format( $payment->amount(), 2) ),
‘currency’ => $payment->currency_code(),
‘card’ => $billing_info[‘ee_stripe_token’],
‘description’ => $billing_info[‘ee_stripe_prod_description’],
‘metadata’ => array(“name” => $user_data->data->display_name)
);

Can you check on this?

Thank you!


Tony

  • Support Staff

November 3, 2017 at 5:53 am

Pretty much the next line after the above is a filter to allow you to add details to $stripe_data without editing the files:

$stripe_data = apply_filters('FHEE__EEG_Stripe_Onsite__do_direct_payment__stripe_data_array', $stripe_data, $payment, $transaction, $billing_info);

You’re using $user_data but that’s not a variable we create within Stripe so I’m guessing there are more than that edit.

Heres an example of how you can add the name without hacking up core:
https://gist.github.com/Pebblo/3e9f4775c05d0ad5d2bf65f9d717b106

That uses the primary registrant’s details from the registrations assigned to the transaction.

You mentioned the phone number and using the customer ID to pull that information, do you mean from Stripe? We don’t create customers within Stripe to make payments currently, you can add the phone number if the user provided it during the registration to the metadata in a similar way to the above using:

'phone' => $primary_attendee->phone();

I’m not sure how you’d use that within the Stripe confirmation email, however.


Devaraj

November 8, 2017 at 10:34 pm

Hi Tony!

Thank you for your continuous support. However we are having trouble when we’re configuring your codes. Do you have any other suggestions on how we can include the customer’s name and phone number on the Stripe payment notification?

Thank you so much!


Tony

  • Support Staff

November 9, 2017 at 1:35 am

Are you passing the details over and they are not showing on the confirmation email? Or are you having problems pulling the details? (the above pulls full name and the phone number).

As we don’t have any control over the Stripe email, I don’t know how you would add those details to that email, have you contacted them since adding the details to meta data asking how to add the details passed into the email?


Devaraj

November 9, 2017 at 11:10 pm

Hello Tony,

We have just chatted with stripe support and they are asking if you guys supports Webhooks for Stripe? I think they can do it on their end if there’s a webhooks supported.


Tony

  • Support Staff

November 10, 2017 at 3:14 am

I don’t believe so but I can check with the developers (may take a little due to time differences), however Webhooks are a way for Stripe to post data back to your site, I’m not sure how that helps pull the details into the email.

Another option have is to include the Stripe payment link within the admin email you receive when a registration is approved.

So from your above message, you could have this:

https://dashboard.stripe.com/payments/ch_1BH7klDP4vNwCR14OqHQ7hZ0
==== Charge Summary ====
Charge ID: ch_1BH7klDP4vNwCR14OqHQ7hZ0

Within the event admin email, like this – http://take.ms/oTSDN
(that’s an example from one of my registrations on a test site)

That way you don’t have another email, just include the details in one you already receive.


Devaraj

November 10, 2017 at 6:25 am

Hello Tony,

Thank you for that option! We think that is much better however I am just confused on how to implement that, can you guide me through it or give some step step screenshots? Thank you so much have a great weekend!


Tony

  • Support Staff

November 10, 2017 at 8:33 am

Sure, go to Event Espresso -> Messages -> Default message templates -> Registration Approved -> Event Admin – http://take.ms/0YQVk

That’s the template for the message the admin receives when a registration has been approved.

Now you want to add the content you want to include and it depends where you want to add it. The way I did the above was to paste in the details you linked above in ‘visual’ mode – http://take.ms/NsxdK

Pasted this in place:

https://dashboard.stripe.com/payments/ch_1BH7klDP4vNwCR14OqHQ7hZ0
==== Charge Summary ====
Charge ID: ch_1BH7klDP4vNwCR14OqHQ7hZ0

Like so – http://take.ms/5ibgN

Then switch to Text mode on the editor (next to the visual tab).

Now you’ll see the HTML view for the content, find the details you just added in – http://take.ms/qwhC5

Swap out the charge ID from Stripe to use the [LAST_PAYMENT_TRANSACTION_ID] shortcode – http://take.ms/lHqPR

Now switch back to text mode and you’ll have this – http://take.ms/k1oaj

You can convert the Stripe link into an actual link by highlighing it and clicking the link button on the editor – http://take.ms/z84Cv

Make sure the popup for the link has https://dashboard.stripe.com/payments/[LAST_PAYMENT_TRANSACTION_ID]

Then click the blue arrow to add it.

Now save the template and retest.

Note that the link will obviously only work for Stripe payments, if you have another payment method it will still build a link in that template, but it won’t take you to an actual payment in Stripe.

That help?


Devaraj

November 14, 2017 at 5:13 am

Hello Tony,

Brilliant! This is very helpful! We will try it on the site and we’ll let you know the result.

We really appreciate your help. Thanks a lot!


Tony

  • Support Staff

November 14, 2017 at 5:18 am

You’re most welcome.

Hopefully that proves a little easier than the above and should include all of the details you need 🙂

The support post ‘Payment Received Notification’ 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