Still logging even if deactivated
-
Hello everyone,
there is a problem with your plugin. CF7 is a multi purpose plugin and therefore it can be used for many many type of forms, simple request, polls or payments. The problem is, if a CF7 form is used other than for payments, your plugin is still logging the submission.
I’ve turned off the settings “Enable PayPal on this form” and “Enable Stripe on this form”, but it is still writing entries into the payments.It’s a quickfix to me – the problem is based in redirect_methode.cpp withing cf7pp_before_send_mail() on line 197-199 or line 160.
You can probably leave this function after L160, if nothing is enabled:
//L158
$enable = get_post_meta( $post_id, "_cf7pp_enable", true);
$enable_stripe = get_post_meta( $post_id, "_cf7pp_enable_stripe", true);
//leave function, if plugin isn't used for this form
if( $enable == '1' && $enable_stripe == '1' )
{
return;
}If you need to run further:
//L197
// save payment
//don't save the ""payment""
if( $enable == '1' || $enable_stripe == '1' )
{
$mode = ((strtolower($gateway) == 'paypal' && $options['mode'] == 1) ||(strtolower($gateway) == 'stripe' && $options['mode_stripe'] == 1)) ? 'sandbox' : 'live';
$payment_id = cf7pp_insert_payment($gateway, $mode, $amount_total, $post_id);
}I would recommend to exit this function, if is nothing is enabled, because it’s not needed to save anything for later on (Session/Cookies), if nothing is activated.
Best regards,
~Mike
You must be logged in to reply to this topic.