Hi!
Is there a way to send the event title/name and the name of the person paying over to Stripe? Currently only the Booking Reference Number is showing in Stripe.
It would be helpful to see this in Stripe when we pull our reports for bookkeeping.
-Zach
Zachary Cole
I’m guessing it’s these…
%display_name%
%event_title%
Possible to send this info to Stripe? Stripe has a metadata section. I’ve used the PayPal option in the past and PayPall would capture this info, but Stripe isn’t doing that.
Zach
Zachary Cole
Or maybe is there some kind of webhoook possibly?
Zachary Cole
Hi Zachary,
Apologies for the delay in responding to your post. You can do this with the following snippet:
add_filter('eventorganiser_stripe_create_charge', function($charge, $booking_id){
$event_id = eo_get_booking_meta( $booking_id, 'event_id', true );
$charge['metadata'] = isset($charge['metadata']) ? $charge['metadata'] : array();
$charge['metadata']['eventname'] = get_the_title($event_id);
$charge['metadata']['bookee_fname'] = eo_get_booking_meta( $booking_id, 'bookee_first_name', true );
$charge['metadata']['bookee_lname'] = eo_get_booking_meta( $booking_id, 'bookee_last_name', true );
return $charge;
}, 10, 2 );
Just add that to a utility plugin, or theme’s functions.php
Stephen Harris
This worked perfectly! Ended up creating a site utility plugin and putting it in there. Thank you so much!
Zachary Cole
Following up on this. This works like a charm, any way to send the bookee’s Address as well to Stripe in the Metadata?
Zachary Cole
Actually… can the following info be passed onto Stripe via MetaData? …
Address
Email
Phone Number
Thank you! I love this plugin!
Zachary Cole
Yes, for email just use:
eo_get_booking_meta( $booking_id, 'bookee_email', true );
For custom fields, to get the data stored with field {field-id}
:
eo_get_booking_meta( $booking_id, 'meta_{field-id}', true );
See http://codex.wp-event-organiser.com/function-eo_get_booking_meta.html for more details
Glad you like the plug-in 🙂
Stephen Harris
Thanks for this. The email one worked great, but the metas ones still don’t seem to pass the data on to Stripe. See the 3 screenshots attached/below. Do I have something incorrect?
Thank you for your help!
Zachary Cole
Zachary Cole
The keys should be meta_6
and meta_3
.
Stephen Harris
Oh my word… major face palm. Sorry to waste your time with that question, ha ha! This did it, thank You!
Zachary Cole
Hi Stephen
I’ve added the code above to my theme function file.
add_filter('eventorganiser_stripe_create_charge', function($charge, $booking_id){
$event_id = eo_get_booking_meta( $booking_id, 'event_id', true );
$charge['metadata'] = isset($charge['metadata']) ? $charge['metadata'] : array();
$charge['metadata']['eventname'] = get_the_title($event_id);
$charge['metadata']['bookee_fname'] = eo_get_booking_meta( $booking_id, 'bookee_first_name', true );
$charge['metadata']['bookee_lname'] = eo_get_booking_meta( $booking_id, 'bookee_last_name', true );
return $charge;
}, 10, 2 );
However the Events name and bookee names don’t appear in stripe. Is there some other step I’m missing?
Many thanks
Wil
Wil McDonald
What I’m after ideally is to set a dynamic statement descriptor for Stripe, that will then appear in Bank transaction details. As detailed here: https://stripe.com/nz/blog/dynamic-descriptors
Any help on this would extremely awesome.
Cheers
Wil McDonald
Hi WIll,
On the most recent version of Pro / Stripe extensions you would need to do the following:
add_filter('eventorganiser_stripe_create_payment_intent', function($intent, $booking){
$bookee = $booking->get_bookee();
$bookable = $booking->get_bookable();
$event_id = (int) $bookable->get_event_id();
$intent['metadata']['eventname'] = get_the_title($event_id);
$intent['metadata']['bookee_fname'] = $bookee->get_first_name();
$intent['metadata']['bookee_lname'] = $bookee->get_last_name();
return $intent;
}, 10, 2 );
You can also use that to set the statement_descriptor
:
$intent['statement_descriptor'] = '....';
Stephen Harris