Add ability to set default currency for a store (#2998)

This commit is contained in:
Nicolas Dorier
2021-10-20 23:17:40 +09:00
committed by GitHub
parent 407f26b1dc
commit 4cf3249e0b
17 changed files with 129 additions and 64 deletions

View File

@@ -105,6 +105,7 @@ namespace BTCPayServer.Controllers.GreenField
}
PaymentMethodId.TryParse(request.DefaultPaymentMethod, out var defaultPaymnetMethodId);
ToModel(request, store, defaultPaymnetMethodId);
await _storeRepository.UpdateStore(store);
return Ok(FromModel(store));
@@ -150,7 +151,6 @@ namespace BTCPayServer.Controllers.GreenField
private static void ToModel(StoreBaseData restModel, Data.StoreData model, PaymentMethodId defaultPaymentMethod)
{
var blob = model.GetStoreBlob();
model.StoreName = restModel.Name;
model.StoreName = restModel.Name;
model.StoreWebsite = restModel.Website;
@@ -163,6 +163,7 @@ namespace BTCPayServer.Controllers.GreenField
//we do not include EmailSettings in this model and instead opt to set it in stores/storeid/email endpoints
//we do not include OnChainMinValue and LightningMaxValue because moving the CurrencyValueJsonConverter to the Client csproj is hard and requires a refactor (#1571 & #1572)
blob.NetworkFeeMode = restModel.NetworkFeeMode;
blob.DefaultCurrency = restModel.DefaultCurrency;
blob.RequiresRefundEmail = restModel.RequiresRefundEmail;
blob.LightningAmountInSatoshi = restModel.LightningAmountInSatoshi;
blob.LightningPrivateRouteHints = restModel.LightningPrivateRouteHints;