Membership Plugin

WordPress Membership Plugin

  • Home
  • Documentation
  • Addons
  • Support
    • Quick Setup
    • Documentation
    • Premium Addon Support
    • Paid Support
    • Support Forum
    • Support Forum Search
    • Forum Login
    • Forum Registration
  • Contact

[Support request] Fatal error! Payment with ref_id swpm_XXXX|1195 can’be found.

Simple Membership Plugin › Forums › Simple Membership Plugin › Fatal error! Payment with ref_id swpm_XXXX|1195 can’be found.

  • This topic has 13 replies, 4 voices, and was last updated 2 years, 1 month ago by admin.
Viewing 14 posts - 1 through 14 (of 14 total)
  • Author
    Posts
  • March 29, 2024 at 3:10 pm #27851
    mario
    Participant

    Hello Support team,

    I am having this issue, as some others on the forum, but mine in particular only appears when non logged users click on the button (Stripe SCA Subscription), whenever the admin or any other subscriber tries to use the button it works fine.

    On the console I have noticed that an error appears only for non logged users that is the following: Uncaught TypeError: jQuery(…).on is not a function at … and the line is this one:
    jQuery(‘#swpm-stripe-payment-form-694a82263b388b51d9a16f58e110f2ab’).on(‘submit’, function(e) {e.preventDefault();
    var btn = jQuery(this).find(‘button’).attr(‘disabled’, true);…

    I have already tried deactivating plugins and addons, installed https redirection and the custom rules on WP fastest cache. Since it works fine for logged users I suspect maybe there is some setting or something I am missing.

    Thank you in advance for your help, have a nice day.

    March 29, 2024 at 10:37 pm #27852
    The Assurer
    Moderator

    …and the custom rules on WP fastest cache.

    You means, you followed this?
    WP Fastest Cache Compatibility for Simple Membership
    https://simple-membership-plugin.com/wp-fastest-cache-compatibility-for-simple-membership/

    March 29, 2024 at 11:02 pm #27853
    mario
    Participant

    Yes, that one.

    March 31, 2024 at 1:03 am #27854
    The Assurer
    Moderator

    What happens when you disable that caching plugin? Does it work as expected?

    April 1, 2024 at 5:02 pm #27860
    mario
    Participant

    Unfortunately it does not solve the issue. What else should I try?

    April 2, 2024 at 12:48 pm #27861
    The Assurer
    Moderator

    I am having this issue, as some others on the forum, but mine in particular only appears when non logged users click on the button (Stripe SCA Subscription), whenever the admin or any other subscriber tries to use the button it works fine.

    Is this button for a renewal or a new subscription?

    April 5, 2024 at 2:20 pm #27880
    jaesga
    Participant

    I am having exactly the same problem since few days ago.

    I think the problem is on a race condition under SwpmStripeSCASubscriptionIpnHandler::handle_stripe_ipn.
    I realized that the callback to my site (and that method execution) was perform before these Webhook events are received:

    [2024/04/05 16:12:31] – SUCCESS: End of Stripe subscription webhook processing. Webhook type: invoice.paid
    [2024/04/05 16:12:32] – SUCCESS: Stripe subscription webhook received: invoice.payment_succeeded. Checking if we need to handle this webhook.
    [2024/04/05 16:12:32] – SUCCESS: End of Stripe subscription webhook processing. Webhook type: invoice.payment_succeeded

    This probably make “checkout.session.completed” event still not available causing the error.
    I added for testing purposes just a sleep(2) to the code and things start to work again.

    Can some developer of the plugin check this out plz? Maybe a recent update of the plugin break something? I will try to review the changelog.

    Thanks in advance,
    J.

    April 6, 2024 at 12:59 am #27882
    The Assurer
    Moderator

    This has been referred to the developers.

    April 8, 2024 at 12:36 am #27885
    admin
    Keymaster

    Hi, I will investigate this.

    The most frequent reason for issues with Stripe subscription payment buttons often stems from an incomplete webhook configuration in your Stripe account. To ensure your webhooks are set up correctly, please consult the ‘Troubleshooting Section’ of our documentation. This section provides detailed steps to verify your webhook setup:

    https://simple-membership-plugin.com/sca-compliant-stripe-subscription-button/#troubleshooting-related

    Can you give me info on what you have configured in the webhooks menu of your Stripe.com account (for BOTH the live and test modes)? You can find your configured webhooks by going to the following page of your Stripe account dashboard:

    https://dashboard.stripe.com/webhooks

    April 8, 2024 at 10:48 am #27887
    jaesga
    Participant

    Both (test / live) are configured the same way:

    URL:
    ENV_HOST?swpm_process_stripe_subscription=1&hook=1

    Events:
    charge.refunded
    customer.subscription.deleted
    customer.subscription.updated
    invoice.paid
    invoice.payment_succeeded

    Let me know if something is not properly set up

    April 9, 2024 at 12:02 am #27888
    admin
    Keymaster

    Thank you. The webhook configuration looks fine to me.

    I need to recreate this on our site so I can investigate further. I will ask some questions to get more details:

    In your case, do you see the error happen before the transaction (after you click the button) or after the transaction on Stripe?

    Can you post a link to the page where you have the button so I can inspect it?

    If you temporarily do the following test, is there any difference?
    https://simple-membership-plugin.com/forums/topic/test-for-plugin-and-theme-conflict-before-posting-an-issue-or-a-bug/

    Which theme are you using on this site? I will try to install the same one to test.

    April 10, 2024 at 12:20 pm #27894
    jaesga
    Participant

    The error happends while executing the callback function (SwpmStripeSCASubscriptionIpnHandler::handle_stripe_ipn).

    After paying on stripe everything seems fine, then when redirected to my site executing that function leads to the error. Searching into the code I’m pretty sure the problem is a race condition.

    When reaching swpm-stripe-sca-subscription-ipn.php:L69 $sess is false, because $events array (L50) is empty.

    Activating my logs, I see that this error (Fatal error! Payment with ref_id %s can’t be found) is logged before the webhook notification logs for events invoice.paid and invoice.payment_succeeded (check my first messsage).

    I fixed on my site by adding some retries with 1s sleep in between to fetch the “checkout.session.completed” events from Stripe and after 1-2s the event is ready and things starts working again.

    Hope this helps you to reproduce / patch.
    Regards,
    J

    April 11, 2024 at 11:22 pm #27902
    admin
    Keymaster

    Thank you. I will check this further and get back to you.

    April 20, 2024 at 9:55 am #27929
    admin
    Keymaster

    Hi, Can you please share the full debug log file for the following actions (that will give me more insight into how I need to setup my test site to try to reproduce this).

    1) Reset the debug log file from the settings menu of the plugin.
    2) Click the Stripe subscription button and complete the test transaction.
    3) After the process is complete, copy and paste the full debug log file’s details here. I will delete the text after I check it.

    Also, please post the URL of the page where your Stripe subscription button is so I can inspect the HTML code of it (it will be helpful for this troubleshooting).

  • Author
    Posts
Viewing 14 posts - 1 through 14 (of 14 total)
  • You must be logged in to reply to this topic.
Log In

Please read this message before using our plugin.

Search

Featured Addons and Extensions

  • Membership Form Builder Addon
  • Member Directory Listing Addon
  • WooCommerce Payment Integration
  • Member Data Exporter Addon

Documentation

  • Documentation Index Page

Copyright © 2026 | Simple Membership Plugin | Privacy Policy