mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-09-06 12:25:15 +08:00
Remove cache references
This commit is contained in:
parent
dbf303b2f6
commit
627328df9c
3 changed files with 2 additions and 28 deletions
|
@ -1669,8 +1669,7 @@ return array(
|
|||
return new UserIdToken(
|
||||
$container->get( 'api.host' ),
|
||||
$container->get( 'woocommerce.logger.woocommerce' ),
|
||||
$container->get( 'api.client-credentials' ),
|
||||
$container->get( 'api.client-credentials-cache' )
|
||||
$container->get( 'api.client-credentials' )
|
||||
);
|
||||
},
|
||||
'api.sdk-client-token' => static function( ContainerInterface $container ): SdkClientToken {
|
||||
|
|
|
@ -96,18 +96,6 @@ class ApiModule implements ModuleInterface {
|
|||
10,
|
||||
2
|
||||
);
|
||||
|
||||
add_action(
|
||||
'wp_logout',
|
||||
function( int $user_id ) use ( $c ) {
|
||||
$client_credentials_cache = $c->get( 'api.client-credentials-cache' );
|
||||
assert( $client_credentials_cache instanceof Cache );
|
||||
|
||||
if ( $client_credentials_cache->has( UserIdToken::CACHE_KEY . '-' . (string) $user_id ) ) {
|
||||
$client_credentials_cache->delete( UserIdToken::CACHE_KEY . '-' . (string) $user_id );
|
||||
}
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -11,7 +11,6 @@ use Psr\Log\LoggerInterface;
|
|||
use WooCommerce\PayPalCommerce\ApiClient\Endpoint\RequestTrait;
|
||||
use WooCommerce\PayPalCommerce\ApiClient\Exception\PayPalApiException;
|
||||
use WooCommerce\PayPalCommerce\ApiClient\Exception\RuntimeException;
|
||||
use WooCommerce\PayPalCommerce\ApiClient\Helper\Cache;
|
||||
use WP_Error;
|
||||
|
||||
/**
|
||||
|
@ -21,8 +20,6 @@ class UserIdToken {
|
|||
|
||||
use RequestTrait;
|
||||
|
||||
const CACHE_KEY = 'user-id-token-key';
|
||||
|
||||
/**
|
||||
* The host.
|
||||
*
|
||||
|
@ -44,31 +41,21 @@ class UserIdToken {
|
|||
*/
|
||||
private $client_credentials;
|
||||
|
||||
/**
|
||||
* The cache.
|
||||
*
|
||||
* @var Cache
|
||||
*/
|
||||
private $cache;
|
||||
|
||||
/**
|
||||
* UserIdToken constructor.
|
||||
*
|
||||
* @param string $host The host.
|
||||
* @param LoggerInterface $logger The logger.
|
||||
* @param ClientCredentials $client_credentials The client credentials.
|
||||
* @param Cache $cache The cache.
|
||||
*/
|
||||
public function __construct(
|
||||
string $host,
|
||||
LoggerInterface $logger,
|
||||
ClientCredentials $client_credentials,
|
||||
Cache $cache
|
||||
ClientCredentials $client_credentials
|
||||
) {
|
||||
$this->host = $host;
|
||||
$this->logger = $logger;
|
||||
$this->client_credentials = $client_credentials;
|
||||
$this->cache = $cache;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue