mirror of
https://github.com/btcpayserver/btcpayserver.git
synced 2025-02-23 14:40:36 +01:00
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 )
51 lines
1.8 KiB
C#
51 lines
1.8 KiB
C#
using System.Collections.Generic;
|
|
using System.ComponentModel.DataAnnotations;
|
|
using BTCPayServer.ModelBinders;
|
|
using BTCPayServer.Models.AppViewModels;
|
|
using Microsoft.AspNetCore.Mvc;
|
|
|
|
namespace BTCPayServer.Models.StoreViewModels
|
|
{
|
|
public class PayButtonViewModel
|
|
{
|
|
[ModelBinder(BinderType = typeof(InvariantDecimalModelBinder))]
|
|
public decimal Price { get; set; }
|
|
public string InvoiceId { get; set; }
|
|
[Required]
|
|
public string Currency { get; set; }
|
|
public string CheckoutDesc { get; set; }
|
|
public string OrderId { get; set; }
|
|
public int ButtonSize { get; set; }
|
|
public int ButtonType { get; set; }
|
|
|
|
// Slider properties (ButtonType = 2)
|
|
public decimal Min { get; set; }
|
|
public decimal Max { get; set; }
|
|
public decimal Step { get; set; }
|
|
|
|
// Custom Amount properties (ButtonType = 1)
|
|
public bool SimpleInput { get; set; }
|
|
public bool FitButtonInline { get; set; }
|
|
|
|
[Url]
|
|
public string ServerIpn { get; set; }
|
|
[Url]
|
|
public string BrowserRedirect { get; set; }
|
|
[EmailAddress]
|
|
public string NotifyEmail { get; set; }
|
|
|
|
public string StoreId { get; set; }
|
|
public string CheckoutQueryString { get; set; }
|
|
|
|
// Data that influences Pay Button UI, but not invoice creation
|
|
public string UrlRoot { get; set; }
|
|
public List<string> CurrencyDropdown { get; set; }
|
|
public string PayButtonImageUrl { get; set; }
|
|
public string PayButtonText { get; set; }
|
|
public bool UseModal { get; set; }
|
|
public bool JsonResponse { get; set; }
|
|
public ListAppsViewModel.ListAppViewModel[] Apps { get; set; }
|
|
public string AppIdEndpoint { get; set; } = "";
|
|
public string AppChoiceKey { get; set; } = "";
|
|
}
|
|
}
|