Skip to content

Commit 6340d70

Browse files
committed
🔧 Cache raw seller status before applying filter
1 parent 788bd16 commit 6340d70

1 file changed

Lines changed: 5 additions & 9 deletions

File tree

‎modules/ppcp-api-client/src/Endpoint/PartnersEndpoint.php‎

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -163,23 +163,19 @@ public function seller_status(): SellerStatus {
163163
array( 'error' => $exception->getMessage() )
164164
);
165165

166-
/** @var SellerStatus $status */
167-
$status = apply_filters( 'woocommerce_paypal_payments_seller_status', $fallback );
168-
169-
$this->cache->set( self::SELLER_STATUS_CACHE_KEY, $status, self::SELLER_STATUS_CACHE_TTL );
166+
$this->cache->set( self::SELLER_STATUS_CACHE_KEY, $fallback, self::SELLER_STATUS_CACHE_TTL );
170167

171-
return $status;
168+
/** @var SellerStatus $status */
169+
return apply_filters( 'woocommerce_paypal_payments_seller_status', $fallback );
172170
}
173171

174172
throw $exception;
175173
}
176174

177-
/** This filter is documented above. */
178-
$status = apply_filters( 'woocommerce_paypal_payments_seller_status', $status );
179-
180175
$this->cache->set( self::SELLER_STATUS_CACHE_KEY, $status, self::SELLER_STATUS_CACHE_TTL );
181176

182-
return $status;
177+
/** This filter is documented above. */
178+
return apply_filters( 'woocommerce_paypal_payments_seller_status', $status );
183179
}
184180

185181
/**

0 commit comments

Comments
 (0)