feat(payment): separate creator income settlement
This commit is contained in:
1 parent
cd93ea1656
commit
e20418e909
17 files changed
+451
-445
No files matched your search
@@ -20,7 +20,6 @@ class CreatorRevenue {
|
||||
|
||||
public function init(): void {
|
||||
add_action('aksrt_creator_income_settlement', [$this, 'settle_due']);
|
||||
add_action('aksrt_order_status_changed', [$this, 'handle_order_status_changed'], 10, 3);
|
||||
if (!wp_next_scheduled('aksrt_creator_income_settlement')) {
|
||||
wp_schedule_event(time() + HOUR_IN_SECONDS, 'hourly', 'aksrt_creator_income_settlement');
|
||||
}
|
||||
@@ -32,12 +31,6 @@ class CreatorRevenue {
|
||||
}
|
||||
}
|
||||
|
||||
public function handle_order_status_changed(string $order_number, string $new_status, array $order = []): void {
|
||||
if (in_array($new_status, ['cancelled', 'refunding', 'refunded'], true) && class_exists('AKSRT\\Payment\\Revenue')) {
|
||||
Revenue::get_instance()->cancel_or_reverse($order_number, sprintf(__('订单状态变更为%s', 'aksrt'), $new_status));
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Create creator income after content entitlement has been delivered.
|
||||
*
|
||||
|
||||
Reference in new issue
Block a user