mirror of
https://github.com/btcpayserver/btcpayserver.git
synced 2024-11-20 10:40:29 +01:00
36bd76248b
This PR allows you to use the pay button generator to create buttons that target apps. This means that you can generate an invoice that is linked to an item on the POS/Crowdfund (targeting the item is optional). The POS/Crowdfund item amount -> invoice creation amount validation works too so that the user cannot modify the amount of a perk using just html ( fixes #1392 )
42 lines
1011 B
C#
42 lines
1011 B
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Threading.Tasks;
|
|
using Newtonsoft.Json;
|
|
|
|
namespace BTCPayServer.Data
|
|
{
|
|
public class AppData
|
|
{
|
|
public string Id { get; set; }
|
|
public string Name { get; set; }
|
|
public string StoreDataId
|
|
{
|
|
get; set;
|
|
}
|
|
public string AppType { get; set; }
|
|
public StoreData StoreData
|
|
{
|
|
get; set;
|
|
}
|
|
public DateTimeOffset Created
|
|
{
|
|
get; set;
|
|
}
|
|
public bool TagAllInvoices { get; set; }
|
|
public string Settings { get; set; }
|
|
|
|
public T GetSettings<T>() where T : class, new()
|
|
{
|
|
if (String.IsNullOrEmpty(Settings))
|
|
return new T();
|
|
return JsonConvert.DeserializeObject<T>(Settings);
|
|
}
|
|
|
|
public void SetSettings(object value)
|
|
{
|
|
Settings = value == null ? null : JsonConvert.SerializeObject(value);
|
|
}
|
|
}
|
|
}
|