mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-09-05 08:59:14 +08:00
Show webhooks
This commit is contained in:
parent
0b029a9392
commit
e2a7f6d8d9
12 changed files with 5132 additions and 7 deletions
|
@ -0,0 +1,84 @@
|
|||
<?php
|
||||
/**
|
||||
* Register and configure assets for webhooks status page.
|
||||
*
|
||||
* @package WooCommerce\PayPalCommerce\Webhooks\Status\Assets
|
||||
*/
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace WooCommerce\PayPalCommerce\WcGateway\Assets;
|
||||
|
||||
use WooCommerce\PayPalCommerce\ApiClient\Authentication\Bearer;
|
||||
use WooCommerce\PayPalCommerce\ApiClient\Exception\RuntimeException;
|
||||
|
||||
/**
|
||||
* Class WebhooksStatusPageAssets
|
||||
*/
|
||||
class WebhooksStatusPageAssets {
|
||||
|
||||
/**
|
||||
* The URL to the module.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
private $module_url;
|
||||
|
||||
/**
|
||||
* WebhooksStatusPageAssets constructor.
|
||||
*
|
||||
* @param string $module_url The URL to the module.
|
||||
*/
|
||||
public function __construct(
|
||||
string $module_url
|
||||
) {
|
||||
$this->module_url = untrailingslashit( $module_url );
|
||||
}
|
||||
|
||||
/**
|
||||
* Registers the scripts and styles.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function register(): void {
|
||||
wp_register_style(
|
||||
'ppcp-webhooks-status-page-style',
|
||||
$this->module_url . '/assets/css/status-page.css',
|
||||
array(),
|
||||
1
|
||||
);
|
||||
|
||||
wp_register_script(
|
||||
'ppcp-webhooks-status-page',
|
||||
$this->module_url . '/assets/js/status-page.js',
|
||||
array(),
|
||||
1,
|
||||
true
|
||||
);
|
||||
|
||||
wp_localize_script(
|
||||
'ppcp-webhooks-status-page',
|
||||
'PayPalCommerceGatewayWebhooksStatus',
|
||||
$this->get_script_data()
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the data for the script.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function get_script_data() {
|
||||
return array();
|
||||
}
|
||||
|
||||
/**
|
||||
* Enqueues the necessary scripts.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function enqueue(): void {
|
||||
wp_enqueue_style( 'ppcp-webhooks-status-page-style' );
|
||||
wp_enqueue_script( 'ppcp-webhooks-status-page' );
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue