getdokan / dokan

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

DOKAN / STRIPE EXPRESS - 'Delayed' option to process withdraw not respected #2234

Closed Sophie-2e closed 4 months ago

Sophie-2e commented 5 months ago

Bug Description

Following up on Dokan support ticket #56084

Again facing issues with Stripe Express and Dokan since the last update, it seems that the delay and the Order Status adding in Dokan Settings or WooPayment settings are not respected resulting in the vendor being paid in less than 24h while they have not done anything on the order so they can take the money of the clients and never process the order then which is terrible for the admin, and for the customers.

Review the video sent in Dokan support ticket #56084 for full explanations and details on the settings.

For access to the website and stripe, ask Dokan Support Team, they have all access.

Step To Reproduce

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

Expected Behaviour

Make an order and pay with stripe express

Actual Behaviour

don't respect settings on payment delay/statut

Additional Information

No response

Environment (please complete the following information)

1. Dokan Version: [3.10.2]
2. Dokan Pro Version: [3.10.2]
3. WooCommerce Version: [8.7.0]
4. Browser [all]
5. Current Theme: [all]
Sophie-2e commented 4 months ago

Hello @mrabbani do you have any news on this? Just tested with Dokan 3.10.4 and still not working. This issue is an emergency

mralaminahamed commented 4 months ago

Dear @Sophie-2e, thank you for raising this issue and providing the video demonstration in the Dokan support ticket #56084. I appreciate you taking the time to explain the problem in detail.

After carefully reviewing the video and investigating the issue, I have identified the root cause of the problem. The order status not being updated correctly is related to the product type you are trying to purchase.

In your case, you are purchasing a simple (physical) product that requires shipping. For such products, the expected behavior is that the order status will be set to "Processing" after the purchase, instead of "Completed." This is because the order needs to go through the shipping process before it can be marked as completed.

I appreciate your patience and understanding as I work to find the root cause of this issue. Thank you for your continued support and for bringing this issue to our attention.

References:

  1. Screenshot of Your screen recording
  2. Screenshot of purchased product details
  3. Screenshot of purchased order details
Sophie-2e commented 4 months ago

Hello @mralaminahamed, no this is not the root cause of problem because:

  1. the status is currently properly updated as it gets the 'processing' status after purchase which is exactly what is supposed to happen so indeed vendor first takes care of shipping, and once shipping module is completed (excl. digital product), the vendor will proceed with changing the status for completed and so the stripe payment will be released to his account. the issue is that the stripe payment is released even when the order is still 'Processing'
  2. Same issue happens for all type of products: simple, variables, kits so product type is not the cause of the issue

It seems that the issue lies with the Stripe Express API somehow where the delay and the Order Status adding in Dokan Settings or WooPayment settings are not respected resulting in the vendor being paid in less than 24h while the order status is still 'processing'

Hope it helps, please do let me know :)

Waiting for your news as this is the most urgent and critical error in Dokan plugin currently.

mralaminahamed commented 4 months ago

Hi @Sophie-2e, thank you for the clarification and additional details. I understand the issue better now.

  1. You're correct that the order status update itself is working as expected, with the status changing to 'Processing' after a purchase, which is the intended behavior.

  2. I also acknowledge that the issue is not specific to any particular product type and is occurring across simple, variable, and kit products.

As you mentioned, the root cause seems to be related to the Stripe Express API not adhering to the delay and order status settings configured in Dokan or WooPayment. This is resulting in vendors being paid before the configured 6-day delay period, even when the order status is still in 'Processing'.

To provide some additional context, the disburse funds method in Stripe depends on the following configurations:

It seems that the issue lies with the Stripe Express API somehow where the delay and the Order Status adding in Dokan Settings or WooPayment settings are not respected resulting in the vendor being paid in less than 24h while the order status is still 'processing'

Based on your site's configuration, you have chosen the 'Delayed' option with a 6-day delay period. This means that Stripe should disburse payments to vendors after a 6-day delay, even if the order status is 'Processing' or 'Completed'. You mention in the issue that vendors are being paid within 24 hours.

It's important to note that while Stripe can initiate and disburse payments to vendors, it cannot directly change the order status in WooCommerce or Dokan. The order status update needs to be handled manually.

References:

Sophie-2e commented 4 months ago

Hello @mralaminahamed , Yes you got it, and yes indeed Stripe has no impact on the 'status' of the order as it handles within the marketplace (by seller or admin) šŸ‘Œ And thank you very much for the clear explanation šŸ˜Š I did a test, which is why I waited a bit to reply but I think all is good now, at least for what I need, but then indeed if admin selects the Stripe Option "Delayed" as I had before, it does not respect the settings.

Thanks to your explanation, I found that there are options to select if it is on the order or payment completed now in Stripe: Screenshot 2024-05-09 at 10 51 58

Not sure how I miss that before šŸ˜… Or maybe I could not see the option previously šŸ§ The only change I did in my settings was in the admin Stripe account, I reverted the payment to admin as 'manual' instead of automatic šŸ§

So tested the 'On Order Completed' option and I can confirm that the Payment on Order Completed works like a charm, but indeed then there is the issue with the 'delayed' option which does not respect the number of days.

So for my specific case, it is all good now šŸ‘Œ Do you want to keep the GitHub open for the 'delayed' option not working?

@mralaminahamed a thousand thank you for your precious help, I really appreciate your clear explanation and how we could find the solution for my use case together šŸ˜Š Great teamwork šŸ‘Œā¤ļø

mralaminahamed commented 4 months ago

So for my specific case, it is all good now šŸ‘Œ Do you want to keep the GitHub open for the 'delayed' option not working?

Need discussions with @mrabbani vai.

mralaminahamed commented 4 months ago

@Sophie-2e, have nice day. The delayed system functionality relies on WordPress cron jobs running on your website. For these scheduled cron jobs to complete tasks in a timely manner, a high traffic website is ideal. On lower traffic sites, there can sometimes be issues with cron jobs not triggering as scheduled or falling behind.

To further investigate and resolve any potential cron job delays affecting the 'delayed' option, I recommend reaching out to our support team. They can provide assistance in ensuring the WordPress cron system is operating properly for your site's traffic levels.

Please don't hesitate to contact our support team so they can look into this cron job scheduling issue impacting the 'delayed' functionality. Let me know if you need any help getting that support request started."

The key points are:

1) Explaining that the delayed system uses WP cron jobs which require higher traffic to run reliably 2) Noting that low traffic sites can have issues with cron jobs not triggering as expected 3) Recommending they contact the support team for further investigation/resolution 4) Offering to assist them in starting a support request if needed

This frames the issue as likely being server/traffic related while making it clear the support team is best equipped to fully diagnose and resolve any cron job scheduling problems.

Sophie-2e commented 4 months ago

Hello @mralaminahamed happy Tuesday šŸ™‚ Thanks for your detailed and clear reply, indeed I did notice the cron re not running, but it is only the staging website because of the server settings. Hopefully, your answer will help Dokan users who use the delayed option if they are facing this issue and research about it.

As explained previously, it is not the settings I need for my website so it is already solved in my environment šŸ˜‰ So then I will go ahead and close this GitHub šŸ‘Œ