Changing the 'Description' field sent to Stripe

WordPress Event Management, Calendars & Registration Forums General Question Changing the 'Description' field sent to Stripe

This topic contains 1 reply, has 2 voices, and was last updated by  Stephen Harris 4 years, 2 months ago.

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #38683

    Is there a way to change the ‘Description’ sent to Stripe from ‘Booking reference #466 (tom@tombeavan.co.uk)’ to include the course title?

    For example I need to the ‘Description’ changed to ‘Booking reference #466 – Jazz Guitar Course (tom@tombeavan.co.uk)’.

    I have attached an image of what comes through to Stripe at present which I would like changing.

    enter image description here

    Tom Beavan
    #38721

    Hi Tom,

    This is possible with the eventorganiser_stripe_create_payment_intent hook:

    add_filter('eventorganiser_stripe_create_payment_intent', function($intent, $booking){
        $bookee = $booking->get_bookee();
        $email = sanitize_email($bookee->get_email());
        $bookable = $booking->get_bookable();
        $event_id = (int) $bookable->get_event_id();
        $event_title = get_the_title($event_id);
        $intent['description'] = "Booking reference #{$booking->id()} - $event_title ({$email})";
        return $intent;
    }, 10, 2 );
    
    Stephen Harris
Viewing 2 posts - 1 through 2 (of 2 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.