Support » Plugin: Stripe Payments for WordPress - WP Simple Pay » Lite v2.3.0 custom amount function/filter

  • Resolved richminust

    (@richminust)


    I have updated from Lite v2.2.0 to v2.3.0 and now my custom implementation no longer works, specifically the custom amount function/filter now has no effect.

    e.g.
    function simpay_custom_amount() {
    return 40.00;
    }
    add_filter( ‘simpay_form_{FORMID}_amount’, ‘simpay_custom_amount’ );

    Also, I previously had a modal popup for payments however the site is now redirected to a page at Stripe.

    Are these features still available to Lite users?

    Also, the plugin update message states… “Dev: Deprecated many hooks/filters that no longer apply to the new payment flows. Please review any custom snippets that may change functionality.” However I can find no information on what has been deprecated in this update.

    Please advise. Assistance greatly appreciated.

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Contributor Adam Lea

    (@adamjlea)

    Hello, again @richminust,

    I was just able to successfully test that filter with 2.3 and it worked for me.

    Just to confirm, you are using a one-time set amount form? Does it work if you hard code the form id?

    The modal has been deprecated by Stripe and replaced with the new Stripe Checkout you are now seeing.

    The snippet repository on Github has been updated with the changes!

    Regards,

    Hi, thank you for the reply.

    I am using a standard form created in the WordPress CMS and have also set a default price in the WordPress CMS. I am using the custom amount function to update the price on-the-fly. The form id is hardcoded, I omitted it in my example above deliberately but the line of code is actually…

    add_filter( ‘simpay_form_4454_amount’, ‘simpay_custom_amount’ );

    As I say the code was working fine in v2.2.0 so any help would be appreciated.

    A quick update, I have the custom amount filter working now. However, the simpay_do_something_after_charge function is no longer firing. I used the plugin code from Github previously for reference and this seems to have been removed, I can see no reference to this function in the new Github repository. Has it been replaced with something else?

    Please advise. TIA.

    Plugin Contributor Adam Lea

    (@adamjlea)

    Hello again @richminust

    I believe you’re after
    simpay_after_checkout_session_from_payment_form_request Take a look at the lite-add-wp-user-on-success.php snippet in the snippet repo. There are a couple more examples there that should be helpful.

    Regards,

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