Commit Graph

48 Commits

Author SHA1 Message Date
nicolas.dorier
ae76cc1ca2
Small UI improvements in the payout processors 2024-10-09 17:44:19 +09:00
nicolas.dorier
e4f79f046a
Remove unused field from automated payout settings 2024-10-09 13:13:10 +09:00
nicolas.dorier
c0aa9a8bd4
Prevent double BOLT11 payment with LNUrlWithdraw 2024-10-09 13:10:04 +09:00
Nicolas Dorier
363b60385b
Renaming various properties in the Payouts API (#6246)
* Rename Payouts Currency/OriginalCurrency

* Rename Payout Processor PayoutMethodIds

* Rename paymentMethods to payoutMethodIds

* Rename payoutMethodIds to payoutMethods
2024-09-26 11:25:45 +09:00
nicolas.dorier
f00a71922f
Optimize queries from payout processor at startup 2024-09-24 23:39:05 +09:00
Nicolas Dorier
c93497af10
Rename PaymentMethod => PaymentMethodId (#6198)
* Rename PaymentMethod => PaymentMethodId

* Rename DB Columns
2024-09-06 13:24:33 +09:00
Nicolas Dorier
1dd37c5020
Refactor Payouts and PullPayments DB models (#6173) 2024-08-28 18:52:08 +09:00
Nicolas Dorier
a295e123bc
Migrate Payouts to new format (#5989)
* Migrate Payouts to new format

* Rename PayoutData column to PayoutMethodId
2024-06-28 20:07:53 +09:00
Nicolas Dorier
9db9c5e936
Decouple PaymentMethodId from PayoutMethodId (#5944) 2024-05-01 10:22:07 +09:00
Nicolas Dorier
6cc1751924
The Big Cleanup: Refactor BTCPay internals (#5809) 2024-04-04 16:31:04 +09:00
Andrew Camilleri
0e64df3bbf
Parallel payout ln (#5781) 2024-03-14 10:29:14 +01:00
Andrew Camilleri
e497903bf4
Support Admin being able to view stores (#5782)
* Support Admin being able to view stores

* fix null check

* Delete obsolete empty view

* Add test

* Apply CanViewStoreSettings policy changes

Taken from #5719

* Fix Selenium tests

* Update dashboard permission requirement

---------

Co-authored-by: Dennis Reimann <mail@dennisreimann.de>
2024-03-14 10:25:40 +01:00
Andrew Camilleri
5c98ca180a
Webhook tests + FIXES + DOCS (#5686)
* webhook tests

* fixes and add docs

* Do not update FormResponse and StoreId in update/create PullPayment

---------

Co-authored-by: nicolas.dorier <nicolas.dorier@gmail.com>
2024-02-23 09:44:42 +01:00
nicolas.dorier
b96e73a002
Fix: Payouts state could turn cancelled even if payment was successful 2024-02-08 16:32:41 +09:00
Nicolas Dorier
376067324b
Remove unused variables (#5669) 2024-01-18 09:47:39 +09:00
Nicolas Dorier
1d6d146fb2
Revert "Remove unused variables" (#5667)
This reverts commit f070b22355.
2024-01-18 00:05:50 +09:00
nicolas.dorier
f070b22355
Remove unused variables 2024-01-17 18:46:28 +09:00
Andrew Camilleri
a97172cea6
Pluginize Webhooks and support Payouts (#5421)
Co-authored-by: d11n <mail@dennisreimann.de>
2023-12-01 10:50:05 +01:00
Nicolas Dorier
a2faa6fd59
Minor fixes (#5185) 2023-07-21 09:05:50 +02:00
Andrew Camilleri
4063a5aaee
Quality of life improvements to payout processors (#5135)
* Quality of life improvements to payout processors

* Allows more fleixble intervals for payout processing from 10-60 mins to 1min-24hours(requested by users)
* Cancel ln payotus that expired (bolt11)
* Allow cancelling of ln payotus that have failed to be paid after x attempts
* Allow conifguring a threshold for when to process on-chain payouts (reduces fees)

# Conflicts:
#	BTCPayServer.Tests/SeleniumTests.cs

* Simplify the code

* switch to concurrent dictionary

* Allow ProcessNewPayoutsInstantly

* refactor plugin hook service to have events available and change processor hooks to actions with better args

* add procesor extended tests

* Update BTCPayServer.Tests/GreenfieldAPITests.cs

* fix concurrency issue

* Update BTCPayServer/PayoutProcessors/BaseAutomatedPayoutProcessor.cs

---------

Co-authored-by: nicolas.dorier <nicolas.dorier@gmail.com>
2023-07-20 22:05:14 +09:00
Andrew Camilleri
783e4ccb35
Store Custom Roles (#4940) 2023-05-26 23:49:32 +09:00
Nicolas Dorier
3d5361cd11
[Bug] If a altcoins is disabled from BTCPay and payout processor is used, it would crash at restart (#4997)
Co-authored-by: Andrew Camilleri <evilkukka@gmail.com>
2023-05-25 12:42:23 +02:00
Kukks
8db5e7e043
Plugins: Allow payout processors to signal they cannot be removed through common UI 2023-05-15 09:49:13 +02:00
nicolas.dorier
58c409e7fa
Fix tests 2023-04-27 13:00:25 +09:00
Nicolas Dorier
9577eed524
Validate input in greenfield for payout processors (#4922) 2023-04-27 10:59:19 +09:00
nicolas.dorier
c17572c76f
Clip configuration values for payout processors 2023-04-26 18:24:46 +09:00
nicolas.dorier
5c91e072a6
Prevent payout processors from stalling restart 2023-04-26 18:09:56 +09:00
nicolas.dorier
7546ef7a8e
Dotnet reformat 2023-04-10 11:07:03 +09:00
Wouter Samaey
e02abb509f
Allow plugins to do something before and after automatic payouts (#4224) 2023-03-17 13:50:37 +01:00
Nicolas Dorier
2bd8227e20
Start using JSONB column instead of app side compressed data (#4574) 2023-02-21 15:06:34 +09:00
Andrew Camilleri
5b96ab89fd
Fix Payout Mark Paid in UI (#4585)
fixes #4579
2023-02-07 16:51:20 +09:00
d11n
d5d0be5824
Code formatting updates (#4502)
* Editorconfig: Add space_before_self_closing setting

This was a difference between the way dotnet-format and Rider format code. See https://www.jetbrains.com/help/rider/EditorConfig_Index.html

* Editorconfig: Keep 4 spaces indentation for Swagger JSON files

They are all formatted that way, let's keep it like that.

* Apply dotnet-format, mostly white-space related changes
2023-01-06 22:18:07 +09:00
nicolas.dorier
1732606581
Automated payout processors shouldn't spam logs on shutdown (Fix #4193) 2022-12-22 20:33:50 +09:00
Andrew Camilleri
2fd9eb6c68
Adapt ln payouts to handle unknown status (#4382)
Co-authored-by: d11n <mail@dennisreimann.de>
2022-12-04 13:23:59 +01:00
Nicolas Dorier
9404819dbe
Fix flaky test (#4330)
* Fix flaky test

* Update BTCPayServer/PayoutProcessors/BaseAutomatedPayoutProcessor.cs

Co-authored-by: d11n <mail@dennisreimann.de>

Co-authored-by: d11n <mail@dennisreimann.de>
2022-11-22 12:17:29 +01:00
Nicolas Dorier
a2fa688cde
Refactor labels (#4179)
* Create new tables

* wip

* wip

* Refactor LegacyLabel

* Remove LabelFactory

* Add migration

* wip

* wip

* Add pull-payment attachment to tx

* Address kukks points
2022-10-11 17:34:29 +09:00
Andrew Camilleri
7c8f4c0405
Allow specifing fee block target for onchain payout processor (#4065)
Co-authored-by: d11n <mail@dennisreimann.de>
2022-08-23 12:35:20 +02:00
Andrew Camilleri
d0b26e9f69
Refactor Payouts (#4032)
Co-authored-by: d11n <mail@dennisreimann.de>
2022-08-17 09:45:51 +02:00
Kukks
7d454a4c7b
make sure entity state gets modified in payout processors 2022-08-06 17:05:29 +02:00
Andrew Camilleri
f8619e382b
Fix LN Address payouts (#3960)
* Fix LN Address payouts

LN Address was validated when creating the claim but the paying sdection did not support it.

* reuse code

* reuse code

* do not use mail directly

* fix email validator
2022-07-15 12:37:47 +09:00
d11n
f48bb5a40a
Fix build warnings (#3870)
Fixes #3866.
2022-06-15 11:17:10 +09:00
nicolas.dorier
3ede0a50f0
Remove Payout processor log spam 2022-05-23 18:43:35 +09:00
Andrew Camilleri
c7d0537bf9
Fix labels not showing multiple payouts payments (#3729)
* Fix labels not showing multiple payouts payments

* Improve label tooltip

Makes it more readable

* Cleanup code

* Fix overflowing text in order ID field in invoices table (#3765)

close #3714

Co-authored-by: Dennis Reimann <mail@dennisreimann.de>
Co-authored-by: nicolas.dorier <nicolas.dorier@gmail.com>
Co-authored-by: Umar Bolatov <bolatovumar@gmail.com>
2022-05-23 10:25:46 +09:00
Andrew Camilleri
76a6d94bbe
Exchange api no kraken (#3679)
* WIP New APIs for dealing with custodians/exchanges

* Simplified things

* More API refinements + index.html file for quick viewing

* Finishing touches on spec

* Switched cryptoCode to paymentMethod as this allows us to differentiate between onchain and lightning

* Moved draft API docs to "/docs-draft"

* WIP baby steps

* Added DB migration for CustodianAccountData

* Rough but working POST /v1/api/custodian-account + GET /v1/api/custodian

* WIP + early Kraken API client

* Moved service registration to proper location

* Working create + list custodian accounts + permissions + WIP Kraken client

* Kraken API Balances call is working

* Added asset balances to response

* List Custodian Accounts call does not load assetBalances by default, because it can fail. Can be requested when needed.

* Call to get the details of 1 specific custodian account

* Added permissions to swagger

* Added "tradableAssetPairs" to Kraken custodian response + cache the tradable pairs in memory for 24 hours

* Removed unused file

* WIP + Moved files to better locations

* Updated docs

* Working API endpoint to get info on a trade (same response as creating a new trade)

* Working API endpoints for Deposit + Trade + untested Withdraw

* Delete custodian account

* Trading works, better error handling, cleanup

* Working withdrawals + New endpoint for getting bid/ask prices

* Completed withdrawals + new endpoint for getting info on a past withdrawal to simplify testing, Enums are output as strings,

* Better error handling when withdrawing to a wrong destination

* WithdrawalAddressName in config is now a string per currency (dictionary)

* Added TODOs

* Only show the custodian account "config" to users who are allowed

* Added the new permissions to the API Keys UI

* Renamed KrakenClient to KrakenExchange

* WIP Kraken Config Form

* Removed files for UI again, will make separate PR later

* Fixed docs + Refactored to use PaymentMethod more + Added "name" to custodian account + Using cancelationToken everywhere

* Updated withdrawal info docs

* First unit test

* Complete tests for /api/v1/custodians and /api/v1/custodian-accounts endpoints + Various improvements and fixes

* Mock custodian and more exceptions

* Many more tests + cleanup, moved files to better locations

* More tests

* WIP more tests

* Greenfield API tests complete

* Added missing "Name" column

* Cleanup, TODOs and beginning of Kraken Tests

* Added Kraken tests using public endpoints + handling of "SATS" currency

* Added 1st mocked Kraken API call: GetAssetBalancesAsync

* Added assert for bad config

* Mocked more Kraken API responses + added CreationDate to withdrawal response

* pr review club changes

* Make Kraken Custodian a plugin

* Re-added User-Agent header as it is required

* Fixed bug in market trade on Kraken using a percentage as qty

* A short delay so Kraken has the time to execute the market order and we don't fetch the details too quickly.

* Merged the draft swagger into the main swagger since it didn't work anymore

* Fixed API permissions test

* Removed 2 TODOs

* Fixed unit test

* Remove Kraken Api as it should be separate opt-in plugin

* Flatten namespace hierarchy and use InnerExeption instead of OriginalException

* Remove useless line

* Make sure account is from a specific store

* Proper error if custodian code not found

* Remove various warnings

* Remove various warnings

* Handle CustodianApiException through an exception filter

* Store custodian-account blob directly

* Remove duplications, transform methods into property

* Improve docs tags

* Make sure the custodianCode saved is canonical

* Fix test

Co-authored-by: Wouter Samaey <wouter.samaey@storefront.be>
Co-authored-by: nicolas.dorier <nicolas.dorier@gmail.com>
2022-05-18 14:59:56 +09:00
Dennis Reimann
d7faa0a0fd Improve payout processors UI
Some quick fixes, closes #3697.
2022-05-10 15:27:39 +02:00
Kukks
e60e8dc9ba
reduce payout processor logs 2022-04-28 14:43:01 +02:00
Andrew Camilleri
273bc78db3
Allow Users to be disabled/enabled (#3639)
* Allow Users to be disabled/enabled

* rebrand to locked for api

* Update BTCPayServer/Views/UIAccount/Lockout.cshtml

Co-authored-by: d11n <mail@dennisreimann.de>

* fix docker compose and an uneeded check in api handler

* fix

* Add enabled user test

Co-authored-by: d11n <mail@dennisreimann.de>
Co-authored-by: Nicolas Dorier <nicolas.dorier@gmail.com>
2022-04-26 21:27:35 +09:00
Andrew Camilleri
51690b47a3
Transfer Processors (#3476)
* Automated Transfer processors

This PR introduces a few things:
* Payouts can now be directly nested under a store instead of through a pull payment.
* The Wallet Send screen now has an option to "schedule" instead of simply creating a transaction. When you click on schedule, all transaction destinations are converted into approved payouts. Any options relating to fees or coin selection are discarded.
* There is a new concept introduced, called "Transfer Processors".  Transfer Processors are services for stores that process payouts that are awaiting payment. Each processor specifies which payment methods it can handle.  BTCPay Server will have some forms of transfer processors baked in but it has been designed to allow the Plugin System to provide additional processors.
* The initial transfer processors provided are "automated processors", for on chain and lightning payment methods. They can be configured to process payouts every X amount of minutes. For  on-chain, this means payments are batched into one transaction, resulting in more efficient and cheaper fees for processing.
*

* fix build

* extract

* remove magic string stuff

* fix error message when scheduling

* Paginate migration

* add payout count to payment method tab

* remove unused var

* add protip

* optimzie payout migration dramatically

* Remove useless double condition

* Fix bunch of warnings

* Remove warning

* Remove warnigns

* Rename to Payout processors

* fix typo

Co-authored-by: Nicolas Dorier <nicolas.dorier@gmail.com>
2022-04-24 12:19:34 +09:00