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
Fantastic, thank you. Works well.
Wil McDonald
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
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
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
Hi Chris,
In the above snippet you can add
$intent['receipt_email'] = $bookee->get_email();
Stephen Harris