diff --git a/BTCPayServer/Controllers/GreenField/GreenfieldInvoiceController.cs b/BTCPayServer/Controllers/GreenField/GreenfieldInvoiceController.cs index 282a22dff..7e2daf94d 100644 --- a/BTCPayServer/Controllers/GreenField/GreenfieldInvoiceController.cs +++ b/BTCPayServer/Controllers/GreenField/GreenfieldInvoiceController.cs @@ -184,7 +184,6 @@ namespace BTCPayServer.Controllers.Greenfield ModelState.AddModelError(nameof(request.Amount), "The amount should be 0 or more."); } request.Checkout ??= new CreateInvoiceRequest.CheckoutOptions(); - request.Checkout.DefaultPaymentMethod ??= store.GetDefaultPaymentId()?.ToStringNormalized(); if (request.Checkout.PaymentMethods?.Any() is true) { for (int i = 0; i < request.Checkout.PaymentMethods.Length; i++) diff --git a/BTCPayServer/Controllers/UIInvoiceController.cs b/BTCPayServer/Controllers/UIInvoiceController.cs index b20ef6297..3e4f3bfc8 100644 --- a/BTCPayServer/Controllers/UIInvoiceController.cs +++ b/BTCPayServer/Controllers/UIInvoiceController.cs @@ -245,7 +245,7 @@ namespace BTCPayServer.Controllers } entity.SpeedPolicy = invoice.Checkout.SpeedPolicy ?? store.SpeedPolicy; entity.DefaultLanguage = invoice.Checkout.DefaultLanguage; - entity.DefaultPaymentMethod = invoice.Checkout.DefaultPaymentMethod; + entity.DefaultPaymentMethod = invoice.Checkout.DefaultPaymentMethod ?? store.GetDefaultPaymentId()?.ToStringNormalized() ?? new PaymentMethodId(_NetworkProvider.DefaultNetwork.CryptoCode, PaymentTypes.BTCLike).ToStringNormalized(); entity.RedirectAutomatically = invoice.Checkout.RedirectAutomatically ?? storeBlob.RedirectAutomatically; entity.CheckoutType = invoice.Checkout.CheckoutType; entity.RequiresRefundEmail = invoice.Checkout.RequiresRefundEmail;