mirror of
https://github.com/aljazceru/btcpayserver.git
synced 2025-12-18 06:24:24 +01:00
@@ -79,6 +79,7 @@ namespace BTCPayServer.Controllers
|
|||||||
public string CustomCSSLink { get; set; }
|
public string CustomCSSLink { get; set; }
|
||||||
public string NotificationEmail { get; set; }
|
public string NotificationEmail { get; set; }
|
||||||
public string NotificationUrl { get; set; }
|
public string NotificationUrl { get; set; }
|
||||||
|
public bool RedirectAutomatically { get; set; }
|
||||||
}
|
}
|
||||||
|
|
||||||
[HttpGet]
|
[HttpGet]
|
||||||
@@ -105,7 +106,8 @@ namespace BTCPayServer.Controllers
|
|||||||
CustomTipPercentages = settings.CustomTipPercentages != null ? string.Join(",", settings.CustomTipPercentages) : string.Join(",", PointOfSaleSettings.CUSTOM_TIP_PERCENTAGES_DEF),
|
CustomTipPercentages = settings.CustomTipPercentages != null ? string.Join(",", settings.CustomTipPercentages) : string.Join(",", PointOfSaleSettings.CUSTOM_TIP_PERCENTAGES_DEF),
|
||||||
CustomCSSLink = settings.CustomCSSLink,
|
CustomCSSLink = settings.CustomCSSLink,
|
||||||
NotificationEmail = settings.NotificationEmail,
|
NotificationEmail = settings.NotificationEmail,
|
||||||
NotificationUrl = settings.NotificationUrl
|
NotificationUrl = settings.NotificationUrl,
|
||||||
|
RedirectAutomatically = settings.RedirectAutomatically
|
||||||
};
|
};
|
||||||
if (HttpContext?.Request != null)
|
if (HttpContext?.Request != null)
|
||||||
{
|
{
|
||||||
@@ -180,7 +182,8 @@ namespace BTCPayServer.Controllers
|
|||||||
CustomTipPercentages = ListSplit(vm.CustomTipPercentages),
|
CustomTipPercentages = ListSplit(vm.CustomTipPercentages),
|
||||||
CustomCSSLink = vm.CustomCSSLink,
|
CustomCSSLink = vm.CustomCSSLink,
|
||||||
NotificationUrl = vm.NotificationUrl,
|
NotificationUrl = vm.NotificationUrl,
|
||||||
NotificationEmail = vm.NotificationEmail
|
NotificationEmail = vm.NotificationEmail,
|
||||||
|
RedirectAutomatically = vm.RedirectAutomatically
|
||||||
|
|
||||||
});
|
});
|
||||||
await UpdateAppSettings(app);
|
await UpdateAppSettings(app);
|
||||||
|
|||||||
@@ -270,7 +270,8 @@ namespace BTCPayServer.Controllers
|
|||||||
RedirectURL = redirectUrl ?? Request.GetDisplayUrl(),
|
RedirectURL = redirectUrl ?? Request.GetDisplayUrl(),
|
||||||
FullNotifications = true,
|
FullNotifications = true,
|
||||||
ExtendedNotifications = true,
|
ExtendedNotifications = true,
|
||||||
PosData = string.IsNullOrEmpty(posData) ? null : posData
|
PosData = string.IsNullOrEmpty(posData) ? null : posData,
|
||||||
|
RedirectAutomatically = settings.RedirectAutomatically
|
||||||
}, store, HttpContext.Request.GetAbsoluteRoot(),
|
}, store, HttpContext.Request.GetAbsoluteRoot(),
|
||||||
new List<string>() {AppService.GetAppInternalTag(appId)},
|
new List<string>() {AppService.GetAppInternalTag(appId)},
|
||||||
cancellationToken);
|
cancellationToken);
|
||||||
|
|||||||
@@ -314,6 +314,7 @@ namespace BTCPayServer.Controllers
|
|||||||
ItemDesc = invoice.ProductInformation.ItemDesc,
|
ItemDesc = invoice.ProductInformation.ItemDesc,
|
||||||
Rate = ExchangeRate(paymentMethod),
|
Rate = ExchangeRate(paymentMethod),
|
||||||
MerchantRefLink = invoice.RedirectURL ?? "/",
|
MerchantRefLink = invoice.RedirectURL ?? "/",
|
||||||
|
RedirectAutomatically = invoice.RedirectAutomatically,
|
||||||
StoreName = store.StoreName,
|
StoreName = store.StoreName,
|
||||||
InvoiceBitcoinUrl = paymentMethodId.PaymentType == PaymentTypes.BTCLike ? cryptoInfo.PaymentUrls.BIP21 :
|
InvoiceBitcoinUrl = paymentMethodId.PaymentType == PaymentTypes.BTCLike ? cryptoInfo.PaymentUrls.BIP21 :
|
||||||
paymentMethodId.PaymentType == PaymentTypes.LightningLike ? cryptoInfo.PaymentUrls.BOLT11 :
|
paymentMethodId.PaymentType == PaymentTypes.LightningLike ? cryptoInfo.PaymentUrls.BOLT11 :
|
||||||
|
|||||||
@@ -125,6 +125,8 @@ namespace BTCPayServer.Controllers
|
|||||||
if (!Uri.IsWellFormedUriString(entity.RedirectURL, UriKind.Absolute))
|
if (!Uri.IsWellFormedUriString(entity.RedirectURL, UriKind.Absolute))
|
||||||
entity.RedirectURL = null;
|
entity.RedirectURL = null;
|
||||||
|
|
||||||
|
entity.RedirectAutomatically = invoice.RedirectAutomatically;
|
||||||
|
|
||||||
entity.Status = InvoiceStatus.New;
|
entity.Status = InvoiceStatus.New;
|
||||||
entity.SpeedPolicy = ParseSpeedPolicy(invoice.TransactionSpeed, store.SpeedPolicy);
|
entity.SpeedPolicy = ParseSpeedPolicy(invoice.TransactionSpeed, store.SpeedPolicy);
|
||||||
|
|
||||||
|
|||||||
@@ -54,5 +54,8 @@ namespace BTCPayServer.Models.AppViewModels
|
|||||||
public string CustomCSSLink { get; set; }
|
public string CustomCSSLink { get; set; }
|
||||||
|
|
||||||
public string Id { get; set; }
|
public string Id { get; set; }
|
||||||
|
|
||||||
|
[Display(Name = "Redirect invoice to redirect url automatically after paid")]
|
||||||
|
public bool RedirectAutomatically { get; set; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -79,5 +79,8 @@ namespace BTCPayServer.Models
|
|||||||
public string Guid { get; set; }
|
public string Guid { get; set; }
|
||||||
[JsonProperty(PropertyName = "token", DefaultValueHandling = DefaultValueHandling.Ignore)]
|
[JsonProperty(PropertyName = "token", DefaultValueHandling = DefaultValueHandling.Ignore)]
|
||||||
public string Token { get; set; }
|
public string Token { get; set; }
|
||||||
|
|
||||||
|
[JsonProperty(PropertyName = "redirectAutomatically", DefaultValueHandling = DefaultValueHandling.Ignore)]
|
||||||
|
public bool RedirectAutomatically { get; set; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -67,5 +67,6 @@ namespace BTCPayServer.Models.InvoicingModels
|
|||||||
public string CoinSwitchMerchantId { get; set; }
|
public string CoinSwitchMerchantId { get; set; }
|
||||||
public string RootPath { get; set; }
|
public string RootPath { get; set; }
|
||||||
public decimal CoinSwitchAmountMarkupPercentage { get; set; }
|
public decimal CoinSwitchAmountMarkupPercentage { get; set; }
|
||||||
|
public bool RedirectAutomatically { get; set; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -299,6 +299,12 @@ namespace BTCPayServer.Services.Invoices
|
|||||||
set;
|
set;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public bool RedirectAutomatically
|
||||||
|
{
|
||||||
|
get;
|
||||||
|
set;
|
||||||
|
}
|
||||||
|
|
||||||
[Obsolete("Use GetPaymentMethod(network).GetTxFee() instead")]
|
[Obsolete("Use GetPaymentMethod(network).GetTxFee() instead")]
|
||||||
public Money TxFee
|
public Money TxFee
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -52,18 +52,22 @@
|
|||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label asp-for="EnableShoppingCart"></label>
|
<label asp-for="EnableShoppingCart"></label>
|
||||||
<input asp-for="EnableShoppingCart" type="checkbox" class="form-check" />
|
<input asp-for="EnableShoppingCart" type="checkbox" class="form-check" />
|
||||||
|
<span asp-validation-for="EnableShoppingCart" class="text-danger"></span>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label asp-for="ShowCustomAmount"></label>
|
<label asp-for="ShowCustomAmount"></label>
|
||||||
<input asp-for="ShowCustomAmount" type="checkbox" class="form-check" />
|
<input asp-for="ShowCustomAmount" type="checkbox" class="form-check" />
|
||||||
|
<span asp-validation-for="ShowCustomAmount" class="text-danger"></span>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label asp-for="ShowDiscount"></label>
|
<label asp-for="ShowDiscount"></label>
|
||||||
<input asp-for="ShowDiscount" type="checkbox" class="form-check" />
|
<input asp-for="ShowDiscount" type="checkbox" class="form-check" />
|
||||||
|
<span asp-validation-for="ShowDiscount" class="text-danger"></span>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label asp-for="EnableTips"></label>
|
<label asp-for="EnableTips"></label>
|
||||||
<input asp-for="EnableTips" type="checkbox" class="form-check" />
|
<input asp-for="EnableTips" type="checkbox" class="form-check" />
|
||||||
|
<span asp-validation-for="EnableTips" class="text-danger"></span>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label asp-for="ButtonText" class="control-label"></label>*
|
<label asp-for="ButtonText" class="control-label"></label>*
|
||||||
@@ -114,6 +118,12 @@
|
|||||||
<input type="email" asp-for="NotificationEmail" class="form-control" />
|
<input type="email" asp-for="NotificationEmail" class="form-control" />
|
||||||
<span asp-validation-for="NotificationEmail" class="text-danger"></span>
|
<span asp-validation-for="NotificationEmail" class="text-danger"></span>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<div class="form-group">
|
||||||
|
<label asp-for="RedirectAutomatically"></label>
|
||||||
|
<input asp-for="RedirectAutomatically" type="checkbox" class="form-check" />
|
||||||
|
<span asp-validation-for="RedirectAutomatically" class="text-danger"></span>
|
||||||
|
</div>
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<input type="submit" class="btn btn-primary" value="Save Settings" />
|
<input type="submit" class="btn btn-primary" value="Save Settings" />
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -46,6 +46,12 @@ function onDataCallback(jsonData) {
|
|||||||
|
|
||||||
resetTabsSlider();
|
resetTabsSlider();
|
||||||
$("#paid").addClass("active");
|
$("#paid").addClass("active");
|
||||||
|
if (!jsonData.isModal && jsonData.redirectAutomatically && jsonData.merchantRefLink) {
|
||||||
|
$(".payment__spinner").show();
|
||||||
|
setTimeout(function () {
|
||||||
|
window.location = jsonData.merchantRefLink;
|
||||||
|
}, 2000);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (newStatus === "expired" || newStatus === "invalid") { //TODO: different state if the invoice is invalid (failed to confirm after timeout)
|
if (newStatus === "expired" || newStatus === "invalid") { //TODO: different state if the invoice is invalid (failed to confirm after timeout)
|
||||||
|
|||||||
Reference in New Issue
Block a user