Support » Plugin: Stripe Payments for WordPress - WP Simple Pay » Filters are broken in 2.3.1

  • Resolved David Bee


    I used to use many different filters. And although the majority of them still seem to affect the outputted JS, once we get to the actual new Checkout page, none of the settings get applied.

    As an example, I used to use the following code to dynamically modify the payment amount:

    add_filter( 'simpay_form_' . $form_id . '_script_variables', array( $this, 'bbs_make_stripe_otp_dynamic'), 10, 2 );
    function bbs_make_stripe_otp_dynamic( $temp, $form_id ) {
    	$temp[ $form_id ][ 'form' ][ 'integers' ][ 'amount' ] = $stripe_appointment_booking_total_fee;
    	return $temp;

    This worked like a charm. In the current version, I see that this still affects the JS output, however, once I click through to pay, all my custom filters, including amount, email, metadata, etc) are gone.

    I’ve gone through the code and see that some of the filters were moved into Legacy hooks. But they still don’t seem to function properly. I did noticed that there are a bunch of new filters in paymentintent.php and customer.php. I tried using all three of the following (with appropriate corresponding methods) and can’t get a single one of them to fire:

    add_filter( 'simpay_create_paymentintent_args', array( $this, 'bbs_simpay_create_paymentintent_args' ), 20, 1 );
    add_filter( 'simpay_get_paymentintent_args_from_payment_form_request', array($this, 'bss_simpay_get_paymentintent_args_from_payment_form_request'), 20, 1 );
    add_filter( 'simpay_get_customer_args_from_payment_form_request', array( $this, 'bss_simpay_get_customer_args_from_payment_form_request' ), 20, 4 );

    Please help.

Viewing 5 replies - 1 through 5 (of 5 total)
  • David Bee


    I’ve managed to figure out how to get the dynamic amount working:

    add_filter( 'simpay_amount', array( $this, 'override_simpay_amount' ), 20, 1 );
    public function override_simpay_amount() {
    	return $stripe_appointment_booking_total_fee;;

    This works well.

    I’ve managed to get the metadata working, as well as even passing the saved Stripe Customer ID using the simpay_get_session_args_from_payment_form_request filter.

    However, I’m still unable to take actions after successful payment. Previously I was able to use add_action('simpay_charge_created','my_action'); This is now again considered a legacy hook. And a broken one. So what has replaced it? I tried 'simpay_after_paymentintent_response_from_payment_form_request'. No luck. I need to run some database actions after successful payment. How can I achieve that?

    Plugin Author spencerfinnell


    Hello David,

    You have two options:

    1. You can use the simpay_after_checkout_session_from_payment_form_request hook which runs after a Stripe Checkout Session is generated — but happens before the payment is fully completed (it may be abandoned while on the hosted Checkout page).

    2. Ensure the page you have set in Settings > General > Payment Success page includes the [simpay_payment_receipt] shortcode. This shortcode is required to run the legacy simpay_charge_created hook.

    I ended up finding the _simpay_payment_confirmation hook and using that. Seems to have done the trick. From what I could see, this one gets triggered after successful payment happens. Is that correct?

    Plugin Author spencerfinnell


    Hello David,

    _simpay_payment_confirmation ends up calling the simpay_charge_created and simpay_subscription_created legacy hooks inside the [simpay_payment_receipt] shortcode. You can use whichever fits your needs.

    Plugin Contributor Adam Lea


    We haven’t heard back from you in a while so we’ll assume your issue is resolved. If you are still having issues please start a new topic or consider purchasing a Pro license at for faster support.


Viewing 5 replies - 1 through 5 (of 5 total)
  • You must be logged in to reply to this topic.