Automattic\WooCommerce\Internal\Admin\Settings\PaymentsProviders
PaymentGateway::get_plugin_details
Get the plugin details for a payment gateway.
Method of the class: PaymentGateway{}
No Hooks.
Returns
Array. The plugin details for the payment gateway.
Usage
$PaymentGateway = new PaymentGateway(); $PaymentGateway->get_plugin_details( $payment_gateway ): array;
- $payment_gateway(WC_Payment_Gateway) (required)
- The payment gateway object.
PaymentGateway::get_plugin_details() PaymentGateway::get plugin details code WC 10.9.4
public function get_plugin_details( WC_Payment_Gateway $payment_gateway ): array {
$entity_type = $this->get_containing_entity_type( $payment_gateway );
return array(
'_type' => $entity_type,
'slug' => $this->get_plugin_slug( $payment_gateway ),
// Only include the plugin file if the entity type is a regular plugin.
// We don't want to try to change the state of must-use plugins or themes.
'file' => PaymentsProviders::EXTENSION_TYPE_WPORG === $entity_type ? $this->get_plugin_file( $payment_gateway ) : '',
// The gateway's underlying plugin is obviously active (aka the code is running).
'status' => PaymentsProviders::EXTENSION_ACTIVE,
);
}