• Resolved Vanois.be

    (@lepapefrancois)


    Hi Florent,

    I’ve opened a ticket on the Contact Form 7 support page about a broken form using the native Stripe Integration. See https://wordpress.org/support/topic/invalid-stripe-payment-intent-id-detected/

    It appears that when I disable your plugin (and only yours) the Stripe integration works perfectly.

    This happens only on forms that use the default [stripe] field, even when theses forms are not configured to send PDF.

    I’ve already spent a few hours trying to debug this and I’ve come to theses conclusions:

    • You have to fix something in your plugin that interfere with the Stripe Integration (see hint below)
    • Waiting for you to investigate that, I would like to implement a quick fix to disable your plugin on the form that uses the Stripe field.

    You have to fix something in your plugin

    So, for you to check your plugin, here’s how CF7 manage the Stripe field : https://github.com/rocklobster-in/contact-form-7/blob/master/modules/stripe/stripe.php

    I think you might check specifically this : I explain in my ticket on CF7 support that the function wpcf7_stripe_skip_spam_check inject the metadata wpcf7_submission_timestamp in my Stripe dashboard, so it works until then. The conflict maybe come just after in this code section:

    if (
    ! empty( $submission->pull( 'payment_intent' ) ) and
    $submission->verify_posted_data_hash()
    ) {
    $skip_spam_check = true;
    }

    I would like to implement a quick fix

    I would like to implement a quick fix until you find a solution. For that, in my case, the form that use [stripe] field will never have to send any PDF.

    I can also target the form that use the Stripe field because they will use a custom “amount_to_pay” field. After analysing your plugin code, I think about something like this:

    add_action(
    'wpcf7_before_send_mail',
    function ( $contact_form, &$abort, $submission ) {
    $amount = $submission->get_posted_data( 'amount_to_pay' );
    if ( !empty($amount)) {
    remove_action( 'wpcf7_before_send_mail', 'wpcf7pdf_send_pdf', 10);
    }
    },
    9,
    3
    );

    Is the action name wpcf7pdf_send_pdf correct in order to disable your plugin? Is there another way to do this ?

    Thanks!
    François

    PS : My current setup

    • WordPress version: 6.9.4 (latest)
    • CF7 version 6.1.6 (latest)
    • Akismet version 5.7 (latest)
    • Contact Form Entries version 1.5.0 (latest) -> when I disable this extension it doesn’t change anything to the current problem.
    • Send PDF for Contact form 7 Version 1.0.3.9 (latest)
    • Apache Server, PHP 8.2.30


    • This topic was modified 5 months ago by Vanois.be. Reason: Add php details in my config
    • This topic was modified 5 months ago by Vanois.be.
Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter Vanois.be

    (@lepapefrancois)

    Hello Florent,

    Any news about this bug?
    Thanks for your reply 🙂

    Thread Starter Vanois.be

    (@lepapefrancois)

    Well, I guess this plugin is no longer maintained… That’s a shame.

    I’ll try another plugin, there’s a few that look promising.

Viewing 2 replies - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.