Commit e2b10f95db for woocommerce
commit e2b10f95dbc9672f721e24e54931bcc1c3221af3
Author: Vlad Olaru <vlad.olaru@automattic.com>
Date: Thu Apr 24 10:37:56 2025 +0300
[WC Payments NOX] Fix Airwallex gateway titles (#57455)
* Add Airwallex to exclusion list
* Add memo to extensions base details
* Add changelog
---------
Co-authored-by: Vladimir Reznichenko <kalessil@gmail.com>
diff --git a/plugins/woocommerce/changelog/fix-WOOPLUG-3736-airwallex-gateway-titles b/plugins/woocommerce/changelog/fix-WOOPLUG-3736-airwallex-gateway-titles
new file mode 100644
index 0000000000..ddc6c1f766
--- /dev/null
+++ b/plugins/woocommerce/changelog/fix-WOOPLUG-3736-airwallex-gateway-titles
@@ -0,0 +1,5 @@
+Significance: patch
+Type: fix
+Comment: We allow the Airwallex extension to provide its own gateway titles and descriptions.
+
+
diff --git a/plugins/woocommerce/src/Internal/Admin/Settings/PaymentProviders.php b/plugins/woocommerce/src/Internal/Admin/Settings/PaymentProviders.php
index 85d0441a5b..e1b96177f4 100644
--- a/plugins/woocommerce/src/Internal/Admin/Settings/PaymentProviders.php
+++ b/plugins/woocommerce/src/Internal/Admin/Settings/PaymentProviders.php
@@ -886,6 +886,7 @@ class PaymentProviders {
ExtensionSuggestions::AMAZON_PAY,
ExtensionSuggestions::SQUARE,
ExtensionSuggestions::PAYONEER,
+ ExtensionSuggestions::AIRWALLEX,
ExtensionSuggestions::COINBASE, // We don't have suggestion details yet.
ExtensionSuggestions::AUTHORIZE_NET, // We don't have suggestion details yet.
ExtensionSuggestions::BOLT, // We don't have suggestion details yet.
diff --git a/plugins/woocommerce/src/Internal/Admin/Suggestions/PaymentExtensionSuggestions.php b/plugins/woocommerce/src/Internal/Admin/Suggestions/PaymentExtensionSuggestions.php
index 68d18fd9bd..1863a0aed8 100644
--- a/plugins/woocommerce/src/Internal/Admin/Suggestions/PaymentExtensionSuggestions.php
+++ b/plugins/woocommerce/src/Internal/Admin/Suggestions/PaymentExtensionSuggestions.php
@@ -97,6 +97,13 @@ class PaymentExtensionSuggestions {
const TAG_MADE_IN_WOO = 'made_in_woo'; // For extensions developed by Woo.
const TAG_RECOMMENDED = 'recommended'; // For extensions that should be further emphasized.
+ /**
+ * The memoized extensions base details to avoid computing them multiple times during a request.
+ *
+ * @var array|null
+ */
+ private ?array $extensions_base_details_memo = null;
+
/**
* The payment extension list for each country.
*
@@ -2356,7 +2363,10 @@ class PaymentExtensionSuggestions {
* @return array[] The base details of all extensions.
*/
private function get_all_extensions_base_details(): array {
- return array(
+ if ( isset( $this->extensions_base_details_memo ) ) {
+ return $this->extensions_base_details_memo;
+ }
+ $this->extensions_base_details_memo = array(
self::AIRWALLEX => array(
'_type' => self::TYPE_PSP,
'title' => esc_html__( 'Airwallex Payments', 'woocommerce' ),
@@ -3335,6 +3345,8 @@ class PaymentExtensionSuggestions {
),
),
);
+
+ return $this->extensions_base_details_memo;
}
/**