Hi,
They use set_transient in the payment to temporarily save the transient, the response should then be valid for 60 min. In this case when they use get_transient the cache has saved the transient as valid after 60 min. It is then first when I purge the object cache as it works again.
Since they are using the standard WordPress set_transient and get_transient, do you know if this can be excluded to be saved as object cache and what group I then can use?
They use the functions below for set_transient and get_transient
/**
* Save Walley order data to transient in WordPress.
*
* @param array $walley_order the returned Walley order data.
* @return void
*/
function walley_save_order_data_to_transient( $walley_order ) {
$walley_order_status_data = array(
'status' => $walley_order['status'] ?? '',
'total_amount' => $walley_order['total_amount'] ?? '',
'currency' => $walley_order['currency'] ?? '',
);
set_transient( "walley_order_status_{$walley_order['order_id']}", $walley_order_status_data, 30 );
}
and
* Get the access token from Walley.
*
* @return string
*/
private function get_access_token() {
$access_token = get_transient( 'walley_checkout_access_token' );
if ( $access_token ) {
return $access_token;
}
$response = CCO_WC()->api->get_access_token();
if ( is_wp_error( $response ) ) {
return '';
}
$access_token = $response['token_type'] . ' ' . $response['access_token'];
set_transient( 'walley_checkout_access_token', $access_token, absint( $response['expires_in'] ) );
return $access_token;
}
Thank you for your support, I wish a good continuation on 2024:)