Hello,
I am using the offline payment option for the booking.
Since the introduction of the payment gateway, I get in rare cases some bookings flagged with Incomplete status but where the booking confirmation mail is sent to both the user and the admin. These mails are normally sent only to the Pending booking
Since the Incomplete bookings don’t decrease the places count, this leads to overbooking.
I could not clearly reproduce the behaviour.
Thanks in advance for your advice.
All the best!
Jef
zwazo
Hi Jef,
Which emails are sent out? Booking confirmation emails are (should) only sent out when the booking is transitioned to the confirmed status (they are hooked onto transition_post_status
). (Which might happen immediately if the booking is free).
In the settings, under “Notify me when” do you have “A new booking is made” checked? If so, that will be sent as soon as the booking is created, but before a payment gateway is selected (and only to the admin).
If it is the confirmation emails, add the following to your wp-config.php
define( 'EVENTORGANISER_DEBUG', 'debug');
and then add this snippet to record booking transitions:
add_action('eventorganiser_transition_booking_status', function($new_status, $old_status, $booking){
$container = eo_pro_get_container();
$logger = $container[\EventOrganiserPro\Logger\AbstractLogger::class];
$logger->debug("Booking {$booking->ID} $old_status --> $new_status");
}, 10, 3);
That will log any booking status transition, if the issue should recur that will provide some information as to what statuses the booking transitions to/from and when.
Stephen Harris
Hello Stephen,
This is the “Offline Payment Instructions” mail which is sometime sent to the bookee with incomplete status and the booking confirmation is sent to the admin as well.
Basically the mail process is behaving like a “pending” status.
I’ll check to include the mods you propose to log the issue.
best regards,
Jef
zwazo
Hi Jef,
So the offline payment gateway email should be sent after the status has been updated to ‘pending’ (i.e. status has transition from incomplete to pending). That happens when the customer opts to pay offline. The booking is then left in the pending state until manually confirmed.
If bookings are being left in a pending state, you can opt to reserve ‘pending’ bookings (generally recommended when taking offline payments)
Stephen Harris