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 ago.

Viewing 8 posts - 16 through 23 (of 23 total)
  • Author
    Posts
  • #36646

    Brilliant, thank you Stephen

    There’s just one more detail I can’t find. I want to pass the Booking ID in the statement descriptor as follows:

    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();
     $description = 'IC:'.***NEED Booking ID here***;
    
     // Make sure the string has less than 22 characters - otherwise doesn't seem to appear in Bank statements
     $shortdescription = substr($description,0,21);
    
     // Add meta details to Stripe
     $intent['metadata']['eventname'] = get_the_title($event_id);
     $intent['metadata']['bookee_fname'] = $bookee->get_first_name();
     $intent['metadata']['bookee_lname'] = $bookee->get_last_name();
     $intent['metadata']['bookee_email'] = $bookee->get_email();
    
     // Sets statement descriptors for stripe to send to banks
     $intent['statement_descriptor'] = $shortdescription;
    
     return $intent;
    }, 10, 2 );
    

    Any help would be fantastic

    Wil McDonald
    #36686

    Hi Will,

    $booking->id();
    

    returns the booking ID.

    Stephen Harris
    #36721

    Fantastic, thank you. Works well.

    Wil McDonald
    #38226

    Hi!
    I just tried the code above but this don’t work for me. Stripe only shows the Booking Reference Number. Have there been any changes in the meantime?
    Thanks!
    Chris

    Le Re
    #38231

    Hi Chris,

    There’s been no changes since my last reply on November 7th.

    Where are you putting that code snippet?

    What you can do is add an error_log call to determine if that code is being executed at all.

    Stephen Harris
    #38244

    Hi Stephen, thank you for your reply. After putting the code to the site-utility it works. Thanks. One last question, how can i use the email-adress as the stripe receipt-email – (To trigger an automatic receipt after the payment is complete)
    Thanks Chris

    Le Re
    #38246

    Hi Chris,

    In the above snippet you can add

    $intent['receipt_email'] = $bookee->get_email();
    
    Stephen Harris
    #38276

    Perfect, thank you!

    Le Re
Viewing 8 posts - 16 through 23 (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.