diff --git a/BTCPayServer.Client/Models/InvoiceData.cs b/BTCPayServer.Client/Models/InvoiceData.cs index 5a05f09a2..89d21f63b 100644 --- a/BTCPayServer.Client/Models/InvoiceData.cs +++ b/BTCPayServer.Client/Models/InvoiceData.cs @@ -26,6 +26,7 @@ namespace BTCPayServer.Client.Models public SpeedPolicy? SpeedPolicy { get; set; } public string[] PaymentMethods { get; set; } + public string DefaultPaymentMethod { get; set; } [JsonConverter(typeof(TimeSpanJsonConverter.Minutes))] [JsonProperty("expirationMinutes")] diff --git a/BTCPayServer/Controllers/GreenField/InvoiceController.cs b/BTCPayServer/Controllers/GreenField/InvoiceController.cs index cfcb23938..f237c11a2 100644 --- a/BTCPayServer/Controllers/GreenField/InvoiceController.cs +++ b/BTCPayServer/Controllers/GreenField/InvoiceController.cs @@ -407,6 +407,7 @@ namespace BTCPayServer.Controllers.GreenField PaymentTolerance = entity.PaymentTolerance, PaymentMethods = entity.GetPaymentMethods().Select(method => method.GetId().ToStringNormalized()).ToArray(), + DefaultPaymentMethod = entity.DefaultPaymentMethod, SpeedPolicy = entity.SpeedPolicy, DefaultLanguage = entity.DefaultLanguage, RedirectAutomatically = entity.RedirectAutomatically, diff --git a/BTCPayServer/Controllers/InvoiceController.cs b/BTCPayServer/Controllers/InvoiceController.cs index 31811ed67..4c52d60ed 100644 --- a/BTCPayServer/Controllers/InvoiceController.cs +++ b/BTCPayServer/Controllers/InvoiceController.cs @@ -178,6 +178,7 @@ namespace BTCPayServer.Controllers } entity.SpeedPolicy = invoice.Checkout.SpeedPolicy ?? store.SpeedPolicy; entity.DefaultLanguage = invoice.Checkout.DefaultLanguage; + entity.DefaultPaymentMethod = invoice.Checkout.DefaultPaymentMethod; entity.RedirectAutomatically = invoice.Checkout.RedirectAutomatically ?? storeBlob.RedirectAutomatically; IPaymentFilter? excludeFilter = null; if (invoice.Checkout.PaymentMethods != null) diff --git a/BTCPayServer/wwwroot/swagger/v1/swagger.template.invoices.json b/BTCPayServer/wwwroot/swagger/v1/swagger.template.invoices.json index e55b306b1..b96b99072 100644 --- a/BTCPayServer/wwwroot/swagger/v1/swagger.template.invoices.json +++ b/BTCPayServer/wwwroot/swagger/v1/swagger.template.invoices.json @@ -1025,6 +1025,11 @@ }, "description": "A specific set of payment methods to use for this invoice (ie. BTC, BTC-LightningNetwork). By default, select all payment methods enabled in the store." }, + "defaultPaymentMethod": { + "type": "string", + "nullable": true, + "description": "Default payment type for the invoice (e.g., BTC, BTC_LightningLike). Default payment method set for the store is used if this parameter is not specified." + }, "expirationMinutes": { "nullable": true, "description": "The number of minutes after which an invoice becomes expired. Defaults to the store's settings. (The default store settings is 15)",