Filters are broken in 2.3.1
-
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.
- The topic ‘Filters are broken in 2.3.1’ is closed to new replies.