Automattic\WooCommerce\Internal\Admin\WCPayPromotion

WCPayPromotionDataSourcePoller::get_data_sources()public staticWC 1.0

Get data sources.

Method of the class: WCPayPromotionDataSourcePoller{}

No Hooks.

Return

Array.

Usage

$result = WCPayPromotionDataSourcePoller::get_data_sources();

WCPayPromotionDataSourcePoller::get_data_sources() code WC 9.7.1

public static function get_data_sources() {
	$data_sources = array(
		WC_Helper::get_woocommerce_com_base_url() . 'wp-json/wccom/payment-gateway-suggestions/2.0/payment-method/promotions.json',
	);

	// Add country query param to data sources.
	$base_location             = wc_get_base_location();
	$data_sources_with_country = array_map(
		function ( $url ) use ( $base_location ) {
			return add_query_arg(
				'country',
				$base_location['country'],
				$url
			);
		},
		$data_sources
	);
	return $data_sources_with_country;
}