getdokan / dokan

Multivendor marketplace platform
https://wordpress.org/plugins/dokan-lite/
249 stars 191 forks source link

Stripe Subscription Payments Randomly Fail #2278

Open thekendog opened 1 month ago

thekendog commented 1 month ago

Bug Description

I am having an issue with the Stripe and subscriptions modules. Subscription renewal payments fail randomly. They work sometimes, but a lot of times they are failing. Here is the error...

No API key provided. (HINT: set your API key using "Stripe::setApiKey(<API-KEY>)". You can generate API keys from the Stripe web interface.

I've done some digging and I see this note in the StripePaymentGateway.php file.

https://share.cleanshot.com/L4N92xmg

What is this issue exactly? I cannot see it as it is private, but it appears to be directly related to my issue and is in the exact spot where the error is occurring.

Step To Reproduce

  1. Go to '...'
  2. Click on '....'
  3. Scroll down to '....'
  4. See error

Expected Behaviour

Subscription renewal payments should work all the time.

Actual Behaviour

Subscription renewal payments are failing about 50% of the time and I'm getting the setApiKey error.

Additional Information

No response

Environment (please complete the following information)

1. Dokan Version: [e.g. v3.1.2]
2. Dokan Pro Version: [e.g. v3.1.2]
3. WooCommerce Version: [e.g. v4.9.2]
4. Browser [e.g. chrome, safari]
5. Current Theme: [e.g. Store Front]
mralaminahamed commented 1 month ago

@thekendog, thank you for reporting the issue you're facing with Stripe and subscription renewal payments failing randomly. I understand that this is a critical issue as it impacts the smooth functioning of recurring payments for your business.

Based on the information provided, it appears that the issue is related to the Stripe API key not being set correctly, which is causing the "No API key provided" error. The code snippet you shared from the StripePaymentGateway.php file indicates that there might be a temporary workaround in place, but it's hard to determine the exact cause without further investigation.

While I can provide a general analysis, I would recommend contacting our support team for a more in-depth investigation and resolution of this issue. Our support team has the necessary expertise and access to additional resources to diagnose and resolve such complex issues effectively.

When you reach out to the support team, please provide them with the following information:

  1. A detailed description of the issue, including the steps to reproduce and the expected behavior.
  2. The error message you're receiving: "No API key provided. (HINT: set your API key using "Stripe::setApiKey(<API-KEY>)". You can generate API keys from the Stripe web interface."
  3. The Dokan, Dokan Pro, WooCommerce, and WordPress versions you're using.
  4. Any relevant logs or screenshots that may help in understanding the issue better.
  5. Information about your hosting environment, including PHP version and any caching plugins or services you're using.

Our support team will thoroughly investigate the issue, and work closely with you to identify the root cause and provide an appropriate solution or workaround.

thekendog commented 1 month ago

I did open a ticket with support and went back and forth for a couple months with them. They were not helpful. I created a staging site for them, gave them access to the live site, gave them many examples of this happening, and still no resolution. I'm also not sure they completely read my messages and/or grasped what the issue is in general to be honest, hence why I am here now. It is not a cheap plugin and I have an upset client right now, and rightfully so.

Can you tell me what this issue is as I cannot see it?

https://github.com/getdokan/client-issue/issues/93

There is a comment in the StripePaymentGateway.php file suggesting there is a known issue when bootstrapping Stripe and setting credentials. This appears to be the exact issue I am seeing. Sometimes renewal payments go through successfully, sometimes they don't. When they don't I get the error about an API key not being set, yet it is as evident by the fact that some renewal payments go through and all regular payments do as well. It seems as if there is some kind of issue with the plugin and I am trying to figure out why before I have to ditch it and go with another solution which works.

mralaminahamed commented 1 month ago

mentioned issue is fixed and working fine as expected.

CC: @tanjiralmamun vai, @mrabbani vai

thekendog commented 1 month ago

What was the issue and what version was it fixed in?

mralaminahamed commented 1 month ago

What was the issue and what version was it fixed in?

v3.10.3 ( Apr 17, 2024 )

This appears to be a site-specific issue. We are actively investigating to identify the root cause. Our team is diligently working to develop a more effective solution that enhances the experience for our users. We kindly request that you reach out to our support team again, providing access to a staging site, and follow the necessary steps to assist us in pinpointing and resolving your problem efficiently.

thekendog commented 1 month ago

I updated everything yesterday. Dokan, Woocommerce, everything. Payments still failed last night. Once again, here is the error.

caught exception on process_subscription_payment, code: get_source_object, message: No API key provided. (HINT: set your API key using "Stripe::setApiKey(<API-KEY>)". You can generate API keys from the Stripe web interface. See https://stripe.com/api for details, or email support@stripe.com if you have any questions.

So it appears the issue is NOT fixed.

mralaminahamed commented 1 month ago

@thekendog, it appears that the issue with Stripe subscription renewal payments failing is still persisting even after updating Dokan, WooCommerce, and other plugins/themes. The error message "No API key provided..." indicates that there might be a configuration issue with the Stripe API key or a compatibility issue with the updated versions.

Since this is a recurring and critical issue that is impacting their business operations, I would recommend you to contact our support team immediately with the following information:

  1. Provide the support team with the staging site credentials or a temporary admin access to their live site, whichever is more convenient for them. This will allow our support team to investigate the issue directly and identify the root cause more effectively.

  2. If they have already raised a support ticket for this issue, please provide the ticket number or reference to the support team. This will help them quickly locate the previous correspondence and continue the investigation seamlessly.

  3. Share any additional information, such as recent changes made to the site (plugin updates, theme updates, or any other modifications), server logs, or any other relevant details that might assist the support team in their investigation.

Our support team is well-equipped with the necessary expertise and resources to thoroughly investigate and resolve this issue. By providing them with direct access to the site and all relevant information, they can expedite the troubleshooting process and provide a timely resolution.

CC: @mrabbani vai Support: @tanjiralmamun vai, @mr-gausulazam vai

thekendog commented 1 month ago

As I have already said, I went back and forth with support for a few months. They were not helpful. We are just going to cancel our Dokan subscription and switch to another plugin. Our client is pretty upset right now and rightfully so.

mr-gausulazam commented 1 month ago

Hello @thekendog,

I hope you are having a great day. I am unable to find any ticket history through your name. If you have already raised a support ticket, please share the ticket number here.

Additionally, it seems that the issue you are experiencing is specific to your website and not related to our plugin. Therefore, I am unable to provide proper support or development assistance without thoroughly checking your site. As this is our public repository, please reach out to our support team for assistance. To expedite the process, kindly back up your website, provide us with a staging site and credentials, and enable the test mode of your payment gateway.

Once you have provided this information, we will work to resolve your issues from our end. I am looking forward to your reply in support ticket.

Best regards,