Skip to content

Commit

Permalink
Merge branch 'trunk' into PCP-3867-Redux-stores-for-plugin-settings
Browse files Browse the repository at this point in the history
  • Loading branch information
stracker-phil committed Dec 17, 2024
2 parents 515423b + 4949a4f commit 75652cd
Show file tree
Hide file tree
Showing 322 changed files with 14,984 additions and 13,147 deletions.
3 changes: 2 additions & 1 deletion .ddev/config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,12 @@ nfs_mount_enabled: false
mutagen_enabled: false
use_dns_when_possible: true
composer_version: "2"
nodejs_version: "22"
hooks:
pre-start:
- exec-host: "mkdir -p .ddev/wordpress/wp-content/plugins/${DDEV_PROJECT}"
web_environment:
- WP_VERSION=6.3.3
- WP_VERSION=6.7.1
- WP_LOCALE=en_US
- WP_TITLE=WooCommerce PayPal Payments
- WP_MULTISITE=true
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/package-new.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ jobs:
uses: inpsyde/reusable-workflows/.github/workflows/build-plugin-archive.yml@main
with:
PHP_VERSION: 7.4
NODE_VERSION: 22
PLUGIN_MAIN_FILE: ./woocommerce-paypal-payments.php
PLUGIN_VERSION: ${{ needs.check_version.outputs.version }}
PLUGIN_FOLDER_NAME: woocommerce-paypal-payments
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/php.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
php-versions: ['7.4', '8.0', '8.1', '8.2', '8.3']
php-versions: ['7.4', '8.0', '8.1', '8.2', '8.3', '8.4']

name: PHP ${{ matrix.php-versions }}
steps:
Expand All @@ -30,6 +30,7 @@ jobs:
run: vendor/bin/phpunit

- name: Psalm
if: ${{ matrix.php-versions == '7.4' }}
run: ./vendor/bin/psalm --show-info=false --threads=8 --diff

- name: Run PHPCS
Expand Down
117 changes: 81 additions & 36 deletions .psalm/stubs.php
Original file line number Diff line number Diff line change
@@ -1,71 +1,116 @@
<?php
if (!defined('PAYPAL_INTEGRATION_DATE')) {
define('PAYPAL_INTEGRATION_DATE', '2023-06-02');
/**
* Stubs to help psalm correctly annotate problems in the plugin.
*
* @package WooCommerce
*/

if ( ! defined( 'PAYPAL_INTEGRATION_DATE' ) ) {
define( 'PAYPAL_INTEGRATION_DATE', '2023-06-02' );
}
if (!defined('PAYPAL_URL')) {
if ( ! defined( 'PAYPAL_URL' ) ) {
define( 'PAYPAL_URL', 'https://www.paypal.com' );
}
if (!defined('PAYPAL_SANDBOX_URL')) {
if ( ! defined( 'PAYPAL_SANDBOX_URL' ) ) {
define( 'PAYPAL_SANDBOX_URL', 'https://www.sandbox.paypal.com' );
}
if (!defined('EP_PAGES')) {
define('EP_PAGES', 4096);
if ( ! defined( 'EP_PAGES' ) ) {
define( 'EP_PAGES', 4096 );
}
if (!defined('MONTH_IN_SECONDS')) {
define('MONTH_IN_SECONDS', 30 * DAY_IN_SECONDS);
if ( ! defined( 'MONTH_IN_SECONDS' ) ) {
define( 'MONTH_IN_SECONDS', 30 * DAY_IN_SECONDS );
}
if (!defined('HOUR_IN_SECONDS')) {
define('HOUR_IN_SECONDS', 60 * MINUTE_IN_SECONDS);
if ( ! defined( 'HOUR_IN_SECONDS' ) ) {
define( 'HOUR_IN_SECONDS', 60 * MINUTE_IN_SECONDS );
}
if (!defined('MINUTE_IN_SECONDS')) {
if ( ! defined( 'MINUTE_IN_SECONDS' ) ) {
define( 'MINUTE_IN_SECONDS', 60 );
}

if (!defined('ABSPATH')) {
define('ABSPATH', '');
if ( ! defined( 'ABSPATH' ) ) {
define( 'ABSPATH', '' );
}

if (!defined('PPCP_PAYPAL_BN_CODE')) {
define('PPCP_PAYPAL_BN_CODE', 'Woo_PPCP');
if ( ! defined( 'PAYPAL_API_URL' ) ) {
define( 'PAYPAL_API_URL', 'https://api-m.paypal.com' );
}
if ( ! defined( 'PAYPAL_SANDBOX_API_URL' ) ) {
define( 'PAYPAL_SANDBOX_API_URL', 'https://api-m.sandbox.paypal.com' );
}
if ( ! defined( 'PPCP_PAYPAL_BN_CODE' ) ) {
define( 'PPCP_PAYPAL_BN_CODE', 'Woo_PPCP' );
}
if ( ! defined( 'CONNECT_WOO_CLIENT_ID' ) ) {
define( 'CONNECT_WOO_CLIENT_ID', 'AcCAsWta_JTL__OfpjspNyH7c1GGHH332fLwonA5CwX4Y10mhybRZmHLA0GdRbwKwjQIhpDQy0pluX_P' );
}
if ( ! defined( 'CONNECT_WOO_SANDBOX_CLIENT_ID' ) ) {
define( 'CONNECT_WOO_SANDBOX_CLIENT_ID', 'AYmOHbt1VHg-OZ_oihPdzKEVbU3qg0qXonBcAztuzniQRaKE0w1Hr762cSFwd4n8wxOl-TCWohEa0XM_' );
}
if ( ! defined( 'CONNECT_WOO_MERCHANT_ID' ) ) {
define( 'CONNECT_WOO_MERCHANT_ID', 'K8SKZ36LQBWXJ' );
}
if ( ! defined( 'CONNECT_WOO_SANDBOX_MERCHANT_ID' ) ) {
define( 'CONNECT_WOO_SANDBOX_MERCHANT_ID', 'MPMFHQTVMBZ6G' );
}
if ( ! defined( 'CONNECT_WOO_URL' ) ) {
define( 'CONNECT_WOO_URL', 'https://api.woocommerce.com/integrations/ppc' );
}
if ( ! defined( 'CONNECT_WOO_SANDBOX_URL' ) ) {
define( 'CONNECT_WOO_SANDBOX_URL', 'https://api.woocommerce.com/integrations/ppcsandbox' );
}

/**
* Cancel the next occurrence of a scheduled action.
*
* While only the next instance of a recurring or cron action is unscheduled by this method, that will also prevent
* all future instances of that recurring or cron action from being run. Recurring and cron actions are scheduled in
* a sequence instead of all being scheduled at once. Each successive occurrence of a recurring action is scheduled
* only after the former action is run. If the next instance is never run, because it's unscheduled by this function,
* then the following instance will never be scheduled (or exist), which is effectively the same as being unscheduled
* by this method also.
* While only the next instance of a recurring or cron action is unscheduled by this method, that
* will also prevent all future instances of that recurring or cron action from being run.
* Recurring and cron actions are scheduled in a sequence instead of all being scheduled at once.
* Each successive occurrence of a recurring action is scheduled only after the former action is
* run. If the next instance is never run, because it's unscheduled by this function, then the
* following instance will never be scheduled (or exist), which is effectively the same as being
* unscheduled by this method also.
*
* @param string $hook The hook that the job will trigger.
* @param array $args Args that would have been passed to the job.
* @param string $hook The hook that the job will trigger.
* @param array $args Args that would have been passed to the job.
* @param string $group The group the job is assigned to.
*
* @return string|null The scheduled action ID if a scheduled action was found, or null if no matching action found.
* @return string|null The scheduled action ID if a scheduled action was found, or null if no
* matching action found.
*/
function as_unschedule_action($hook, $args = array(), $group = '') {}
function as_unschedule_action( $hook, $args = array(), $group = '' ) {
return null;
}

/**
* Schedule an action to run one time
*
* @param int $timestamp When the job will run.
* @param string $hook The hook to trigger.
* @param array $args Arguments to pass when the hook triggers.
* @param string $group The group to assign this job to.
* @param bool $unique Whether the action should be unique.
* @param string $hook The hook to trigger.
* @param array $args Arguments to pass when the hook triggers.
* @param string $group The group to assign this job to.
* @param bool $unique Whether the action should be unique.
*
* @return int The action ID.
*/
function as_schedule_single_action( $timestamp, $hook, $args = array(), $group = '', $unique = false ) {}
function as_schedule_single_action( $timestamp, $hook, $args = array(), $group = '', $unique = false ) {
return 0;
}

/**
* HTML API: WP_HTML_Tag_Processor class
*/
// phpcs:disable
class WP_HTML_Tag_Processor {
public function __construct( $html ) {}
public function next_tag( $query = null ) {}
public function set_attribute( $name, $value ) {}
public function get_updated_html() {}
public function __construct( $html ) {
}

public function next_tag( $query = null ) : bool {
return false;
}

public function set_attribute( $name, $value ) : bool {
return false;
}

public function get_updated_html() : string {
return '';
}
}
21 changes: 19 additions & 2 deletions changelog.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,24 @@
*** Changelog ***

= 2.9.4 - xxxx-xx-xx =
= 2.9.5 - 2024-12-10 =
Fix - Early translation loading triggers `Function _load_textdomain_just_in_time was called incorrectly.` notice #2816
Fix - ACDC card fields not loading and payment not successful when Classic Checkout Smart Button Location disabled #2852
Fix - ACDC gateway does not appear for guests when is Fastlane enabled and a subscription product is in the cart #2745
Fix - "Voide authorization" button does not appear for Apple Pay/Google Pay orders when payment buttons are separated #2752
Fix - Additional payment tokens saved with new customer_id #2820
Fix - Vaulted payment method may not be displayed in PayPal button for return buyer #2809
Fix - Conflict with EasyShip plugin due to shipping methods loading too early #2845
Fix - Restore accidentally removed ACDC currencies #2838
Enhancement - Native gateway icon for PayPal & Pay upon Invoice gateways #2712
Enhancement - Allow disabling specific card types for Fastlane #2704
Enhancement - Fastlane Insights SDK implementation for block Checkout #2737
Enhancement - Hide split local APMs in Payments settings tab when PayPal is not enabled #2703
Enhancement - Do not load split local APMs on Checkout when PayPal is not enabled #2792
Enhancement - Add support for Button Options in the Block Checkout for Apple Pay & Google Pay buttons #2797 #2772
Enhancement - Disable “Add payment method” button while saving ACDC payment #2794
Enhancement - Sanitize soft_descriptor field #2846 #2854

= 2.9.4 - 2024-11-11 =
* Fix - Apple Pay button preview missing in Standard payment and Advanced Processing tabs #2755
* Fix - Set "Sold individually" only for subscription connected to PayPal #2710
* Fix - Ensure Google Pay button does not appear for subscriptions #2718
Expand All @@ -13,7 +31,6 @@
* Fix - Payment with OXXO cause continuation state for next payment #2702
* Fix - Fix problems with autoptimize plugin #2705
* Fix - Missing custom field PayPal Transaction Fee for OXXO #2700
* Enhancement - Extend Advanced Card Processing country/currency feature availability #2754
* Enhancement - Add void button #2678
* Enhancement - Use basic redirect gateway when checkout smart buttons disabled #2714
* Enhancement - Receive button properties from the Checkout Block #2448
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "woocommerce/woocommerce-paypal-payments",
"type": "wordpress-plugin",
"description": "PayPal Commerce Platform for WooCommerce",
"license": "GPL-2.0",
"license": "GPL-2.0-or-later",
"require": {
"php": "^7.4 | ^8.0",
"ext-json": "*",
Expand Down
6 changes: 3 additions & 3 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 75652cd

Please sign in to comment.