Skip to content

Remove redundant cache from ReferenceTransactionStatus (6280)#4309

Merged
danieldudzic merged 3 commits into
dev/developfrom
dev/PCP-6280-remove-redundant-cache-from-reference-transaction-status
Apr 28, 2026
Merged

Remove redundant cache from ReferenceTransactionStatus (6280)#4309
danieldudzic merged 3 commits into
dev/developfrom
dev/PCP-6280-remove-redundant-cache-from-reference-transaction-status

Conversation

@danieldudzic

Copy link
Copy Markdown
Collaborator

Description

Remove the redundant cache from ReferenceTransactionStatus and rely on PartnersEndpoint::seller_status(), which already caches the SellerStatus object.

This cache is a leftover from the old BillingAgreementsEndpoint (removed in #3495), where it made sense because the check required an expensive create_token() API call.

Now that the class reads from PartnersEndpoint::seller_status(), which already caches the SellerStatus object in its own transient, the extra cache is redundant.

This change:

  • Removes the extra boolean cache and its service wiring
  • Keeps woocommerce_paypal_payments_seller_status effective on repeated calls
  • Removes the stale cache-clearing logic from WCGatewayModule
  • Adds unit coverage for the updated helper behavior

@github-actions

github-actions Bot commented Apr 28, 2026

Copy link
Copy Markdown

Test using WordPress Playground

The changes in this pull request can be previewed and tested using a WordPress Playground instance.
WordPress Playground is an experimental project that creates a full WordPress instance entirely within the browser.

🔗 Test this pull request with WordPress Playground

What's included:

  • ✅ WordPress (latest)
  • ✅ WooCommerce (latest)
  • ✅ PayPal Payments plugin v4.0.2-pr4309-25054092804-g7a94faf (built from this PR)

Login credentials:

  • Username: admin
  • Password: password

Plugin Details:

  • Version: 4.0.2-pr4309-25054092804-g7a94faf
  • Commit: 6441670
  • Artifact: woocommerce-paypal-payments-4.0.2-pr4309-25054092804-g7a94faf

💡 The demo environment resets each time you refresh. Perfect for testing!

🔄 This link updates automatically with each new commit to the PR.

⚠️ This URL is valid for 30 days from when this comment was last updated.


🤖 Auto-generated for commit 6441670 • Last updated: 2026-04-28T13:00:00.894Z

@Narek13 Narek13 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 👍 Thanks a lot for adding the unit test!

@danieldudzic
danieldudzic merged commit 8ee5cd2 into dev/develop Apr 28, 2026
12 checks passed
@danieldudzic
danieldudzic deleted the dev/PCP-6280-remove-redundant-cache-from-reference-transaction-status branch April 28, 2026 16:31
@InpsydeNiklas InpsydeNiklas added this to the 4.1.0 milestone May 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants