Send Event Name & Payer Name to Stripe

WordPress Event Management, Calendars & Registration Forums General Question Send Event Name & Payer Name to Stripe

This topic contains 22 replies, has 4 voices, and was last updated by  Le Re 1 week, 4 days ago.

Viewing 15 posts - 1 through 15 (of 23 total)
  • Author
    Posts
  • #30193

    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
    #30194

    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
    #30225

    Or maybe is there some kind of webhoook possibly?

    Zachary Cole
    #30239

    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
    #30246

    This worked perfectly! Ended up creating a site utility plugin and putting it in there. Thank you so much!

    Zachary Cole
    #35224

    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
    #35225

    Actually… can the following info be passed onto Stripe via MetaData? …

    Address
    Email
    Phone Number

    Thank you! I love this plugin!

    Zachary Cole
    #35291

    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
    #35313

    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? Booking Form Stripe Meta PHP Code Used

    Thank you for your help!

    Zachary Cole
    #35314
    Zachary Cole
    #35315

    The keys should be meta_6 and meta_3.

    Stephen Harris
    #35316

    Oh my word… major face palm. Sorry to waste your time with that question, ha ha! This did it, thank You!

    Zachary Cole
    #36602

    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
    #36605

    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
    #36612

    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
Viewing 15 posts - 1 through 15 (of 23 total)
To enable me to focus on Pro customers, only users who have a valid license for the Pro add-on may post new topics or replies in this forum. If you have a valid license, please log-in or register an account using the e-mail address you purchased the license with. If you don't you can purchase one here. Or there's always the WordPress repository forum.