payment_gateways(); if ( isset( $gateways['stripe'] ) && $gateways['stripe'] instanceof WC_Gateway_Stripe ) { // We must get the option and apply the filter as the description may be already modified with the testmode string. $description = apply_filters( 'woocommerce_gateway_description', $gateways['stripe']->get_option( 'description' ), $gateways['stripe']->id ); // Add testmode string as done in WC_Gateway_Stripe class. if ( $gateways['stripe']->testmode ) { /* translators: %s is a link to the Stripe documentation */ $description .= ' ' . sprintf( __( 'TEST MODE ENABLED. In test mode, you can use the card number 4242424242424242 with any CVC and a valid expiration date or check the documentation "Testing Stripe" for more card numbers.', 'polylang-wc' ), 'https://stripe.com/docs/testing' ); $description = trim( $description ); } } return $description; } }