Closed rvdsteege closed 7 months ago
As discussed @pronamic HQ we may want to increase the WordPress HTTP API timeout when dealing with an "Action Scheduler" background task:
$args = [
'method' => $method,
'user-agent' => $this->get_user_agent(),
'headers' => [
'Authorization' => 'Bearer ' . $this->api_key,
],
'timeout' => \wp_doing_cron() ? 30 : 5,
];
Let us wait a moment for a possible response to the following issue:
In internal Help Scout ticket https://secure.helpscout.net/conversation/2482719794/26765 it came to our attention that the status of a recurring payment can be set to
Failure
in WordPress, while the actual payment has been paid successfully.The cause seems to be a cURL timeout on payment start, which is converted from
WP_Error
to an exception in the pronamic/wp-http library, resulting in theFailure
payment status.https://github.com/pronamic/wp-http/blob/2b0ce3ca663103b8a30101ff5bff9254ee4da093/src/Facades/Http.php#L37-L43
https://github.com/pronamic/wp-pay-core/blob/e484e55c656cec8af3bd9a8ef34914549202cd2e/src/Plugin.php#L1110-L1125