Skip to content

cURL timeout resulting in failed recurring payment #170

@rvdsteege

Description

@rvdsteege

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 the Failure payment status.

https://github.com/pronamic/wp-http/blob/2b0ce3ca663103b8a30101ff5bff9254ee4da093/src/Facades/Http.php#L37-L43

wp-pay-core/src/Plugin.php

Lines 1110 to 1125 in e484e55

$gateway->start( $payment );
} catch ( \Exception $exception ) {
$message = $exception->getMessage();
// Maybe include error code in message.
$code = $exception->getCode();
if ( $code > 0 ) {
$message = \sprintf( '%s: %s', $code, $message );
}
$payment->add_note( $message );
$payment->set_status( PaymentStatus::FAILURE );
throw $exception;

Metadata

Metadata

Assignees

Type

No type

Projects

Status

Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions