What changed, and why it matters
This commit only reformats code and adds blank lines in a single controller file. No behavior, logic, or security checks were changed. It is a non-functional 'dummy' style/refactoring commit with no security relevance.
No action needed; this is a cosmetic/style-only commit.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The diff in GreenfieldStorePaymentMethodsController.cs consists entirely of whitespace changes: added blank lines, a line break splitting a constructor call across two lines, and reformatting a LINQ Select expression. No statements were added, removed, or reordered, and no API behavior changed.
Changed components
BTCPayServer/Controllers/GreenField/GreenfieldStorePaymentMethodsController.csInspect captured patch +13 / −8
### BTCPayServer/Controllers/GreenField/GreenfieldStorePaymentMethodsController.cs
@@ -44,6 +44,7 @@ public async Task<IActionResult> GetStorePaymentMethod(
var m = methods.FirstOrDefault(m => m.PaymentMethodId == paymentMethodId.ToString());
return m is { } ? Ok(m) : PaymentMethodNotFound();
}
+
return result;
}
@@ -76,12 +77,14 @@ public async Task<IActionResult> UpdateStorePaymentMethod(
ModelState.AddModelError(nameof(request), "Missing body");
return this.CreateValidationError(ModelState);
}
+
var handler = AssertHasHandler(paymentMethodId);
if (request?.Config is { } config)
{
try
{
- var ctx = new PaymentMethodConfigValidationContext(authorizationService, ModelState, config, User, Store.GetPaymentMethodConfig(paymentMethodId), Store);
+ var ctx = new PaymentMethodConfigValidationContext(authorizationService, ModelState, config, User,
+ Store.GetPaymentMethodConfig(paymentMethodId), Store);
await handler.ValidatePaymentMethodConfig(ctx);
config = ctx.Config;
if (ctx.MissingPermission is not null)
@@ -96,14 +99,17 @@ public async Task<IActionResult> UpdateStorePaymentMethod(
ModelState.AddModelError(nameof(config), $"Invalid configuration ({ex.Message})");
return this.CreateValidationError(ModelState);
}
+
Store.SetPaymentMethodConfig(paymentMethodId, config);
}
+
if (request?.Enabled is { } enabled)
{
var storeBlob = Store.GetStoreBlob();
storeBlob.SetExcluded(paymentMethodId, !enabled);
Store.SetStoreBlob(storeBlob);
}
+
await storeRepository.UpdateStore(Store);
return await GetStorePaymentMethod(storeId, paymentMethodId, request?.Config is not null);
}
@@ -136,13 +142,12 @@ public async Task<IActionResult> GetStorePaymentMethods(
}
return Ok(Store.GetPaymentMethodConfigs(handlers, onlyEnabled is true)
- .Select(
- method => new GenericPaymentMethodData()
- {
- PaymentMethodId = method.Key.ToString(),
- Enabled = !excludedPaymentMethods.Match(method.Key),
- Config = includeConfig is true ? JToken.FromObject(method.Value, handlers[method.Key].Serializer.ForAPI()) : null
- }).ToArray());
+ .Select(method => new GenericPaymentMethodData()
+ {
+ PaymentMethodId = method.Key.ToString(),
+ Enabled = !excludedPaymentMethods.Match(method.Key),
+ Config = includeConfig is true ? JToken.FromObject(method.Value, handlers[method.Key].Serializer.ForAPI()) : null
+ }).ToArray());
}
}
}Why this scored 15/100
Community notes
Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.
The AI analysis stands alone for now. Submit a note if you can add evidence or important context.