fix payment points
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user