mirror of
https://github.com/aljazceru/BTCPayServerPlugins.git
synced 2025-12-17 07:34:24 +01:00
fixes
This commit is contained in:
@@ -15,10 +15,12 @@ using Microsoft.Extensions.Options;
|
||||
using NBitcoin.DataEncoders;
|
||||
using Newtonsoft.Json;
|
||||
using Newtonsoft.Json.Linq;
|
||||
using Serilog.Core;
|
||||
using WalletWasabi.Affiliation;
|
||||
using WalletWasabi.Affiliation.Models;
|
||||
using WalletWasabi.Affiliation.Models.CoinJoinNotification;
|
||||
using WalletWasabi.Affiliation.Serialization;
|
||||
using Constants = WalletWasabi.Helpers.Constants;
|
||||
|
||||
namespace BTCPayServer.Plugins.Wabisabi.AffiliateServer;
|
||||
|
||||
@@ -73,7 +75,6 @@ public class AffiliateServerController:Controller
|
||||
[HttpPost("get_status")]
|
||||
public async Task<IActionResult> GetStatus()
|
||||
{
|
||||
|
||||
var settings =
|
||||
await _settingsRepository.GetSettingAsync<WabisabiAffiliateSettings>();
|
||||
if(settings?.Enabled is true&& !string.IsNullOrEmpty(settings.SigningKey))
|
||||
@@ -89,7 +90,6 @@ public class AffiliateServerController:Controller
|
||||
[HttpPost("notify_coinjoin")]
|
||||
public async Task<IActionResult> GetCoinjoinRequest()
|
||||
{
|
||||
|
||||
var settings = await _settingsRepository.GetSettingAsync<WabisabiAffiliateSettings>();
|
||||
if (settings?.Enabled is not true)
|
||||
{
|
||||
|
||||
@@ -42,9 +42,6 @@
|
||||
<ExcludeAssets>runtime;contentFiles</ExcludeAssets>
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Folder Include="Resources" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<PackageReference Include="NNostr.Client" Version="0.0.18" />
|
||||
</ItemGroup>
|
||||
|
||||
@@ -0,0 +1,19 @@
|
||||
|
||||
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<g><g><path d="M928.2,192.3C684.7,114.2,500.1,10,500.1,10h-0.3c0,0-181.9,105.6-428,182.3c0,0-86.4,549.3,426.8,797.7h2.8C1014.6,741.6,928.2,192.3,928.2,192.3z M506,935.1l-6,3.1l-6-3.2C115.1,735.7,107.9,349.9,114.7,236.5l0.5-8.7l8.3-2.7C301.8,166,442.2,94.7,494.2,66.8l6-3.2l6.1,3.2c52.6,27.6,193.9,98.3,370.5,158.1l8.1,2.8l0.6,8.5C893.4,349.2,889.1,733.9,506,935.1z M860.4,246.4c-168.1-57.6-303.6-124.4-360-153.7c-56,29.7-190.6,97.1-360.4,154c-5.5,118.7,9.7,474.1,360.1,662.5C854.4,719.1,867,364.6,860.4,246.4z M496.5,743.2c-144,0-260.6-116.7-260.6-260.6c0-144,116.7-260.6,260.6-260.6c144,0,260.7,116.7,260.7,260.6C757.1,626.5,640.5,743.2,496.5,743.2z M500,720.7c-13.6,0-27.3-1.2-40.7-3.5c-7-1.2-11.7-7.9-10.5-14.9c1.2-7,7.8-11.7,14.9-10.5c23.9,4.2,49,4.2,72.9,0c7-1.3,13.7,3.4,14.9,10.4c1.2,7-3.4,13.7-10.4,14.9C527.7,719.5,513.8,720.7,500,720.7z M388.8,691c-2.2,0-4.4-0.5-6.4-1.8c-23.8-13.7-44.9-31.4-62.7-52.5c-4.6-5.4-3.9-13.6,1.5-18.1c5.4-4.7,13.6-3.8,18.2,1.6c15.8,18.8,34.6,34.6,55.9,46.8c6.2,3.6,8.3,11.5,4.7,17.7C397.6,688.7,393.2,691,388.8,691z M611.5,690.8c-4.4,0-8.8-2.3-11.2-6.4c-3.6-6.1-1.5-14,4.7-17.6c21.2-12.4,40-28.1,55.8-46.9c4.6-5.5,12.7-6.1,18.1-1.6c5.5,4.6,6.2,12.7,1.6,18.2c-17.7,21.1-38.8,38.8-62.6,52.6C616,690.3,613.7,690.8,611.5,690.8z M290.7,574.4c-5.3,0-10.2-3.2-12.1-8.5c-9.4-25.8-14.2-52.9-14.3-80.5c0-7.1,5.7-12.9,12.9-12.9c0,0,0,0,0,0c7.1,0,12.9,5.7,12.9,12.9c0.1,24.7,4.3,48.8,12.7,71.8c2.5,6.6-1,14-7.7,16.5C293.7,574.2,292.2,574.4,290.7,574.4z M709.5,574.1c-1.5,0-2.9-0.3-4.4-0.8c-6.7-2.4-10.2-9.8-7.7-16.5c8.3-23,12.6-47.1,12.6-71.8c0-7.1,5.8-13.4,12.9-13.4s12.9,5.3,12.9,12.4v0.9c0,27.7-4.8,54.8-14.1,80.6C719.6,570.8,714.7,574.1,709.5,574.1z M290.4,422.1c-1.5,0-2.9-0.3-4.4-0.8c-6.7-2.4-10.2-9.8-7.7-16.5c9.3-25.9,23.1-49.8,40.8-70.9c4.6-5.5,12.7-6.2,18.2-1.6c5.5,4.6,6.2,12.7,1.6,18.2c-15.8,18.9-28,40.1-36.3,63.1C300.6,418.9,295.7,422.1,290.4,422.1z M709.1,420.8c-5.3,0-10.2-3.2-12.1-8.4c-8.5-23-20.8-44.1-36.7-62.9c-4.6-5.4-3.9-13.6,1.5-18.2c5.4-4.6,13.6-3.9,18.1,1.5c17.8,21.1,31.7,44.8,41.2,70.6c2.5,6.7-1,14.1-7.6,16.6C712.1,420.6,710.6,420.8,709.1,420.8z M388.1,305.2c-4.4,0-8.8-2.3-11.2-6.4c-3.6-6.2-1.5-14,4.7-17.7c23.8-13.9,49.7-23.3,76.8-28.2c7.2-1.3,13.7,3.4,14.9,10.4c1.2,7-3.4,13.7-10.4,14.9c-24.1,4.3-47.2,12.8-68.4,25.1C392.5,304.6,390.3,305.2,388.1,305.2z M610.8,304.5c-2.2,0-4.4-0.5-6.4-1.7c-21.3-12.3-44.4-20.6-68.5-24.7c-7-1.2-11.7-7.9-10.5-14.9c1.2-7,7.9-11.7,14.9-10.5c27.2,4.7,53.1,14,77,27.7c6.1,3.5,8.3,11.4,4.8,17.6C619.6,302.2,615.2,304.5,610.8,304.5z M598.6,505.9c-4.6-7.9-10.8-14-18.7-18.5c-5.4-3.1-13.3-6-23.5-8.7c9.5-3.2,17.2-7.3,23.1-12.3c5.8-5,10.2-10.7,13.4-17.2c3.1-6.5,4.7-13.4,4.7-20.6c0-9.9-2.9-19.1-8.8-27.4c-5.9-8.3-14.2-14.7-25.1-19.1c-4.2-1.7-9.3-3-14.7-4v-38.6H512v36h-23.8v-36H451v36h-56.5v30.3h8.6c5.8,0,9.6,0.5,11.7,1.6c2.1,1,3.5,2.5,4.3,4.2c0.9,1.8,1.3,5.9,1.3,12.3V546c0,6.4-0.4,10.5-1.3,12.3c-0.8,1.9-2.3,3.2-4.3,4.2c-2,1-5.9,1.6-11.7,1.6h-8.6v30.3H451v36h37.1v-36h21.1c1,0,1.8,0,2.7,0v36H549v-39.1c6.2-1.2,11.7-2.7,16.4-4.6c12.8-5.1,22.7-12.6,29.7-22.4c7-9.8,10.5-20.4,10.5-32.1C605.6,522.6,603.3,513.8,598.6,505.9z M527.7,413.5c5.4,1.7,9.6,4.6,12.5,8.7c2.8,4.1,4.3,9,4.3,14.7c0,5.6-1.5,10.5-4.6,14.7c-3,4.2-7.5,7.4-13.6,9.5c-6,2.1-15.3,3.1-27.9,3.1h-24v-53.3h24C512.5,410.8,522.3,411.7,527.7,413.5z M503.6,559.4h-16c-5.3,0-8.6-0.3-9.8-0.9c-1.2-0.6-2.1-1.6-2.6-3c-0.4-1.2-0.7-5-0.8-11.8v-47.4h28.3c12.4,0,21.7,1.2,27.7,3.5c6,2.3,10.6,5.8,13.6,10.2c3,4.5,4.6,10,4.6,16.4c0,7.7-2.1,14.2-6.4,19.7c-4.3,5.4-9.5,9.1-15.6,10.7C520.6,558.6,512.9,559.4,503.6,559.4z"/></g>
|
||||
<g></g>
|
||||
<g></g>
|
||||
<g></g>
|
||||
<g></g>
|
||||
<g></g>
|
||||
<g></g>
|
||||
<g></g>
|
||||
<g></g>
|
||||
<g></g>
|
||||
<g></g>
|
||||
<g></g>
|
||||
<g></g>
|
||||
<g></g>
|
||||
<g></g>
|
||||
<g></g></g>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 3.8 KiB |
@@ -0,0 +1,2 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24">
|
||||
<path d="M12 4.942c1.827 1.105 3.474 1.6 5 1.833v7.76c0 1.606-.415 1.935-5 4.76v-14.353zm9-1.942v11.535c0 4.603-3.203 5.804-9 9.465-5.797-3.661-9-4.862-9-9.465v-11.535c3.516 0 5.629-.134 9-3 3.371 2.866 5.484 3 9 3zm-2 1.96c-2.446-.124-4.5-.611-7-2.416-2.5 1.805-4.554 2.292-7 2.416v9.575c0 3.042 1.69 3.83 7 7.107 5.313-3.281 7-4.065 7-7.107v-9.575z"/></svg>
|
||||
|
After Width: | Height: | Size: 447 B |
@@ -10,9 +10,9 @@
|
||||
{
|
||||
<li class="nav-item">
|
||||
<a asp-area="" asp-controller="WabisabiStore" asp-action="UpdateWabisabiStoreSettings" asp-route-storeId="@storeId" class="nav-link js-scroll-trigger @(isActive? "active": string.Empty)">
|
||||
<svg role="img" class="icon">
|
||||
</svg>
|
||||
<span>Wabisabi</span>
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" class="icon" style="height: 14px;">
|
||||
<path fill="currentColor" d="M12 4.942c1.827 1.105 3.474 1.6 5 1.833v7.76c0 1.606-.415 1.935-5 4.76v-14.353zm9-1.942v11.535c0 4.603-3.203 5.804-9 9.465-5.797-3.661-9-4.862-9-9.465v-11.535c3.516 0 5.629-.134 9-3 3.371 2.866 5.484 3 9 3zm-2 1.96c-2.446-.124-4.5-.611-7-2.416-2.5 1.805-4.554 2.292-7 2.416v9.575c0 3.042 1.69 3.83 7 7.107 5.313-3.281 7-4.065 7-7.107v-9.575z"/></svg>
|
||||
<span>Coinjoin</span>
|
||||
</a>
|
||||
</li>
|
||||
}
|
||||
|
||||
@@ -28,7 +28,7 @@ public class WabisabiPlugin : BaseBTCPayServerPlugin
|
||||
{
|
||||
public override IBTCPayServerPlugin.PluginDependency[] Dependencies { get; } =
|
||||
{
|
||||
new() { Identifier = nameof(BTCPayServer), Condition = ">=1.8" }
|
||||
new() { Identifier = nameof(BTCPayServer), Condition = ">=1.7.12" }
|
||||
};
|
||||
public override void Execute(IServiceCollection applicationBuilder)
|
||||
{
|
||||
@@ -81,7 +81,7 @@ public class WabisabiPlugin : BaseBTCPayServerPlugin
|
||||
applicationBuilder.AddSingleton<IUIExtension>(new UIExtension("Wabisabi/WabisabiWalletSend",
|
||||
"onchain-wallet-send"));
|
||||
|
||||
applicationBuilder.AddSingleton<IPayoutProcessorFactory, WabisabiPayoutProcessor>();
|
||||
// applicationBuilder.AddSingleton<IPayoutProcessorFactory, WabisabiPayoutProcessor>();
|
||||
Logger.SetMinimumLevel(LogLevel.Info);
|
||||
Logger.SetModes(LogMode.DotNetLoggers);
|
||||
|
||||
@@ -89,50 +89,50 @@ public class WabisabiPlugin : BaseBTCPayServerPlugin
|
||||
base.Execute(applicationBuilder);
|
||||
}
|
||||
|
||||
public class WabisabiPayoutProcessor: IPayoutProcessorFactory
|
||||
{
|
||||
private readonly LinkGenerator _linkGenerator;
|
||||
|
||||
public WabisabiPayoutProcessor(LinkGenerator linkGenerator)
|
||||
{
|
||||
_linkGenerator = linkGenerator;
|
||||
}
|
||||
public string Processor { get; } = "Wabisabi";
|
||||
public string FriendlyName { get; } = "Coinjoin";
|
||||
public string ConfigureLink(string storeId, PaymentMethodId paymentMethodId, HttpRequest request)
|
||||
{
|
||||
return _linkGenerator.GetUriByAction(
|
||||
nameof(WabisabiStoreController.UpdateWabisabiStoreSettings),
|
||||
"WabisabiStore",
|
||||
new { storeId},
|
||||
request.Scheme,
|
||||
request.Host,
|
||||
request.PathBase);
|
||||
}
|
||||
|
||||
public IEnumerable<PaymentMethodId> GetSupportedPaymentMethods()
|
||||
{
|
||||
return new[] {new PaymentMethodId("BTC", PaymentTypes.BTCLike)};
|
||||
}
|
||||
|
||||
public Task<IHostedService> ConstructProcessor(Data.PayoutProcessorData settings)
|
||||
{
|
||||
return Task.FromResult<IHostedService>(new ShellSerice());
|
||||
}
|
||||
public class ShellSerice:IHostedService
|
||||
{
|
||||
public Task StartAsync(CancellationToken cancellationToken)
|
||||
{
|
||||
return Task.CompletedTask;
|
||||
}
|
||||
|
||||
public Task StopAsync(CancellationToken cancellationToken)
|
||||
{
|
||||
return Task.CompletedTask;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// public class WabisabiPayoutProcessor: IPayoutProcessorFactory
|
||||
// {
|
||||
// private readonly LinkGenerator _linkGenerator;
|
||||
//
|
||||
// public WabisabiPayoutProcessor(LinkGenerator linkGenerator)
|
||||
// {
|
||||
// _linkGenerator = linkGenerator;
|
||||
// }
|
||||
// public string Processor { get; } = "Wabisabi";
|
||||
// public string FriendlyName { get; } = "Coinjoin";
|
||||
// public string ConfigureLink(string storeId, PaymentMethodId paymentMethodId, HttpRequest request)
|
||||
// {
|
||||
// return _linkGenerator.GetUriByAction(
|
||||
// nameof(WabisabiStoreController.UpdateWabisabiStoreSettings),
|
||||
// "WabisabiStore",
|
||||
// new { storeId},
|
||||
// request.Scheme,
|
||||
// request.Host,
|
||||
// request.PathBase);
|
||||
// }
|
||||
//
|
||||
// public IEnumerable<PaymentMethodId> GetSupportedPaymentMethods()
|
||||
// {
|
||||
// return new[] {new PaymentMethodId("BTC", PaymentTypes.BTCLike)};
|
||||
// }
|
||||
//
|
||||
// public Task<IHostedService> ConstructProcessor(PayoutProcessorData settings)
|
||||
// {
|
||||
// return Task.FromResult<IHostedService>(new ShellSerice());
|
||||
// }
|
||||
// public class ShellSerice:IHostedService
|
||||
// {
|
||||
// public Task StartAsync(CancellationToken cancellationToken)
|
||||
// {
|
||||
// return Task.CompletedTask;
|
||||
// }
|
||||
//
|
||||
// public Task StopAsync(CancellationToken cancellationToken)
|
||||
// {
|
||||
// return Task.CompletedTask;
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
//
|
||||
|
||||
public override void Execute(IApplicationBuilder applicationBuilder,
|
||||
IServiceProvider applicationBuilderApplicationServices)
|
||||
|
||||
@@ -74,23 +74,23 @@ namespace BTCPayServer.Plugins.Wabisabi
|
||||
}
|
||||
|
||||
await _walletProvider.SettingsUpdated(storeId, wabisabiSettings);
|
||||
var existingProcessor = (await _payoutProcessorService.GetProcessors(new PayoutProcessorService.PayoutProcessorQuery()
|
||||
{
|
||||
Stores = new[] {storeId},
|
||||
Processors = new[] {"Wabisabi"},
|
||||
|
||||
})).FirstOrDefault();
|
||||
_eventAggregator.Publish(new PayoutProcessorUpdated()
|
||||
{
|
||||
Id = existingProcessor?.Id,
|
||||
Data = paybatching? new PayoutProcessorData()
|
||||
{
|
||||
Id = existingProcessor?.Id,
|
||||
Processor = "Wabisabi",
|
||||
StoreId = storeId,
|
||||
PaymentMethod = "BTC",
|
||||
}: null
|
||||
});
|
||||
// var existingProcessor = (await _payoutProcessorService.GetProcessors(new PayoutProcessorService.PayoutProcessorQuery()
|
||||
// {
|
||||
// Stores = new[] {storeId},
|
||||
// Processors = new[] {"Wabisabi"},
|
||||
//
|
||||
// })).FirstOrDefault();
|
||||
// _eventAggregator.Publish(new PayoutProcessorUpdated()
|
||||
// {
|
||||
// Id = existingProcessor?.Id,
|
||||
// Data = paybatching? new PayoutProcessorData()
|
||||
// {
|
||||
// Id = existingProcessor?.Id,
|
||||
// Processor = "Wabisabi",
|
||||
// StoreId = storeId,
|
||||
// PaymentMethod = "BTC",
|
||||
// }: null
|
||||
// });
|
||||
}
|
||||
|
||||
|
||||
|
||||
Submodule submodules/btcpayserver updated: e6a157a101...9344113ae4
Reference in New Issue
Block a user