Skip to content

Conversation

puntope
Copy link
Collaborator

@puntope puntope commented Sep 10, 2025

Description

  • Fix the "disabled" functionality for PayPal and Venmo metabox.
  • Fix typo in property when "ownBrad" was used instead of "ownBrand"
  • Improve tests coverage for SavePaymentMethods component

Steps to Test

  1. Go to WooCommerce and select a country supporting Vaulting like USA
  2. Go to PayPal Settings and see that you can toggle "Save PayPal and Venmo"
  3. Go to WooCommerce and select a country NOT supporting Vaulting like Vietnam
  4. Go to PayPal Settings and see that you CANNOT toggle "Save PayPal and Venmo"

Demo

Screen.Recording.2025-09-10.at.18.55.50.mov
Screenshot 2025-09-10 at 18 55 31

Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR fixes the disabled functionality for PayPal and Venmo metabox by correcting typos in property names and improving feature availability checks. It also enhances test coverage for the SavePaymentMethods component.

  • Fixes typo where "ownBradOnly" was used instead of "ownBrandOnly" in multiple locations
  • Adds proper feature availability check for save payment methods functionality
  • Implements comprehensive test coverage for the SavePaymentMethods component

Reviewed Changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated no comments.

Show a summary per file
File Description
tests/js/__mocks__/@wordpress/i18n.js Adds mock implementation for WordPress i18n functions to support testing
modules/ppcp-wc-gateway/src/WCGatewayModule.php Enhances feature availability check by adding save payment methods eligibility validation
modules/ppcp-settings/resources/js/Components/Screens/Settings/Tabs/TabSettings.js Fixes typo by removing incorrect "ownBradOnly" prop from CommonSettings
modules/ppcp-settings/resources/js/Components/Screens/Settings/Components/Settings/CommonSettings.js Corrects parameter name from "ownBradOnly" to "ownBrandOnly"
modules/ppcp-settings/resources/js/Components/Screens/Settings/Components/Settings/Blocks/SavePaymentMethods.test.js Adds comprehensive test suite for SavePaymentMethods component
modules/ppcp-settings/resources/js/Components/Screens/Settings/Components/Settings/Blocks/SavePaymentMethods.js Fixes typo in parameter name and adds early return when feature is unavailable

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@puntope puntope marked this pull request as ready for review September 10, 2025 15:15
Copy link

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 v3.1.0-pr3650-17618366189-g3bc25bc (built from this PR)

Login credentials:

  • Username: admin
  • Password: password

Plugin Details:

  • Version: 3.1.0-pr3650-17618366189-g3bc25bc
  • Commit: 3bc25bc
  • Artifact: woocommerce-paypal-payments-3.1.0-pr3650-17618366189-g3bc25bc

💡 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 3bc25bc • Last updated: 2025-09-10T15:22:51.112Z

Copy link
Collaborator

@Narek13 Narek13 left a comment

Choose a reason for hiding this comment

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

Thanks for working on this. Worked as expected for me.

@puntope puntope self-assigned this Sep 15, 2025
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.

2 participants