Commit 4e94b40470b for woocommerce
commit 4e94b40470b3668a1940330abc929ac3476d69e1
Author: Povilas Staskus <povilas.staskus@automattic.com>
Date: Tue May 26 17:58:13 2026 +0300
Add Stripe IPP channel check to POS order identification (#64029)
* Add Stripe IPP channel check to POS order identification
Update PointOfSaleOrderUtil::is_order_paid_at_pos() to also check
for _stripe_ipp_channel meta key with value mobile_pos. This enables
POS email suppression for orders paid via Stripe extension terminal
payments, not just WooCommerce Payments.
WOOMOB-2607
* Add changelog entry for Stripe IPP channel POS identification
* Simplify docblock for is_order_paid_at_pos
diff --git a/plugins/woocommerce/changelog/woomob-2607-stripe-ipp-channel-pos-identification b/plugins/woocommerce/changelog/woomob-2607-stripe-ipp-channel-pos-identification
new file mode 100644
index 00000000000..ac4cdc8cbcd
--- /dev/null
+++ b/plugins/woocommerce/changelog/woomob-2607-stripe-ipp-channel-pos-identification
@@ -0,0 +1,4 @@
+Significance: patch
+Type: add
+
+Add Stripe IPP channel check to POS order identification for email suppression.
diff --git a/plugins/woocommerce/src/Internal/Orders/PointOfSaleOrderUtil.php b/plugins/woocommerce/src/Internal/Orders/PointOfSaleOrderUtil.php
index b675a4793f0..4a93148bcba 100644
--- a/plugins/woocommerce/src/Internal/Orders/PointOfSaleOrderUtil.php
+++ b/plugins/woocommerce/src/Internal/Orders/PointOfSaleOrderUtil.php
@@ -33,8 +33,8 @@ class PointOfSaleOrderUtil {
*
* An order is considered paid at POS if:
* - It was created via the POS REST API, OR
- * - It was paid via card terminal (_wcpay_ipp_channel = mobile_pos), OR
- * - It was paid via cash at POS (_cash_change_amount meta present).
+ * - It was paid via card terminal, OR
+ * - It was paid via cash at POS.
*
* @param WC_Abstract_Order $order Order instance.
* @return bool
@@ -50,6 +50,10 @@ class PointOfSaleOrderUtil {
return true;
}
+ if ( 'mobile_pos' === $order->get_meta( '_stripe_ipp_channel' ) ) {
+ return true;
+ }
+
if ( '' !== $order->get_meta( '_cash_change_amount' ) ) {
return true;
}
diff --git a/plugins/woocommerce/tests/php/src/Internal/Orders/PointOfSaleEmailHandlerTest.php b/plugins/woocommerce/tests/php/src/Internal/Orders/PointOfSaleEmailHandlerTest.php
index cd2b88b1a22..852a073fbe1 100644
--- a/plugins/woocommerce/tests/php/src/Internal/Orders/PointOfSaleEmailHandlerTest.php
+++ b/plugins/woocommerce/tests/php/src/Internal/Orders/PointOfSaleEmailHandlerTest.php
@@ -52,6 +52,18 @@ class PointOfSaleEmailHandlerTest extends WC_Unit_Test_Case {
$this->assertFalse( $this->sut->maybe_suppress_email( true, $order ) );
}
+ /**
+ * @testdox maybe_suppress_email returns false for Stripe POS card reader payment.
+ */
+ public function test_suppresses_email_for_stripe_card_reader_payment(): void {
+ $order = new WC_Order();
+ $order->set_created_via( 'bookings' );
+ $order->update_meta_data( '_stripe_ipp_channel', 'mobile_pos' );
+ $order->save();
+
+ $this->assertFalse( $this->sut->maybe_suppress_email( true, $order ) );
+ }
+
/**
* @testdox maybe_suppress_email returns false for cash payment at POS.
*/
diff --git a/plugins/woocommerce/tests/php/src/Internal/Orders/PointOfSaleOrderUtilTest.php b/plugins/woocommerce/tests/php/src/Internal/Orders/PointOfSaleOrderUtilTest.php
index 9368d2a3d29..4c0420e5b0e 100644
--- a/plugins/woocommerce/tests/php/src/Internal/Orders/PointOfSaleOrderUtilTest.php
+++ b/plugins/woocommerce/tests/php/src/Internal/Orders/PointOfSaleOrderUtilTest.php
@@ -58,6 +58,18 @@ class PointOfSaleOrderUtilTest extends WC_Unit_Test_Case {
$this->assertTrue( PointOfSaleOrderUtil::is_order_paid_at_pos( $order ) );
}
+ /**
+ * @testdox is_order_paid_at_pos returns true for Stripe POS card reader payment.
+ */
+ public function test_is_order_paid_at_pos_returns_true_for_stripe_card_reader_payment(): void {
+ $order = new WC_Order();
+ $order->set_created_via( 'bookings' );
+ $order->update_meta_data( '_stripe_ipp_channel', 'mobile_pos' );
+ $order->save();
+
+ $this->assertTrue( PointOfSaleOrderUtil::is_order_paid_at_pos( $order ) );
+ }
+
/**
* @testdox is_order_paid_at_pos returns true for cash payment at POS.
*/