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; model.SpeedPolicy = restModel.SpeedPolicy; model.SetDefaultPaymentId(defaultPaymentMethod); //we do not include the default payment method in this model and instead opt to set it in the stores/storeid/payment-methods endpoints //blob //we do not include DefaultCurrencyPairs;Spread; PreferredExchange; RateScripting; RateScript in this model and instead opt to set it in stores/storeid/rates endpoints //we do not include ExcludedPaymentMethods in this model and instead opt to set it in stores/storeid/payment-methods endpoints //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.ReceiptOptions = InvoiceDataBase.ReceiptOptions.Merge(restModel.Receipt, null); blob.LightningAmountInSatoshi = restModel.LightningAmountInSatoshi; blob.LightningPrivateRouteHints = restModel.LightningPrivateRouteHints; blob.OnChainWithLnInvoiceFallback = restModel.OnChainWithLnInvoiceFallback; blob.LazyPaymentMethods = restModel.LazyPaymentMethods; blob.RedirectAutomatically = restModel.RedirectAutomatically; blob.ShowRecommendedFee = restModel.ShowRecommendedFee; blob.RecommendedFeeBlockTarget = restModel.RecommendedFeeBlockTarget; blob.DefaultLang = restModel.DefaultLang; blob.MonitoringExpiration = restModel.MonitoringExpiration; blob.InvoiceExpiration = restModel.InvoiceExpiration; blob.CustomLogo = restModel.CustomLogo; blob.CustomCSS = restModel.CustomCSS; blob.HtmlTitle = restModel.HtmlTitle; blob.AnyoneCanInvoice = restModel.AnyoneCanCreateInvoice; blob.LightningDescriptionTemplate = restModel.LightningDescriptionTemplate; blob.PaymentTolerance = restModel.PaymentTolerance; blob.PayJoinEnabled = restModel.PayJoinEnabled; model.SetStoreBlob(blob); }
private Client.Models.StoreData FromModel(Data.StoreData data) { var storeBlob = data.GetStoreBlob(); return(new Client.Models.StoreData() { Id = data.Id, Name = data.StoreName, Website = data.StoreWebsite, SpeedPolicy = data.SpeedPolicy, DefaultPaymentMethod = data.GetDefaultPaymentId()?.ToStringNormalized(), //blob //we do not include DefaultCurrencyPairs,Spread, PreferredExchange, RateScripting, RateScript in this model and instead opt to set it in stores/storeid/rates endpoints //we do not include ExcludedPaymentMethods in this model and instead opt to set it in stores/storeid/payment-methods endpoints //we do not include EmailSettings in this model and instead opt to set it in stores/storeid/email endpoints //we do not include PaymentMethodCriteria because moving the CurrencyValueJsonConverter to the Client csproj is hard and requires a refactor (#1571 & #1572) NetworkFeeMode = storeBlob.NetworkFeeMode, RequiresRefundEmail = storeBlob.RequiresRefundEmail, Receipt = InvoiceDataBase.ReceiptOptions.Merge(storeBlob.ReceiptOptions, null), LightningAmountInSatoshi = storeBlob.LightningAmountInSatoshi, LightningPrivateRouteHints = storeBlob.LightningPrivateRouteHints, OnChainWithLnInvoiceFallback = storeBlob.OnChainWithLnInvoiceFallback, RedirectAutomatically = storeBlob.RedirectAutomatically, LazyPaymentMethods = storeBlob.LazyPaymentMethods, ShowRecommendedFee = storeBlob.ShowRecommendedFee, RecommendedFeeBlockTarget = storeBlob.RecommendedFeeBlockTarget, DefaultLang = storeBlob.DefaultLang, MonitoringExpiration = storeBlob.MonitoringExpiration, InvoiceExpiration = storeBlob.InvoiceExpiration, CustomLogo = storeBlob.CustomLogo, CustomCSS = storeBlob.CustomCSS, HtmlTitle = storeBlob.HtmlTitle, AnyoneCanCreateInvoice = storeBlob.AnyoneCanInvoice, LightningDescriptionTemplate = storeBlob.LightningDescriptionTemplate, PaymentTolerance = storeBlob.PaymentTolerance, PayJoinEnabled = storeBlob.PayJoinEnabled }); }