mirror of
https://github.com/aljazceru/btcpayserver.git
synced 2025-12-18 22:44:29 +01:00
Make Pay Button a plugin (#3862)
* Move files * Fix potentially missing default payment method Before, it got removed if any other value was changed besides the default payment method. * Fix missing store data * Update BTCPayServer/Plugins/PayButton/PayButtonPlugin.cs Co-authored-by: Pavlenex <pavle@pavle.org> * Update pay button warning Closes #3535. Co-authored-by: Pavlenex <pavle@pavle.org>
This commit is contained in:
54
BTCPayServer/Plugins/PayButton/Models/PayButtonViewModel.cs
Normal file
54
BTCPayServer/Plugins/PayButton/Models/PayButtonViewModel.cs
Normal file
@@ -0,0 +1,54 @@
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using BTCPayServer.ModelBinders;
|
||||
using BTCPayServer.Models.AppViewModels;
|
||||
using BTCPayServer.Models.StoreViewModels;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
|
||||
namespace BTCPayServer.Plugins.PayButton.Models
|
||||
{
|
||||
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 DefaultPaymentMethod { get; set; }
|
||||
public PaymentMethodOptionViewModel.Format[] PaymentMethods { 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 string 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; } = "";
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user