Automattic\WooCommerce\Blocks\Payments\Integrations

PayPal::get_descriptionpublicWC 1.0

Get the description for the payment method. Add sandbox instructions if sandbox mode is enabled.

Method of the class: PayPal{}

No Hooks.

Returns

String.

Usage

$PayPal = new PayPal();
$PayPal->get_description();

PayPal::get_description() code WC 10.5.0

public function get_description() {
	$gateway     = WC_Gateway_Paypal::get_instance();
	$testmode    = $gateway->testmode;
	$description = $this->get_setting( 'description' ) ?? '';
	if ( $testmode ) {
		/* translators: %s: Link to PayPal sandbox testing guide page */
		$description .= '<br>' . sprintf( __( '<strong>Sandbox mode enabled</strong>. Only sandbox test accounts can be used. See the <a href="%s">PayPal Sandbox Testing Guide</a> for more details.', 'woocommerce' ), 'https://developer.paypal.com/tools/sandbox/' );
	}
	return trim( $description );
}