• Resolved dn17

    (@dianar17)


    Hello,

    I have a website that has two different membership modes: one through Woocommerce that uses stripe checkout through this plugin, and another one through the Armember membership plugin which also uses stripe for payments.

    The second one uses stripe’s webhooks which are now failing and point to a There has been a critical error on your website response, which as it turns out is caused by the following error:

    Cannot declare class Stripe\Stripe, because the name is already in use

    It appears that both armember and this plugin declare stripe with the same name, which causes the error to happen. Is there a way to solve this? It appears that many are facing the same issue (not with this plugin in particular, but with several I’ve seen also using stripe). Possible solutions I found were to check if another plugin has already declared the class before creating it again, or renaming the class to something else (eg. Stripe => MyStripe). If such functionality can’t be implemented, can you tell me how to safely update the class name on my own to avoid the conflict?

    Thanks.

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author WebToffee

    (@webtoffee)

    Hi @dianar17,

    We will look into it.

    Plugin Author WebToffee

    (@webtoffee)

    Hi @dianar17,

    After reviewing the plugin code, we can confirm that our plugin already includes a check to see if the class exist and then include it. You can refer the screenshot.

    It looks like the other plugin is loading the class after ours and thus they should include the check in their code to fix it.

    Thread Starter dn17

    (@dianar17)

    Many thanks for your reply. I was able to implement the same check you do on your plugin over on the main call for the Stripe class in the armember plugin, then I ran a test and the error is no longer showing up and webhooks are working again!

    Plugin Author WebToffee

    (@webtoffee)

    Hi @dianar17,

    Great. I hope you like our plugin and services. You can leave us a review here. Thanks.

Viewing 4 replies - 1 through 4 (of 4 total)

The topic ‘Cannot declare class Stripe\Stripe (payment conflict)’ is closed to new replies.