SubscriptionActivationService: guard against merchant mismatch
This commit is contained in:
@@ -58,6 +58,11 @@ class SubscriptionActivationService
|
||||
/** @var SiteSubscription $subscription */
|
||||
$subscription = SiteSubscription::query()->findOrFail($order->site_subscription_id);
|
||||
|
||||
// 治理安全阀:订单绑定的订阅必须属于同一站点(merchant),否则拒绝同步,避免误续费/串单。
|
||||
if ((int) $subscription->merchant_id !== (int) $order->merchant_id) {
|
||||
throw new \InvalidArgumentException('订阅与订单站点不一致:请核对订阅ID与订单站点后再同步');
|
||||
}
|
||||
|
||||
// 以 ends_at 为基准续期:
|
||||
// - 若 ends_at 为空或已过期 => 从 now 起算
|
||||
// - 若仍有效 => 从 ends_at 起算
|
||||
|
||||
Reference in New Issue
Block a user