Automattic\WooCommerce\Internal\Admin\Settings

PaymentProviders::get_payment_gateway_plugin_filepublicWC 1.0

Get the plugin file of payment gateway, without the .php extension.

This is useful for the WP API, which expects the plugin file without the .php extension.

Method of the class: PaymentProviders{}

No Hooks.

Returns

String. The plugin file corresponding to the payment gateway plugin. Does not include the .php extension.

Usage

$PaymentProviders = new PaymentProviders();
$PaymentProviders->get_payment_gateway_plugin_file( $payment_gateway, $plugin_slug ): string;
$payment_gateway(WC_Payment_Gateway) (required)
The payment gateway object.
$plugin_slug(string)
The payment gateway plugin slug to use directly.
Default: ''

PaymentProviders::get_payment_gateway_plugin_file() code WC 9.9.4

public function get_payment_gateway_plugin_file( WC_Payment_Gateway $payment_gateway, string $plugin_slug = '' ): string {
	$provider = $this->get_payment_gateway_provider_instance( $payment_gateway->id );

	return $provider->get_plugin_file( $payment_gateway, $plugin_slug );
}