diff --git a/DysonNetwork.Sphere/Wallet/PaymentHandlers/AfdianPaymentHandler.cs b/DysonNetwork.Sphere/Wallet/PaymentHandlers/AfdianPaymentHandler.cs
index 0aa83e1..b3d310d 100644
--- a/DysonNetwork.Sphere/Wallet/PaymentHandlers/AfdianPaymentHandler.cs
+++ b/DysonNetwork.Sphere/Wallet/PaymentHandlers/AfdianPaymentHandler.cs
@@ -87,9 +87,8 @@ public class AfdianPaymentHandler(
/// Get a specific order by its ID (out_trade_no)
///
/// The order ID to query
- /// The account ID
/// The order item if found, otherwise null
- public async Task GetOrderAsync(string orderId, Guid accountId)
+ public async Task GetOrderAsync(string orderId)
{
if (string.IsNullOrEmpty(orderId))
{
@@ -97,11 +96,6 @@ public class AfdianPaymentHandler(
return null;
}
- var connection = await db.AccountConnections
- .Where(c => c.AccountId == accountId && c.Provider == "afdian")
- .FirstOrDefaultAsync();
- if (connection is null) throw new InvalidOperationException("Account need to link an afdian account first.");
-
try
{
var token = _configuration["Payment:Auth:Afdian"] ?? "_:_";
@@ -119,7 +113,7 @@ public class AfdianPaymentHandler(
{
Content = new StringContent(JsonSerializer.Serialize(new
{
- user_id = connection.ProvidedIdentifier,
+ user_id = userId,
@params = paramsJson,
ts,
sign
diff --git a/DysonNetwork.Sphere/Wallet/SubscriptionController.cs b/DysonNetwork.Sphere/Wallet/SubscriptionController.cs
index 3892779..12fb747 100644
--- a/DysonNetwork.Sphere/Wallet/SubscriptionController.cs
+++ b/DysonNetwork.Sphere/Wallet/SubscriptionController.cs
@@ -183,9 +183,7 @@ public class SubscriptionController(SubscriptionService subscriptions, AfdianPay
[Authorize]
public async Task RestorePurchaseFromAfdian([FromBody] RestorePurchaseRequest request)
{
- if (HttpContext.Items["CurrentUser"] is not Account.Account currentUser) return Unauthorized();
-
- var order = await afdian.GetOrderAsync(request.OrderId, currentUser.Id);
+ var order = await afdian.GetOrderAsync(request.OrderId);
if (order is null) return NotFound($"Order with ID {request.OrderId} was not found.");
var subscription = await subscriptions.CreateSubscriptionFromOrder(order);