mirror of
https://github.com/aljazceru/btcpayserver.git
synced 2025-12-18 14:34:23 +01:00
Greenfield: Add missing checkout (V2) settings (#5406)
* Greenfield: Add missing checkout (V2) settings Closes #5403. * Fix swagger
This commit is contained in:
@@ -73,6 +73,17 @@ namespace BTCPayServer.Client.Models
|
|||||||
|
|
||||||
public bool PayJoinEnabled { get; set; }
|
public bool PayJoinEnabled { get; set; }
|
||||||
|
|
||||||
|
[JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
|
||||||
|
public bool? AutoDetectLanguage { get; set; }
|
||||||
|
[JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
|
||||||
|
public bool? ShowPayInWalletButton { get; set; }
|
||||||
|
[JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
|
||||||
|
public bool? ShowStoreHeader { get; set; }
|
||||||
|
[JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
|
||||||
|
public bool? CelebratePayment { get; set; }
|
||||||
|
[JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
|
||||||
|
public bool? PlaySoundOnPayment { get; set; }
|
||||||
|
|
||||||
public InvoiceData.ReceiptOptions Receipt { get; set; }
|
public InvoiceData.ReceiptOptions Receipt { get; set; }
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -153,13 +153,18 @@ namespace BTCPayServer.Controllers.Greenfield
|
|||||||
LightningDescriptionTemplate = storeBlob.LightningDescriptionTemplate,
|
LightningDescriptionTemplate = storeBlob.LightningDescriptionTemplate,
|
||||||
PaymentTolerance = storeBlob.PaymentTolerance,
|
PaymentTolerance = storeBlob.PaymentTolerance,
|
||||||
PayJoinEnabled = storeBlob.PayJoinEnabled,
|
PayJoinEnabled = storeBlob.PayJoinEnabled,
|
||||||
PaymentMethodCriteria = storeBlob.PaymentMethodCriteria?.Where(criteria => criteria.Value is not null)?.Select(criteria => new PaymentMethodCriteriaData()
|
AutoDetectLanguage = storeBlob.AutoDetectLanguage,
|
||||||
|
ShowPayInWalletButton = storeBlob.ShowPayInWalletButton,
|
||||||
|
ShowStoreHeader = storeBlob.ShowStoreHeader,
|
||||||
|
CelebratePayment = storeBlob.CelebratePayment,
|
||||||
|
PlaySoundOnPayment = storeBlob.PlaySoundOnPayment,
|
||||||
|
PaymentMethodCriteria = storeBlob.PaymentMethodCriteria?.Where(criteria => criteria.Value is not null).Select(criteria => new PaymentMethodCriteriaData
|
||||||
{
|
{
|
||||||
Above = criteria.Above,
|
Above = criteria.Above,
|
||||||
Amount = criteria.Value.Value,
|
Amount = criteria.Value.Value,
|
||||||
CurrencyCode = criteria.Value.Currency,
|
CurrencyCode = criteria.Value.Currency,
|
||||||
PaymentMethod = criteria.PaymentMethod.ToStringNormalized()
|
PaymentMethod = criteria.PaymentMethod.ToStringNormalized()
|
||||||
})?.ToList() ?? new List<PaymentMethodCriteriaData>()
|
}).ToList() ?? new List<PaymentMethodCriteriaData>()
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -201,11 +206,21 @@ namespace BTCPayServer.Controllers.Greenfield
|
|||||||
blob.LightningDescriptionTemplate = restModel.LightningDescriptionTemplate;
|
blob.LightningDescriptionTemplate = restModel.LightningDescriptionTemplate;
|
||||||
blob.PaymentTolerance = restModel.PaymentTolerance;
|
blob.PaymentTolerance = restModel.PaymentTolerance;
|
||||||
blob.PayJoinEnabled = restModel.PayJoinEnabled;
|
blob.PayJoinEnabled = restModel.PayJoinEnabled;
|
||||||
|
if (restModel.AutoDetectLanguage.HasValue)
|
||||||
|
blob.AutoDetectLanguage = restModel.AutoDetectLanguage.Value;
|
||||||
|
if (restModel.ShowPayInWalletButton.HasValue)
|
||||||
|
blob.ShowPayInWalletButton = restModel.ShowPayInWalletButton.Value;
|
||||||
|
if (restModel.ShowStoreHeader.HasValue)
|
||||||
|
blob.ShowStoreHeader = restModel.ShowStoreHeader.Value;
|
||||||
|
if (restModel.CelebratePayment.HasValue)
|
||||||
|
blob.CelebratePayment = restModel.CelebratePayment.Value;
|
||||||
|
if (restModel.PlaySoundOnPayment.HasValue)
|
||||||
|
blob.PlaySoundOnPayment = restModel.PlaySoundOnPayment.Value;
|
||||||
blob.PaymentMethodCriteria = restModel.PaymentMethodCriteria?.Select(criteria =>
|
blob.PaymentMethodCriteria = restModel.PaymentMethodCriteria?.Select(criteria =>
|
||||||
new PaymentMethodCriteria()
|
new PaymentMethodCriteria
|
||||||
{
|
{
|
||||||
Above = criteria.Above,
|
Above = criteria.Above,
|
||||||
Value = new CurrencyValue()
|
Value = new CurrencyValue
|
||||||
{
|
{
|
||||||
Currency = criteria.CurrencyCode,
|
Currency = criteria.CurrencyCode,
|
||||||
Value = criteria.Amount
|
Value = criteria.Amount
|
||||||
|
|||||||
@@ -241,7 +241,7 @@ namespace BTCPayServer.Data
|
|||||||
|
|
||||||
[DefaultValue(false)]
|
[DefaultValue(false)]
|
||||||
[JsonProperty(DefaultValueHandling = DefaultValueHandling.Populate)]
|
[JsonProperty(DefaultValueHandling = DefaultValueHandling.Populate)]
|
||||||
public bool PlaySoundOnPayment { get; set; } = false;
|
public bool PlaySoundOnPayment { get; set; }
|
||||||
|
|
||||||
public string SoundFileId { get; set; }
|
public string SoundFileId { get; set; }
|
||||||
|
|
||||||
|
|||||||
@@ -542,6 +542,31 @@
|
|||||||
"default": false,
|
"default": false,
|
||||||
"description": "If true, payjoin will be proposed in the checkout page if possible. ([More information](https://docs.btcpayserver.org/Payjoin/))"
|
"description": "If true, payjoin will be proposed in the checkout page if possible. ([More information](https://docs.btcpayserver.org/Payjoin/))"
|
||||||
},
|
},
|
||||||
|
"autoDetectLanguage": {
|
||||||
|
"type": "boolean",
|
||||||
|
"default": false,
|
||||||
|
"description": "If true, the language on the checkout page will adapt to the language defined by the user's browser settings"
|
||||||
|
},
|
||||||
|
"showPayInWalletButton": {
|
||||||
|
"type": "boolean",
|
||||||
|
"default": true,
|
||||||
|
"description": "If true, the \"Pay in wallet\" button will be shown on the checkout page (Checkout V2)"
|
||||||
|
},
|
||||||
|
"showStoreHeader": {
|
||||||
|
"type": "boolean",
|
||||||
|
"default": true,
|
||||||
|
"description": "If true, the store header will be shown on the checkout page (Checkout V2)"
|
||||||
|
},
|
||||||
|
"celebratePayment": {
|
||||||
|
"type": "boolean",
|
||||||
|
"default": true,
|
||||||
|
"description": "If true, payments on the checkout page will be celebrated with confetti (Checkout V2)"
|
||||||
|
},
|
||||||
|
"playSoundOnPayment": {
|
||||||
|
"type": "boolean",
|
||||||
|
"default": false,
|
||||||
|
"description": "If true, sounds on the checkout page will be enabled (Checkout V2)"
|
||||||
|
},
|
||||||
"lazyPaymentMethods": {
|
"lazyPaymentMethods": {
|
||||||
"type": "boolean",
|
"type": "boolean",
|
||||||
"default": false,
|
"default": false,
|
||||||
|
|||||||
Reference in New Issue
Block a user