- Trait-split content-pay, vip-service, balance-service, order-repository - Procedural split of user module into user-parts/* - Split scripts enqueue_public into part-1b/1c; settings bulk trait - Bootstrap: explicit notifications, widgets glob-only, home-modules init - ADR: freeze domain placement for pay/revenue/notify boundaries
39 lines
844 B
PHP
39 lines
844 B
PHP
<?php
|
|
/**
|
|
* AKSRT VIP Service — package parse, purchase, activate membership.
|
|
*
|
|
* product_type = ORDER_PRODUCT_VIP
|
|
* product_id encodes package: level * 1000 + index (1-based)
|
|
*
|
|
* packages_raw line format: price|days|title (days 0 = permanent)
|
|
*
|
|
* @package AKSRT
|
|
*/
|
|
|
|
defined('ABSPATH') || exit;
|
|
|
|
class AKSRT_Vip_Service {
|
|
use AKSRT_Vip_Service_Rest;
|
|
use AKSRT_Vip_Service_Purchase;
|
|
use AKSRT_Vip_Service_Packages;
|
|
|
|
private static $instance = null;
|
|
|
|
|
|
|
|
public static function get_instance(): self {
|
|
if (null === self::$instance) {
|
|
self::$instance = new self();
|
|
}
|
|
return self::$instance;
|
|
}
|
|
|
|
|
|
|
|
public function init(): void {
|
|
add_action('rest_api_init', [$this, 'register_routes']);
|
|
add_action('aksrt_order_paid', [$this, 'on_order_paid'], 20, 2);
|
|
}
|
|
|
|
}
|