mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-09-05 08:59:14 +08:00
Do not log reference transactions checks
This commit is contained in:
parent
21aa8980d6
commit
8e703061a8
2 changed files with 21 additions and 6 deletions
|
@ -120,11 +120,17 @@ class BillingAgreementsEndpoint {
|
|||
*/
|
||||
public function reference_transaction_enabled(): bool {
|
||||
try {
|
||||
$this->create_token(
|
||||
'Checking if reference transactions are enabled',
|
||||
'https://example.com/return',
|
||||
'https://example.com/cancel'
|
||||
);
|
||||
$this->is_request_logging_enabled = false;
|
||||
|
||||
try {
|
||||
$this->create_token(
|
||||
'Checking if reference transactions are enabled',
|
||||
'https://example.com/return',
|
||||
'https://example.com/cancel'
|
||||
);
|
||||
} finally {
|
||||
$this->is_request_logging_enabled = true;
|
||||
}
|
||||
|
||||
return true;
|
||||
} catch ( PayPalApiException $exception ) {
|
||||
|
|
|
@ -16,6 +16,13 @@ use WP_Error;
|
|||
*/
|
||||
trait RequestTrait {
|
||||
|
||||
/**
|
||||
* Whether to log the detailed request/response info.
|
||||
*
|
||||
* @var bool
|
||||
*/
|
||||
protected $is_request_logging_enabled = true;
|
||||
|
||||
/**
|
||||
* Performs a request
|
||||
*
|
||||
|
@ -39,7 +46,9 @@ trait RequestTrait {
|
|||
}
|
||||
|
||||
$response = wp_remote_get( $url, $args );
|
||||
$this->logger->debug( $this->request_response_string( $url, $args, $response ) );
|
||||
if ( $this->is_request_logging_enabled ) {
|
||||
$this->logger->debug( $this->request_response_string( $url, $args, $response ) );
|
||||
}
|
||||
return $response;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue