mirror of
https://github.com/aljazceru/btcpayserver.git
synced 2025-12-17 22:14:26 +01:00
Remove useless properties
This commit is contained in:
@@ -711,21 +711,6 @@ namespace BTCPayServer.Controllers
|
||||
return View(model);
|
||||
}
|
||||
|
||||
[HttpGet("invoice-noscript")]
|
||||
public async Task<IActionResult> CheckoutNoScript(string? invoiceId, string? id = null, string? paymentMethodId = null, [FromQuery] string? lang = null)
|
||||
{
|
||||
//Keep compatibility with Bitpay
|
||||
invoiceId = invoiceId ?? id;
|
||||
//
|
||||
if (invoiceId is null)
|
||||
return NotFound();
|
||||
var model = await GetInvoiceModel(invoiceId, paymentMethodId is null ? null : PaymentMethodId.Parse(paymentMethodId), lang);
|
||||
if (model == null)
|
||||
return NotFound();
|
||||
|
||||
return View(model);
|
||||
}
|
||||
|
||||
private async Task<PaymentModel?> GetInvoiceModel(string invoiceId, PaymentMethodId? paymentMethodId, string? lang)
|
||||
{
|
||||
var invoice = await _InvoiceRepository.GetInvoice(invoiceId);
|
||||
|
||||
@@ -13,7 +13,6 @@ namespace BTCPayServer.Payments.Bitcoin
|
||||
context.RegisterCheckoutUI(new CheckoutUIPaymentMethodSettings
|
||||
{
|
||||
ExtensionPartial = "Bitcoin/BitcoinLikeMethodCheckout",
|
||||
CheckoutBodyVueComponentName = "BitcoinLikeMethodCheckout"
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@@ -63,6 +63,5 @@ namespace BTCPayServer.Payments
|
||||
public class CheckoutUIPaymentMethodSettings
|
||||
{
|
||||
public string? ExtensionPartial { get; set; }
|
||||
public string? CheckoutBodyVueComponentName { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -16,8 +16,7 @@ namespace BTCPayServer.Payments.LNURLPay
|
||||
context.RegisterPaymentMethodDetails("LNURL/AdditionalPaymentMethodDetails");
|
||||
context.RegisterCheckoutUI(new CheckoutUIPaymentMethodSettings()
|
||||
{
|
||||
ExtensionPartial = "Lightning/LightningLikeMethodCheckout",
|
||||
CheckoutBodyVueComponentName = "LightningLikeMethodCheckout"
|
||||
ExtensionPartial = "Lightning/LightningLikeMethodCheckout"
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@@ -12,8 +12,7 @@ namespace BTCPayServer.Payments.Lightning
|
||||
{
|
||||
context.RegisterCheckoutUI(new CheckoutUIPaymentMethodSettings()
|
||||
{
|
||||
ExtensionPartial = "Lightning/LightningLikeMethodCheckout",
|
||||
CheckoutBodyVueComponentName = "LightningLikeMethodCheckout"
|
||||
ExtensionPartial = "Lightning/LightningLikeMethodCheckout"
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@@ -112,8 +112,7 @@ namespace BTCPayServer.Services.Altcoins.Monero.Payments
|
||||
{
|
||||
return new CheckoutUIPaymentMethodSettings
|
||||
{
|
||||
ExtensionPartial = "Bitcoin/BitcoinLikeMethodCheckout",
|
||||
CheckoutBodyVueComponentName = "BitcoinLikeMethodCheckout"
|
||||
ExtensionPartial = "Bitcoin/BitcoinLikeMethodCheckout"
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
@using BTCPayServer.Abstractions.TagHelpers
|
||||
@model BTCPayServer.Models.InvoicingModels.PaymentModel
|
||||
|
||||
<template id="bitcoin-method-checkout-template">
|
||||
<template id="checkout-template">
|
||||
@await Component.InvokeAsync("UiExtensionPoint", new {location = "checkout-bitcoin-pre-content", model = Model})
|
||||
<div class="payment-box">
|
||||
<div v-if="model.invoiceBitcoinUrlQR" class="qr-container" :data-qr-value="model.invoiceBitcoinUrlQR" :data-clipboard="model.invoiceBitcoinUrl" data-clipboard-confirm-element="#Address_@Model.PaymentMethodId [data-clipboard]">
|
||||
@@ -31,9 +31,9 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
Vue.component('BitcoinLikeMethodCheckout', {
|
||||
Vue.component('checkout-template', {
|
||||
props: ['model', 'nfcSupported', 'nfcScanning', 'nfcErrorMessage'],
|
||||
template: "#bitcoin-method-checkout-template",
|
||||
template: "#checkout-template",
|
||||
components: {
|
||||
qrcode: VueQrcode
|
||||
},
|
||||
|
||||
@@ -1,8 +0,0 @@
|
||||
@model PaymentModel
|
||||
<div>
|
||||
<p>To complete payment, please send <b>@(Model.IsUnsetTopUp ? "any amount of" : Model.BtcDue) @Model.CryptoCode</b> to <b style="word-break: break-word;">@Model.BtcAddress</b></p>
|
||||
<p>Time remaining: @Model.TimeLeft</p>
|
||||
<p>
|
||||
<a href="@Model.InvoiceBitcoinUrl" style="word-break: break-word;" rel="noreferrer noopener">@Model.InvoiceBitcoinUrl</a>
|
||||
</p>
|
||||
</div>
|
||||
@@ -1,6 +1,6 @@
|
||||
@model BTCPayServer.Models.InvoicingModels.PaymentModel
|
||||
|
||||
<template id="lightning-method-checkout-template">
|
||||
<template id="checkout-template">
|
||||
<div class="payment-box">
|
||||
@await Component.InvokeAsync("UiExtensionPoint" , new { location="checkout-lightning-pre-content", model = Model})
|
||||
<div v-if="model.invoiceBitcoinUrlQR" class="qr-container" :data-qr-value="model.invoiceBitcoinUrlQR" :data-clipboard="model.invoiceBitcoinUrl" data-clipboard-confirm-element="#Lightning_@Model.PaymentMethodId [data-clipboard]">
|
||||
@@ -23,9 +23,9 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
Vue.component('LightningLikeMethodCheckout', {
|
||||
Vue.component('checkout-template', {
|
||||
props: ['model', 'nfcSupported', 'nfcScanning', 'nfcErrorMessage'],
|
||||
template: "#lightning-method-checkout-template",
|
||||
template: "#checkout-template",
|
||||
components: {
|
||||
qrcode: VueQrcode
|
||||
},
|
||||
|
||||
@@ -1,12 +0,0 @@
|
||||
@model PaymentModel
|
||||
<div>
|
||||
<p>To complete payment, please send <b>@Model.BtcDue @Model.CryptoCode</b> to <b style="word-break: break-word;">@Model.BtcAddress</b></p>
|
||||
<p>Time remaining: @Model.TimeLeft</p>
|
||||
<p>
|
||||
<a href="@Model.InvoiceBitcoinUrl" style="word-break: break-word;" rel="noreferrer noopener">@Model.InvoiceBitcoinUrl</a>
|
||||
</p>
|
||||
@if (!string.IsNullOrEmpty(Model.PeerInfo))
|
||||
{
|
||||
<p>Peer Info: <b>@Model.PeerInfo</b></p>
|
||||
}
|
||||
</div>
|
||||
@@ -17,7 +17,7 @@
|
||||
@functions {
|
||||
private string ToJsValue(object value)
|
||||
{
|
||||
return Safe.Json(value).ToString()?.Replace("\"", "'");
|
||||
return Safe.Json(value?.ToString()).ToString()?.Replace("\"", "'");
|
||||
}
|
||||
}
|
||||
<!DOCTYPE html>
|
||||
|
||||
@@ -152,7 +152,7 @@ function initApp() {
|
||||
btcPaid () {
|
||||
return this.asNumber(this.srvModel.btcPaid);
|
||||
},
|
||||
pmId () {
|
||||
pmId() {
|
||||
return this.paymentMethodId || this.srvModel.paymentMethodId;
|
||||
},
|
||||
minutesLeft () {
|
||||
@@ -174,10 +174,10 @@ function initApp() {
|
||||
paymentMethodIds () {
|
||||
return this.srvModel.availableCryptos.map(function (c) { return c.paymentMethodId });
|
||||
},
|
||||
paymentMethodComponent () {
|
||||
paymentMethodComponent() {
|
||||
return this.isPluginPaymentMethod
|
||||
? `${this.pmId}Checkout`
|
||||
: this.srvModel.activated && this.srvModel.uiSettings.checkoutBodyVueComponentName;
|
||||
: this.srvModel.activated && 'checkout-template';
|
||||
},
|
||||
isPluginPaymentMethod () {
|
||||
return !this.paymentMethodIds.includes(this.pmId);
|
||||
|
||||
Reference in New Issue
Block a user