• Resolved mouritz114

    (@mouritz114)


    Hi,

    When I look at the log of SWPM I see a lot of Fatal error! Payment with ref_id swpm_ .. can’t be found.

    However, I cannot reproduce the problem myself. When I try the payment button if works well. I have no idea how it is even possible to create the error.

    I have previosly experienced this problem, but in those cases I could reproduce the problem and solve it.

    E.g. in one case I had to force https. In another case I had to add a Stripe script to the header of my page.

    In this case, I cannot reproduce the problem (i.e. encounter the error message myself).
    Do you have a suggestion to how I can further investigate (i.e. reproduce the situation that creates the error message)?

    Or is there more information about what caused the error message somewhere?

Viewing 15 replies - 1 through 15 (of 15 total)
  • Plugin Support mbrsolution

    (@mbrsolution)

    Hi, do you have a cache plugin installed in your site?

    Regards.

    Thread Starter mouritz114

    (@mouritz114)

    I dont think so, i have not installed one.

    Plugin Support mbrsolution

    (@mbrsolution)

    Hi, what about your host? Are they running any time of caching system?

    Regards.

    Thread Starter mouritz114

    (@mouritz114)

    I have just submitted the question to them as a ticket.

    I will return when they have replied ??

    Thread Starter mouritz114

    (@mouritz114)

    Hi,

    The host replied that no caching system is set up for my website from their side.

    Plugin Support mbrsolution

    (@mbrsolution)

    Hi, I have submitted a message to the plugin developers to investigate further your issue.

    Thank you.

    Thread Starter mouritz114

    (@mouritz114)

    Thanks a lot! Let me know if more information is needed from my side.

    Plugin Author wp.insider

    (@wpinsider-1)

    Sometimes you will have spam bots posting data to the plugin’s webbook. The data they post wont’ have all the valid transaction data so it will fail with an error. It’s normal to ignore those.

    Are you seeing any real transactions from your real customers fail?

    Thread Starter mouritz114

    (@mouritz114)

    Hi,

    I am seeing 3 types of actions when someone presses the Stripe payment button:

    1. Payment succeeded -someone started and completed a payment
    This is seen as succesful transaction in the SWPM log and the Stripe payment log.

    2. Payment cancelled – someone started, but did not complete a payment
    This is not seen in the SWPM log, but is shown as canceled payment in the Stripe payment log.

    3. Payment error – I have no clue what happened
    This is shown in the SWPM log as “Fatal error! Payment with r…”, but it is not shown in the Stripe payment log.

    Plugin Author wp.insider

    (@wpinsider-1)

    At this stage, I am not seeing any issue with the payment button system. I tested the payment buttons myself that I created (just now) using the following steps:
    https://simple-membership-plugin.com/sca-compliant-stripe-buy-now-button/

    Do you have any caching on your site? If the page containing the payment buttons are cached, it could have issues (since the reference added to the payment button will be stale).

    I don’t know what other conflicts that could be happening on your site unfortunately. So if you can tell me exactly how we can reproduce an issue, then I will be able to investigate more.

    Thread Starter mouritz114

    (@mouritz114)

    Hi,

    I want to take you briefly through some history and share some additional data, in case this helps.

    A few weeks back the payment button suddently stopped working and I got an error message each time I clicked the button: “Fatal error….”.

    Using the chrome web inspector tool, I found an error on the page that said: Uncaught ReferenceError: Stripe not defined.

    I googled this message and found a solution that required me to insert the following script at the top of my page:
    <script src=”https://js.stripe.com/v3/”></script>

    Then the payment button worked every time I tried it.

    It also worked for some customers (as I received payments), but the error log showed that some customers still encountered the issue with “fatal error”. At this point, I was no longer able to reproduce the issue myself.

    I still seeing the issue occuring in the SWPM log.

    During current troubleshooting I however noticed something new. The payment button is displayed in one style when viewed in Elementor and another style when the page is visited as a normal visitor (unfortunately it seems that I cannot add images to this message).

    The above however leaves me with 2 questions:

    1. What can be the cause of the error message: “Uncaught ReferenceError: Stripe not defined”
    2. What can be the cause of the payment button being displayed with one styling in elementor and another when visiting the page as a normal visitor?

    I am quite sure that the current problem is related to the 2 points above.

    Plugin Author wp.insider

    (@wpinsider-1)

    1) The cause is a JavaScript error on your site coming from another plugin or theme that has gone outdated. The following test will help you isolate it:
    https://simple-membership-plugin.com/forums/topic/test-for-plugin-and-theme-conflict-before-posting-an-issue-or-a-bug/

    2) I don’t know how elementor works but it could be related the issue explained in #1 above. What you see on the front-end (when visiting a page) is the main thing that matters.

    Thread Starter mouritz114

    (@mouritz114)

    1)Unfortunately, I cannot make this test, as I cannot reproduce the issue (“fatal error…”). Therefore, I cannot deactivate plugins and see when the issue goes away.
    I did something else, however. When inspecting the page that has the landing button (Chrome inspector tool), there was also an error message about a google maps API being loaded twice, potentially causing errors. There is a map on the same page as the payment button. The plugin that shows the map has a feature to disable loading of Google map API:

    “don’t load the Google Maps API script
    Tick this when your theme or another plugin is already loading the Google Maps API, causing a conflict.”

    I ticked the box and then there were no more error messages (se seen with the Chrome inspector tool) on the page that has the payment button. I.e. both error messages related to Java, Map API and “Stripe not defined” were not longer found. The map on the page was still displayed the same as before.
    I will leave it with these settings for now and see if I still se any “Fatal error…” messages in the SWPM log over the next days.

    2)Payment buttons are still displayed differently in Elementor and on the actual page (as seen by a visitor). Therefore, the cause cannot be the same as the cause of the error messages described in 1).

    3) After completing 1 above, I tried to make a new tast page and insert payment buttons. They did not work and gave the “Fatal error…” message. I then inserted the following script at the top of the page:

    <script src=”https://js.stripe.com/v3/”></script&gt;

    Then it worked. Any idea why it is necessary to insert that script at the top of the page to make the payment buttons work?

    @mouritz114 – I have the same error Fatal error! Payment with ref_id swpm_xxxxx can’t be found. After reading forum I added <script src=”https://js.stripe.com/v3/”></script&gt; to the header.php file of my theme, but I still have the same problem. Did I put the script in the wrong place?

    Plugin Author wp.insider

    (@wpinsider-1)

    You shouldn’t have to put any script code on your site. It’s better to identify which item is causing the conflict in the first place. the following test will help:
    https://simple-membership-plugin.com/forums/topic/test-for-plugin-and-theme-conflict-before-posting-an-issue-or-a-bug/

    Next, make sure that you are not trying to test in “private/incognito” browser mode. That mode won’t allow the payment processing to work correctly. So try the button on a normal web browser.

Viewing 15 replies - 1 through 15 (of 15 total)
  • The topic ‘Fatal error! Payment with ref_id swpm_ ?can’t be found’ is closed to new replies.