fix payment points

This commit is contained in:
kate522 committed 2026-09-04 23:35:19 +08:00
1 parent f3fcfe45da
commit 9dc278bd83
6 files changed
+44 -19

No files matched your search

+4 -2
View File
@@ -39,8 +39,10 @@ final class CommissionLedger {
]);
return $result >= 0;
}
public function record_paid_order(array $order): int {
if (!\AKSRT\Settings\Settings::affiliate_enabled()) return 0;
public function record_paid_order(array $order): int {
$currency = sanitize_key((string) ($order['currency'] ?? ''));
if ($currency === \AKSRT\Ledger\AssetType::POINTS->value) return 0;
if (!\AKSRT\Settings\Settings::affiliate_enabled()) return 0;
$type = sanitize_key((string) ($order['product_type'] ?? ''));
$map = ['vip' => 'membership', 'resource' => 'content'];
$order_type = $map[$type] ?? $type;