updates in save settings

This commit is contained in:
Nisaba 2023-12-06 14:35:00 +00:00 committed by GitHub
parent 32997ff252
commit fb92ef739b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 1 deletions

View File

@ -153,7 +153,9 @@ namespace Nop.Plugin.Payments.BTCPayServer.Controllers
settings.BtcPayStoreID = "";
settings.WebHookSecret = "";
settings.BtcPayUrl = "";
await _settingService.SaveSettingAsync<BtcPaySettings>(settings);
ModelState.Clear();
_paymentSettings.ActivePaymentMethodSystemNames.Remove("Payments.BTCPayServer");
_notificationService.SuccessNotification("Settings cleared and payment method deactivated");
@ -172,6 +174,8 @@ namespace Nop.Plugin.Payments.BTCPayServer.Controllers
if (command == "getautomaticapikeyconfig")
{
settings.BtcPayUrl = model.BtcPayUrl;
await _settingService.SaveSettingAsync<BtcPaySettings>(settings);
string? result = GetRedirectUri(settings);
if (result != null)
{

View File

@ -189,7 +189,7 @@ namespace Nop.Plugin.Payments.BTCPayServer.Services
await _orderService.InsertOrderNoteAsync(new OrderNote
{
OrderId = order.Id,
Note = $"BTCPayServer: Payment received {(order.PaymentStatus is PaymentStatus.Authorized ? $"but waiting to confirm. <a href='{order.AuthorizationTransactionResult}'>Click here for more information.</a>" : $". <a href='{order.CaptureTransactionResult}'>Click here for more information.</a>")}",
Note = $"BTCPayServer: Payment received{(order.PaymentStatus is PaymentStatus.Authorized ? $" but waiting to confirm. <a href='{order.AuthorizationTransactionResult}'>Click here for more information.</a>" : $". <a href='{order.CaptureTransactionResult}'>Click here for more information.</a>")}",
DisplayToCustomer = true,
CreatedOnUtc = DateTime.UtcNow
});