Describe the bug
In https://github.com/paytrail/paytrail-for-woocommerce/blob/master/src/Gateway.php#L893-L904, it sleeps rand(0, 3) seconds (or 3 to 6 seconds with callback_mode), causing the return from the payment back to the Woocommerce thank you page to be slower. Since it works with the lower bound of the randomly generated number I can't figure out why this would be necessary.
The random sleep was originally added here CheckoutFinland/checkout-finland-for-woocommerce@3f043c3, but the commit doesn't give me a real reason why.
Steps to Reproduce
- Enable logging in Paytrail for Woocommerce settings page
- Order something on the website, using Paytrail as payment provider
- See the log line 'Paytrail: Wait for n seconds until processing reference x'
Expected behaviour
The thank you page load time isn't dependent on a randomly selected wait time.
Actual behaviour
All else being equal the Woocommerce thank you page loads slower or faster depending on the randomly selected wait time.
Screenshots
N/A
Additional context
N/A
Describe the bug
In https://github.com/paytrail/paytrail-for-woocommerce/blob/master/src/Gateway.php#L893-L904, it sleeps rand(0, 3) seconds (or 3 to 6 seconds with callback_mode), causing the return from the payment back to the Woocommerce thank you page to be slower. Since it works with the lower bound of the randomly generated number I can't figure out why this would be necessary.
The random sleep was originally added here CheckoutFinland/checkout-finland-for-woocommerce@3f043c3, but the commit doesn't give me a real reason why.
Steps to Reproduce
Expected behaviour
The thank you page load time isn't dependent on a randomly selected wait time.
Actual behaviour
All else being equal the Woocommerce thank you page loads slower or faster depending on the randomly selected wait time.
Screenshots
N/A
Additional context
N/A