Automattic\WooCommerce\Internal\Admin\Settings

PaymentsProviders::get_extension_suggestion_by_plugin_slugpublicWC 1.0

Get a payment extension suggestion by plugin slug.

Method of the class: PaymentsProviders{}

No Hooks.

Returns

?Array. The payment extension suggestion details, or null if not found.

Usage

$PaymentsProviders = new PaymentsProviders();
$PaymentsProviders->get_extension_suggestion_by_plugin_slug( $slug, $country_code ): ?array;
$slug(string) (required)
The plugin slug of the payment extension suggestion.
$country_code(string)
The business location country code to get the suggestions for.
Default: ''

PaymentsProviders::get_extension_suggestion_by_plugin_slug() code WC 10.7.0

public function get_extension_suggestion_by_plugin_slug( string $slug, string $country_code = '' ): ?array {
	// Normalize the country code to uppercase.
	$country_code = strtoupper( $country_code );

	$suggestion = $this->extension_suggestions->get_by_plugin_slug( $slug, $country_code, Payments::SUGGESTIONS_CONTEXT );
	if ( ! is_null( $suggestion ) ) {
		// Enhance the suggestion details.
		$suggestion = $this->enhance_extension_suggestion( $suggestion );
	}

	return $suggestion;
}