Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rearrange multi-currency backend directory structure #9387

Merged
merged 2 commits into from
Sep 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@
},
"autoload": {
"psr-4": {
"WCPay\\MultiCurrency\\": "includes/multi-currency",
"WCPay\\MultiCurrency\\": "multi-currency/src",
"WCPay\\Vendor\\": "lib/packages",
"WCPay\\": "src"
},
Expand Down
4 changes: 2 additions & 2 deletions includes/class-wc-payments.php
Original file line number Diff line number Diff line change
Expand Up @@ -491,8 +491,8 @@ public static function init() {
include_once __DIR__ . '/class-duplicate-payment-prevention-service.php';
include_once __DIR__ . '/class-wc-payments-incentives-service.php';
include_once __DIR__ . '/class-compatibility-service.php';
include_once __DIR__ . '/multi-currency/wc-payments-multi-currency.php';
include_once __DIR__ . '/class-wc-payments-currency-manager.php';
include_once __DIR__ . '/compat/multi-currency/wc-payments-multi-currency.php';
include_once __DIR__ . '/compat/multi-currency/class-wc-payments-currency-manager.php';
include_once __DIR__ . '/class-duplicates-detection-service.php';

self::$woopay_checkout_service = new Checkout_Service();
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@

namespace WCPay\MultiCurrency;

use WC_Deposits;
use WC_Deposits_Product_Manager;
use WC_Order;
use WC_Order_Refund;
use WCPay\MultiCurrency\Compatibility\BaseCompatibility;
Expand Down Expand Up @@ -41,7 +39,7 @@ class Compatibility extends BaseCompatibility {
*
* @return void
*/
protected function init() {
public function init() {
add_action( 'init', [ $this, 'init_compatibility_classes' ], 11 );

if ( defined( 'DOING_CRON' ) ) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,5 +46,5 @@ public function __construct( MultiCurrency $multi_currency, Utils $utils ) {
*
* @return void
*/
abstract protected function init();
abstract public function init();
}
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public function __construct( MultiCurrency $multi_currency, Utils $utils, Fronte
*
* @return void
*/
protected function init() {
public function init() {
// Add needed actions and filters if Bookings is active.
if ( class_exists( 'WC_Bookings' ) ) {
if ( ! is_admin() || wp_doing_ajax() ) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ class WooCommerceDeposits extends BaseCompatibility {
*
* @return void
*/
protected function init() {
public function init() {
if ( class_exists( 'WC_Deposits' ) ) {
/*
* Multi-currency support was added to WooCommerce Deposits in version 2.0.1.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ class WooCommerceFedEx extends BaseCompatibility {
*
* @return void
*/
protected function init() {
public function init() {
// Add needed actions and filters if FedEx is active.
if ( class_exists( 'WC_Shipping_Fedex_Init' ) ) {
add_filter( MultiCurrency::FILTER_PREFIX . 'should_return_store_currency', [ $this, 'should_return_store_currency' ] );
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ class WooCommerceNameYourPrice extends BaseCompatibility {
*
* @return void
*/
protected function init() {
public function init() {
// Add needed actions and filters if Name Your Price is active.
if ( class_exists( 'WC_Name_Your_Price' ) ) {
// Convert meta prices.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ class WooCommercePointsAndRewards extends BaseCompatibility {
*
* @return void
*/
protected function init() {
public function init() {
// Add needed filters if Points & Rewards is active and it's not an admin request.
if ( is_admin() || ! class_exists( 'WC_Points_Rewards' ) ) {
return;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ class WooCommercePreOrders extends BaseCompatibility {
*
* @return void
*/
protected function init() {
public function init() {
// Add needed actions and filters if Pre-Orders is active.
if ( class_exists( 'WC_Pre_Orders' ) ) {
add_filter( 'wc_pre_orders_fee', [ $this, 'wc_pre_orders_fee' ] );
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ class WooCommerceProductAddOns extends BaseCompatibility {
*
* @return void
*/
protected function init() {
public function init() {
// Add needed actions and filters if Product Add Ons is active.
if ( class_exists( 'WC_Product_Addons' ) ) {
if ( ! is_admin() && ! defined( 'DOING_CRON' ) ) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ class WooCommerceSubscriptions extends BaseCompatibility {
*
* @return void
*/
protected function init() {
public function init() {
// Add needed actions and filters if WC Subscriptions or WCPay Subscriptions are active.
if ( class_exists( 'WC_Subscriptions' ) || class_exists( 'WC_Payments_Subscriptions' ) ) {
if ( ! is_admin() && ! defined( 'DOING_CRON' ) ) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ class WooCommerceUPS extends BaseCompatibility {
*
* @return void
*/
protected function init() {
public function init() {
// Add needed actions and filters if UPS is active.
if ( class_exists( 'WC_Shipping_UPS_Init' ) ) {
add_filter( MultiCurrency::FILTER_PREFIX . 'should_return_store_currency', [ $this, 'should_return_store_currency' ] );
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -12,18 +12,18 @@
*/
class Logger {

/**
* Log source identifier.
*/
const LOG_FILE = 'woopayments-multi-currency';

/**
* The WooCommerce logger instance.
*
* @var \WC_Logger|null
*/
private $logger;

/**
* Log source identifier.
*/
const LOG_FILE = 'woopayments-multi-currency';

/**
* Log a debug message.
*
Expand Down
Loading