Compare commits

...

2401 Commits

Author SHA1 Message Date
af44d6aeac Partially Revert "Adapt controller and partially fix tests"
This reverts commit d4828f8d0edb0878ed1cca5cbafc061b3a46e2f0.
2023-06-26 10:48:27 +02:00
d99bd28386 prevent explicit rate if modify invoice is not available 2023-06-26 10:40:20 +02:00
86a44b6f1e make sure i is not stale 2023-06-26 10:22:05 +02:00
f1e5f1b759 try fix 2023-06-26 10:22:05 +02:00
d4828f8d0e Adapt controller and partially fix tests 2023-06-23 17:53:01 +02:00
a512cb90d4 Fix test and build warnings 2023-06-23 15:53:52 +02:00
b9a96ebb63 Merge branch 'master' into better-lnurl 2023-06-23 12:18:36 +02:00
53aafcf86b Fix: The current preimage of a invoice's lightning payment method should be available via API (#5111) 2023-06-23 19:12:11 +09:00
aec84f6d67 Dashboard: Limit "Top Items" to five (#5110)
Feedback we got at BTCPrague: Do not show more than five items in the top list, because otherwise the list can get very long if there's a POS with many items.
2023-06-23 11:31:05 +02:00
01e9f82d24 Policies: Update wording to fit API keys and Roles (#5106)
* Policies: Update wording to fit API keys and Roles

Closes #5021.

* API keys: Improve spacing
2023-06-22 10:37:30 +02:00
2eff45e65c Ajaxify the wallet transaction list to avoid timeout (Fix #4987) (#5100)
* Ajaxify the wallet transaction list to avoid timeout (Fix #4987)

* Add cancellation to request to wallet transactions

* Fix tests

* Improve empty state

* Cleanups

---------

Co-authored-by: Dennis Reimann <mail@dennisreimann.de>
2023-06-22 16:09:53 +09:00
13203c3e2b Receipt improvements (#5077)
* Remove Order ID link

* Add separate print version for receipt

* Fix POS number handling and add keypad test

Fixes #5056.

* Add formatting function

* Remove OrderUrl for POS, bring back order link for receipt

* Update BTCPayServer/Plugins/PointOfSale/Controllers/UIPointOfSaleController.cs
2023-06-22 15:57:29 +09:00
82c5e0e43d Dashboard: Make invoice badges consistent with those on invoices list (#5108)
Closes #4969.
2023-06-22 15:47:12 +09:00
351702930c Merge branch 'master' into better-lnurl 2023-06-21 14:05:37 +02:00
7f26a97eab fixes 2023-06-21 10:17:46 +02:00
b021039d87 cleanup 2023-06-21 09:56:02 +02:00
a1575f404b Invoices: Fix search box shrinking too small (#5105)
Fixes #5099.
2023-06-21 09:52:42 +02:00
623d7e3056 reduce code 2023-06-21 09:17:13 +02:00
e1509506dc Upgrade Bootstrap-Vue and fix tooltip positioning
Fixes #4956.
2023-06-21 08:31:13 +02:00
0c1d0d7b05 Fix: formResponse and formId missing from API's GetPaymentRequest route 2023-06-21 12:47:21 +09:00
ad70856af0 Fix: LN payments failed to be detected on litd (#5104) 2023-06-21 12:15:46 +09:00
8615f120ce Fix tests 2023-06-20 22:37:05 +09:00
33f1f956f7 Do not create an invoice on every lnurl query 2023-06-20 13:21:00 +02:00
0d0477d661 Lightning: Relax GetInfo constraint for LNDhub connections (#5083)
* Lightning: Relax GetInfo constraint for LNDhub connections

The LNDhub-compatible implementation by LNbits does not support the `GetInfo` call for all their funding sources — see lnbits/lnbits#1182. By catching that exception in combination with the `LndHubLightningClient`, we give people the ability to still use their LNbits-based LNDhub as a Lightning node.

Fixes #4482.

* Update approach to handling unsupported GetInfo calls
2023-06-20 17:28:16 +09:00
b31dc30878 Make file management UI more useful (#5081)
* Make file management UI more useful

* Simplify markup

* Move file info to top

---------

Co-authored-by: Dennis Reimann <mail@dennisreimann.de>
2023-06-20 08:58:28 +02:00
6e392f4cfb After changing PoS items in UpdatePoS ident the JSON template 2023-06-19 14:44:12 +09:00
cc3bdc331e Fix build 2023-06-16 23:19:47 +09:00
76faf77a1c Fix keypad view broken by previous commit 2023-06-16 23:18:47 +09:00
d8c0e5bf3a Add extension point to template editor (#5080) 2023-06-16 23:05:49 +09:00
28c4c320cc Checkout v2: Add return link in processing state (#5075)
* Checkout v2: Add return link in processing state

* Update copy text position
2023-06-16 23:05:08 +09:00
e81403ec3f Fix: Applying a discount in PoS with cart wasn't working (#5079) 2023-06-16 23:02:14 +09:00
f11424f73a Pull Payment: Support LNURL Withdraw with SATS denomination (#5041)
* Pull Payment: Support LNURL Withdraw with SATS denomination

* Refactor and add tests
2023-06-16 10:56:17 +09:00
fa8b977016 Remove id from create webhook endpoint; fix consistency. (#5045) 2023-06-16 10:53:41 +09:00
d181846339 Refund: Fix overpaid option (#5076)
Closes #5066.
2023-06-16 10:52:52 +09:00
1956919886 Do not crash when an invoice have an amount that is too big (#5070) 2023-06-16 10:47:58 +09:00
0f66498965 NFC: Do not start scanning if unsupported
Fixes #5067.
2023-06-14 09:14:09 +02:00
918cd152b1 Fix: Incorrect rounding in the receipt of PoS invoice (fix #5071) (#5072) 2023-06-13 20:34:21 +02:00
d3222df396 Fix build warnings (#5069)
Fixes these two:

```
/source/BTCPayServer/Hosting/MigrationStartupTask.cs(643,49): warning CS0168: The variable 'items' is declared but never used [/source/BTCPayServer/BTCPayServer.csproj]
/source/BTCPayServer/Hosting/MigrationStartupTask.cs(644,24): warning CS0168: The variable 'newTemplate' is declared but never used [/source/BTCPayServer/BTCPayServer.csproj]
```
2023-06-13 20:46:44 +09:00
a84ffd8c7e Crowdfund: Fix null pointer exception for topup type (missing price) (#5068)
Items with type topup have a price = null and hence not even the property set (ignored in JSON). This needs to be handled in the temlate, otherwise this exception occurs:

```
An unhandled exception was thrown by the application.
System.InvalidOperationException: Nullable object must have a value.
   at AspNetCoreGeneratedDocument.Views_Shared_Crowdfund_Public_ContributeForm.<>c__DisplayClass24_0.<<ExecuteAsync>b__0>d.MoveNext()
```
2023-06-13 20:46:27 +09:00
6d0f9120b8 prep for 1.10.2 2023-06-07 18:02:51 +02:00
aafb4a7f2a Fix stale invoice api for settle invoice
fixes #5049
2023-06-07 17:57:03 +02:00
ae432ff237 Fix: Crash on migation of old instances (Fix #5051) 2023-06-07 10:20:39 +02:00
cdc318c71a Pay Button: Fix circular reference when serializing JSON
When apps were set, the `GetAllApps` included the store data, which led to a circular reference when serializing the JSON. That data isn't necessary here, so we can just drop it before rendering.

Fixes #5038.
2023-06-05 12:35:06 +02:00
94d1cec8a9 Hide Sensitive Info: Fix script location
The script snippet needs to be located outside of the theme if-conditions, otherwise it only works if no custom theme is applied.
2023-06-05 12:34:54 +02:00
c0bc19ea59 Update Changelog 2023-06-02 18:21:57 +09:00
6f07714cd9 Language update 2023-06-02 18:18:10 +09:00
a9d2cac23c bump 1.10.1 2023-06-02 18:15:56 +09:00
693b46126b Bump Bitcoin core to 25.0 (#5032) 2023-06-02 16:41:35 +09:00
bbff9710bf fix cart + form combination bug fixes #5031 2023-06-02 09:34:55 +02:00
358e122775 Fix tests 2023-06-01 22:17:42 +09:00
3818468932 Pluginify on chain wallet setup (#4999)
* Pluginify on chain wallet setup

This PR fixes a few logical points in the wallet setup flow to allow more extensive plugin flexibility; It also fixes an issue when building plugins that requires an Altcoin config profile. Here is an example showcasing the Liquid+ plugin using this to enforce that it is a hot wallet (a requirement it has) and that import to RPC is always set, and a new option that is used to configure the wallet further https://i.imgur.com/pDPQ73v.gif

* Update BTCPayServer/Controllers/UIStoresController.Onchain.cs

* update nbx
2023-06-01 21:18:28 +09:00
3d2554fbe1 Make role name show uneditable when not creating 2023-05-31 15:49:34 +02:00
4309603317 Hide topup items from cart 2023-05-31 15:49:34 +02:00
f733c9ea77 Form Builder: Improve wording
Element -> Field. Something bas and I came across while reviewing the blog post.
2023-05-31 14:57:11 +02:00
775ee01171 fix store role deletion fixes #5027 2023-05-31 13:42:38 +02:00
33ec790137 Changelog 2023-05-31 11:50:10 +09:00
0c575c888c Remove payment requirement for marking expired invoices (#5006)
* Remove payment requirement for marking expired invoices

Allows to manually mark expired invoices, regardless of registered payments. See dennisreimann/btcpayserver-plugin-lnbank#34 for context, in which BTCPay Server sometimes did not register payments that were received to a LNbank wallet (this got fixed in btcpayserver/BTCPayServer.Lightning#129)

* Refactor conditions for better readability
2023-05-31 11:49:01 +09:00
24f7e51e3a Small adjustements 2023-05-31 11:27:03 +09:00
0a0cf97c55 Do not cleanup unreachable stores (#5025) 2023-05-31 11:22:37 +09:00
16b988d097 UI: Only display applicable refund options
Fixes #5019.
2023-05-30 12:51:51 +02:00
5edc0ff6ef UI: Fix visual bug with Hide Sensitive Info
Fixes #5011
2023-05-30 11:20:58 +02:00
375b96e508 UI: Center-align recovery phrase
Fixes #5007.
2023-05-30 11:19:16 +02:00
1e72b12074 UI: Store selector link distinguishes between owner and user
The `IsOwner` property went missing with #4940, so everyone landed on the invoices list when switching stores. This brings back the original behaviour of linking to the Dashboard, if the user has the permission to access it.

Fixes #5015.
2023-05-30 11:18:34 +02:00
4a6d52f78e Fix crowdfund perk support fixes #5013 2023-05-30 10:34:48 +02:00
35dd580e74 Fix cart view and provide better naming for default items fixes #5012 2023-05-30 10:05:31 +02:00
79836ef1de make free invoices from pos redirect to receipt and make receipt reload fast on such case 2023-05-30 10:04:23 +02:00
8cb06f9c6c fix user store reole setting fixes #5010 2023-05-30 09:37:14 +02:00
215a36e7a9 Fix: Some multi path payment on LND wouldn't be detected 2023-05-30 12:26:30 +09:00
247f6b86a5 Changelog 1.10.0 (#5004) 2023-05-29 16:24:27 +09:00
a9d42f1e6a Add What's New in v1.10.0 (#4992)
* Add What's New in v1.10.0

* Update BTCPayServer/Views/UIStores/Dashboard.cshtml

Co-authored-by: B <102448109+Bas02@users.noreply.github.com>

---------

Co-authored-by: B <102448109+Bas02@users.noreply.github.com>
2023-05-29 16:08:46 +09:00
4e03c2523a Prune webhook data from database 2023-05-29 09:02:47 +02:00
418b476725 Bug fix on StoreRoleId parsing 2023-05-27 12:51:48 +09:00
783e4ccb35 Store Custom Roles (#4940) 2023-05-26 23:49:32 +09:00
6b7fb55658 Fix: Payment not marked as settled even if the payment is successful with LNBank
Fix https://github.com/dennisreimann/btcpayserver-plugin-lnbank/issues/33
2023-05-25 21:09:13 +09:00
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
2c4349c630 Test concurrent payment of lightning invoices 2023-05-25 18:41:17 +09:00
3589417b58 Form Editor: Minor wording adjustments (#4998) 2023-05-25 08:51:03 +02:00
55203e0b64 Dashboard: Fix SATS denomination display (#4994)
When the default currency of the store is SATS, the display was broken.
2023-05-25 10:08:00 +09:00
a918288e3b Fix codeql config to not scan vendor js, add it to solution 2023-05-23 10:38:59 +09:00
e183138d2c Remove vendor js from codeql scan 2023-05-23 10:07:08 +09:00
d3e42862ed Create codeql.yml (#4821)
Co-authored-by: Nicolas Dorier <nicolas.dorier@gmail.com>
2023-05-23 09:23:24 +09:00
8860eec254 Switch Apps to json not YML (#4792) 2023-05-23 09:18:57 +09:00
97e7e60cea Add minrelayfee to payjoin request
fixes #4689
2023-05-22 14:56:08 +02:00
44aaf7acbb Form editor (#4968)
Co-authored-by: dstrukt <gfxdsign@gmail.com>
2023-05-22 13:30:28 +02:00
9b721fae27 Better handle postgres requests for wallet objects (#4985) 2023-05-20 23:26:16 +09:00
c3f412e3bb Bump tests to Bitcoin Core 24.1 (#4988) 2023-05-20 21:38:39 +09:00
ee738a29f0 Stop spamming logs with event aggregator logging 2023-05-19 15:24:20 +09:00
6c6544bf9b Improve invoice filtering UI (#4914)
* Improve invoice filtering UI

Closes #3664.

* UI updates

* Add app filter

* Add indicator for active filters

* updates text

* Improve selected filter display

* Apply suggestions from code review

---------

Co-authored-by: dstrukt <gfxdsign@gmail.com>
2023-05-19 10:42:09 +09:00
3d57b944ca Fix a bunch of minor bugs (#4983) 2023-05-19 08:41:21 +09:00
acf003b1b4 Do not generate new address when a new payment is detected (#4984)
* Do not generate new address when a new payment is detected

* Update BTCPayServer.Tests/UnitTest1.cs

Co-authored-by: Andrew Camilleri <evilkukka@gmail.com>

---------

Co-authored-by: Andrew Camilleri <evilkukka@gmail.com>
2023-05-18 16:53:01 +09:00
52e108d32f Minor design system updates (#4973)
- Update Manage Plugins icon
- Add ESC to supporters sprite
- Update body-text-active variable
2023-05-17 10:19:26 +02:00
7b96f96025 bump clightning (#4970)
* bump clightning

* Remove Lightning Charge from our tests
2023-05-16 09:17:21 +09:00
8db5e7e043 Plugins: Allow payout processors to signal they cannot be removed through common UI 2023-05-15 09:49:13 +02:00
25fb5c1293 Checkout v2: Improve expired paid partial state (#4827)
Co-authored-by: Andrew Camilleri <evilkukka@gmail.com>
2023-05-11 10:38:40 +02:00
37f0498def adds payouts settings button (#3857)
Co-authored-by: Dennis Reimann <mail@dennisreimann.de>
2023-05-11 10:37:28 +02:00
02110f93d7 Hide sensitive info (#4966) 2023-05-11 10:35:51 +02:00
195dfc2c47 Refund updates (#4934) 2023-05-11 10:33:33 +02:00
541b6cf9eb Improve create first store case (#4951) 2023-05-10 11:18:29 +02:00
2c26b77afc Forms: Add multiline input (#4942) 2023-05-10 11:14:19 +02:00
99bcec5597 bump nbx 2023-05-09 22:06:23 +09:00
781190a65d Bump to 1.9.3 (#4955)
* Bump to 1.9.3

* Apply suggestions from code review

* Update Changelog.md

* Update Changelog.md

* Update Changelog.md

* Update Changelog.md

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

* Update Changelog.md

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

* Update Changelog.md

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

---------

Co-authored-by: d11n <mail@dennisreimann.de>
2023-05-08 21:30:43 +09:00
3763480280 NFC: Handle HTTP-related exceptions (#4965) 2023-05-08 12:11:42 +02:00
6fad5ebedb Do not crash checkout when attempting lnurl checkout through non secure page (#4964)
Co-authored-by: d11n <mail@dennisreimann.de>
2023-05-08 12:09:48 +02:00
0690194aa1 Fix posdata with primitive array (#4954)
Co-authored-by: d11n <mail@dennisreimann.de>
2023-05-08 11:02:13 +02:00
03b94e2be3 Minor refactoring about DefaultPaymentMethod 2023-05-08 09:14:58 +09:00
18e34b3cbe Checkout v2: Improve truncation of displayed addresses (#4924) 2023-05-05 10:00:55 +02:00
a0bb3ace61 LN Settings: Show only node host name (#4927) 2023-05-05 09:59:33 +02:00
920ad67633 Rates: Fix advanced rules example formatting
Fixes #4920.
2023-05-05 09:58:42 +02:00
8b8f72129c Crowdfund: Fix redirect URL fallback
As the request for invoice creation is issued via web socket, the display URL ends up being the hob connection URL. This replaces it with the actual app URL and fixes #4930.
2023-05-05 09:57:44 +02:00
b9b11e722c Greenfield: Apply store default payment method on invoice creation
Fixes #4947.
2023-05-05 09:56:23 +02:00
eddd458744 Fix missing shopify link
fixes #4945
2023-05-05 09:51:45 +02:00
439ea20a89 Resolving weird Firefox form autocomplete behavior on our POS (#4950) 2023-05-04 18:49:35 +02:00
cec223c8e7 Fix missing closing div (#4944) 2023-05-03 10:55:20 +02:00
25cb188d00 Bumping LND to 0.16.2-beta 2023-04-29 09:10:07 -05:00
31007a8d96 Merge pull request #4929 from dennisreimann/esc
Supporters: Add ESC
2023-04-27 18:30:09 +02:00
a4fa8db69b Supporters: Add ESC 2023-04-27 18:28:29 +02:00
6193835ea1 Make LightningListener nullable, fix some NRE 2023-04-27 13:37:32 +09:00
0c78e9e4ac Bumping LND to 0.16.1-beta (#4921) 2023-04-27 13:17:57 +09:00
58c409e7fa Fix tests 2023-04-27 13:00:25 +09:00
9577eed524 Validate input in greenfield for payout processors (#4922) 2023-04-27 10:59:19 +09:00
76f32cd064 Fix payment request overriding user provided email 2023-04-26 14:06:42 +02:00
92d9c17095 Fix payment request merge conflict marker in UI 2023-04-26 14:06:23 +02:00
b0396df33f Update changelog 2023-04-26 18:27:06 +09:00
c17572c76f Clip configuration values for payout processors 2023-04-26 18:24:46 +09:00
5c91e072a6 Prevent payout processors from stalling restart 2023-04-26 18:09:56 +09:00
4991d0f965 Update Changelog and bump version 2023-04-26 17:57:25 +09:00
45b74e1ce5 Fix cart receipt + fix pos email form forwarding (#4917)
* Show correct array regardless of size

fixes #4890

* Email provided to pos form was not forwarded to form

fixes #4810

* Make invoice receipt url redirect to the invoice redirect url if receipt is not enabled

When setting up a default email rule upon invoice settlement, you would link to the receipt page naturally. However, if using the payment requests, receipts are disabled as the payment request itself is the receipt.  This commit makes the receipt url redirect to the invoice redirect url if available, and in the case of payment requests, it would mean the receipt url is the payment request url. fixes #4895

* Set the email address in the form when configured in the payment request

* fix pay request email copy

* fix payouts nav link

fixes #4788

* Update BTCPayServer/Views/UIPaymentRequest/EditPaymentRequest.cshtml

Co-authored-by: Nicolas Dorier <nicolas.dorier@gmail.com>

---------

Co-authored-by: Nicolas Dorier <nicolas.dorier@gmail.com>
2023-04-26 16:45:35 +09:00
ccb4b9a9ba Merge pull request #4916 from dennisreimann/receipt-print
Receipt: Optimize print view
2023-04-26 15:41:41 +09:00
dd635071d6 Merge pull request #4909 from dennisreimann/fix-4889
POS: Fix choiceKey case
2023-04-26 15:16:54 +09:00
fe1448dfae Merge pull request #4911 from NicolasDorier/qiponbtq
Remove LNURLStandardInvoiceEnabled
2023-04-26 15:15:20 +09:00
56855bc54d Fix typo in PayJoinEndpointController.cs (#4918) 2023-04-25 22:29:06 +02:00
b51fa8df5a Fix indent 2023-04-25 21:03:12 +09:00
3aa979cb11 Test updates 2023-04-25 13:07:01 +02:00
c95f75bc6c Remove disable BOLT11 option 2023-04-25 12:21:27 +02:00
b13a636f89 Fix syntax error 2023-04-25 12:11:08 +02:00
8de55cef31 Unify checkout v1 behaviour with v2 2023-04-25 11:36:45 +02:00
cb781f42e3 POS: Fix choiceKey case
I came across this while debugging #4889. This does not actually fix it, but it fixes an inconsistence in the casing of the parameter name.

However, I think the original issue is a caching problem in the browser. I was able to reproduce it on first load, after reloading the page once more it works as intended. The weird thing is: even though the values are correct on first load (verified via debugger), the `choiceKey` for the first item is set incorrectly to an integer value.
2023-04-25 09:16:09 +02:00
b59292dc24 Receipt: Optimize print view
Fixes #4902
2023-04-25 07:30:15 +02:00
03b793d7e2 Fix tests 2023-04-25 10:28:36 +09:00
bee18d1cfb Can set LazyPaymentMethod at the invoice creation level 2023-04-25 08:38:42 +09:00
d8698181f4 Remove LNURLStandardInvoiceEnabled 2023-04-24 23:52:40 +09:00
47f5d97eaf Prevent an NRE in LNURL (#4908)
* Prevent an NRE in LNURL

In addition to f05a7f9f14e0a2f906c79951a15311085774db85. Fixes #4904.

* Revert "Prevent an NRE in LNURL"

This reverts commit 0b241d61ab45b79297211e04da0e05c2cb10dada.

* Fix NRE

---------

Co-authored-by: nicolas.dorier <nicolas.dorier@gmail.com>
2023-04-24 21:50:31 +09:00
cb3c5e56fd Fix: Poll of Lightning Invoice status might fail on LND if LNURL is used (#4910) 2023-04-24 18:15:39 +09:00
39b76c08de Fix: Form in Payment Requests was not setting its values to the invoices metadata (#4907) 2023-04-24 18:04:46 +09:00
c3c8cc21ff Security Page Refactor (#4815)
* Update SECURITY.md

* typo

* project vs product

* Suggestion Update - Docker Deployment

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

* Suggestion - Email highlight

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

---------

Co-authored-by: d11n <mail@dennisreimann.de>
2023-04-24 15:04:56 +09:00
6dba1b6d8b Nullable on LanguageService 2023-04-20 09:44:24 +09:00
381fe70a79 Add UserAgent to IPN and webhook HTTP requests (Fix #4883) 2023-04-19 21:13:31 +09:00
feb927c2e4 Add missing param, fix response code. (#4891) 2023-04-19 13:07:36 +09:00
e77bd4c188 Swagger: FIx typos in pull payments docs (#4893)
Fixes #4892.
2023-04-19 13:06:51 +09:00
43436fc49e Remove BTCPayServer.Plugins.Test (#4875)
Remove the plugin, which is superseded with the plugin template and move the PluginPacker to the root of th solution (which matches its location in the file system).
2023-04-17 11:38:03 +09:00
d738f797ec bump 2023-04-17 11:11:00 +09:00
b5de97f785 Update changelog 2023-04-17 10:54:00 +09:00
b0c1b0895d Fix crash if auto detect language on checkout page, and the language couldn't be detected (Fix #4881) (#4888) 2023-04-17 10:53:45 +09:00
8e60932f81 Migrate reference to AppType in server settings (Fix #4882) 2023-04-17 10:34:41 +09:00
7d14cd74f2 LightningLikePaymentData: Null-check preimage (#4886)
Fixes #4884.
2023-04-17 00:08:40 +02:00
717f1610f5 Update changelog 2023-04-13 16:28:30 +09:00
f1abe6497f Fix wrong data mapping to store data instead of store user data. (#4874) 2023-04-13 16:27:40 +09:00
046129a57d Bumping LND to 0.16.0-beta (#4873) 2023-04-13 14:48:47 +09:00
90d300a490 Remove superflous category in API doc 2023-04-13 08:41:46 +09:00
a2d506c0db Checkout v2: Confetti for processing payments (#4872)
Let's not spoil the fun for those paying on-chain.
2023-04-13 08:40:21 +09:00
58748a24da What's New entry for v1.9 (#4871)
Copy is just a proposal from my side. Link check expected to fail, because the blog post isn't up yet.
2023-04-12 20:40:20 +09:00
639e8a4a1d Add links to invoice metadata in the docs (#4869) 2023-04-12 16:30:34 +09:00
48ebaf5c5a Do not put payRequest in the metadata (#4870) 2023-04-12 16:30:22 +09:00
1aaccb1e6b Do not show empty JObject in AddtionalData of views 2023-04-11 13:21:02 +09:00
f05a7f9f14 Prevent an NRE in LNURL 2023-04-11 13:08:14 +09:00
98ddb348b0 Update changelog 2023-04-10 20:21:13 +09:00
a4aa85ebab Fix: If connection to Lightning node was interrupted, payments would be missed (#4865) 2023-04-10 19:35:01 +09:00
516efe56f4 Refactor: Dot not make LNURLPaymentMethodDetails depends on BTCPayInvoiceId (#4864)
* Refactor: Dot not make LNURLPaymentMethodDetails depends on BTCPayInvoiceId

* Abstract PaymentProof

* fix bug

* Make the selenium container resolves the btcpay host name
2023-04-10 16:38:49 +09:00
a4d72d5bbc Fix tests 2023-04-10 15:06:59 +09:00
24b8ec16f1 Fix tests 2023-04-10 13:37:09 +09:00
ac25fef555 Remove warning 2023-04-10 12:01:11 +09:00
8302f082a2 Do not render the TruncateCenter if text null or empty 2023-04-10 11:17:29 +09:00
7546ef7a8e Dotnet reformat 2023-04-10 11:07:03 +09:00
f598c70a4f Add comment TODO for improving automatic translations efficiency. 2023-04-10 11:03:36 +09:00
422da21de5 Update Changelog 2023-04-07 17:52:48 +09:00
f530fb3241 Update changelog 2023-04-07 17:50:57 +09:00
5d39bb7466 Allow LN Address to customize invoice metadata, and various bug fixes on LNUrl (#4855)
* Allow LN Address to customize invoice metadata

solves https://github.com/OpenSats/website/issues/8

* Refactor GetLNUrl

* Fix lightningAddresssettings.Max being ignored

* Fix: The payRequest generated by the callback wasn't the same as the original

---------

Co-authored-by: nicolas.dorier <nicolas.dorier@gmail.com>
2023-04-07 17:48:58 +09:00
041cba72b6 Made Fake Custodian config field non-required (#4861) 2023-04-07 15:59:44 +09:00
892b3e273f Improve Labeling further (#4849)
* If loading addresses into the send wallet page using bip21 or address,  (or clicking on "Send selected payouts"  from the payotus page), existing labels will be pre-populated.
*  Add the payout label to the address when the payoutis created instead of to the transaction when it is paid.
*  Add the label attachments when adding labels from an address to the transaction.
2023-04-07 15:58:41 +09:00
91faf5756d With core lightning, getting payment by paymenthash wouldn't return the successful payment if the first one failed. 2023-04-07 15:54:56 +09:00
e239390ebf Allow any bolt11 invoice for pullpayments/payouts (#4857)
closes #4830

If users want to deal with expired payout destinations, then they should be able to conifugre it that way. Some wallets simply do not allow customizing the bolt11 expiry and the defaults are much less than a day. I think we should merge #3857 if we introduce this as an automated payotu processor for lightning running every few minutes would work together with this and solve it.
2023-04-06 15:54:19 +09:00
b24764d679 bump 2023-04-05 23:38:39 +09:00
4d5a568fd7 Changelog 1.9 (#4852) 2023-04-05 23:37:01 +09:00
5ab55e71e0 Add cart items to receipt (#4851) 2023-04-05 15:42:23 +02:00
929d63ecf8 Fixed nav menu active states + Better Fake Custodian (#4854) 2023-04-05 15:11:46 +02:00
0ef7f3715f remove obsolete reference 2023-04-05 15:09:42 +02:00
2298f3901a Update langs (#4853) 2023-04-05 13:32:24 +09:00
3005f1937a Replace GetUriByAction by GetPathByAction 2023-04-05 10:58:56 +09:00
f48eec2e93 Fix: Redirecting to local absolute URL in wizard windows should work 2023-04-05 10:55:35 +09:00
754d304e54 Fix tx link in Recent Transactions 2023-04-05 08:53:34 +09:00
9b8d08a668 Make Checkout V2 the default (#4850)
* Make Checkout V2 the default

* Fix align
2023-04-05 08:35:50 +09:00
1b672a1ace Allow multi-step settings in custodian (#4838)
* Allow multi-step settings in custodian

* Fix CustodianAccount.Name not saved

* Reuse TradeQuantity for SimulateTrade

* TradeQuantityJsonConverter accepts numerics

* Fix build
2023-04-04 14:48:29 +09:00
60d6e98c67 Form System Flexibility improvements (#4774)
* Introduce very flexible form input system

* Refactorings after rebase

* Test fix

* Update BTCPayServer/Forms/FormDataService.cs

---------

Co-authored-by: Dennis Reimann <mail@dennisreimann.de>
2023-04-04 11:01:34 +09:00
11f05285a1 Invoice Details: Improve payments list and print view (#4817)
Closes #4729.

Co-authored-by: Nicolas Dorier <nicolas.dorier@gmail.com>
2023-04-04 10:59:14 +09:00
2bd1842da1 Improve pagination (#4828)
Based on the design repo updates by @benalleng in btcpayserver/btcpayserver-design#61. Closes #3835.
2023-04-04 10:54:04 +09:00
57544068e9 Store rule emails in HTML + Test rule emails (#4843)
* Store rule emails in HTML + Test rule emails

* Store rule emails in HTML + Test rule emails

* Update BTCPayServer/Controllers/UIStoresController.Email.cs

Thanks !

Co-authored-by: Andrew Camilleri <evilkukka@gmail.com>

* change in StoreEmails() to work properly with add commande

* CanSetupEmailServer() : Remove Bosy sendkeys that doesn't work with new HTML control

* Update test for new HTML control

* better command treatment

---------

Co-authored-by: nisaba <infos@nisaba.solutions>
Co-authored-by: Andrew Camilleri <evilkukka@gmail.com>
2023-04-04 10:52:42 +09:00
60cfea9f94 Add presets in the checkout appearance (#4756) 2023-04-04 10:45:40 +09:00
eece001376 Add labels for recent txs dashboard widget (#4831)
* Add labels for recent txs dashboard widget

It is not with the rich data for now, but a good start.

* Turn labels into links

* Add rich info to dashboard labels

* Use truncate-center component for recent transactions

---------

Co-authored-by: Dennis Reimann <mail@dennisreimann.de>
2023-03-30 19:54:11 +02:00
98d8ef8e1a Checkout Appearance: Move language settings into the general section (#4833)
The language settings work for both versions of the checkout, so let's make them available for both. Request by @petzsch.
2023-03-30 08:18:13 +02:00
0e43042217 Remove FakeCustodian as a separate project (#4839) 2023-03-30 12:38:30 +09:00
c8e6714207 Merge pull request #4784 from dennisreimann/unify-plugins-apps
Apps become plugins
2023-03-29 20:03:18 +02:00
824e779eb2 Hooks for Zaps (#4826) 2023-03-29 12:27:04 +02:00
83ea898780 Checkout: Update wording (#4829)
We make it "Payment Received" instead of "Payment Sent", because in other places we are also talking from the merchant perspective.
2023-03-29 17:24:49 +09:00
5af3233fd6 Add link to forms doc 2023-03-28 22:02:58 +09:00
08ff2f3173 Checkout: Fix language select width in modal (#4823) 2023-03-28 13:12:47 +02:00
22657b66d7 NFC finetuning (#4822) 2023-03-28 12:36:32 +02:00
8b6c7a6061 Pull Payments: FIx column order in list (#4818)
Date and name were swapped. Fixes #4814.
2023-03-28 19:10:50 +09:00
1f197f6688 Merge pull request #4819 from dennisreimann/nfc 2023-03-28 09:19:58 +02:00
1055e61bb4 NFC improvements
Two changes which fix #4807:

- Once permissions are granted we start scanning immediately, no need to ask for permissions or have the user click the button again
- We don't abort the scan, which gets rid of the cases in which the OS took over after the scan, because the user left the card on the device

Also adds feedback for the NFC states scanning and submitting.
2023-03-27 18:28:53 +02:00
7ad0aa82fc Apps become plugins
Unified navigation for apps that are now plugins. Part of #4744.
2023-03-27 16:43:44 +02:00
d3f5576570 Remove store integrations list page (#4816)
Co-authored-by: d11n <mail@dennisreimann.de>
2023-03-27 16:40:50 +02:00
45141d1391 Checkout v2: Payment processing state (#4778) 2023-03-27 12:12:11 +02:00
de9ac9fd43 Receipt: Add payment proof (#4782)
* Receipt: Add payment proof

Closes #4685.

* shice

* Add truncate-center component

* Improve view

* Hide button and link when printed

* Describe component

* Remove transaction ID from UI

* Remove modification to interface

---------

Co-authored-by: nicolas.dorier <nicolas.dorier@gmail.com>
2023-03-27 14:07:12 +09:00
c53d5272d6 Wallet Transactions Export: Add BIP-329 support (#4799)
* Wallet Transactions Export: Add BIP-329 support

* Adjust wording

* Export one line per label

* Join labels, fix type

* Rewrite the ProcessBip329 function to be more performant

* Add nullable on all TransactionsExport

---------

Co-authored-by: nicolas.dorier <nicolas.dorier@gmail.com>
2023-03-27 13:59:33 +09:00
18c78192ec Reconstruct issue template (#4803)
* reconstruct issue template

* provide a direct link for filing a tech question
2023-03-27 13:59:07 +09:00
632d67eef4 Fix casing in template example for forms 2023-03-27 12:54:12 +09:00
c23aa48688 Optimize invoice print view (#4783)
Closes #4729.
2023-03-26 20:44:05 +09:00
95f3e429b4 Wallet transactions: Add label manager (#4796)
* Wallet transactions: Add label manager

* Update BTCPayServer/Views/UIWallets/WalletTransactions.cshtml

Co-authored-by: Andrew Camilleri <evilkukka@gmail.com>

* Add rich label info

* Fixes

* support labels in wallet send

* add labels to tx info page

* Remove noscript parts

* Allow click on transaction label info

* update psbt info labelstyling

* revert red pixel fix as it broke all

---------

Co-authored-by: Andrew Camilleri <evilkukka@gmail.com>
2023-03-26 20:42:38 +09:00
8635fcfe84 UI: Redesign Recovery Seed view (#4793)
* Improve recovery seed backup page

* Fix errors from Selenium tests (Sequence contains no elements)

* Revert previous commit

* Improve recovery seed backup page

* Recovery phrase UI update

* recovery seed UI format

* Improve word order

* One column version

---------

Co-authored-by: Dennis Reimann <mail@dennisreimann.de>
2023-03-24 16:09:53 +01:00
d861537d9a Merge pull request #4809 from dennisreimann/gf-ln-array-fix
Greenfield: Fix Lightning transaction list return types
2023-03-23 18:59:36 +01:00
631ee99f60 Greenfield: Fix Lightning transaction list return types
The LocalBTCPayServerClient deserializes the results as arrays (`LightningPaymentData[]` and `LightningInvoiceData[]`) — if they are `IEnumerable` the `GetFromActionResult` does not return the data but null.
2023-03-23 17:42:10 +01:00
ffa1441ccd Delete code detecting whether the running version of nbx fixed a bug
The reason to delete this is that any version of NBX with this bug
wouldn't be able to run nowadays because of another bug which would
prevent NBXplorer from synching (Array size too big)
2023-03-23 13:45:40 +09:00
2f3e947027 Merge pull request #4795 from Kukks/lnurl-disable-if-no-node 2023-03-22 09:02:52 +01:00
a62aecfdfe Merge pull request #4798 from dennisreimann/fix-4794 2023-03-22 09:02:35 +01:00
5f829c68f2 Merge pull request #4797 from dennisreimann/fix-4790 2023-03-22 09:02:10 +01:00
0290d74aeb POS: Fix escaped HTML entities in item title
Properly escapes and the sanitized values. Fixes #4794.
2023-03-21 15:31:54 +01:00
f6bc16007d Label tooltips: Use plain text instead of HTML
Fixes #4790.
2023-03-21 15:21:24 +01:00
ad5752f09b Reuse LightningTimeout constant 2023-03-21 14:22:10 +01:00
55565f1718 Do not provide lnurl method if ln node is dead
fixes #3541
2023-03-21 13:48:25 +01:00
5f96d17b8c Update lang 2023-03-20 19:30:56 +09:00
fd22406e0a Fix PullTransifexTranslationsCore 2023-03-20 19:21:35 +09:00
64fe542c1e Update lang 2023-03-20 19:20:46 +09:00
fae1dc8dbb Adapt cookie auth to work with same API permission system (#4595)
* Adapt cookie auth to work with same API permission system

* Handle unscoped store permission case

* Do not consider Unscoped as a valid policy

* Add tests

* Refactor permissions scopes

---------

Co-authored-by: Dennis Reimann <mail@dennisreimann.de>
Co-authored-by: nicolas.dorier <nicolas.dorier@gmail.com>
2023-03-20 10:46:46 +09:00
6f2b673021 Custodian withdrawal support + Some refactoring and cleanup (#4085)
* Renamed "WithdrawAsync" to "WithdrawToStoreWalletAsync"

* WIP

* WIP withdrawal + Refactored Form saving to JObject

* WIP

* Form to fix bad values during withdrawing appears correctly

* WIP

* Lots of cleanup and refactoring + Password field and toggle password view

* Cleanup + Finishing touches on withdrawals

* Added "Destination" dummy text as this is always the destination.

* Fixed broken test

* Added support for withdrawing using qty as a percentage if it ends with "%". Needs more testing.

* Fixed broken build

* Fixed broken build (2)

* Update BTCPayServer/wwwroot/swagger/v1/swagger.template.custodians.json

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

* Update BTCPayServer/wwwroot/swagger/v1/swagger.template.custodians.json

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

* Improved unit tests

* Fixed swagger bug

* Test improvements

Make string conversion of quantity explicitely.

* Fix build warnings

* Swagger: Add missing operationId

* Made change Dennis requested

* Removed unused file

* Removed incorrect comment

* Extra contructor

* Renamed client methods

* Cleanup config before saving

* Fixed broken controller

* Refactor custodian

* Fix build

* Make decimal fields strings to match the rest of Greenfield

* Improve parsing of % quantities

---------

Co-authored-by: d11n <mail@dennisreimann.de>
Co-authored-by: nicolas.dorier <nicolas.dorier@gmail.com>
2023-03-20 10:45:32 +09:00
b26679ca14 Prevent people from starting with --sqlitefile or --mysql (#4772) 2023-03-20 10:40:48 +09:00
04ba1430ca Refactor plugin apps (#4780)
* Refactor plugins

* Add missing names to view models

* Cleanups

* Replace SalesAppBaseType by two interfaces

---------

Co-authored-by: Dennis Reimann <mail@dennisreimann.de>
2023-03-20 10:39:26 +09:00
53f3758abc Replace text in copy buttons with icon (#4764)
Closes #4699.
2023-03-19 21:43:38 +01:00
c6742f5533 Language selector: Ensure correct font-size (#4761)
* Language selector: Ensure correct font-size

Fixes the cut-off text on iOS, because somehow iOS uses a larger font-size by default.

* Fix select background color

Webkit-based browsers displayed transparent in a weird way.
2023-03-19 08:44:23 +01:00
cb44591a47 Derivation scheme parsing incorporates fingerprint and key path (#4781) 2023-03-17 14:35:30 +01:00
e02abb509f Allow plugins to do something before and after automatic payouts (#4224) 2023-03-17 13:50:37 +01:00
eff6be9643 Remove mention of LNUrl-Withdraw when paying by NFC (#4779) 2023-03-17 12:24:27 +01:00
348dbd7107 Support Form Select option (#4726)
* Support Form Select option

* Add country select
2023-03-17 14:37:37 +09:00
f74ea14d8b Plugins can now build apps (#4608)
* Plugins can now build apps

* fix tests

* fixup

* pluginize existing apps

* Test fixes part 1

* Test fixes part 2

* Fix Crowdfund namespace

* Syntax

* More namespace fixes

* Markup

* Test fix

* upstream fixes

* Add plugin icon

* Fix nullable build warnings

* allow pre popualting app creation

* Fixes after merge

* Make link methods async

* Use AppData as parameter for ConfigureLink

* GetApps by AppType

* Use ConfigureLink on dashboard

* Rename method

* Add properties to indicate stats support

* Property updates

* Test fixes

* Clean up imports

* Fixes after merge

---------

Co-authored-by: Dennis Reimann <mail@dennisreimann.de>
2023-03-17 11:56:32 +09:00
a671632fde Dashboard: Fix app stats tiles (#4775)
* Dashboard: Fix app stats tiles

They broke with #4747, because they contain script blocks that are loaded asynchronuosly and need to get run once the chart data is added to the page.

* Refactor PoS dashboard component

* Collocate the component JS files in separate files

---------

Co-authored-by: nicolas.dorier <nicolas.dorier@gmail.com>
2023-03-16 15:51:24 +09:00
e344622c9e Form quick fixes (#4759) 2023-03-15 10:23:33 +01:00
06d7483ca3 Remove obsolete cli argument 'plugin-remote' (#4773) 2023-03-15 09:06:06 +01:00
7fe041fc2c Changelog 1.8.4 2023-03-15 10:45:49 +09:00
3f18e5476a Error when indexing invoices with some field that are too long (Fix #4771) 2023-03-15 09:31:38 +09:00
2a31613fe8 Fix invoice paid after expiration icon 2023-03-14 14:54:01 +01:00
ded0c8a3bc Update price display (#4736)
* Update price display

As proposed by @dstrukt in #4364.

* Update format

* Unify price display across the app

* Add DisplayFormatter

* Replace DisplayFormatCurrency method

* Use symbol currency format for invoice

* Unify currency formats on backend pages

* Revert recent changes

* Do not show exchange rate and fiat order amount for crypto denominations

* Fix test and add test cases
2023-03-13 10:12:58 +09:00
f3d9e07c5e Checkout v2: Celebrate payment with confetti (#4727)
* Checkout v2: Celebrate payment with confetti

Have a colorful celebration for successful payments.

* Make it default and add test
2023-03-13 10:09:56 +09:00
eb3ba95114 Make CanUsePullPaymentsViaUI more robust (#4762)
Fixes this nasty flaky test failure:

```
Failed CanUsePullPaymentsViaUI [17 s]
  Error Message:
   Assert.Equal() Failure
           ↓ (pos 1)
Expected: payout
Actual:   pull-payment
           ↑ (pos 1)
  Stack Trace:
     at BTCPayServer.Tests.ChromeTests.CanUsePullPaymentsViaUI() in /source/BTCPayServer.Tests/SeleniumTests.cs:line 1622
```

Because there are actually two labels, the previous selector was dependent on the correct ordern, because it always chose the first one …
2023-03-13 10:02:07 +09:00
7951dcada6 make sure we have cors for all of greenfield (#4760)
fixes #4758
2023-03-10 15:20:11 +01:00
06951a39c6 fix API breaking changefor payout processors (#4757)
fixes #4752
2023-03-10 17:57:33 +09:00
abe29f21f0 Checkout v2: Option to display amount in Sats in BIP21 case (#4730) 2023-03-09 21:36:11 +01:00
f57eab3008 Store branding: Add complementing text and accent colors (#4746) 2023-03-09 21:34:15 +01:00
6d4b2348ac Update changelog 2023-03-08 21:56:40 +09:00
397ca6ef0c Checkout v2: Minor UI updates (#4734)
* Checkout v2: Minor copy change

* Allow copying of invoice ID and order ID on results page

* Add copy icons for payment details on results view

* Add missing powered by class to store footers
2023-03-08 21:39:03 +09:00
d6e5ee2851 UI: Decrease content padding top on small screens (#4749)
If the viewport height is less than 800px, decrease the content padding top for breakpoints L and on.
2023-03-08 21:37:25 +09:00
98d62e826b Do not through missing-permission error when no store on /api/v1/stores (Close #4735) (#4748) 2023-03-08 21:36:51 +09:00
7b5ce8f70c CSP: Remove unsafe-eval when vue isn't used (#4747)
* CSP: Remove unsafe-eval when vue isn't used

* Prevent XSS injection via VueJS
2023-03-08 17:57:36 +09:00
2010a9a458 bump 2023-03-07 10:29:18 +09:00
f787058c17 Fix: Impossible to create invoice after migration from Sqlite (Close #4743) 2023-03-07 10:27:04 +09:00
87ccae0d90 add missing docs of store payment method criteria 2023-03-05 14:40:18 +01:00
07d95c6ed7 bump clightning 2023-03-05 11:08:01 +09:00
514823f7d2 bump clightning 2023-03-04 21:39:49 +09:00
fb4feb24f3 Minor updates from design repo (#4733) 2023-03-04 09:36:30 +01:00
5caa0e0722 [Greenfield] Allow passing email instead of user id in API (#4732) 2023-03-03 21:24:27 +09:00
0406b420c8 Do not create if create API key is called on a non-existant user (Fix #4731) 2023-03-03 20:30:54 +09:00
9d72b9779e Update Changelog 2023-03-03 20:20:59 +09:00
fdc47e4a38 Avoid crash when some plugins are installed (#4725) 2023-03-03 20:18:09 +09:00
0566e964c0 Fix incorrect punctuation in translations 2023-03-03 17:32:46 +09:00
896fbf9a5c Lang update 2023-03-03 16:38:39 +09:00
126c8c101e Re-add language selector (#4723)
Fixed version
2023-03-02 16:34:15 +09:00
3cb7cc01e4 Update db-migration.md 2023-03-02 13:20:47 +09:00
2b3d15bf45 Update Changelog.md 2023-03-01 23:50:35 +09:00
4049bdadcb Changelog v1.8 (#4670)
* Changelog v1.8

* Update Changelog.md

Co-authored-by: Andrew Camilleri <evilkukka@gmail.com>

* Add fix

* Update changlelog

---------

Co-authored-by: Andrew Camilleri <evilkukka@gmail.com>
Co-authored-by: nicolas.dorier <nicolas.dorier@gmail.com>
2023-03-01 23:41:43 +09:00
2042ba37d8 Update What's New (#4713)
Links to https://blog.btcpayserver.org/btcpay-server-1-8-0/ which doesn't exist yet, that's why the linkcheck is expected to fail.
2023-03-01 23:41:27 +09:00
41a4ba62b0 Remove lang popup in checkout v2 2023-03-01 17:10:54 +09:00
21558d25b1 Do not show product information if there are no product information 2023-03-01 16:19:10 +09:00
06622bfbfd Translate Checkout v2 (#4710) 2023-03-01 15:49:21 +09:00
16fd2e3938 Greenfield: Show detailed Lightning routing error (#4722)
The implementations have more detailed messages for LN routing errors, which e.g. allow me to detect self-payemnts in LNbank. We pass those from the LN lib, so if we have it, we should display it to provide a better insight on what's going on when a rout cannot be found.
2023-03-01 15:46:48 +09:00
040d7670ec Add currency code to payment request list (#4709)
https://github.com/btcpayserver/btcpayserver/discussions/4619
2023-03-01 15:46:13 +09:00
23761eacc1 Unset X-Frame-Options header correctly (#4721)
* Unset X-Frame-Options header correctly

According to the [spec](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/X-Frame-Options) there are onlye the `DENY` and `SAMEORIGIN` options, `ALLOW-FROM` being deprecated. Hence we have to actively unset the header, as we made `DENY` the default.

This also unsets the X-Frame-Options header for the public form pages, which fixes #4666.

* Ignore anti forgery token in Forms

---------

Co-authored-by: nicolas.dorier <nicolas.dorier@gmail.com>
2023-03-01 15:27:18 +09:00
5790bed766 Do not crash sqlite migration if the db is create but without tables 2023-03-01 15:04:32 +09:00
2f88da67e8 Fix build warnings and indentation (#4720) 2023-03-01 10:32:48 +09:00
21091cbf1a show all plugins regardless of version (#4717) 2023-02-28 12:16:33 +01:00
808949a884 Update langs 2023-02-26 21:07:23 +09:00
06334273dc Fix crashing on unserialize of old data 2023-02-26 11:18:54 +09:00
5399c04dff Fix crashing on unserialize of old data 2023-02-26 11:05:23 +09:00
cd051d4093 Update transaction label display (#4700)
* Update transaction label display

* Fix test
2023-02-26 11:01:46 +09:00
0ca6e8ccfb bump 2023-02-26 00:20:55 +09:00
bd075919f3 Improve publish docker script 2023-02-26 00:19:59 +09:00
c229425534 Remove JSON in strings from JObjects (#4703) 2023-02-25 23:34:49 +09:00
e89b1826ce add invoicemetadata as a tab (#4693)
* add invocie metadata as a tab

* Allow forms to add to posdata too in pos app

* Cleanup view

* Display additional information directly

* Update BTCPayServer/Views/Shared/PosData.cshtml

* Update BTCPayServer/Models/InvoicingModels/InvoiceDetailsModel.cs

---------

Co-authored-by: Dennis Reimann <mail@dennisreimann.de>
2023-02-25 22:38:28 +09:00
4ef19e19cc Checkout v2 fixes (#4705)
* Prevent duplicate titles on invoice view

* Fix text display of escaped values

Fixes #4696.

* Fix payment details re-rendering

Closes #4683. Closes #4684.

* Cleanup
2023-02-25 22:28:02 +09:00
ff58301729 do not require docker for plugin restart
we now have a more graceful restart mechanism specifically for plugins and most installs can handle this mechanism
2023-02-24 13:52:46 +01:00
4ae05272c3 Greenfield: Admins can create/delete API keys of any user (#4680)
* Greenfield: Admins can create/delete API keys of any user

* Greenfield: Improve doc for scoped apikey (Close #4673)

* Fix permissions hierarchy

* Update BTCPayServer.Client/Permissions.cs

* Fix tests

---------

Co-authored-by: Andrew Camilleri <evilkukka@gmail.com>
2023-02-24 16:19:03 +09:00
d14dafc871 Apply branding to custom forms (#4697) 2023-02-23 14:35:29 +01:00
022a077726 Use new transifex API on PullTransifexTranslations 2023-02-23 20:59:16 +09:00
d5bd86b07a POS: Align Keypad centered vertically (#4690) 2023-02-23 10:30:16 +01:00
66e1eee010 POS improvements (#4668) 2023-02-23 09:52:37 +01:00
ddb125f458 Fix: HTML injection in payment request/posData/receiptData (Close #4678) (#4679)
Co-authored-by: Dennis Reimann <mail@dennisreimann.de>
2023-02-22 16:35:34 +01:00
e6a157a101 Merge pull request #4686 from dennisreimann/noscript-fix 2023-02-22 14:01:13 +01:00
0a437fba6a Do not show Vue components when there is no JavaScript enabled
Small fix, came across this while testing the noscript checkout version.
2023-02-22 13:34:51 +01:00
39f2e80dc1 Merge pull request #4677 from dennisreimann/fix-4663 2023-02-22 12:30:16 +01:00
13f9eb0d18 Cleanups and unified wording 2023-02-22 11:20:50 +01:00
575b829799 Fix LNURL-Withdraw payments
Fixes comparisons of `long` and `LightMoney`, which did not work, because the `amount` provided was in sats and Lightmoney compares to millisats.

Closes #4663.
2023-02-22 11:18:26 +01:00
02e50fadae Fix: Crash during migration on some SQLite instances (Close #4623) 2023-02-22 17:07:27 +09:00
a02f191034 Fix: Crash during migration on some SQLite instances (Close #4623) 2023-02-22 16:55:19 +09:00
d73d0f178f Checkout: Allow NFC/LNURL-W whenever LNURL is available (#4671)
* Checkout: Allow NFC/LNURL-W whenever LNURL is available

With what we have in master right now, we display NFC only for top-up invoices. With these changes, we display NFC in all cases, where LNURL is available.

Note that this hides LNURL from the list of selectable payment methods, it's only available to use the NFC — and explicitely selectable only for the edge case of top-up invoice + non-unified QR (as before).

Rationale: Now that we got NFC tightly integrated, it doesn't make sense to support the NFC experience only for top-up invoices. With this we bring back LNURL for regular invoices as well, but don't make it selectable and use it only for the NFC functionality.

* Fix LNURL condition

* Improve and test NFC/LNURL display condition

Restores what was fixed in #4660.

* Fix and test Lightning-only case

* Add cache busting for locales
2023-02-22 15:53:14 +09:00
d542a61f5a Fix missing walletchanged event and add storeremoved event (#4676) 2023-02-22 13:13:58 +09:00
e0486aaa24 Label Manager component (#4594)
* Label Manager component

closes #4464

* UI updates

* Test fix

* add test

* fix warnings

* fix select update bug

* add test

* fix test

* Increase payment box max-width

* add labels from address to tx on detection

* Exclude well known label from the dropdown

* Add test on transaction label attachement, tighten UpdateLabels method to only update address labels

---------

Co-authored-by: Dennis Reimann <mail@dennisreimann.de>
Co-authored-by: nicolas.dorier <nicolas.dorier@gmail.com>
2023-02-22 11:47:02 +09:00
02bf76fb3c Merge pull request #4554 from Kukks/gf/pmcriteria 2023-02-21 16:03:29 +01:00
8a3ece4a70 add test 2023-02-21 15:31:11 +01:00
c553dc02a9 Greenfield: Expose Payment method criteria 2023-02-21 15:23:51 +01:00
ff71caa47e Upgrade Lightning lib (#4674)
To include the fix from btcpayserver/BTCPayServer.Lightning#122
2023-02-21 16:00:10 +09:00
2bd8227e20 Start using JSONB column instead of app side compressed data (#4574) 2023-02-21 15:06:34 +09:00
5c61de3ae9 Different icons for notifications (#4632)
* Different icons for notifications

Closes #2510.

* Fix version appendix for SVG use attributes

* Fix SVGUse TagHelper

* Update icons
2023-02-21 11:06:27 +09:00
cff46f2d59 UI: Remove highlight for valid fields (#4669) 2023-02-20 19:23:09 +01:00
bbbaacc350 Generic Forms (#4561)
* Custom Forms

* Update BTCPayServer.Data/Migrations/20230125085242_AddForms.cs

* Cleanups

* Explain public form

* Add store branding

* Add form name to POS form

* add tests

* fix migration

* Minor cleanups

* Code improvements

* Add form validation

Closes #4317.

* Adapt form validation for Bootstrap 5

* update logic for forms

* pr changes

* Minor code cleanup

* Remove unused parameters

* Refactor Form data handling to avoid O(n3) issues

* Rename Hidden to Constant

* Pre-populate FormView from the query string params

* Fix test

---------

Co-authored-by: d11n <mail@dennisreimann.de>
Co-authored-by: nicolas.dorier <nicolas.dorier@gmail.com>
2023-02-20 19:35:54 +09:00
60f84d5e30 Display "Pay by LNURL" only when appropriate (#4660)
Closes #4657.
2023-02-20 08:49:10 +09:00
5218aa3c43 Fix missing style tag around embedded CSS (#4659) 2023-02-18 20:38:02 +09:00
4b2ea0c0c3 Fix: Should not crash with command line arg --help 2023-02-16 18:32:26 +09:00
9b865ef849 Fix build and run scripts (#4655) 2023-02-16 18:31:33 +09:00
9344113ae4 Version bump 2023-02-16 17:46:27 +09:00
4448ac9d2a Changelog 1.7.12 (#4653) 2023-02-16 17:45:51 +09:00
9aff143d40 UI: Fix standalone confirmation modal 2023-02-15 16:17:22 +01:00
fc14f418cb Fix: Setting the password of a new created user via API shouldn't be required (Close #4534) (#4647) 2023-02-15 17:11:39 +09:00
b99253ff47 Revert "Fix: Setting the password of a new created user via API shouldn't be required (Close #4534) (#4645)" (#4646)
This reverts commit 9cb844cbbbd4118442d85e6d7a3031f3e1e6ed5b.
2023-02-15 16:32:36 +09:00
9cb844cbbb Fix: Setting the password of a new created user via API shouldn't be required (Close #4534) (#4645) 2023-02-15 16:32:03 +09:00
285aedef2f Fix: If user get locked out, unlocking or deleting user fails (Fix #4641) (#4644)
This is due to the fact our UserService is a singleton, and it had a
reference on UserManager which is scoped.

UserManager is caching user entities at the scope level.
UserService then had a view completely unsynchronized with the database.
2023-02-15 16:00:52 +09:00
5121d64022 Fix: Migrating from SQLite was crashing in some conditions (Close #4623) 2023-02-15 15:59:45 +09:00
8b80910d70 Fix: Unable to Edit amount when cloning paid Payment Request (Close #4639) 2023-02-15 15:33:26 +09:00
a5ff655eed Fix: If user get locked out, unlocking or deleting user fails
This is due to the fact our UserService is a singleton, and it had a
reference on UserManager which is scoped.

UserManager is caching user entities at the scope level.
UserService then had a view completely unsynchronized with the database.
2023-02-15 14:28:34 +09:00
cc9c63c33e Add list count to user preferences cookie (#4637)
I think it's fair to assume that the user wants to set this as a preference and it fixes #4592.
2023-02-15 11:04:17 +09:00
87eef72289 fix typo in vaultbridge.ui.js (#4640)
targetting -> targeting
2023-02-14 19:20:03 +01:00
8e8ba3d052 Webhook: Add missing model validation (#4636)
Fixes #4628.
2023-02-14 22:37:35 +09:00
fea27b900c Harden file type inputs (#4635) 2023-02-14 17:03:12 +09:00
7ad91a76cd Checkout v2: FIx automatic redirect after paid (#4633) 2023-02-14 08:56:00 +09:00
a62b674722 bump 2023-02-13 23:40:32 +09:00
350f35b08d Add code comment 2023-02-13 23:39:55 +09:00
f405321abc Changelog 1.7.11 (#4631) 2023-02-13 23:35:33 +09:00
0d077f6ce5 Fix lnurl for pull paymentdescription + fix authorize redirect form issue (#4630)
fixes #4627
fixes #4624
2023-02-13 23:34:43 +09:00
dffa6accb0 Fix XSS: Stenghten CSP rules on static file uploads (#4629) 2023-02-13 23:04:15 +09:00
b5abcd5ae5 Merge pull request #4622 from dennisreimann/domain-mapping 2023-02-13 13:41:34 +01:00
72a9e676c1 Feature Descriptor (#3831) 2023-02-13 09:25:24 +01:00
3658b396d3 Update db-migration.md 2023-02-11 21:04:43 +09:00
537acab16d Update db-migration.md 2023-02-11 21:04:28 +09:00
8c6fe91c71 After successful migration from SQLite or MySql, there is an error after a restart 2023-02-11 21:01:36 +09:00
3c344331af Improve domain mapping constraint
- Fix potential double assignment to appId, leading to an [exception](https://pastebin.com/j8dhtcTE)
- Add port to redirect, which makes it work in dev env
2023-02-10 18:15:54 +01:00
d14ce2a37f POS: Improve Keypad view (#4596)
* UI updates

* Updates modes and calculation

* Unify tip buttons

* White caret

* Add top margin to calculation

* Add space between mode buttons and keypad

* Discount updates
2023-02-10 16:26:38 +01:00
33d272d4b0 Crowdfund: View updates (#4588)
* Crowdfund: View updates

Improve store branding and remove the card styles, because they had borders which seemed like visual clutter. Other than that I made some changes to the header section and cleaned up the markup and indentation.

* adds column spacing + details header

* Move the Featured Image input

* Center align the Last Updated

* Remove store header, update header section

* Bump description font size

* Improve perk display

* Improve details section

* Fix main image display

---------

Co-authored-by: dstrukt <gfxdsign@gmail.com>
2023-02-10 16:26:09 +01:00
57f5c15670 Merge pull request #4620 from btcpayserver/Kukks-patch-1 2023-02-10 09:45:30 +01:00
487faa69c6 Bump version 2023-02-10 09:40:03 +01:00
9148a1e564 fix #4570 2023-02-10 09:10:10 +01:00
4c3f5e1e1a fix #4618 2023-02-10 08:59:18 +01:00
b0bf0824dd Update db migration doc 2023-02-10 15:48:43 +09:00
dea5991e01 bump 2023-02-10 11:53:17 +09:00
739932a280 Changelog 2023-02-10 11:52:37 +09:00
1f8bc5b490 Add ability to migrate from MySQL and SQLite with EF (#4614) 2023-02-10 11:43:46 +09:00
753ffd401b BIP21 + LNURL fix (#4616)
In case of the unified invoice, the LNURL wasn't correct — with this change we are simply reusing th one that was issued on invoice creation instead of generating it anew on the fly.

Also fixes missing uppercasing for the QR code in case of non-unified QR.
And removes the `lightning:` scheme from the LNURL that's displayed to the user (unifies it with what we do for Onchain and Lightning)
2023-02-10 11:23:48 +09:00
0d1bab45a0 Fix MySQL migrations 2023-02-10 11:17:52 +09:00
17cc439de3 Merge pull request #4617 from dennisreimann/lnurl-cors
LNURL: Add missing CORS
2023-02-09 20:34:44 +01:00
5d03e300fb LNURL: Add missing CORS
In addition to #4587. Closes #4615.
2023-02-09 17:45:09 +01:00
a20408bed1 Fix crash for installations supporting zcash or monero (#4610) 2023-02-09 09:49:08 +09:00
ed0ccd6f13 Bump lightning lib, fix warnings 2023-02-08 21:29:20 +09:00
bb1138efb5 Catch exception when creating new invoice with GetLNURL 2023-02-08 20:45:05 +09:00
82b36aaca7 bump 2023-02-08 20:20:56 +09:00
688044429e Changelog 1.7.6 (#4606) 2023-02-08 20:14:51 +09:00
7bbfc8e6d4 Greenfield: Currency rate should be strings (#4607) 2023-02-08 19:18:37 +09:00
85513aa5c3 Make NFC built in (#4541)
* Make NFC built int

* support checkout v2

* uninstall old plugin

* fix lnurl in unified checkout

* fix tests

* fix tests

* fix old checkout unified qr

* clean up and make nfc submission more sturdy

* support topup invoices for lnurlw

* fix test

* Payment URI fixes

* Fix LNURL exclusion cases

* UI updates

* Adapt test

---------

Co-authored-by: Dennis Reimann <mail@dennisreimann.de>
2023-02-08 15:47:38 +09:00
67254cc30c Website is nullable. (#4604) 2023-02-07 12:04:13 +01:00
b055844973 Greenfield get app details (#4102)
* Add Greenfield API endpoints for retrieving app details

* add app items details

* Add GetPosApp and GetCrowdfundApp to LocalBTCPayServerClient

* Simplify POS app data items example

* Document app type enum

* make "RequiresRefundEmail" nullable

* remove "Template" and "PerksTemplate" fields
2023-02-07 17:01:53 +09:00
9ba03848f2 Small perf improvement when fetching exactly 1 payout by id 2023-02-07 16:53:44 +09:00
5b96ab89fd Fix Payout Mark Paid in UI (#4585)
fixes #4579
2023-02-07 16:51:20 +09:00
6a4d8f7404 Fix: Payjoin wasn't always properly choosing utxo for optimal change (#4600)
* Fix: Payjoin wasn't always properly choosing utxo for optimal change

* Update with timeout
2023-02-07 16:43:31 +09:00
219d03b8dd Fix: If PoS item code contains a /, LNUrl would not work (fix #4601) (#4602)
This is caused by a weird buggy behavior from ASP.NET Core concerning
path value decoding. (More information on
https://github.com/dotnet/aspnetcore/issues/14170#issuecomment-533342396)

This hasn't been fixed for a while, and the dotnet team keeps reporting
it over and over.
2023-02-06 18:17:17 +09:00
523654f2eb Upgrade Lightning lib (#4589)
Includes the updates from btcpayserver/BTCPayServer.Lightning#121.
2023-02-06 13:26:11 +09:00
b9b8cb9f63 Fix test 2023-02-06 12:38:18 +09:00
94f2cd4257 Server Theme: Allow to unset CustomThemeCssUri
It is necessary to have a way to unset the deprecated variable, to get access to the new way of uploading a theme file.
2023-02-04 17:24:19 +01:00
26248774c2 App domain redirect (#4391)
* Fix duplicates in GetAllApps with allowNoUser

* Use domain mapping as canonical reference and redirect to it

* Revert domain mapping to hostname instead of URL
2023-02-02 20:53:42 +09:00
99299ba06f bump nbx 2023-02-02 10:15:04 +01:00
6e42eaa26c fix plugin packer when relative path provided 2023-02-02 10:15:03 +01:00
ae7b621e3d Change Stores.DerivationStrategies to JSONB (#4573)
Gradually changing column from blobs to JSONB allow us to
later take advantages of more powerful queries on postgres.
2023-02-02 09:43:39 +09:00
f2ced20c42 Fix a bunch of open redirect (#4575) 2023-02-02 09:42:58 +09:00
e4f256d5cd Lightning Address: Fix availability check and refactor option view (#4584)
As @petzsch rightfully assumed in #4578, the check took only the last available LN payment method into account, which in this case was LN on LTC. We now pass the crypto code as well and I refactored the checks as well as the option view.

Fixes #4578.
2023-02-02 09:42:41 +09:00
ca1dac4cc3 Add missing CORS to ln address of BTCPay (Compatibility Beach Wallet) (#4587) 2023-02-02 09:40:31 +09:00
8fc2729fab Merge pull request #4580 from dennisreimann/disqus-csp
Fixes https://github.com/btcpayserver/btcpayserver/issues/4572
2023-02-01 13:12:11 +01:00
24c19efd52 Crowdfund: Add CSP rules for Disqus
Fixes #4572.
2023-01-31 22:13:45 +01:00
a3edd829a6 Add onchain wallet send ui extension 2023-01-31 16:49:41 +01:00
9ec475fa40 Fix PluginPacker crash 2023-01-31 23:24:20 +09:00
aad06c583e Greenfield: Add store rates api (#4550)
* Add store rates api

* Improve doc

---------

Co-authored-by: nicolas.dorier <nicolas.dorier@gmail.com>
2023-01-31 14:42:25 +09:00
f821e35cb0 Store branding: Unify public pages (#4568)
Closes #3842.
2023-01-30 09:23:49 +01:00
14313291d5 Make test less flaky by ordering GetApps query 2023-01-30 17:17:35 +09:00
b818352a04 Register rate providers in DI, so it can be accessed by plugins (#4551) 2023-01-30 09:46:12 +09:00
c0c34fbb41 Add GreenField endpoint for fetching all apps (#4462)
Co-authored-by: Nicolas Dorier <nicolas.dorier@gmail.com>
2023-01-30 09:42:24 +09:00
b372dc21d6 handle non built in tag attachments better 2023-01-27 15:44:21 +01:00
3d576cd06b Fix XSS on uploaded files to the file storage (#4567) 2023-01-26 19:12:06 +09:00
438dcc4c6f Add Greenfield API endpoint for pull payment LNURL items (#4472)
* Add Greenfield API endpoint for pull payment LNURL items

close #4365

* Rename GetLNURLs to GetPullPaymentLNURL

* update "ln-url-not-supported" to "lnurl-not-supported"

* remove hardcoding of "BTC"

* update "PullPayments_LNURL" to "PullPayments_GetPullPaymentLNURL"

* update description of 400 status code response

Co-authored-by: Nicolas Dorier <nicolas.dorier@gmail.com>
2023-01-26 14:43:07 +09:00
de4ac2c830 Greenfield: Add payments list endpoint (#4407)
Based on btcpayserver/BTCPayServer.Lightning#109
2023-01-26 13:22:49 +09:00
f46443a5e3 Add additional permission for pull payments (#4539)
* Add additional permission for pull payments

* Apply suggestions from code review
2023-01-26 09:46:05 +09:00
69e90b7ff1 Point of Sale: Improve merchant view (#4560)
* Point of Sale: Improve merchant view

Closes #3843.

* Trim bottom section

* Display App Name and Display Title next to each other

* Update views
2023-01-26 09:27:31 +09:00
5089ec9826 Merge pull request #4527 from dennisreimann/branding-new 2023-01-25 15:11:08 +01:00
372df93c18 bump 2023-01-25 12:42:40 +09:00
1d2ddeedde Changelog v1.7.5 (#4562)
Inclused updates until f10c1c4730cad394b4361263ffc71e501763f800.
2023-01-25 12:41:29 +09:00
4df2f1f756 Store Branding: Add custom CSS option 2023-01-24 13:24:17 +01:00
f10c1c4730 Checkout v2: UI fixes (#4552)
* Checkout v2: UI fixes

* Improve icon border
2023-01-24 21:00:04 +09:00
92b556e54f Load debug plugins in tests (#4555)
Equivalent to the loading code in Program.cs
2023-01-24 20:12:47 +09:00
b46ae7a651 Checkout v2: Re-add LNURL for top-up invoices (#4556)
My bad, this was excluded erroneously.

Co-authored-by: Nicolas Dorier <nicolas.dorier@gmail.com>
2023-01-24 18:10:38 +09:00
9f3a3c5f51 BIP21: Uppercase addresses only in QR, not in payment URL (#4553)
* BIP21: Uppercase addresses only in QR, not in payment URL

The uppercased address/BOLT11 should only be used for the QR code, the payment URI for the link should stay as it is.

References:

- #2110
- https://bitcoinqr.dev/

* Improve comments

* Add comments step by step

* Ensure correct delimiter

Co-authored-by: nicolas.dorier <nicolas.dorier@gmail.com>
2023-01-24 09:44:39 +09:00
b5071237fd Fix swagger file 2023-01-23 12:11:13 +01:00
1d2bebf17a Greenfield: Lightning addresses API (#4546)
* Greenfield: Lightning addresses API

* add docs

* Apply suggestions from code review

Co-authored-by: d11n <mail@dennisreimann.de>
2023-01-23 10:11:34 +01:00
9086822b94 Merge pull request #4549 from dennisreimann/pnxbet
Remove pnxbet as a supporter
2023-01-22 12:29:59 +01:00
d90d3c5a0f Remove pnxbet as a supporter
Closes #4543.
2023-01-21 20:51:36 +01:00
a3203e5775 Fix several HTML injections (#4545) 2023-01-21 19:08:12 +01:00
5f24b41250 Update Changelog, log restarts 2023-01-19 22:10:38 +09:00
b577c0adb7 Minor UI updates (#4530)
* Minor UI updates

* Lockout page fixes

Fix duplicate headline and model null-check
2023-01-19 18:08:34 +09:00
a9ad0fde9e After a plugin install or uninstall, restart now just kill the process instead of requiring SSH with docker install 2023-01-19 14:27:33 +09:00
9974b6070e Fix NRE in plugin list 2023-01-19 14:22:57 +09:00
bd5e4f3d94 fix NRE in plugins list 2023-01-18 13:47:15 +01:00
e0adb1133d Plugins: Add checkout-noscript-end UI extension point (#4532) 2023-01-18 13:38:58 +01:00
3cdb4f5b2a FileService: Null-check stored file before removal (#4535) 2023-01-18 13:38:37 +01:00
248401f534 Plugin assemblies shouldn't be unloadable 2023-01-18 16:46:08 +09:00
1228a06a90 Improve detection of plugin bricking an install on startup (#4533) 2023-01-18 14:15:27 +09:00
b5cd215643 Use AssemblyProduct rather than AssemblyTitle for default plugin name 2023-01-17 22:05:24 +09:00
7604667b55 Make sure plugin packer has all btcpay deps 2023-01-17 20:04:11 +09:00
3a278d8079 bump 2023-01-16 23:59:09 +09:00
adcc484528 Changelog v1.7.4 (#4513)
Includes commits until 798553e96afeb3aa7ddac125a830fde7a47be187.
2023-01-16 23:58:04 +09:00
798553e96a Greenfield: Add separate permission for viewing LN invoices (#4529)
Based on the diff by @ArttuPakarinen provided in #4523. Closes #4523.
2023-01-16 21:42:54 +09:00
068b717a75 Checkout v2: Configure countdown timer (#4471)
* Checkout v2: Configure countdown timer

This addresses feedback by @astupidmoose left [here](https://github.com/btcpayserver/btcpayserver/discussions/4308#discussioncomment-4438926): Make the countdown timer configurable with a minutes setting. This way the merchant has full control over when to display the timer. They could even set it to equal the invoice expiry, so that it is shown right from the beginning.

* Rename property and adjust wording

* Remove expiration percentage from Checkout v2
2023-01-16 20:45:19 +09:00
785cf597ad Redesign plugin list items (#4528)
* Redesign plugin list items

* Update icon and format code

Co-authored-by: Dennis Reimann <mail@dennisreimann.de>
2023-01-16 12:12:51 +01:00
ee70fe85c0 Fix loading of plugins in the plugin directory 2023-01-16 16:31:26 +09:00
2e31816979 Can load external plugins during dev to debug more easily (#4518)
* Can load external plugins during dev to debug more easily

* Add again load plugin by project reference

* Make sure we don't load same plugin twice
2023-01-16 10:37:17 +09:00
e4237c9511 Bump (Fix signature hash for some altcoins) 2023-01-16 10:11:33 +09:00
0bc6967dbc Greenfield: Add payment hash and preimage to Lightning invoices (#4520)
* Greenfield: Add payment hash and preimage to Lightning invoices

Closes #4475.

* Greenfield: Add payment hash and preimage to invoice payment method details

* Refactor LN payment method details retrieval
2023-01-13 17:29:41 +09:00
2301769419 Checkout v2: Display and copy addresses (#4489)
* Checkout v2: Display and copy addresses

Closes #4442.

* Refinements
2023-01-12 10:41:33 +09:00
42c5f732a2 Provide sensible default to BaseBTCPayServerPlugin (#4522)
A new plugin overriding BaseBTCpayServerPlugin need to override
Identifier, Name, Version, and Description by default.
This information is actually better saved in the .csproj of the plugin.
Using <Title>, <Description> and <Version> properties.
The identifier should match the assembly name as we assume at several
places than a single plugin is a single dll.
2023-01-11 22:35:45 +09:00
2428b564fd Fix: Version numbers in UI appeared with a suffix zero x.x.x.0 instead of x.x.x (#4521) 2023-01-11 18:24:51 +09:00
bb0e96a163 Apply store ids and search term to invoice export (#4516)
This makes the export work like the list in the UI. Exports what one sees.

Fixes #4514.
2023-01-11 13:36:03 +09:00
bb733c5811 Unify 2FA login boxes (#4506)
* Unify 2FA login boxes

* 2FA setup: Make auth code copyable
2023-01-09 16:38:03 +01:00
ffeaf55c4e add extension points for dashboard (#4483) 2023-01-09 14:07:05 +01:00
a12bb1d9ce Update license (#4480) 2023-01-06 16:19:02 +01:00
313f2a667e Summernote: Allow Twitter embeds (#4488)
Bitcoin Ekasi is planning a crowdfund and they want to embed their Twitter timeline into the page. This adds the necessary domains to the SUmmernote iframe whitelist.
2023-01-06 22:22:49 +09:00
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
3fa28bb46d Upgrade Lightning lib (#4503) 2023-01-06 22:08:03 +09:00
eb90fab640 LNURL updates (#4501) 2023-01-05 14:41:18 +01:00
099d65032a Checkout: Fix language dropdown cutoff (#4486)
Fixes #4452 — this time for real. See [this comment](https://github.com/btcpayserver/btcpayserver/issues/4452#issuecomment-1366580849).
2023-01-02 12:09:46 +01:00
e96feb36cd Sync modal: Adjust to Bootstrap changes (#4485)
Fixes #4484.
2022-12-31 09:24:29 +01:00
eb6d01c21e Updates preferred price source copy label (#4492)
* ui+create: updates preferred price source copy label

* Add test case

Co-authored-by: d11n <mail@dennisreimann.de>
2022-12-31 09:24:10 +01:00
03d7dc8971 Ensure only valid non-negative numbers in tip input (#4481)
close #4478
2022-12-27 20:03:31 +01:00
09d5f5a083 Bump version 2022-12-23 17:54:42 +09:00
1a41b3fb64 Bump NBitcoin 2022-12-23 17:28:44 +09:00
f958550061 Fix tests 2022-12-23 17:21:18 +09:00
1e8e7ec4a4 Fix build 2022-12-23 17:17:09 +09:00
83c4e38fa5 Update NBitcoin 2022-12-23 17:15:14 +09:00
607d2fedb7 Changelog v1.7.3 (#4469)
Includes commits up to 627ada56b753e3da46a0db45690d689b050d085a
2022-12-23 17:13:54 +09:00
627ada56b7 Checkout v2: Minor view improvements (#4473) 2022-12-23 17:04:42 +09:00
9ce06fdc4e Update lightning libs (Fix #4458) 2022-12-23 17:03:37 +09:00
bb63ae6d87 fixes language dropdown cutoff on checkout page (#4465)
* fixes language dropdown cutoff on checkout page

* Use min-height class to fix the tests

Co-authored-by: d11n <mail@dennisreimann.de>
2022-12-22 20:31:08 +01:00
a4182621da Update persian 2022-12-22 22:30:18 +09:00
0534261759 Fix wallet transaction info merging logic and compute color as fallback for labels to not crash 2022-12-22 14:17:23 +01:00
c7baa66a4d Bump lightning lib (Fix #4383) 2022-12-22 22:01:23 +09:00
1732606581 Automated payout processors shouldn't spam logs on shutdown (Fix #4193) 2022-12-22 20:33:50 +09:00
68cdd2c2c8 Cleanups: Move test plugin to Plugins subdirectory (#4463)
* Remove unused js-scroll-trigger classes

* Move test plugin to Plugins subdirectory
2022-12-22 15:09:12 +09:00
ea03b6c19c Make checkout CSS and logo paths relative (#4354)
* Make sure custom logo and CSS paths are relative

* match request host and scheme before replacing

* Fix the issue for greenfield as well

Co-authored-by: nicolas.dorier <nicolas.dorier@gmail.com>
2022-12-22 15:05:56 +09:00
b83eb41df3 Frontend cleanups (#4449)
* Update some buttons

* Potential flaky test fix

* Dark theme: Fix primary accent color

* Pay Button: Remove unused clipboard dependency

The pay button uses the cope-to-clipboard.js

* Remove babel-polyfill

Browser-support should be good by now.

* Remove unused jquery-easing scripts

* Remove unused CSS
2022-12-20 23:11:22 +09:00
e6c68dc5bc Checkout: Fix modal iframe clipboard permissions (#4453)
* Checkout: Fix modal iframe clipboard permissions 

WebKit-based browser require a [permissions policy](https://web.dev/async-clipboard/#permissions-policy-integration) to be set on the iframe element. See the discussions [here](https://github.com/btcpayserver/btcpayserver/discussions/4308#discussioncomment-4399342) and [on Mattermost](https://chat.btcpayserver.org/btcpayserver/pl/z7kdgidcjtnd8f5zs5648t1dhe).

* Updates from code review
2022-12-20 22:54:47 +09:00
76a953819e Add persian language back (#4457) 2022-12-20 22:01:29 +09:00
3a2ad48bd6 Checkout v2: Reduce Altcoin name on payment method pill (#4456)
Closes #4455.
2022-12-19 16:06:43 +09:00
674d5bae8a Make sure payment request print view doesn't show table header twice (#4447) 2022-12-17 08:00:35 +01:00
5e983641b6 bump 2022-12-16 17:39:14 +09:00
96d4665880 Changelog for v1.7.2
Prepared changelog up to 889ddf6a385748b1ac357312798ae5bdb74b9261
2022-12-16 08:44:38 +01:00
889ddf6a38 Add links to docs and API in the footer (#4431)
* Add links to docs and API in the footer

* Update icons

Co-authored-by: Dennis Reimann <mail@dennisreimann.de>
2022-12-16 08:41:58 +01:00
158e613e29 Plugins built with newer version of BTCPay couldn't run on older version (#4441) 2022-12-15 16:24:03 +09:00
255c52db26 Upgrade Lightning and ChromeDriver (#4440) 2022-12-15 15:26:25 +09:00
072c81177f Add store logo to invoice receipt page (#4435) 2022-12-15 06:49:33 +01:00
e5c7fc93e2 fix inconsistent result of labels in greenfield compared to ui wallets tx list 2022-12-14 15:57:18 +01:00
5b7b217b9c update lnurl to fix #4393 2022-12-14 15:45:22 +01:00
06cedaef4b Disabled amount/currency update for payment request with active invoices (#4390)
* Disabled amount/currency update for payment request with active invoices

close #4241

* Check amount isn't changed in backend

* Add test case

* Update BTCPayServer/Controllers/GreenField/GreenfieldPaymentRequestsController.cs

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

* Update BTCPayServer/Controllers/UIPaymentRequestController.cs

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

* Improve wording

Co-authored-by: nicolas.dorier <nicolas.dorier@gmail.com>
Co-authored-by: Dennis Reimann <mail@dennisreimann.de>
2022-12-14 14:01:48 +09:00
6972e8a3db UI: Theme extensions (#4398)
* Theme extensions

Adds the ability to choose the themeing strategy: Extend one of the existing themes (light or dark) or go fully custom. The latter was the only option up to now, which isn't ideal:

- One had to provide a full-blown theme file overriding all variables
- Tedious, error prone and hard to maintain, because one has to keep track of updates

This PR makes it so that one can choose light or dark as base theme and do modifications on top.

Benefit: You can specify a limited set of variables and might get away with 5-20 lines of CSS.

* Ensure custom theme is present

* Update checkout test
2022-12-14 13:37:31 +09:00
18ba0148ae Use better default than coingecko when creating a new store (#4416)
* Use better default than coingecko when creating a new store

* Improve recommended exchange UX

* Add btcturk for TRY

* Fix recommendation

Co-authored-by: Dennis Reimann <mail@dennisreimann.de>
2022-12-14 13:33:27 +09:00
dea019ebdc Add DefaultDescription to LNUrl withdrawal request (#4434)
close #4254
2022-12-14 13:32:50 +09:00
e27e93aa9a Add BTCTurk rate provider (#4433) 2022-12-14 13:14:19 +09:00
c9ee7d477d Fix bitbank and yadio rate providers (#4432) 2022-12-14 12:49:30 +09:00
e9deb13ce4 Allow more then 20 accounts when using BTCPayServer.Vault (#4430)
Closes #4410.
2022-12-14 12:06:54 +09:00
cdac238f6d [Greenfield]: Add DescriptionHashOnly to include a description hash in the BOLT11 (#4411)
* [Greenfield]: Add DescriptionHashOnly to include a description hash in the BOLT11

* Add CLN test case

* Improve description in Swagger file

Co-authored-by: Dennis Reimann <mail@dennisreimann.de>
2022-12-13 18:56:33 +09:00
e2c5e2c7fb Remove system plugins from the plugin list (#4429) 2022-12-13 18:54:41 +09:00
0c3f819200 Have address wallet objects rather than script objects (#4417) 2022-12-13 09:09:25 +09:00
3673230fdf Add missing margin 2022-12-12 21:45:41 +01:00
f2cb07ac95 Local file system storage as default (#4386)
* Local file system storage as default

Checks whether or not a file storage has been set. If not, it sets the local file system storage as default.

* Ensure check gets run
2022-12-12 20:28:24 +09:00
484cf9d8a2 PayButton: Fix CSP problems in Firefox (#4376)
* PayButton: Fix CSP problems in Firefox

Firefox does not support [`unsafe-hashes`](https://caniuse.com/?search=unsafe-hashes), so I figured it might be best to get rid of the inline event handlers in general.

Closes #4325.

* Account for multiple paybuttons on one page
2022-12-12 20:27:26 +09:00
5b20be8cfd Checkout fixes (#4425)
* Fix spinner partial usage in Checkout v1

* Update v2 tests
2022-12-10 19:19:13 +09:00
4dbe622a4a Checkout v2: Enable cheating mode on results view (#4418) 2022-12-08 14:20:01 +01:00
9a4dec57d1 Generate a wallet object for all scripts, save source in generatedBy rather than receive label (#4413) 2022-12-08 13:16:18 +09:00
f5c5178f95 Lock user: Improve return code and fix docs (#4377)
* Lock user: Improve return code and fix docs

The docs state that the `DELETE` method should be used, though the controller wants `POST`. The latter seems appropriate here, as the action can be used for locking and unlocking.

Also adapted the action to return a status code based on the actual outcome of the user toggle call.

Closes #4310.

* Update clients
2022-12-07 19:01:50 +01:00
727cf84080 Fix wallet object script should have script hex as id 2022-12-07 20:26:50 +09:00
80a257e85f Fix Output Descriptor parsing for WSH multisig case (#4402)
* Fix Output Descriptor parsing for WSH multisig case

Reuse existing function for extracting from a multisig descriptor, instead of recursively parsing the inner output descriptor. The latter would run into invalid cases, because it'd be interpreted as bare multisig, which supports only up to three public keys. 

For further details see MetacoSA/NBitcoin#1151.

* Add CanParseDerivationSchemes test
2022-12-07 20:18:17 +09:00
ad3c15df9b Fix mobile nav (#4409) 2022-12-06 22:52:37 +01:00
c665bd2321 Bump clightning (#4406) 2022-12-06 22:15:06 +09:00
948bae9f95 Wallet import: Surface detailed error messages (#4392)
* Wallet import: Surface detailed error messages

Similar to #4205, this checks if the input is an output descriptor and display more detailed information about why an import might fail.

* Add test cases
2022-12-05 17:06:05 +09:00
a1c10b4ea3 Fix store selector transition (#4400) 2022-12-05 08:47:51 +01:00
f36df81d9a bump lightning lib (Fix #4245) 2022-12-05 11:37:03 +09:00
2fd9eb6c68 Adapt ln payouts to handle unknown status (#4382)
Co-authored-by: d11n <mail@dennisreimann.de>
2022-12-04 13:23:59 +01:00
8894d14130 Upgrade Bootstrap to v5.2.3; Design System improvements (#4380) 2022-12-04 10:01:38 +01:00
4039e74a82 Do not run label migration for new instances 2022-12-01 19:09:51 +09:00
0af3faf6ff Wallet object scripts (#4301)
* Wallet object scripts

* Adjust comment

Co-authored-by: nicolas.dorier <nicolas.dorier@gmail.com>
2022-12-01 09:54:55 +09:00
0520b69c18 Update Changelog 2022-11-29 11:55:59 +09:00
e11a775bed fix migration 2022-11-29 11:29:35 +09:00
b4ed4623e1 bump 2022-11-29 11:20:14 +09:00
9ee9653c7d Checkout fixes (#4375)
* Round buttons on results view

* Checkout v2: Fix for BIP21 case with LN as default payment method

Fixes #4352.

* Update changelog

* Add test for fix
2022-11-29 11:19:23 +09:00
e55a16d917 bump bitcoin core in tests (#4374) 2022-11-28 22:18:19 +09:00
3458a0b22c Changelog 1.7.1 2022-11-28 21:08:33 +09:00
ddcfa735e0 Improve documentation of Refund API in Greenfield (#4372) 2022-11-28 20:58:18 +09:00
3370240541 Udpate langs 2022-11-28 20:57:31 +09:00
c0cec4716e Fix error HTTP 500 happening on Point of Sale (Fix: #4355) (#4368) 2022-11-28 20:50:09 +09:00
08b239e87a Change some table type from TEXT to JSONB (#4371)
* Change some table type from TEXT to JSONB

* Deprecate mysql and sqlite backend
2022-11-28 20:36:18 +09:00
84132e794a POS: Fix manifest (#4373)
- Manifest v1 doesn't support HEX colors
- Make icon URLs absolute

Closes #4363.
2022-11-28 20:35:52 +09:00
425d70f261 Add Greenfield invoice refund endpoint (#4238)
* Add Greenfield invoice refund endpoint

See discussion here: https://github.com/btcpayserver/btcpayserver/discussions/4181

* add test

* add docs
2022-11-28 17:53:08 +09:00
420954ed00 Add metadata to invoice webhook event (#4370)
close #4223
2022-11-28 17:50:52 +09:00
45edd330f5 Fix logos when rootPath is used (#4367)
* Fix logos when rootPath is used

* Fix close buttons used in JS

Co-authored-by: Dennis Reimann <mail@dennisreimann.de>
2022-11-28 09:25:18 +01:00
6a0e2bcad3 Adjust currency name to be standard (#4369) 2022-11-28 15:00:35 +09:00
d67d3e0167 Small README changes (#4361) 2022-11-27 23:35:29 +09:00
cd4f3d9a66 Fix: Calling GetPayment more than once on aLND client would fail 2022-11-26 22:42:08 +09:00
5c6db35c9b Cleanups (#4351) 2022-11-26 13:01:00 +09:00
887bea4328 bump BTCPayServer.Client 2022-11-26 00:22:09 +09:00
def5095d77 Changelog for v1.7 (#4288)
Includes updates from v1.6.12 to a6ee92fbd59a702dd56520126b4aea82d54cfb6c.
2022-11-25 22:37:20 +09:00
ab66662ff6 Update What's New (#4309)
Add v1.7 info and hide the button in case the store isn't set up, yet.

Closes #4305.
2022-11-25 22:31:59 +09:00
2d84433a62 bump 2022-11-25 22:26:29 +09:00
b8e61787d4 Merge pull request #4350 from btcpayserver/woirnew
Some adjustment for Forms
2022-11-25 22:22:25 +09:00
669825a35d Ensure redirecturl is local for form builder 2022-11-25 19:28:46 +09:00
31b25ca169 Propagate the ModelState errors on dynamic forms 2022-11-25 18:32:40 +09:00
a6ee92fbd5 Update incorrect "monitoringTime" field for invoice API docs (#4348) 2022-11-25 09:12:55 +01:00
5ff1a59a99 Make sure the form is properly validated 2022-11-25 16:11:13 +09:00
4f65eb4d65 Remove dead code, fix dups form value 2022-11-25 15:14:54 +09:00
39328c7368 Rename walletobjects Parent/Child to A/B (#4347) 2022-11-25 12:06:57 +09:00
2f5f3e1b51 Do not enable receipts for payment requests (#4342)
Payment requests have a receipt-ish style by default. Receipts for each individual invoice of a payment request can be quite confusing as individually they do not prove the pay request was settled.
2022-11-25 11:04:34 +09:00
022285806b Form Builder (#4137)
* wip

* Cleanups

* UI updates

* Update UIFormsController.cs

* Make predefined forms usable statically

* Add support for pos app + forms

* pay request form rough support

* invoice form through receipt page

* Display form name in inherit from store setting

* Do not request additional forms on invoice from pay request

* fix up code

* move checkoutform id in checkout appearance outside of checkotu v2 toggle

* general fixes for form system

* fix pav bug

* UI updates

* Fix warnings in Form builder (#4331)

* Fix build warnings about string?

Enable nullable on UIFormsController.cs
Fixes CS8632 The annotation for nullable reference types should only be used in code within a '#nullable' annotations context.

* Clean up lack of space in injected services in Submit() of UIFormsController.cs

* Remove unused variables (CS0219) and assignment of nullable value to nullable type (CS8600)

* Cleanup double semicolons while we're at tit

* Fix: If reverse proxy wasn't well configured, and error message should have been displayed (#4322)

* fix monero issue

* Server Settings: Update Policies page (#4326)

Handles the multiple submit buttons on that page and closes #4319.

Contains some UI unifications with other pages and also shows the block explorers without needing to toggle the section via JS.

* Change confirmed to settled. (#4328)

* POS: Fix null pointer

Introduced in #4307, the referenced object needs to be `itemChoice` instead of `choice`.

* Add documentation link to plugins (#4329)

* Add documentation link to plugins

* Minor UI updates

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

* 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>

* Remove invoice and store level form

* add form test

* fix migration for forms

* fix

* make pay request form submission redirect to invoice

* Refactor FormQuery to only be able to query single store and single form

* Put the Authorize at controller level on UIForms

* Fix warnings

* Fix ef request

* Fix query to forms, ensure no permission bypass

* Fix modify

* Remove storeId from step form

* Remove useless storeId parameter

* Hide custom form feature in UI

* Minor cleanups

* Remove custom form options from select for now

* More minor syntax cleanups

* Update test

* Add index - needs migration

* Refactoring: Use PostRedirect instead of TempData for data transfer

* Remove untested and unfinished code

* formResponse should be a JObject, not a string

* Fix case for Form type

Co-authored-by: Dennis Reimann <mail@dennisreimann.de>
Co-authored-by: JesterHodl <103882255+jesterhodl@users.noreply.github.com>
Co-authored-by: Nicolas Dorier <nicolas.dorier@gmail.com>
Co-authored-by: Andreas Tasch <andy.tasch@gmail.com>
2022-11-25 10:42:55 +09:00
bb60c2ac48 Checkout v2: Minor fixes (#4345)
* Do not show remaining amount for topup invoices in expiry message

As [reported by @petzsch](https://chat.btcpayserver.org/btcpayserver/pl/gg1zy8t5h3dq7nme1nom93migo).

* Fix links on result page in Checkout Classic

Closes #4344.

* Better way to exclude Lightning if BIP21 is active and we have both PMs


Unify margins
2022-11-24 23:14:56 +09:00
a4ee1e9805 Checkout v2 finetuning (#4276)
* Indent all JSON files with two spaces

* Upgrade Vue.js

* Cheat mode improvements

* Show payment details in case of expired invoice

* Add logo size recommendation

* Show clipboard copy hint cursor

* Improve info area and wording

* Update BIP21 wording

* Invoice details adjustments

* Remove form; switch payment methods via AJAX

* UI updates

* Decrease paddings to gain space

* Tighten up padding between logo mark and the store title text

* Add drop-shadow to the containers

* Wording

* Cheating improvements

* Improve footer spacing

* Cheating improvements

* Display addresses

* More improvements

* Expire invoices

* Customize invoice expiry

* Footer improvements

* Remove theme switch

* Remove non-existing sourcemap references

* Move inline JS to checkout.js file

* Plugin compatibility

See Kukks/btcpayserver#8

* Test fix

* Upgrade vue-i18next

* Extract translations into a separate file

* Round QR code borders

* Remove "Pay with Bitcoin" title in BIP21 case

* Add copy hint to payment details

* Cheating: Reduce margins

* Adjust dt color

* Hide addresses for first iteration

* Improve View Details button

* Make info section collapsible

* Revert original en locale file

* Checkout v2 tests

* Result view link fixes

* Fix BIP21 + lazy payment methods case

* More result page link improvements

* minor visual improvements

* Update clipboard code

Remove fallback for old browsers. https://caniuse.com/?search=navigator.clipboard

* Transition copy symbol

* Update info text color

* Invert dark neutral colors

Simplifies the dark theme quite a bit.

* copy adjustments

* updates QR border-radius

* Add option to remove logo

* More checkout v2 test cases

* JS improvements

* Remove leftovers

* Update test

* Fix links

* Update tests

* Update plugins integration

* Remove obsolete url code

* Minor view update

* Update JS to not use arrow functions

* Remove FormId from Checkout Appearance settings

* Add English-only hint and feedback link

* Checkout Appearance: Make options clearer, remove Custom CSS for v2

* Clipboard copy full URL instead of just address/BOLT11

* Upgrade JS libs, add content checks

* Add test for BIP21 setting with zero amount invoice

Co-authored-by: dstrukt <gfxdsign@gmail.com>
2022-11-24 08:53:32 +09:00
bf0a8c1e62 Fix flaky test ln payout (#4334) 2022-11-23 21:02:47 +09:00
d2b10ef4e6 CanUseTorClient fail no more 2022-11-22 21:58:15 +09:00
9f3fca8fd7 Show the git commit of the current build of BTCPay (#4320)
* Show the git commit of the current build of BTCPay

* Fix build

Co-authored-by: d11n <mail@dennisreimann.de>
2022-11-22 21:37:07 +09:00
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
d959f5096b Add documentation link to plugins (#4329)
* Add documentation link to plugins

* Minor UI updates

Co-authored-by: Dennis Reimann <mail@dennisreimann.de>
2022-11-22 11:06:23 +01:00
bd3710a60f Merge pull request #4327 from btcpayserver/dennisreimann-patch-1 2022-11-22 06:58:10 +01:00
3d43f3a2b3 Change confirmed to settled. (#4328) 2022-11-22 11:10:21 +09:00
6194c156bd Server Settings: Update Policies page (#4326)
Handles the multiple submit buttons on that page and closes #4319.

Contains some UI unifications with other pages and also shows the block explorers without needing to toggle the section via JS.
2022-11-22 10:27:27 +09:00
850c26dc13 POS: Fix null pointer
Introduced in #4307, the referenced object needs to be `itemChoice` instead of `choice`.
2022-11-21 22:07:46 +01:00
eda0f7327e fix monero issue 2022-11-21 19:55:19 +01:00
bf597495ff Fix: If reverse proxy wasn't well configured, and error message should have been displayed (#4322) 2022-11-21 19:32:19 +01:00
20025f254c Use the plugin builder website instead of docker to fetch plugins (#4285) 2022-11-21 10:23:25 +09:00
ec76acd3a6 Code analysis (#4293)
* Enable NETAnalyzers for whole project

- remove obsolete analyzers so that the .NET Core SDK NETAnalyzers can be used
- enable NETAnalyzers for all projects so that developers can use them by defining the AnalysisMode on individual projects

This is because if we set AnalysisMode to minimal, recommended or all it would spam with warning.
The idea is to be able to turn them on during development to fix recommended stuff without polluting the build output.

Following commits will implement some of the Code Analysis findings

* Performance hints for using char overloads for single characters (CA1834 and CA1847)

CA1834: Use StringBuilder.Append(char) for single character strings
CA1847: Use string.Contains(char) instead of string.Contains(string) with single characters
2022-11-20 17:42:36 +09:00
1e2acfb296 Disable internal node options if no internal node configured (#4315) 2022-11-20 14:22:36 +09:00
2bd4a680ad Fix tests 2022-11-20 14:19:48 +09:00
4ce504a1e1 Add index to WalletObjects + allow additional queries 2022-11-19 23:39:41 +09:00
d2f071b8b2 Make store creation field same width (#4311)
* Make store creation field same width

Closes #4306.

* Update CreateStore.cshtml
2022-11-19 11:29:34 +01:00
fdbd7b977a Merge pull request #4312 from btcpayserver/non-admin-wallet-warning
Refine non-admin wallet warning copy
2022-11-19 09:44:22 +01:00
d19961b7a0 Refine non-admin wallet warning copy
As [discussed on Mattermost](https://chat.btcpayserver.org/btcpayserver/pl/us4kscqsw7rzmnng7aarxczd5r).
2022-11-18 22:12:53 +01:00
c156254600 Validate cart cost with explicit amount 2022-11-18 16:50:26 +01:00
9b5c6ece90 Refactor walletobj API, make wallet object graph directionless (#4297) 2022-11-19 00:04:46 +09:00
bf91efc756 Add Lightning Service Torq (#4296) 2022-11-18 12:19:01 +01:00
a253fd5001 Small doc improve 2022-11-18 14:22:59 +09:00
52af129c8b Add crowdfund app create endpoint (#4068)
* Add crowdfund app create endpoint

* replace DateTimeJsonConverter with NBitcoin.JsonConverters.DateTimeToUnixTimeConverter

* Use DateTimeOffset instead of DateTime

* Use array instead of CSV

* update "startDate" and "endDate" docs definition

* update docs
2022-11-18 14:20:07 +09:00
3942463ac9 UI: Unify payment request list with invoices (#4294)
Some quick win updates to the payment requests list that unify the display with the invoices list:

- Status is displayed as badge
- Amount is properly formatted
- Expiry date format and ability to switch to relative date
2022-11-18 13:24:57 +09:00
ff572eef7f Use constants rather than magic strings in transaction attachments 2022-11-17 10:24:49 +09:00
2740dfea87 Greenfield: Wallet Objects (#4274)
Co-authored-by: Nicolas Dorier <nicolas.dorier@gmail.com>
2022-11-16 12:11:17 +09:00
324112b73b Receipts: Fix amount paid discrepancy (#4287)
Displays the actual amount paid instead of the total invoice price. Fixes #4242.
2022-11-16 11:35:49 +09:00
1d7dee8314 Fix NRE and do nto activate onchain if node unavailable even when lazy payments (#4291)
fixes #4289
2022-11-16 09:04:51 +09:00
2d23819944 Greenfield: Allow marking payout status and payment proofs (#4244)
This allows external services to integrate with the payouts system to process payouts. This is also  a step to allow plugins to provide payout processors.

* It provides the payment proof through the greenfield payoust api.
* It allows you to set the state of a payout outside of the usual flow:
  * When state is awaiting payment, allow setting to In progess or completed
  * When state is in progress, allow setting back to awaiting payment
2022-11-15 18:40:57 +09:00
17f3b4125b Add option to customize the instance logo (#4258)
* Add option to customize the instance logo


Custom logo for BTCPay instances

* Incorporate SVGUse helper
2022-11-14 22:29:23 +09:00
c8a1024e24 Remove dead shitcoin MUE 2022-11-14 15:59:41 +09:00
9a2d2e2d89 Confirm modal: Prevent form submit without confirmation (#4262)
Fixes https://github.com/btcpayserver/btcpayserver/issues/4259
2022-11-13 12:38:13 +01:00
b7af234427 Payment Request: Fix invoice creation
Fix and test for a regression introduced with #4243: As the `PayPaymentRequest` action allows anonymous access, the `CookieAuthorizationHandler` isn;t run and hence the `GetCurrentStore` returns `null`.

This leads to an exception when creating the invoice. Store needs to be fetched seperately - like [before](4bbc7d9662 (diff-bdc264670a171e862d09fdf1a1c9f3ca14b41982a3c4c8e66d4f780cdde9f21dL241)).
2022-11-10 18:23:41 +01:00
a374e351e2 Use PluginLoader in the Plugin packer to prevent conflicts (#4277) 2022-11-09 15:28:16 +01:00
562f88555c Lightning: Better handling for non-public nodes (#4263)
Fixes #4246. 

`LightningLikePaymentHandler.GetNodeInfo` needed the `throws` argument to handle the cases as previously, otherwise the catch case in `ShowLightningNodeInfo` never occured.

State with this PR: A node can be available, but not have any public addresses. The latter will now be reported when testing the connection and on the public node info page.
2022-11-05 12:21:24 +01:00
167c5297fa Merge pull request #4268 from dennisreimann/supporters
Supporters: Remove Nomics; add SVGs for README
2022-11-05 12:17:11 +01:00
b281d09694 Bumping LND to 0.15.4-beta-1 (#4271)
* Bumping LND to 0.15.4-beta-1

* Bump LND in Altcoin docker-compose

Co-authored-by: Dennis Reimann <mail@dennisreimann.de>
2022-11-05 12:15:04 +01:00
853a0ac5ea Remove old/unused images 2022-11-03 21:58:53 +01:00
ea948cfc3f Optimize SVGs 2022-11-03 21:55:11 +01:00
fdd13390fb Merge pull request #4267 from dennisreimann/fix-4266
Fix wording
2022-11-03 19:57:34 +01:00
b2f6f8b3c1 Supporters: Remove Nomics; add SVGs for README
The `img/readme` directory contains SVGs for the README, so that we can from now on use one markup for the supporters in all README files across our repositories. 

With these, we could finally get rid of the table layout for the supporters section in the README. This will make it much easier to maintain those.
2022-11-03 19:37:13 +01:00
cd12162b6f Fix wording
Closes #4266.
2022-11-03 13:13:03 +01:00
79717d1d64 Sync modal improvements (#4260) 2022-11-02 16:55:05 +01:00
e56cbf0baa Greenfield: Graceful return for in-flight HTLCs (#4252)
* Greenfield: Graceful return for in-flight HTLCs

Based on btcpayserver/BTCPayServer.Lightning#106 this closes #3781.

* Update descriptions
2022-11-02 21:03:34 +09:00
05232414ad Improve LN balance details toggle (#4253) 2022-11-02 18:48:23 +09:00
4bbc7d9662 [Greenfield] Can create an invoice for a payment request via Greenfield (#4243)
* [Greenfield] Can create an invoice for a payment request via Greenfield

* Add allowPendingInvoiceReuse so payment request invoices can be reused

* Add PayPaymentRequest to the LocalBTCPayServerClient

* Allow amount to be specified if same as PR amount
2022-11-02 18:41:19 +09:00
3805b7f287 Checkout v2 (#4157)
* Opt-in for new checkout

* Update wording

* Create invoice view update

* Remove jQuery from checkout testing code

* Checkout v2 basics

* WIP

* WIP 2

* Updates and fixes

* Updates

* Design updates

* More design updates

* Cheating and JS fixes

* Use checkout form id whenever invoices get created

* Improve email form handling

* Cleanups

* Payment method exclusion cases for Lightning and LNURL

TODO: Cases and implementation need to be discussed

* Introduce CheckoutType in API and replace UseNewCheckout in backend

Co-authored-by: nicolas.dorier <nicolas.dorier@gmail.com>
2022-11-02 18:21:33 +09:00
63620409a9 Allow config to set default block explorer link (#4249)
This logic can potentially be inside BlockExplorerLinkStartupTask instead but it's not a big deal imo
2022-10-31 11:41:31 +09:00
ba423a79e3 Fix Public Node Info View
As the Node Info was used as an ID, this didn't work with IPv6 addresses, as those contain characters not suitable for HTML IDs.

Fixes #4245.

Also: Simplify the head section of that view by reusing the existing partial.
2022-10-30 11:23:09 +01:00
8806ba76eb Fix: On some circumstances, clicking on cancel invoice and pay button in PaymentRequest would throw an exception 2022-10-27 15:50:35 +09:00
9e73260230 Fix: Invoice's orderId equals to payreq id shouldn't appear part of the payreq 2022-10-27 13:17:18 +09:00
c0125b83d1 UI: Improve access token pairing (#4237)
Closes #4133.
2022-10-27 08:57:54 +09:00
1fa297fb73 Add donate link (#4239)
* Add donate link

Closes #4173.

* Simplify wording
2022-10-27 08:56:44 +09:00
57557748e2 Greenfield: Fix missing payment data (#4233)
* Greenfield: Fix missing payment data

Fixes #4229.

* Client: Return payment data from PayLightningInvoice

* Add test for PayLightningInvoice response
2022-10-27 08:56:24 +09:00
8b79212a6e [Greenfield] Fix: The route to connect to a peer lightning node was always crashing 2022-10-26 13:35:04 +09:00
f4af4ec4dc Fix OpenAPI 3.0 validation errors and warnings (#4235) 2022-10-25 20:37:36 +09:00
2e150f4bf4 Checkout: Fix Order ID text overflow (#4232)
Fixes #4230. Thanks for the pointer @handsomelatino!
2022-10-25 10:46:00 +09:00
4f4aa051c9 Add missing route parameter in /api/v1/stores/{storeId}/users swagger (See #4231) 2022-10-24 16:33:42 +09:00
da1dd7448e Add warnings in btcpay vault page for safari and brave (Fix https://github.com/btcpayserver/BTCPayServer.Vault/issues/54) (#4226)
* Add warnings in btcpay vault page for safari and brave (Fix https://github.com/btcpayserver/BTCPayServer.Vault/issues/54)

* Apply suggestions from code review

Co-authored-by: d11n <mail@dennisreimann.de>
2022-10-21 09:13:36 +02:00
0fd47eeee0 Asset-bundle cleanups (#4225)
Some cleanups in addition to #4222.
2022-10-21 09:17:06 +09:00
54c9d7283a Fix: PayjoinController could throw HTTP 500 of a few corner cases (#4215) 2022-10-20 11:19:48 +09:00
848db5f7de Remove the bundle minifier (#4222) 2022-10-20 11:17:42 +09:00
5fb32fe0e9 Remove some debug code 2022-10-19 13:06:15 +09:00
adf5b4ca0c Fix sync modal z-index 2022-10-18 21:00:54 +02:00
16bfb1dbfe Bump libraries (#4219) 2022-10-18 23:58:28 +09:00
e5421b8a9f Add script to create a regtest multisig wallet for testing (#4204)
* Add script to create a regtest multisig wallet for testing

* Unload wallets to prevent having to specify wallet in BTCPay, NBXplorer
2022-10-17 20:57:09 +09:00
f9f1a22e3b Store settings: Add branding options (#4131)
* Add logo upload

* Add brand color definition

* Cleanups

* Add logo to store selector

* Improve brand color handling

* Update color input

* Add logo dimensions hint

* Fixes

* Fix pattern and warning in js logs for color validation

* Fix condition, add test

Co-authored-by: nicolas.dorier <nicolas.dorier@gmail.com>
2022-10-17 12:16:29 +02:00
9533809631 Bump NBitcoin (Fix #4212) 2022-10-17 18:47:49 +09:00
6d7c11f1b1 Greenfield: Get Lightning invoices (#4180)
* Greenfield: Get Lightning invoices

Matching the data added in btcpayserver/BTCPayServer.Lightning#98 and btcpayserver/BTCPayServer.Lightning#99.

* Small adjustments

Co-authored-by: nicolas.dorier <nicolas.dorier@gmail.com>
2022-10-17 09:51:15 +02:00
0286c72256 Do not crash startup if ssh settings aren't correct 2022-10-14 14:51:05 +09:00
763aaa2926 UI: Fix checkbox flex-shrink (#4209)
Closes #4207.
2022-10-13 22:48:45 +09:00
ae4af7dd13 Bumping LND to 0.15.2-beta (#4211) 2022-10-13 09:40:07 +02:00
4ae2ea32e9 UI: Fix missing timezone in browser dates (#4210)
Fix for an issue brought up by @petzsch in todays dev meeting.
2022-10-13 09:29:30 +02:00
434298cba6 Greenfield: Store Rates Config (#3931)
* Greenfield: Store Rates Config

* FIX SWAGGER

* rebase fix

* Apply suggestions from code review

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

* Update BTCPayServer/wwwroot/swagger/v1/swagger.template.stores-rates-config.json

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

* Fix: Spread isn't converted from/to percentage, rename some fields, and move some routes

* Fix error handling

Co-authored-by: d11n <mail@dennisreimann.de>
Co-authored-by: nicolas.dorier <nicolas.dorier@gmail.com>
2022-10-12 22:19:33 +09:00
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
895462ac7f Import xpub: Surface error details (#4205)
Checks if the input is an output descriptor and explicitely handles that case instead of catching any errors. This allows us to display more detailed information about why an import might fail.
2022-10-11 12:19:10 +09:00
e883714446 Do not hide errors happening in tasks spawned by BaseAsyncService 2022-10-08 12:46:26 +09:00
e1a235b4e8 Changelog and bump (#4201) 2022-10-08 12:42:46 +09:00
ffa2c59df7 POS: Fix keypad view without custom amount (#4185)
The custom amount option was disabled by default in #4126. This requires some additional adaptations in the post action as otherwise the invoice won't be generated.

Fixes #4183.
2022-10-08 12:41:56 +09:00
3f19dc55fa Add "{Invoice.OrderId}" to list of supported email interpolation strings (#4202)
close #4112
2022-10-07 14:29:56 +02:00
66c2148a63 Increase tor test timeout 2022-10-07 16:04:22 +09:00
28850f534c Fix test warning 2022-10-07 15:05:11 +09:00
c40c11a822 bump ms aspnet packages (#4166)
* bump ms aspnet packages

* Bump .NET SDK in Dockerfile

* bump more packages

Co-authored-by: Dennis Reimann <mail@dennisreimann.de>
Co-authored-by: nicolas.dorier <nicolas.dorier@gmail.com>
2022-10-07 14:53:30 +09:00
b334e1aa00 Date display improvements (#4191)
Fixes styling issues introduced in #4074, because the `max-width` was to small for localized dates.

Also adds the ability to choose the prefered initial display format, which can be the localized or relative date.
2022-10-07 13:29:03 +09:00
b48986bfd6 Update default value for "showCustomAmount" in Swagger docs (#4200) 2022-10-07 13:27:10 +09:00
ced63baed6 fix custodian Swagger docs missing some path parameters (#4196) 2022-10-06 12:03:39 +02:00
880635d615 Make sure string is valid URL before rendering it as such in invoice details POS data section (#4197) 2022-10-06 10:43:18 +02:00
d9f8c8d3b1 Always show overpaid amount if invoice is overpaid (#4192)
close #4146
2022-10-06 12:59:05 +09:00
8155841a1d Fix receipts for Lightning Address invoices
`AdditionalData` needs to be null-checked, because it isn't set for invoices generated via Lightning Address. 

Fixes #4169.
2022-10-01 07:13:57 +02:00
30f83d8f3f Remove direct and temp link functionality from the File Storage (#4177) 2022-09-29 12:40:00 +02:00
96c86160df Fix warning error when rebooting the server caused by some shitcoin currency pair format 2022-09-29 15:45:27 +09:00
b7ea128132 Old Payout labels weren't displayed properly 2022-09-29 15:42:01 +09:00
4bee8e9bfe Greenfield: Extend LN GetInfo data (#4167)
Matching the data added in btcpayserver/BTCPayServer.Lightning#97.
2022-09-28 09:34:34 +09:00
bc195e771e Update WalletTransactions pagination default settings (#4074)
* Update WalletTransactions pagination default settings

Remove the numeric page selection and add displaying data of last 30 days by default.

* Update WalletTransactions to show txs based on Days

* Update text formatting on WalletTransactions view

Keeps the logic changes. Just undo the formatting of the file from previous commit

* Update WalletTransactions to show all after second load

Utilize Model.Days instead of new variables
Moved javascript code to PageFootContent section

* Update WalletTransactions to use ajax for infinite scroll

* Cleanups

* Apply skip and count only when not prefiltering

* Infinite scroll mode

* Improve datetime formatting and switching

* Upgrade NBXplorer to include get_wallets_recent bugfix

* Revert "Upgrade NBXplorer to include get_wallets_recent bugfix"

This reverts commit b390d942d74d88bb1da3ab8e3407184a527175ef.

* JS fixes

* Upgrade ChromeDriver and BundleMinifier

Co-authored-by: Dennis Reimann <mail@dennisreimann.de>
2022-09-27 21:24:53 +09:00
0bc3e94052 bump 2022-09-26 22:51:49 +09:00
3eb3523b52 Changelog for v1.6.11 (#4130)
* Changelog for v1.6.11

* Update Changelog.md

Co-authored-by: Nicolas Dorier <nicolas.dorier@gmail.com>

* Update Changelog.md

Co-authored-by: Nicolas Dorier <nicolas.dorier@gmail.com>

* Update changelog

* Update changelog

Co-authored-by: Nicolas Dorier <nicolas.dorier@gmail.com>
2022-09-26 22:50:59 +09:00
8e2f84a989 Upgrade Lightning libraries (#4164) 2022-09-26 22:48:47 +09:00
143ec7463f Fix crash on migration from old install (Fix #4162) 2022-09-26 22:00:49 +09:00
4a5fd08e51 Footer: Improve responsive display (#4163)
Enhancement in addition to #4160.
2022-09-26 10:29:35 +02:00
0306635a45 Merge pull request #4160 from daviogg/enhancement/4158-add-telegram-url
Add telegram icon and url on footer
2022-09-26 09:07:50 +02:00
0a4d32cdb5 Merge pull request #4161 from Bangalisch/SmallPageUpdate
Small update to Security.md
2022-09-26 09:07:33 +02:00
d590992d1d Fix crash on migration from old install (Fix #4162) 2022-09-26 10:31:04 +09:00
e8766946dd Improve currency selection (#4155)
Removes the current value on focus, so that the user gets to see the available options. If no selection or change is made, the value is reset to the previous value on blur.

Closes #4154.
2022-09-26 10:26:13 +09:00
8c35189b37 Small update to Security.md
Yo yo

Added title to page and ran it through Grammarly to slightly update the text.
2022-09-25 00:17:52 +02:00
e6390cde97 Add telegram icon and url on footer 2022-09-24 23:32:28 +02:00
db976a6408 Fix unit test and build warning 2022-09-23 16:41:51 +02:00
031c3ed055 Update README 2022-09-23 19:41:09 +09:00
cb391f08b9 Remove redundant exception status from invoice state label (#4151) 2022-09-23 15:17:50 +09:00
5387a6287e Fix pagination of wallet's transactions (#4150) 2022-09-22 10:39:48 +09:00
0e4544b2da POS - CustomAmount disabled by default also for App 2022-09-20 13:10:42 +02:00
e0cbb7bede POS - CustomAmount disabled by default 2022-09-20 13:10:42 +02:00
ed45b73274 Dashboard: Fix links in app tiles
Fixes #4144.
2022-09-20 10:10:54 +02:00
cadcb586a7 Fix settigs sidebar activation (#4138)
* Fix settigs sidebar activation

* remove active payout from settings

* Fix Store Settings nav highlight

Fixes #4134.

Co-authored-by: Dennis Reimann <mail@dennisreimann.de>
2022-09-20 10:05:55 +02:00
9e31270459 Improve "Advanced Settings" button (#4140)
* Improve "Advanced Settings" button

Closes #4132.

* Use collapse toggle for multi-sig examples
2022-09-20 09:50:59 +02:00
dc07f046f2 Improve PayButton error page (#4129)
As this is a public page we should embed it in the non-navigation layout. Also improves the error display.
2022-09-19 21:56:42 +02:00
5032bbafb1 Consistent switch UI on Create Wallet views (#4135)
* ui+wallet: consistent switch ui update

* Cleanups

* Improve CTA wording

Co-authored-by: Dennis Reimann <mail@dennisreimann.de>
2022-09-19 21:56:16 +02:00
1540bfb3a1 Merge pull request #4128 from bolatovumar/fix/4125 2022-09-17 09:38:54 +02:00
f3f5851118 Add missing store ID to invoice links
close #4125
2022-09-16 21:04:56 -07:00
9810edcd1a Fix Monero and Zcash nav extensions
They failed with an `System.NullReferenceException: Object reference not set to an instance of an object.` when navigating to a LNbank page, because LNbank uses Razor Pages and the controller part wan't defined. Brought up [on Mattermost](https://chat.btcpayserver.org/btcpayserver/pl/x3iohhct97nateyq4y1c4hp9mw).
2022-09-16 11:51:14 +02:00
e334b9162a Fix: Lnurl Max is set to min when item type is minmum
fixes #4108
2022-09-16 09:20:49 +02:00
836c676057 Upgrade Lightning lib 2022-09-15 16:57:57 +02:00
1abadd9c5d Update BTCPayServer/Storage/Services/FileService.cs 2022-09-15 16:26:22 +02:00
e8bd1d8237 FileService: Sanitize filename for downloaded files
Replaces invalid characters in filenames of files which are retrieved via URL.
2022-09-15 16:26:22 +02:00
8a7470500a Do not show set up wallet link in dashboard
fixes #4116
2022-09-13 16:14:46 +02:00
75689c665d Update source for urlib.min.js 2022-09-13 10:17:12 +02:00
d84f4f676b Document wider wallet import support 2022-09-13 10:17:12 +02:00
c97b859963 Refactor QR functionality
Based on the `ur-registry` upgrade I refactored the `CameraScanner` and `ShowQR` partials: Besides general code changes, the main change is that most of the configuration and result handling now happens on the outer view.
Those partials and functions are now generalized and don't know about their purpose (like handling PSBTs): They can be instantiated with simple data (e.g. for displaying a plain QR code) or different modes (like showing a static and the UR version of a QR code) and the result handling is done via callback.

The callbacks can now also distinguish between the different results (data as plain string vs. UR-type objects for wallet data or PSBT) and also handle the specific type of data. For instance: Before it wasn't possible to strip the leading derivation path from an xpub when scanning the QR code, because the scanner didn't know about the type of data it was handling. Now that the data is handled in the callback, we can implement that functionality for the scan view only.
2022-09-13 10:17:12 +02:00
6b8f4ee1d5 Remove bc-ur and upgrade ur-registry
Up to now we were supporting two versions of the UR standard: The legacy one implemented in `bc-ur` and the current version in `ur-registry`.
@Kukks forked a separate version of bc-ur for our web-bundle ([some more details](https://github.com/CoboVault/cobo-vault-blockchain-base/pull/8)), but it got hard to maintain the custom build, because the web-bundle needed manual assembly. We decided to get rid of the support for the legacy version and bc-ur, so that we can continue with the current version, which seems to be implemented across modern wallets (if they support UR at all). This way we can continue with only the `ur-registry` as a dependency, which handles encoding and decoding. 

I needed to make some modifications for the browser version of `ur-registry`. So I [forked their module to our org](https://github.com/btcpayserver/ur-registry) and I submitted the [modifications as PRs](https://github.com/KeystoneHQ/ur-registry/pulls) — hopefully we can eliminate our fork once those changes get merged. We are in contact with them and maintaining that fork wouldn't be as hard as the bc-ur one, because at least it has a working and automated build.
2022-09-13 10:17:12 +02:00
3532789c35 Improve Lightning Node setup examples (#4033)
* Catch connection string ToString errors

LNDhub connection string error fixed in btcpayserver/BTCPayServer.Lightning#92.

* Add Eclair bitcoin-host example

* Document LNDhub integration
2022-09-09 23:01:20 +09:00
267905b5e7 Reduce confusion 2022-09-09 13:49:24 +02:00
1626bd7a18 Show iframe when showing invoice in Shopify plugin
Close #4105
2022-09-09 13:49:24 +02:00
7106830be9 Make sure end date is after start date in Crowdfund app (#4084)
* Make sure end date is after start date in Crowdfund app

* Add null checks

* Add test case

Co-authored-by: Dennis Reimann <mail@dennisreimann.de>
2022-09-09 19:26:11 +09:00
3b1946d65c bump lightning libs 2022-09-09 16:46:39 +09:00
6dedf4d44f Upgrade Lightning library to 1.4.1 (#4093)
This enables new feature of specifying `certfilepath`

Closes #2182
2022-09-09 14:33:17 +09:00
fe5e2584b1 Use mempool as default block explorer (#4100) 2022-09-09 14:32:40 +09:00
8fae38deca Set explicit cursor style property on pay button with custom text (#4107)
We need to set "cursor: pointer;" explicitly on pay buttons with custom text because the <button> HTML tag default pointer is not a cursor. This is not an issue for the default button because it uses the <input> tag which has "cursor: pointer;" by default in browsers.

Close #4104
2022-09-09 14:28:03 +09:00
7f8e322e9c Fixed text + simplification (#4109) 2022-09-09 14:27:49 +09:00
4d0f76f9e8 Update invoice amount description in Swagger template
Close #4067
2022-09-04 09:57:41 +03:00
5d2b42960b fix CanExportInvoicesJson 2022-08-30 09:16:17 +02:00
0098dacdff fix host in launchprofile 2022-08-30 09:16:17 +02:00
51666fbf0e fix CanUseInvoiceReceipts 2022-08-30 09:16:17 +02:00
defb9120fd Ensure apps can be deleted through UI
Bug was introduced by https://github.com/btcpayserver/btcpayserver/pull/3987
2022-08-26 11:23:00 +02:00
11ec72ce8c changelog and bump
(cherry picked from commit a661f08d7b97f44913221e3641f740274f8232b5)
2022-08-26 10:26:51 +02:00
f67bd69ecc do not try to mention payout ids/ pull payments if they were not saved for labels
fixes #4078
2022-08-26 09:41:48 +02:00
db2c29a6e1 PoS UI fix: scale-down item image (#4076) 2022-08-25 12:26:44 +02:00
e22e522245 LNURL: Fix missing route hints option
Fixes #4072.
2022-08-25 12:01:26 +02:00
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
01ab21e4c0 Dashboard: Fix app tiles
I broke this with #3987.
2022-08-23 12:07:18 +02:00
534a2912e1 Create dynamic manifest for pos apps (#4064)
Co-authored-by: Dennis Reimann <mail@dennisreimann.de>
2022-08-21 20:38:14 +02:00
1456f4e227 Enhance export function for invoices (#4060)
Co-authored-by: Andrew Camilleri <evilkukka@gmail.com>
2022-08-21 08:43:23 +02:00
63e11451ba Rename PutPointOfSaleApp to UpdatePointOfSaleApp 2022-08-21 08:41:04 +02:00
7f80674cf2 Update Swagger docs 2022-08-21 08:41:04 +02:00
16f4ca5fbf Add support for updating POS app through Greenfield API
Part of #3458
2022-08-21 08:41:04 +02:00
701ba59bd8 Convert public app parts 2022-08-21 08:38:25 +02:00
8c6705bccb Make POS and Crowdfund plugins 2022-08-21 08:38:25 +02:00
e4542c4ac4 Paybutton: Fix logo and URL
Fixes #4053.
2022-08-20 11:32:09 +02:00
45eea1d6de API docs: Fix server base path
Introduced in #4041. Fixes #4059.
2022-08-20 11:31:28 +02:00
4aa94d5a13 bump btcpay to revert bug 2022-08-18 13:21:21 +02:00
b0253e11bf Revert "Allow bind and port for http too (#4031)"
This reverts commit a51c9d2b2dfd1b78ce99cb9c527f17a559660e43.
2022-08-18 13:12:29 +02:00
1a4a3714c7 Changelog for 1.6.8 2022-08-18 08:16:22 +02:00
999090dbdb Add Yadio exchange rate provider
Yadio is a service which provides exchange rates for many currencies such as the Lebanese Pound which have the real exchange rate which differs from the official rate significantly (32,525 LBP for USD real rate vs 1,510 official rate).

See more details here: https://yadio.io/info.html

See discussions here:
https://github.com/btcpayserver/btcpayserver/discussions/4001
https://github.com/btcpayserver/btcpayserver/discussions/2489#discussioncomment-3102370
2022-08-18 08:08:55 +02:00
13e3b515c9 Cleanse objects from obsolete altcoins 2022-08-17 21:23:16 +02:00
b6062a94b9 Explicitly disable fsize limit for some routes (#4045) 2022-08-17 10:18:30 +02:00
d0b26e9f69 Refactor Payouts (#4032)
Co-authored-by: d11n <mail@dennisreimann.de>
2022-08-17 09:45:51 +02:00
d6ae34929e Update launchSettings.json
Remove `BTCPAY_BTCEXTERNALLNDGRPC` because it is unsupported and not used anywhere in the app.

Use `http` for `BTCPAY_BTCEXTERNALLNDREST` because the HTTPS connection cannot be established.
2022-08-17 09:28:46 +02:00
a51c9d2b2d Allow bind and port for http too (#4031) 2022-08-17 09:11:13 +02:00
6c45ccc73d Add no rate found error message in Invoices (#4039) 2022-08-16 09:04:13 +02:00
6459c7bfad fix altcoin only dashboard crash
closes #4038
2022-08-15 20:22:31 +02:00
e6c1b0cf54 Merge pull request #4041 from dennisreimann/swagger-validation 2022-08-15 17:27:30 +02:00
c8558810ad Fix swagger validation errors
Combined the files with the same approach as in the docs:

`jq -rs 'reduce .[] as $item ({}; . * $item)' swagger.template.* > openapi.json`

Afterwards the bundled version can be validated using these commands:

`npx swagger-cli validate openapi.json && npx @redocly/cli lint openapi.json`
2022-08-15 15:59:26 +02:00
b0eb0b1de7 Merge pull request #4034 from dennisreimann/lnurl-controller-refactoring 2022-08-15 10:00:50 +02:00
6bdf31efda API docs: Fix duplicate speed policy schema
See the additional discussion in #3877. As we merged the Swagger JSON files for the docs, the duplicate store speed policy schema overwrote the updated invoice speed policy schema. This is now fixed by using a unified schema.
2022-08-15 06:20:10 +02:00
3cd2971cec Remove link to article that is no longer available 2022-08-14 11:19:25 +02:00
58784ebbfc Update ChromeDriver 2022-08-13 12:54:18 +02:00
de24a6e71b LNURL controller refactoring
By moving the `amount is null` check up, this prevents cases in which the `paymentMethodDetails.GeneratedBoltAmount != amount` check fails because of amount being null.
2022-08-12 20:10:44 +02:00
8c8a5a4f5e Edit view for Pull Payments (#4016)
Co-authored-by: Dennis Reimann <mail@dennisreimann.de>
2022-08-11 14:30:42 +02:00
7f41a1ef09 bump and changelog for 1.6.7 2022-08-10 10:07:15 +02:00
15e1169f62 Fix Kraken rate provider 2022-08-10 08:20:41 +02:00
de92677b69 Custodian Account Deposit UI (#4024)
Co-authored-by: d11n <mail@dennisreimann.de>
2022-08-09 20:03:55 +02:00
377ed95130 Upgrade Lightning library 2022-08-09 19:57:43 +02:00
1b1c7ad3b1 Bind app server to 0.0.0.0 to make it accessible on the local network
This way it can be accessed with other devices on the local network. It helps test with mobile devices for instance.
2022-08-08 11:15:24 +02:00
e4e0fb0f35 Ensure store button shows up correctly before store is created
fix #3972
2022-08-07 20:44:28 +02:00
bf0cbf24e4 bump and changelog for 1.6.6 2022-08-06 17:07:41 +02:00
7d454a4c7b make sure entity state gets modified in payout processors 2022-08-06 17:05:29 +02:00
680f1470cf Update app store links, add Authy as two factor app 2022-08-04 12:49:53 +09:00
1854fd307f Fix tests and warnigns 2022-08-04 12:42:15 +09:00
6239f9da75 Bump 2022-08-04 12:11:21 +09:00
40e39b82e8 Fix several potential NullReferenceException (Fix #4017) 2022-08-04 12:08:13 +09:00
c71e671311 Added custodian account trade support (#3978)
* Added custodian account trade support

* UI updates

* Improved UI spacing and field sizes + Fixed input validation

* Reset error message when opening trade modal

* Better error handing + test + surface error in trade modal in UI

* Add delete confirmation modal

* Fixed duplicate ID in site nav

* Replace jQuery.ajax with fetch for onTradeSubmit

* Added support for minimumTradeQty to trading pairs

* Fixed LocalBTCPayServerClient after previous refactoring

* Handling dust amounts + minor API change

* Replaced jQuery with Fetch API + UX improvements + more TODOs

* Moved namespace because Rider was unhappy

* Major UI improvements when swapping or changing assets, fixed bugs in min trade qty, fixed initial qty after an asset change etc

* Commented out code for easier debugging

* Fixed missing default values

Co-authored-by: Dennis Reimann <mail@dennisreimann.de>
2022-08-04 11:38:49 +09:00
2ea6eb09e6 Update changelog 2022-08-03 21:41:39 +09:00
55c39a12bc Checkout UI fix (#4015)
* Fix checkout UI bottom padding for paid state

* Improve public receipt form spacings
2022-08-03 21:31:16 +09:00
14cb65eb6a Minor refactor 2022-08-03 18:36:25 +09:00
a753459a6d Fix update webhooks (#4011)
* Fix update webhooks

* Update swagger for webhook update
2022-08-03 18:35:31 +09:00
bbce4451aa Add ability to mark auth handle as successful
Without this, there is no way to let the handle finish with a successful state. I somehow missed to add this in #3977.
2022-08-02 11:55:31 +02:00
1e378dd986 Plugins: Add authorization hook (#3977)
* Plugins: Add authorization hook

Makes the `PolicyRequirement` available to plugins.
Adds a filter hook to the authorization handlers, so that plugins can extend and leverage the existing authorization policies and permissions.

* Update to pass back and forth handle class
2022-08-02 14:20:16 +09:00
3db2b60b92 Add loopback client for local webhooks to skip ssl 2022-08-01 16:14:50 +02:00
2317a7df55 Make InvoicePaymentSettled return correct afterExpiration value
fixes #3966
2022-08-01 11:16:26 +02:00
c53fcde12a Do not crash when BTC network not available
fixes #4007
2022-08-01 10:44:39 +02:00
4be5eb39ff Make tx label endpoint not error 2022-07-28 15:33:28 +02:00
5ef31a96ea Provide error when plugin gets disabled due to crash 2022-07-28 15:31:34 +02:00
0d017c30e2 Fix: Joule -> Alby 2022-07-27 16:12:37 +09:00
92d85fa8a7 Added Alby, as Joule has been delisted on Chrome (#3934)
* Added Alby, as Joule has been delisted on Chrome

* Add files via upload
2022-07-27 16:11:42 +09:00
c2a0daedeb Bump versions of various deps (#3998) 2022-07-27 15:55:37 +09:00
51642bc4cc Update ListInvoices to say Settled instead of Paid (#4000)
Updated ListInvoices to say Settled instead of Paid

Co-authored-by: The Bitcoin Developer  <96552652+theBitcoinDeveloper@users.noreply.github.com>
2022-07-27 15:55:23 +09:00
c821208b5d Bumping LND to 0.15.0-beta (#3999) 2022-07-26 20:09:56 +09:00
a3d536bd51 Changelog and bump 2022-07-23 20:39:15 +09:00
f7262d12e6 Update lang 2022-07-23 20:37:56 +09:00
bec888da19 Payjoin label fixes (#3986)
* Payjoin label fixes

* When a payjoin label was applied, coin selection filter would not work
* When a payjoin happened with a receive address wallet, the payjoin label was not applied
* Coin selection shows when a utxo is currently reserved for a payjoin. Applies both to UI and to GF API

* remove reserved label

* Update BTCPayServer/Payments/PayJoin/PayJoinEndpointController.cs
2022-07-23 20:26:13 +09:00
2e6246e385 Move TagHelpers to Abstractions (#3975)
* Move TagHelpers to Abstractions

Makes them available for use in plugins. Also cleans up the tag helper references in the view code: As we have it in the root view imports, the individual directives in the views are superfluous.

* Move CurrenciesSuggestionsTagHelper back

To get rid of the Rating dependency in Abstractions.
2022-07-22 21:58:25 +09:00
a9a0bf01ad Design updates (#3981)
Contains the following design system PRs:
- btcpayserver/btcpayserver-design#50
- btcpayserver/btcpayserver-design#51
- btcpayserver/btcpayserver-design#52
2022-07-22 21:53:13 +09:00
8dd3c76fa4 Make it work with decimal discount values 2022-07-22 13:31:41 +02:00
a7c22399d8 Minor JS improvements 2022-07-22 13:31:41 +02:00
04cb8a2fe0 Minor toggle improvement 2022-07-22 13:31:41 +02:00
494739f771 Add discount option for Keypad POS app type
See https://chat.btcpayserver.org/btcpayserver/pl/ju5bu6r8qjfe9mrxdri3kihpby for details
2022-07-22 13:31:41 +02:00
6fbcc9a244 Fix Crowdfund + additional issues (#3994)
* Show free when invoice is fixed and 0 amount in apps
* animations on crowdfund not enabled broke JS
* Perk expansion in crowdfund was broken
2022-07-22 20:30:39 +09:00
d016f59867 Coin Selection: Fix responsive display (#3992)
Fixes #3985.
2022-07-22 20:29:53 +09:00
88f8f3938c Make app invoices show link to app in receipt (#3995) 2022-07-22 20:29:34 +09:00
1322fd97f6 Revert "Redirect instead of show 404 on 0 amount invoices"
This reverts commit 7f617df4e851b296bb5181a1f99df066fa704727.
2022-07-22 06:21:41 +02:00
7f617df4e8 Redirect instead of show 404 on 0 amount invoices
fixes #3904
2022-07-21 14:33:39 +02:00
b02542f3be Do not crash on bad language file 2022-07-21 11:09:51 +02:00
5fd620556e Fix Local client
This cleans up the client factory for plugins so that it is less hectic looking. Additionally, it fixes a bug where if you reuse the factory after setting a store, the state might stick.
2022-07-20 18:20:14 +02:00
218d64d8df Update Changlog, and bump 2022-07-15 12:47:15 +09:00
e8291eb00e Move ConfirmModel to Abstractions (#3964)
To make it available to plugins.
2022-07-15 12:38:33 +09:00
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
83c35328ed Fix: No pager in the wallet transactions list 2022-07-15 12:35:57 +09:00
f548d78907 Merge pull request #3965 from dennisreimann/new-supporters
Supporters: Add Strike and HRF
2022-07-12 15:31:30 +02:00
5aca8b41af Supporters: Add Strike and HRF 2022-07-12 15:14:02 +02:00
a7b6f3fa19 Redirect to dashboard instead of apps list on app delete (#3941)
close #3898
2022-07-12 15:18:08 +09:00
afb989d72e Fix lnurl withdraw modal (#3955)
* Fix lnurl withdraw modal

fixes #3949

* Fix test
2022-07-12 15:17:44 +09:00
12c96c7a74 Fix webhook display bug (#3959)
Specific events list now displays correctly when modifying specific events webhook
2022-07-12 12:37:02 +09:00
79bfffd77b Invoice summary: Fix indentation and heading levels (#3956) 2022-07-12 12:35:19 +09:00
58d68e7e31 Update changelog 2022-07-11 23:42:15 +09:00
499352e51c Fix the ExchangeSharpRateProvider for some pairs 2022-07-11 23:39:11 +09:00
03fbd51fab bump 2022-07-11 23:13:35 +09:00
bd73cac1a1 Fix: For some asset pair the kraken rate was inverted (Fix #3957) 2022-07-11 23:09:35 +09:00
0c43fda86d Prevent stackoverflow exception when ripio is unavailable 2022-07-11 23:08:59 +09:00
a64b8fb310 Update test plugin with more data related functionality 2022-07-11 11:29:57 +02:00
316d39f24c Update Changelog 2022-07-09 11:29:33 +09:00
265e2930f1 bump 2022-07-08 16:54:35 +09:00
9511cf8d8a Update changelog (#3913) 2022-07-08 16:53:41 +09:00
b86f0a7d9c Make BTCPay ssh key using safe algo 2022-07-08 16:32:43 +09:00
19be847624 Do not use Renci.SSH in tests 2022-07-08 16:30:52 +09:00
15e45ac4ec Bump SSH.NET 2022-07-08 16:08:21 +09:00
86572635df Fix build 2022-07-08 16:05:40 +09:00
4a5c51d7a3 Update sln 2022-07-08 12:43:11 +09:00
8530cf3535 Make sure we do not expose lightning services if not admin 2022-07-08 12:42:36 +09:00
eec54831ef Update lightning lib, on-chain balance shouldn't be lightmoney (#3945) 2022-07-08 10:55:26 +09:00
a41e98910d Update langs 2022-07-08 10:41:43 +09:00
be985466a3 Add payouts docs link (#3942) 2022-07-08 10:27:04 +09:00
98fb46957a Add error message when invoice could not be created (#3943)
If user requested to create an invoice for a payment method which is not set up for their store we currently return a generic error. This PR updates the logic so that we return a more specific error in this case.

closes #3830
2022-07-08 10:23:26 +09:00
2abc35058b Custodian Account UI: CRUD (#3923)
* 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

* After a utxo rescan, the cached balance should be invalidated

* Fixed Kraken plugin build issues

* Added Kraken plugin to build

* WIP UI + config form

* Create custodian account almost working - only need to add in the config form

* Working form, but lacks refinement

* Viewing balances + Editing custodian account works, but cannot change the withdrawal destination config because that is an object using a name with [] in it

* cleanup

* Minor cleanup, comments

* Working: Delete custodian account

* Moved the MockCustodian used in tests to a new plugin + linked it to the tests

* WIP viewing custodian account balances

* Split the Mock custodian into a Mock + Fake, various UI improvements and minor fixes

* Minor UI fixes

* Removed broken link

* Removed links to anchors as they cannot pass the tests since they use JavaScript

* Removed non-existing link. Even though it was commented out, the test still broke?

* Added TODOs

* Now throwing BadConfigException if API key is invalid

* UI improvements

* Commented out unfinished API endpoints. Can be finished later.

* Show fiat value for fiat assets

* Removed Kraken plugin so I can make a PR


Removed more Kraken files

* Add experimental route on UICustodianAccountsControllre

* Removed unneeded code

* Cleanup code

* Processed Nicolas' feedback

Co-authored-by: Kukks <evilkukka@gmail.com>
Co-authored-by: nicolas.dorier <nicolas.dorier@gmail.com>
2022-07-07 22:42:50 +09:00
35f97a6013 Add link to the order id if there is a orderUrl 2022-07-07 21:55:00 +09:00
b8d509eb12 Show order id in invoice details even if orderUrl is not present 2022-07-07 21:54:45 +09:00
d6f13be95f Redirect to invoice details instead of list upon creation (#3936)
* Redirect to invoice details instead of list upon creation

close #3909

* fix tests
2022-07-07 21:47:59 +09:00
4dad27bb76 Add v1.6.0 to the What's New modal (#3932) 2022-07-07 12:41:13 +09:00
efe1686c05 Don't show "Set up a Lightning node" when LN is not supported (#3935)
See discussion here: https://github.com/btcpayserver/btcpayserver/discussions/3868
2022-07-07 10:38:51 +09:00
09462e6877 Enhance Store email capability (#3911)
* Enhance Store email capability

Currenty the new email rules can send an email when an invoice event occurs. However, there is currently no way to customize the email based on the invoice, making the feature a bit useless.

This PR:
* adds the rich text editor to the body input
* allows you to use some of the properties from the Invoice (based on greenfield api properties. I've taken a imple approach for now using just  a string.replace mechanism, but we can update this to a dynamic linq approach so that users can customize further (e.g. `{Invoice.Metadata["something"].ToString().ToUpper()}`)

NOT READY:
Since this all takes place as a background service, there is an issue around how to handle items such as the "checkout link", as we are not aware of the btcpay url at that moment. Thoughts? @nicolasdorier

* fix typo and make it simpler for now

* remove dditor
2022-07-06 22:17:33 +09:00
612a0397a7 Make LNURL enabled when only method (#3930)
* Make LNURL enabled when only method

This fixes the scenario where LNURL for standard invoices are disabled, but the POS Print view only shows LNURL, so the QR code would always error out. The fix is to bypass the setting when lnurl is the only enabled payment method on the invoice

* Make sure not to affect other flows

* fix
2022-07-06 22:09:05 +09:00
3576ebd14f Public Invoice receipt (#3612)
* Public Invoice receipt

* implement payment,s qr, better ui, and fix invoice bug

* General view updates

* Update admin details link

* Update view

* add missing check

* Refactor

* make payments and qr  shown by default
* move cusotmization options to own ReceiptOptions
* Make sure to sanitize values inside PosData partial

* Refactor

* Make sure that ReceiptOptions for the StoreData is never null, and that values are always set in API

* add receipt link to checkout and add tests

* add receipt  link to lnurl

* Use ReceiptOptions.Merge

* fix lnurl

* fix chrome

* remove i18n parameterization

* Fix swagger

* Update translations

* Fix warning

Co-authored-by: Dennis Reimann <mail@dennisreimann.de>
Co-authored-by: nicolas.dorier <nicolas.dorier@gmail.com>
2022-07-06 21:14:55 +09:00
2a190d579c Show lightning balances even of 0 2022-07-06 15:40:00 +09:00
67abc107c5 Do not prefilter if label filter in transaction view 2022-07-06 13:00:41 +09:00
9ec2052428 ui+stores: updates switches ui to be consistent with other switches (#3929) 2022-07-06 12:43:22 +09:00
657423207b Async dashboard (#3916)
* Dashboard: Load Lightning balance async, display default currency

* Simplify approach, improve views and scripts

* Async tiles


Async tiles

* Add period for app sales

* Fix missing keypad view sales

* Fix after rebase

* Fix awaited call

* Fix build

Co-authored-by: Nicolas Dorier <nicolas.dorier@gmail.com>
2022-07-06 12:40:16 +09:00
19aaff2345 Merge pull request #3928 from dennisreimann/build-warnings
Fix build warnings
2022-07-06 12:16:15 +09:00
8873c51f2b Merge pull request #3926 from NicolasDorier/improveperfbigwallet
Improve performance of on chain transaction listing for big wallets
2022-07-05 14:54:27 +09:00
2ba24ba56b Tests should use explorer.postgres 2022-07-05 14:39:50 +09:00
52f5d21480 Improve performance of on chain transaction listing for big wallets 2022-07-05 14:23:13 +09:00
0405cda9d6 Fix build warnings 2022-07-04 19:05:25 +02:00
b422e79896 Add test cases for wallet send wizard links (#3927) 2022-07-04 21:59:46 +09:00
181d4d5ea4 Improve wallet nav (#3921)
* Fix rescan nav highlighting

* Wallet send wizard

* Wallet receive wizard

* Consistent wizard back button behaviour
2022-07-04 13:20:08 +09:00
f30ddbf175 Fix spurious crash at shutdown 2022-07-04 13:17:36 +09:00
2c3b8d8925 Dashboard: Load Lightning balance async, display default currency (#3907)
* Dashboard: Load Lightning balance async, display default currency

* Simplify approach, improve views and scripts

* Remove LightMoney converters
2022-07-04 11:03:16 +09:00
2e2c6aef83 Fix warning 2022-07-02 20:39:34 +09:00
e511538ba6 Fix: Local client factory when no user is specified would fail on some edge case auth scenarios 2022-07-01 09:03:32 +02:00
c12e08ef01 Open public app views in new tab/window (#3920) 2022-07-01 13:31:11 +09:00
0970944ee4 Add refund badge to invoice lists (#3918)
* Add refund badge to invoice lists

* fix badge
2022-07-01 13:26:00 +09:00
4eabe91cee remove lnurl from crowdfund as per requests 2022-06-30 14:25:52 +02:00
cf747f1e07 Fix missing refund flow error message
Fixes #3919.
2022-06-30 14:25:15 +02:00
e5a1da7136 Fix: Refund flow failed when lnurl was the only payment method 2022-06-30 08:52:56 +02:00
27b6cf436b fix cheat mode when default payment is not onchain 2022-06-30 08:46:34 +02:00
e4866a8265 Can disable cert check for email server (#3908) 2022-06-29 23:38:44 +09:00
d90cc02e5a CI: Try docker-compose pull several times 2022-06-29 23:37:38 +09:00
23a1a8e3f5 Add title on link of ln services in the dashboard 2022-06-29 23:31:25 +09:00
b8f1c0df09 Create interface for providing store id to plugins (#3910) 2022-06-29 23:18:02 +09:00
ed1f249aaf Fix empty permissions case 2022-06-29 15:36:54 +02:00
eef7539c2d Fix selective stores case 2022-06-29 15:36:54 +02:00
1bb35bf545 Limit selection to one store 2022-06-29 15:36:54 +02:00
2b9cb4a257 Better handling of confirm case (existing API key) 2022-06-29 15:36:54 +02:00
209cff8888 View improvements 2022-06-29 15:36:54 +02:00
9e253ac7a3 Test improvements 2022-06-29 15:36:54 +02:00
27c5b16957 Improve views; fix tests 2022-06-29 15:36:54 +02:00
2f1df3be7d Autofocus confirm modal input 2022-06-29 15:36:54 +02:00
bb4a28ecd8 Refactor Authorize UI
Closes #2902.
2022-06-29 15:36:54 +02:00
54c20b26cc Fix NRE 2022-06-29 15:33:48 +02:00
4a71b952b6 Revert "Fix: If SMTP port is 25, SSL shouldn't be used"
This reverts commit 9423bc4ea71747809b029dadfdf3545d5a6d0b68.
2022-06-29 15:12:30 +09:00
3d7f628014 Support Lnurl Withdraw in pull payments (#3709)
* Support Lnurl Withdraw

* cleanup and small fixes

* remove putin brace
2022-06-28 23:02:17 +09:00
c63529ea99 Fix: Warnings and view build issues during dotnet publish (#3902) 2022-06-28 17:38:59 +09:00
d43bdcc1a2 UI: Fix cancel plugin command (#3903)
* UI: Fix cancel plugin command

As installing a plugin also adds the delete/uninstall command, we just select the last action, which is the one the user triggered. 

Fixes #3890.

* Apply suggestions from code review

https://stackoverflow.com/questions/50100688/check-if-value-tuple-is-default
2022-06-28 17:38:47 +09:00
a4aa6c5ab9 Fix email rule remove action (#3901)
It simply exited to early by returning the view. The updated rules didn't get saved afterwards.
2022-06-28 14:10:45 +09:00
6d3e1bb40a Dashboard: Add Point Of Sale data (#3897)
* Dashboard: Add Point Of Sale data

Closes #3675.

* LNURL: Add POS redirect URL

* POS: Fix invoices link

* Fix integration tests

* Simplify data aggregation

* Improve chart display
2022-06-28 14:05:02 +09:00
9428347cb6 Crowdfund finetuning (#3488)
* Update crowdfund defaults

* Crowdfund: Move sound, animation and discussion into additional options

* Update sound URLs

Fixes #3745.

* Update featured image URL label

* Improve the recurring goal section

* Crowdfund: Goal section finetuning
2022-06-28 12:03:13 +09:00
618666abf1 bump mailkit 2022-06-27 10:58:57 +09:00
9423bc4ea7 Fix: If SMTP port is 25, SSL shouldn't be used 2022-06-27 10:54:02 +09:00
95b9e4dfd9 Add basic Greenfield API Get and Delete operations for apps (#3894)
* Add basic Greenfield API Get and Delete operations for apps

Will follow-up with PATCH and also with GET which returns more than just basic data later. This sets up the basic stuff first.

* Add methods to LocalBTCPayServerClient
2022-06-27 10:14:16 +09:00
61c6a2ab57 Greenfield: Add balance endpoint (#3887)
* Greenfield: Add balance endpoint

* Remove superfluous try/catch
2022-06-23 13:42:28 +09:00
c89f7aaaed Improve email settings validation and UX (#3891) 2022-06-23 13:41:52 +09:00
c2d72e71aa Store Emails (#3611)
* Store Emails

* fix test

* Update email rules layout

* Cleanups

* Test cleanups

* Add back comments

* Update view; add test

* Show email rules link even if email settings aren't completed

* Validate email addresses

* No redirect, display warning

* Fix test

* Refactoring: Change email argument types to MailAddress

* Test fix

* Refactoring: Use MailboxAddress

* Parse emails properly in controllers and backend

Co-authored-by: Dennis Reimann <mail@dennisreimann.de>
Co-authored-by: nicolas.dorier <nicolas.dorier@gmail.com>
2022-06-22 12:05:32 +09:00
af93cf2adb Lightning balance: Handle null values (#3886)
* Lightning balance: Handle null values

* Upgrade Lightning lib
2022-06-21 16:09:18 +09:00
7a75a8c254 Fix nav height issue on mobile devices (#3888)
close #3807
2022-06-21 13:04:50 +09:00
0aa7dacbca Add spam rate limits for public invoice endpoints (Fix #3782) (#3889) 2022-06-21 12:33:20 +09:00
9d41a52d3b Remove Store ID from Store Settings & various minor UI tweaks (#3881)
* ui+layout: update main container padding

* ui+invoice: updates archive button

* ui+users: updates search input
2022-06-20 16:02:12 +09:00
c943303a45 Dashboard balance fixes (#3876)
* Fix wallet balance for case crypto code == default currency

* Handle old NBXplorer backend case

* Cleanup
2022-06-20 14:31:22 +09:00
b2a5b3c3c4 Fix tests 2022-06-20 13:36:01 +09:00
495d4b82cf Fix warning from CLI parser (#3875) 2022-06-20 13:07:58 +09:00
ea2a200302 Adding description to speedPolicy parameter. (#3877) 2022-06-20 13:07:24 +09:00
c531b26821 Updates Crowdfund & POS Modal (#3806)
* ui+cf: updates perks modal

* Toggle editor with Bootstrap

* Add currency info to app items

Co-authored-by: Dennis Reimann <mail@dennisreimann.de>
2022-06-20 11:55:47 +09:00
cade6c6c38 Move View action to the Name column in Payouts & Payment Requests (#3873)
* ui+paymentrequest: moves 'view' link to name

* ui+pull: moves 'view' link to name column

* Update links, fix tests

Co-authored-by: Dennis Reimann <mail@dennisreimann.de>
2022-06-20 11:52:12 +09:00
c56821300a Server Settings: Consolidate Storage and Files (#3863)
* Server Settings: Consolidate Storage and Files

* Improve storage options name display

* Remove file services from services page

* Remove more code
2022-06-15 21:06:16 +09:00
346821f0d6 Added toggle button to switch to store default currency (#3752)
* Added toggle button to switch to store default currency

* Replaced ["usd"] with the currency variable

* Fix indentation and improve JS part

* Update script and display

* Improve chart display

* Improve rate display

* Address code review comments

Co-authored-by: Dennis Reimann <mail@dennisreimann.de>
2022-06-15 16:33:24 +09:00
0da97c5da3 Report shopify errors to the UI (Fix #3853) 2022-06-15 14:12:47 +09:00
f0e013e1f8 Make Pay Button a plugin (#3862)
* Move files

* Fix potentially missing default payment method

Before, it got removed if any other value was changed besides the default payment method.

* Fix missing store data

* Update BTCPayServer/Plugins/PayButton/PayButtonPlugin.cs

Co-authored-by: Pavlenex <pavle@pavle.org>

* Update pay button warning

Closes #3535.

Co-authored-by: Pavlenex <pavle@pavle.org>
2022-06-15 11:32:46 +09:00
8a144f3c35 removes plugin (#3805) 2022-06-15 11:19:02 +09:00
f48bb5a40a Fix build warnings (#3870)
Fixes #3866.
2022-06-15 11:17:10 +09:00
3abde67671 Merge pull request #3865 from dennisreimann/fullynoded
Update Fully Noded link
2022-06-14 19:22:32 +02:00
59b2e2dba1 Update Fully Noded link 2022-06-14 10:01:10 +02:00
479f21f4f3 Dashboard: Add Lightning balances and services (#3838)
* Update Lightning lib

* Refactoring: Move Lightning methods and props to ExternalServices

* Rename Lightning services

* Add Lightning balance to dashboard

* Split Lightning dashboard tiles

* View updates
2022-06-14 14:36:22 +09:00
4a0f10ea99 Support LN connection string with onion http client (#3845)
I'm not sure if onion based ln conenction strings ever worked in btcpay? closes #1648
2022-06-13 16:22:26 +09:00
9a24e4ade1 Store Settings feature with own table (#3851)
* Store Settings feature with own table

* fix test

* Include the store settings to StoreRepository, remove caching stuff

Co-authored-by: nicolas.dorier <nicolas.dorier@gmail.com>
2022-06-13 13:36:47 +09:00
4691e896a1 Fix invoice index migration 2022-06-13 12:37:38 +09:00
869411a977 ui+dashboard: small margin tweaks (#3856) 2022-06-13 10:48:36 +09:00
68bd40d2a4 Improves Invoice Summary accordion view (#3859)
* ui+site: moves invoice css

* ui+invoice: improves invoice summary and partials
2022-06-13 10:47:26 +09:00
cb8fe24a77 Add new issue forms for filing Bug Reports (#3846)
* remove old .md template, add new issue form

* Update .github/ISSUE_TEMPLATE/bug_report.yml

Co-authored-by: Andrew Camilleri <evilkukka@gmail.com>

* Update .github/ISSUE_TEMPLATE/bug_report.yml

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

* change browser from drop down to textfield

* fix github yaml validation

* enable blank templates

* emoji consistency

Co-authored-by: Andrew Camilleri <evilkukka@gmail.com>
Co-authored-by: d11n <mail@dennisreimann.de>
2022-06-10 13:35:31 +02:00
eb65949b69 Mobile header improvements
- Moves the menu button to the left, besides the logo
- Improves width and text display of the store selector
 
Closes  #3826.
2022-06-10 09:11:26 +02:00
fdf6f68624 Remove unused "using" directive 2022-06-10 08:39:01 +02:00
d0e01768ab Allow excluding unconfirmed UTXOs when creating a new transaction with Greenfield API
See original request: https://github.com/btcpayserver/btcpayserver/discussions/3737
2022-06-10 08:39:01 +02:00
fd3d389557 Notifications: Fix mark all as seen return URL
Fixes the return URL for the case in which the dropdown content got replaced after a notification update: As the refresh request is done via AJAX, the return URL previously was `/notifications/getnotificationdropdownui` (the `Context.Request.GetCurrentPathWithQueryString()` value of the AJAX action).

We need to pass in the URL of the actual current page as the return URL.
2022-06-10 08:17:06 +02:00
3d63e12c9e fix test 2022-06-09 12:43:28 +02:00
ac6770bdff Add Buda rate provider for CLP
closes #3766
2022-06-09 12:01:40 +02:00
2ad2ce6c3b Fixed issue with users when disabling then setting admin
Concurrency issue; moved user update from controller to service
2022-06-07 13:04:21 +02:00
fcbe1dd8eb Fix: Local Client Factory was not properly handling the override for auth (#3799)
* Fix: Local Client Factory was not properly handling the override for auth

* implement nonimplemented method
2022-06-06 22:57:55 +09:00
df618d1aa2 Simple Notification Modal Improvement (#3784)
* ui+layout: updates notification modal overlay

* Update BTCPayServer/wwwroot/main/layout.css

Co-authored-by: d11n <mail@dennisreimann.de>
2022-06-06 18:58:57 +09:00
b846f16e6c ui+pos: update notification copy (#3801) 2022-06-06 18:58:32 +09:00
51ab9746de UI: Minor 2FA improvements (#3812)
Styles the "Remember me" checkbox on login and sets a proper width for the verification code field.
2022-06-06 18:57:42 +09:00
ae10d0c7fd Bump and fix rate providers (#3813)
* Bump and fix rate providers

* fix
2022-06-06 18:56:50 +09:00
a443426d83 Fix remove and enable issues with non-last-admin
"Remove" issue likely due to multiple context instances. "Enable" issue due to conditional check.

Discovered bug with users when first disabling, then marking as admin, which remains an issue.
2022-06-06 10:43:06 +02:00
f2aa4d4484 fix swagger test 2022-06-06 10:40:57 +02:00
4579dc9385 Update UIManageController.APIKeys.cs
Fixed grammar.
2022-06-06 10:36:17 +02:00
8ef8c97072 Refactoring: Bitpay Rate Controller
Some tweaks I did when working on #3752.
2022-06-06 10:34:52 +02:00
84fcd1c1b5 Add custom bg and border classes 2022-06-06 10:32:15 +02:00
d0e6bcd784 ui+payout: removes border 2022-06-06 10:32:15 +02:00
1142ff884e Update payment data partials 2022-06-06 09:41:23 +02:00
29080e9d7d Add Refunds list to Invoice details page
(this is missing the refunded badge and progress as I have another PR that makes this easier to compute to show)
2022-06-06 09:41:23 +02:00
04c3191795 Layout cleanups
Just some minor cleanups
2022-06-06 09:33:19 +02:00
9d75225bd5 Redirect create and edit payment request to list view upon completion
Create and edit now redirect to list view. Both actions use the same method. Also updated notification message.

Kept extraneous redirect value for xUnit tests. Update selenium test to account for redirect to list view.
2022-06-06 07:53:41 +02:00
ce85bd26df Fix change domain documentation link 2022-06-03 10:49:28 +02:00
ba0e46b465 Improve payouts UI (#3792)
* Improve payouts UI

* Display units

* Update badges

* Update badge background
2022-06-02 11:03:06 +02:00
5616b7550f Improve Refund Flow (#3731) 2022-06-02 10:08:55 +02:00
fcd6159b42 Merge pull request #3511 from bolatovumar/feat/api/apps
Add support for creating POS apps through Greenfield API
2022-06-02 14:13:25 +09:00
02e5e1bc1e Fix CheckNoDeadLink which can enter in infinite loop 2022-06-02 13:26:14 +09:00
6d83a00728 Rename tags of PoS API in swagger 2022-06-02 13:07:02 +09:00
d697c2ac9e Add fallback values for buttons 2022-05-31 22:27:03 -07:00
c917aec401 Add PosViewType enum 2022-05-31 22:25:04 -07:00
89c1b94a12 Dashboard: Do not display archived invoices in recent invoices
Fixes #3783.
2022-05-31 13:20:16 +02:00
46b9760179 Greenfield: Fix GetDepositAddress return type (#3790)
The local clients GetFromActionResult cannot handle the JValue return type, because it gets invoked with GetFromActionResult<string>.
2022-05-31 19:15:38 +09:00
ff66e66f21 PluginPacker: Shell fallback for macOS/Linux 2022-05-30 11:47:06 +02:00
b1f62f74cd Update language to explicitly request view-only wallet files
Right now the tooltips displayed do not specify using a view-only wallet, but there is no reason to upload full keys to BTCPay Server and view-only keys are actually the BTCPay Server recommendation.

Updated language in the UI to reflect that and made some minor improvements to the other language used in the UI here.
2022-05-29 12:12:55 +09:00
a0d0f1f98b Error when broadcasting transactions weren't shown in the UI 2022-05-28 21:36:42 +09:00
f08f064bc6 add changelog and bump 2022-05-28 14:05:16 +02:00
20d653798c After a utxo rescan, the cached balance should be invalidated 2022-05-28 10:21:55 +02:00
a9e08dd587 Allow resending verification email for users (#3726)
* Allow resending verification email for users

Partially address #3645

* Replace RequiresEmailConfirmation with Verified

* Use confirmation modal

Co-authored-by: Dennis Reimann <mail@dennisreimann.de>
2022-05-27 13:36:47 +09:00
5dba4a2201 Merge pull request #3778 from dennisreimann/pp-sats
Allow pull payments denominated in SATS to be claimed
2022-05-25 20:59:42 +09:00
c964870416 Allow pull payments denominated in SATS to be claimed
Fixes #3750.
2022-05-25 12:59:57 +02:00
cfbf081cac bump 2022-05-25 19:33:39 +09:00
bad429e853 Merge pull request #3777 from NicolasDorier/fuowiuiq
Fix: Invoices from shopify had empty orderId (Fix #3769)
2022-05-25 19:32:28 +09:00
8ce7466dc1 Fix: Invoices from shopify had empty orderId (Fix #3769) 2022-05-25 19:10:49 +09:00
1ffa067d5f Merge pull request #3775 from dennisreimann/wallet-export-ui-fixes
Wallet export UI fixes
2022-05-25 18:16:28 +09:00
b595763446 Wallet export UI fixes 2022-05-24 16:13:45 +02:00
e7180ac82a Merge pull request #3774 from NicolasDorier/wiobq
Improve performance when lot's of pending invoices
2022-05-24 19:06:20 +09:00
1d3c4b6f90 Merge pull request #3773 from NicolasDorier/wefiou
Remove HistoricalAddresses table
2022-05-24 19:06:08 +09:00
891809a13a Merge pull request #3772 from NicolasDorier/experimental
Add experimental mode
2022-05-24 19:05:38 +09:00
67eeb4b69a Allow resolution of any settings via DI 2022-05-24 14:10:19 +09:00
f6b157167d Improve performance when lot's of pending invoices 2022-05-23 19:17:33 +09:00
d768314f03 Make login and password not required for sending email (#3764)
* Make login and password not required for sending email

close #3656

* Add space

* Remove unused "using" statements
2022-05-23 19:00:34 +09:00
3ede0a50f0 Remove Payout processor log spam 2022-05-23 18:43:35 +09:00
8828251204 Remove HistoricalAddresses 2022-05-23 11:32:37 +09:00
019788670e Fix: Not properly recording unaffected addresses in database 2022-05-23 11:12:09 +09:00
3285f24fe9 Add experimental mode 2022-05-23 10:46:51 +09:00
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
2254a5960e Fix overflowing text in order ID field in invoices table (#3765)
close #3714
2022-05-23 10:13:24 +09:00
af4a06f91d Fix a couple of mobile display issues (#3759)
* Fix Tor hidden services text overflow on smaller screens

* Fix issue with overflow "select" element on general store settings page in mobile Safari
2022-05-20 09:36:36 +09:00
3e95b59be8 Wallet transactions export (#3744)
* Wallet transactions export

The exported data needs some more work.

* Fix transactions export policy

* Add test cases

* Fix Selenium warnings

* Finalize export format

* Test export download

* Remove CSV download check

* Try to fix test
2022-05-20 09:35:31 +09:00
bb24ec4a9f Upgrade Lightning lib 2022-05-19 17:37:00 +02:00
5a4b675791 Upgrade Lightning lib; add and pass cancellation tokens in Greenfield 2022-05-19 17:37:00 +02:00
5328303c32 Align settings in properties and docker-compose (#3761)
Maps the LND gRPC port, which is used in the launch settings and fixes the LND REST port.
2022-05-19 23:58:04 +09:00
3f6212e799 Payout Processors: Use friendly name in delete confirmation
Closes #3758.
2022-05-19 13:15:38 +02:00
1803d3ee2b Fix NRE introduced by previous commit 2022-05-18 21:49:42 +09:00
421a2b0cd9 Pull payment code improvements (#3756)
* Controller syntax improvements

* Improve Payout Processors protip
2022-05-18 21:40:26 +09:00
533ae0ea89 fix unwanted alert list marker for single error, issue #3583 (#3704)
* fix unwanted alert list marker for single error, issue #3583  https://github.com/btcpayserver/btcpayserver/issues/3583

* Update ViewPullPayment.cshtml

Co-authored-by: Nicolas Dorier <nicolas.dorier@gmail.com>
2022-05-18 21:38:10 +09:00
df5add04e2 Wallet display improvements (#3755)
* Improve fiat value text group display

* Improve generate/cheat button display

* Improve PSBT table display
2022-05-18 15:45:59 +09:00
174e743904 Improve invoice list performance (#3742) 2022-05-18 15:44:58 +09:00
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
6d76771b16 Lightning: Allow specifying explicit amount for invoices (#3753)
* Upgrade Lightning lib

* Lightning: Allow specifying explicit amount for invoices

* Fix tests
2022-05-18 14:57:36 +09:00
fca066fe52 Add endpoint for creating POS app 2022-05-17 21:26:33 -07:00
aa3c0346c8 Add GreenfieldAppsController 2022-05-17 21:26:33 -07:00
bafec0d974 Move PointOfSaleSettings class into own file 2022-05-17 21:26:33 -07:00
f3f605a90f Fix DivideByZeroException raised if crowdfund's target amount is 0 (#3747) (#3748) 2022-05-17 14:34:06 +09:00
a9a9f26aa0 Remove mailto: handling in bitpayjs 2022-05-14 10:57:08 +09:00
4eb143c265 Fix a bunch of open redirect vulns 2022-05-13 10:26:20 +09:00
e597b2177c Re-add StoreNavPages.Integrations with deprecation warning 2022-05-12 13:32:40 +02:00
2ae4501de6 Rewording: Integrations become (store) plugins
We're keeping the `store-integrations-list` extension point name for backwards compatibility, otherwise I renamed all "integration" occurences in the views and also the routes.

Note: We still refer to external software like WooCommerce, Drupal, Magento and such as "integrations", I think that distinction makes sense.

Closes #3594.
2022-05-12 13:32:40 +02:00
f1029fceff Fix webhooks test
Re-adds two classes used by the tests, that got removed in #3716.
2022-05-12 12:04:31 +02:00
b67d3a504b Add responsive table wrap where necessary 2022-05-12 07:54:12 +02:00
12a5998a07 ui+invoice: improve webhooks section styling 2022-05-12 07:54:12 +02:00
fbe2096098 Set pull payment auto approve flag when creating the model
fix #3693
2022-05-12 07:45:54 +02:00
d7faa0a0fd Improve payout processors UI
Some quick fixes, closes #3697.
2022-05-10 15:27:39 +02:00
8bd54493a3 add pgp verif 2022-05-09 14:00:21 +02:00
225243ba93 1.5.2 changelog (#3730)
* 1.5.2 chaneglog

* bump
2022-05-09 20:58:49 +09:00
21bd35accd Fix shopify id / order no (#3718)
fixes #3636
2022-05-09 20:58:05 +09:00
4acca4c6f5 Try fix selenium test error (#3728) 2022-05-09 14:13:51 +09:00
c106ff8290 bump selenium (#3723) 2022-05-06 12:07:53 +09:00
296ba4606d Redirect to payment method setup (#3721)
Closes #3651.
2022-05-06 11:14:56 +09:00
54dd602be4 Implementing tables fix per dennisreimann suggestion 2022-05-05 15:17:44 +02:00
9cac8d36ad A few tables in the Cart checkout were having bad width and margins which caused misalignments. 2022-05-05 15:17:44 +02:00
d407e9ffba Add dark mode option for public pull payment and payment request views
Closes #3706. Closes #3705.
2022-05-04 14:36:37 +02:00
26025b564e Lightning: Catch and display external service errors
Prevent crashes like in #3700 and display the error to the user.
2022-05-04 14:30:07 +02:00
4cacc2a9e6 bump LNURL package 2022-05-04 14:08:02 +02:00
16ef405670 bump LNURL package 2022-05-04 13:31:15 +02:00
642aad28ac Update validation of crowdfund app settings (#3708) 2022-05-04 10:34:40 +02:00
B
e5feda69c8 Updated Payout processor Label for setting interval (#3698) 2022-05-04 10:34:31 +02:00
aa89d1dffe Makle plugin packer store in dir with plugin name 2022-05-04 09:01:17 +02:00
662f269a94 Fix return type of webhooks get so that plugins can use it 2022-05-03 11:15:08 +02:00
6f80100ee6 Plugin Packer: Generate versioned dir and also SHA256SUMS (+ asc file is on windows with gpg and powershell installed) 2022-05-03 08:12:25 +02:00
38d3154ddf Dashboard: Prevent y-axis labels from getting cut off (#3702)
Fixes #3692.
2022-05-02 21:32:24 +09:00
e16a718bde Do not always provide counting in list views (#3696) 2022-05-02 16:35:28 +09:00
a40429e219 Fix possible NRE 2022-05-02 09:43:55 +09:00
e5602a86a2 bump 2022-04-30 12:58:58 +09:00
7d4d8bff93 Do not show balance if can't get the balance (#3695) 2022-04-30 12:56:05 +09:00
d028ebfdf1 Improve performance of Invoice count (#3688) 2022-04-30 12:54:44 +09:00
a5aeb2a3c1 Fix performance issue on dashboard for big wallets (#3694) 2022-04-30 12:54:12 +09:00
410bd5ab9c Remove logs about pending invoices 2022-04-29 16:01:25 +09:00
f4823d962a Do not crash if /apps/{appId} do not exists 2022-04-29 16:00:27 +09:00
9aa35f3488 add missing docs 2022-04-29 08:58:17 +02:00
d2a7e5dc4d get pgp verified commit 2022-04-28 16:05:33 +02:00
f7cb44c343 fix crash on not found perk items (#3685) 2022-04-28 16:03:19 +02:00
ae67cc8a51 bump 2022-04-28 22:06:03 +09:00
454d628f93 1.5.0 changelog (#3680)
* 1.5.0 changelog

* Apply suggestions from code review

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

* Update Changelog.md

Co-authored-by: d11n <mail@dennisreimann.de>
2022-04-28 22:04:47 +09:00
e60e8dc9ba reduce payout processor logs 2022-04-28 14:43:01 +02:00
382fe5cd47 Auto approve refunds (#3682) 2022-04-28 20:50:28 +09:00
86e53552c0 Upgrade Lightning library (#3683) 2022-04-28 12:49:43 +02:00
6296d63197 Local API client: Allow for cancellation of GetPayment calls (#3681)
I missed adding those in #3674.
2022-04-28 09:51:21 +09:00
ed1a7bb887 Allow auto approval of claims for pull payments (#1851)
* Allow auto approval of claims for pull payments

closes #1780

* fix
2022-04-28 09:51:04 +09:00
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
261a3ecee3 Greenfield: Allow for cancellation of Lightning method calls (#3674) 2022-04-26 10:29:20 +09:00
8f0ac61634 Refactoring: Extract Safe module to Abstractions (#3676)
So that it can be used by plugins as well.
2022-04-26 10:28:49 +09:00
5a7b275ee3 Fix CanCreateAppPos 2022-04-25 17:37:46 +09:00
54e106ec74 LNURL: Use Lightning description template in LNURL metadata (#3667)
* LNURL: Use Lightning description template in LNURL metadata

Unifies the invoice description for the Lightning and LNURL payment methods and fixes #3634.

* Add POS Order ID for consistency with Crowdfund

* LNURL: Add POS item metadata to invoice

For consistency with the Lightning payment method. Closes #3655.
2022-04-24 20:36:10 +09:00
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
9ab129ba89 More URL id parameter fixes (#3673) 2022-04-22 15:52:57 +02:00
b39a67534c Greenfield: Proper response for store not found (#3658)
* Greenfield: Proper response for store not found

Previously the "network not configured" error message was also displayed when indeed the store could not be found. This is misleading, hence we should have a separate error for that case.

* Use StoreNotFound method
2022-04-22 12:17:20 +02:00
2d717cbf01 Fix payment request redirect URL (#3672) 2022-04-22 10:28:46 +02:00
c4f284aaf1 Lightning: Add GetPayment methods to local client (#3657)
I missed adding them in #3557.
2022-04-22 09:28:11 +09:00
e40a9089e0 Merge pull request #3666 from dennisreimann/ivpn
Add IVPN as supporter to README
2022-04-21 16:02:33 +02:00
8cf849e590 Add IVPN as supporter to README 2022-04-21 15:50:46 +02:00
03e113b063 Merge pull request #3665 from dennisreimann/ivpn
Add IVPN logo for supporters section
2022-04-21 15:36:38 +02:00
d9305b1e63 Add IVPN logo for supporters section
We are not displaying it in the app, but linking to it from various other sites (docs, website, etc.)
2022-04-21 15:34:09 +02:00
182fa7d803 Upgrade Lightning lib (#3662) 2022-04-21 21:47:10 +09:00
4dd41cffe3 Order swagger's docs tags 2022-04-21 12:30:49 +09:00
9bf3df1e87 Fix Swagger, replacing additionalProperties by allOf 2022-04-21 12:12:30 +09:00
2e08c29c64 Remove replace hardcoded BTC string to default network (#3654) 2022-04-20 10:20:39 +09:00
75afd30008 Design updates (#3653)
* Design updates

Contains:

- btcpayserver/btcpayserver-design#12
- btcpayserver/btcpayserver-design#33
- btcpayserver/btcpayserver-design#35
- btcpayserver/btcpayserver-design#37
- btcpayserver/btcpayserver-design#39

* Improve input focus styles
2022-04-20 09:42:14 +09:00
7652d2c7e3 LN Address - db schema fix method (#3638)
* LN Address - db schema fix method

* pr changes

* shorten
2022-04-19 16:58:31 +09:00
7e6a2d08e2 Add label filter for onchain tx API endpoint (#3588)
* Add label filter for onchain tx API endpoint

close #3587

* Add Swagger docs

* Add test for filtering by transaction label
2022-04-18 11:20:15 +09:00
c1dbe235dc Hide empty plugins section (#3643)
Closes #3617. Implementation of @bolatovumar's [proposal](https://github.com/btcpayserver/btcpayserver/issues/3617#issuecomment-1094173005) - we might be able to replace it with a better solution, that would avoid rendering that section in the first place. For now that solves the issue though.
2022-04-18 10:25:00 +09:00
eb2ccf06a5 Fix typos in README file (#3644)
* Fix typos in README file

* Update BTCPayServer.Tests/README.md

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

Co-authored-by: Nicolas Dorier <nicolas.dorier@gmail.com>
Co-authored-by: d11n <mail@dennisreimann.de>
2022-04-18 10:24:17 +09:00
e202f24592 Wallet view: Minor display improvements (#3647)
* Label improvements

* Fix erratic display bug in ToTimeAgo helper
2022-04-18 10:23:32 +09:00
d11f87f0cc Pay Button: Re-add Vue handlers to currency input (#3646)
Fixes a regression introduced in #3642: The pay button preview and code sample do not update without the Vue handlers.
2022-04-16 18:38:51 +02:00
8f54ec4f4a add currency-selector input on Payment Request and Pay Button pages (#3642) 2022-04-15 13:53:37 +09:00
64534efe71 Fix broken "CanCreateRefunds" test (#3635) 2022-04-14 14:07:10 +09:00
1235ced355 htmlcoin altcoin updates (#3601)
* remove old logo

* add new logo

* switch name from Althash to Htmlcoin

* increment version NBXplorer.Client

* fix KeyPath BIP-0044, fix name

https://github.com/BEPAL/slips/blob/master/slip-0044.md

* revert increment version
2022-04-14 13:18:12 +09:00
23d383be67 Add transaction info PATCH endpoint (#3561)
* Add transaction info patch endpoint

* Add "#nullable enable" to LabelFactory

* Add Swagger docs

* Update OnChain to onchain

* update feeRate to feerate

* Add test

* replace "Onchain" with "onchain"
2022-04-14 13:17:22 +09:00
fb90ff2fbb updates (#3631) 2022-04-14 13:09:37 +09:00
4706aa95e6 Minor Dashboard Adjustments (#3629)
* improves border-radius

* adjusts CF widget wording
2022-04-14 13:08:43 +09:00
8981414705 API: Add Lightning Payment info endpoint (#3557)
* Upgrade Lightning lib

* API: Add Lightning Payment info endpoint
2022-04-12 18:01:58 +09:00
7ec978fcdb Dashboard (#3530)
* Add dashboard and chart basics

* More widgets

* Make widgets responsive

* Layout dashboard

* Prepare ExplorerClient

* Switch to Chartist

* Dynamic data for store numbers and recent transactions tiles

* Dynamic data for recent invoices tile

* Improvements

* Plug NBXPlorer DB

* Properly filter by code

* Reorder cheat mode button

* AJAX update for graph data

* Fix create invoice button

* Retry connection on transient issues

* App Top Items stats

* Design updates

* App Sales stats

* Add points for weekly histogram, set last point to current balance

Co-authored-by: nicolas.dorier <nicolas.dorier@gmail.com>
2022-04-12 16:55:10 +09:00
d58803a058 Specify PayJoin enabled in Payment Link heading (#3614)
* Specify PayJoin enabled in Payment Link heading

* Fix for non bitcoin payments
2022-04-12 11:05:09 +09:00
fe6b7dc1e3 Fix visual bug when user clicks on "Create refund" without selecting an option (#3624)
* Add missing refund option validation error element

* Add missing hidden inputs for text elements

* Move validation element above button

* Update validation error message
2022-04-11 17:53:52 +09:00
c9f0988b95 Handle possible error when bumping fee (#3608)
fix #3600
2022-04-11 17:53:10 +09:00
cd9a52706c Use the store's default currency when creating entities (#3585)
* Use default currency for new pull payments

Closes #3582.

* Pull payment: Improve create form

* Use default currency for new invoices

Closes  #3581.

* Clean up old invoice form code

* Use default currency for new payment requests

* Test fixes
2022-04-11 17:50:30 +09:00
bfdb1b4af9 Design updates (#3565)
* Design updates

* Improve table styles

* Form input color improvements

* Form input shadows

* Increase accordion button padding

* Hover transition for checkboxes and radio buttons

* Improve checkbox and radio button spacings

* Improve input styles

* Secondary button updates

* Clear pager floats

* Link improvements

* Don't display border for last table row
2022-04-11 17:49:57 +09:00
e5174b4a29 Lightning: Link to services directly (#3593)
* Allow to access fake LN services in dev mode

* Link directly to Lightning services

Closes #3552.

* Fix typo
2022-04-11 17:49:28 +09:00
8feb60c30d Add ability to set default payment method for pay button (#3606)
* Add ability to set default payment method for pay button

close #3604

* Add "#nullable enable" to UIStoresController

* Add PaymentMethodOptionViewModel

* Add explicit "Use the store’s default" option
2022-04-11 17:48:12 +09:00
6bd7fb64ab CI test fixes (#3609)
* Test fix


Logs

* Add test logs

* Test change

* Use async overloads in CanPayWithTwoCurrencies test

* Bump NBXplorer

* More test updates

* More logs

* More waiting

* More waiting

* Update GoToUrl calls

* Log request status

* More logs

* More logs, more waits, idk

* Click checkboxes using JS

* Go to url directly

* Double timeout
2022-04-08 18:58:01 +09:00
b9602243d3 Fix tests for litecoin 2022-04-08 13:03:51 +09:00
b7a930ef18 Adjust user search input width (#3577)
Co-authored-by: Dennis Reimann <mail@dennisreimann.de>
2022-04-05 07:34:56 -04:00
add206ae2d Fixes #3598 by adding overflow scrolling to StoreSelectorMenu (#3599)
Co-authored-by: Dennis Reimann <mail@dennisreimann.de>
2022-04-05 07:34:14 -04:00
28ce095fb4 Merge pull request #3602 from phershbe/master
Link to local development environment instructions corrected
2022-04-05 09:01:00 +02:00
13952a4b79 Bump NBX (#3607) 2022-04-05 14:46:42 +09:00
05ec398346 Update CoinGeckoRateProvider 2022-04-04 14:47:50 +09:00
dea2dd52be Link to local development environment instructions corrected
As noted here: https://github.com/btcpayserver/btcpayserver/issues/3590

The link to the local development environment instructions was broken and now is correct.
2022-04-01 22:18:43 -04:00
debe3cda4b fix typo 2022-04-01 13:45:30 +02:00
5b5aa2c721 bump btcpay 2022-04-01 13:22:24 +02:00
e201ddd74c Plugins: Fix plugin installer 2022-04-01 13:20:19 +02:00
4a1580169d Merge pull request #3595 from pavlenex/shopify 2022-03-31 15:15:26 +02:00
001ca7de60 Fix UI to match Shopify's 2022-03-31 14:51:16 +02:00
184be4e27b Merge pull request #3592 from Kukks/updaart 2022-03-31 13:36:11 +02:00
7652645dda 1.4.8 update 2022-03-31 12:48:10 +02:00
ef6016857b FileService: AddFile from URL (#3566) 2022-03-31 11:54:25 +02:00
e449ca2c95 Fix shopify 2022-03-31 10:13:07 +02:00
b0f00773d6 fix issues around local btcpay client and no request obj 2022-03-30 15:04:51 +02:00
451eee549b added additional inputmode attr to relevant form input fields (#3578)
* added inputmode attr to relevant input fields

* missed some numerical form inputs

* removed inputmode attribute from checkout appearnce invoice settings input field
2022-03-30 09:58:50 +02:00
77da261fea Allow plugins to extend swagger docs and fix pull payment test 2022-03-29 20:29:27 +02:00
e23c9ee608 Add missing policies in api key UI 2022-03-29 20:12:02 +02:00
37cb87a9c6 Update CircleCI config (#3586) 2022-03-29 16:35:02 +01:00
211db8e0f0 Adjust pull payment badge color (#3584)
Co-authored-by: Dennis Reimann <mail@dennisreimann.de>
2022-03-29 12:09:30 +02:00
d074d60dad Change "was confirmed paid" to "is settled"
As detailed here: https://github.com/btcpayserver/btcpayserver/issues/3572
2022-03-27 07:56:32 +01:00
0bff5e2236 Update BTCPayServer/wwwroot/swagger/v1/swagger.template.stores-email.json
Co-authored-by: d11n <mail@dennisreimann.de>
2022-03-26 21:46:40 +00:00
dca986eb2e Add Greenfield Store Email API 2022-03-26 21:46:40 +00:00
326eb1135b added inputmode attr to relevant input fields 2022-03-26 18:27:22 +00:00
b2f7b4e6b9 Update BTCPayServer/Services/Invoices/InvoiceRepository.cs
Co-authored-by: Andrew Camilleri <evilkukka@gmail.com>
2022-03-25 13:21:43 +00:00
5129d6aa6b Update BTCPayServer/Services/Invoices/InvoiceRepository.cs
Co-authored-by: Andrew Camilleri <evilkukka@gmail.com>
2022-03-25 13:21:43 +00:00
a8cf334616 Update BTCPayServer/Services/Invoices/InvoiceRepository.cs
Co-authored-by: Andrew Camilleri <evilkukka@gmail.com>
2022-03-25 13:21:43 +00:00
3b4d06a1e5 Bugfix: Could not find an order by OrderId after it's OrderId was changed through the API 2022-03-25 13:21:43 +00:00
c7969476b0 Apply suggestions from code review
Co-authored-by: d11n <mail@dennisreimann.de>
2022-03-25 10:45:56 +00:00
7bf24df03a Change payment method name from "Wallet" to "Bitcoin"
As discussed here: https://github.com/btcpayserver/btcpayserver/issues/3571
2022-03-25 10:45:56 +00:00
5ef41294e4 Optimize github plugin fetching 2022-03-23 15:03:39 +00:00
2eb68655c7 FileService: Add method to check availability 2022-03-21 12:38:25 +01:00
23049439c0 API: Add description hash to CreateLightningInvoiceRequest (#3559)
Co-authored-by: Andrew Camilleri <evilkukka@gmail.com>
2022-03-17 10:15:27 +01:00
ce6cd40b92 Adjust wallet receive page layout (#3553)
Co-authored-by: Dennis Reimann <mail@dennisreimann.de>
2022-03-11 10:43:31 +01:00
c36b0c16b0 New API endpoint: Send email using store SMTP (#3181)
Co-authored-by: Kukks <evilkukka@gmail.com>
2022-03-11 10:17:40 +01:00
c15f182377 Streamline JS/CSS bundles (#3520) 2022-03-11 08:41:48 +01:00
165cb345b4 Merge pull request #3551 from dennisreimann/acinq
Remove ACINQ from README
2022-03-10 11:52:57 +03:00
9b6d2beb4d Remove ACINQ from README
Closes #3546.
2022-03-10 09:50:40 +01:00
722c39a6ff Exclude ChainCoin in rate provider test 2022-03-08 12:12:01 +01:00
e344749d2f Remove Polis
As per [this comment](https://github.com/btcpayserver/btcpayserver/pull/3514#issuecomment-1059583143)
2022-03-08 12:12:01 +01:00
fe782bc3b6 Merge pull request #3519 from dennisreimann/2fa-layout
Use simple layout for 2FA views
2022-03-08 13:42:28 +03:00
d372cbad74 Fix null reference error when "destinations" field is not specified or empty when creating a new wallet transaction
fix #3537
2022-03-08 11:14:34 +01:00
1e1198f4ec Remove Kraken from README 2022-03-08 11:13:19 +01:00
5effc96cff Remove Kraken as a supporter
Closes #3539.
2022-03-08 11:13:19 +01:00
b8d4a1be05 Delete Plugins/packed directory 2022-03-08 09:57:43 +01:00
36a25e6efa Merge pull request #3543 from dennisreimann/manage-plugins
Rename Add plugin to Manage plugins
2022-03-08 11:26:35 +03:00
1240e7914d Fixes 2022-03-08 08:17:39 +00:00
e4683b1ea1 Refactoring: Extract ITempDataDictionary extensions 2022-03-08 08:17:39 +00:00
749c22a0c3 Refactoring: Extract HttpRequest extensions 2022-03-08 08:17:39 +00:00
6867774627 Refactoring: Extract StringExtensions 2022-03-08 08:17:39 +00:00
80944972e9 Rename Add plugin to Manage plugins
Closes #3540.
2022-03-08 08:04:15 +01:00
c1f608c0d8 Upgrade Lightning lib (#3531) 2022-03-08 10:02:48 +09:00
4dfbb08db3 Try test fix 2022-03-04 10:49:36 +00:00
ead1dffd98 QR container display fixes
Consistently centers the container contents.
2022-03-04 10:49:36 +00:00
5a16e4d132 Use simple layout for 2FA views 2022-03-03 13:43:22 +01:00
a89491e343 Skip Polis and OKEx in rate fetching tests 2022-03-03 10:57:55 +01:00
b1b00ae886 Scroll to checkbox before click 2022-03-03 10:57:55 +01:00
cde5bd87d8 update 1.4.7 2022-03-02 12:37:28 +01:00
3231d5d179 Allow file service to be used in plugins 2022-03-02 12:22:46 +01:00
03e49ea2bf Allow access to global invoices list
The recent changes in 19eea3a6154e73f7fc9d62ab20480134e95be3d5 prevent it to access a global/unfiltered list of invoices across all stores. This removes the fallback to the current store, which brings the global list back at `/invoices`.
2022-03-02 11:00:25 +01:00
7d3eef092c Add missing generate wallet greenfield docs 2022-03-02 10:54:05 +01:00
30d0410b49 fix shopify settings 2022-03-01 09:19:28 +01:00
eb2a887f77 Fix missing store in export for invoices
fixes #3505
2022-03-01 09:18:46 +01:00
e77b8d29cf Remove policy, set store context manually 2022-03-01 09:18:23 +01:00
490ec299c5 Fix missing store context for Lightning payouts 2022-03-01 09:18:23 +01:00
e47c2aa24d Fix redirect 2022-03-01 09:18:23 +01:00
3eb9fdca6a Syntax improvements 2022-03-01 09:18:23 +01:00
a4173a93b7 Improve display on payout confirm page 2022-03-01 09:18:23 +01:00
ad762cf239 Fix back link on payout confirm page
Fixes #3490.
2022-03-01 09:18:23 +01:00
5a478607dc Fix "Copy Link" button on pull payment and payment request pages
close #3499
2022-03-01 09:15:15 +01:00
4abc6eb387 Refactoring: Allow GreenfieldExtensions to be used by plugins 2022-03-01 09:14:51 +01:00
c313bba288 Fix mobile content z-index
I think we added this before taking proper care of the main menu z-index. Now that that is fixed we can remove the z-index of the content area, which fixes #3504.
2022-02-26 13:51:59 +01:00
73eaf97afb Fix pos print view
fixes #3503
2022-02-26 13:22:27 +01:00
8d25df5d4e Fix Pay Button code copying
Fixes #3489.
2022-02-24 12:23:03 +01:00
4a05f16050 Refactoring: Move WellKnownTempData into Abstractions.Constants
This allows plugins to reuse the status message mechanism.
2022-02-21 16:39:08 +01:00
3ef1423263 Update Changelog.md 2022-02-21 13:06:13 +01:00
898652189b Changelog: Fix usernames 2022-02-21 13:06:13 +01:00
2976edf333 Sticky header JS fix
The old version lead to an error on pages that do not contain a sticky header.
2022-02-21 13:05:50 +01:00
248be11e4d fix local client http accessor overrider 2022-02-21 11:48:40 +01:00
19ec8c36e2 Remove debug line in selenium tests 2022-02-21 16:17:36 +09:00
90d989e358 Bump 1.4.6 2022-02-21 14:54:43 +09:00
19eea3a615 Refactor how we get storeids list in invoice filter (#3483) 2022-02-21 14:53:48 +09:00
7b81b9786d Fix LNUrl comment truncating 2022-02-21 13:47:00 +09:00
292d302a3d Allow only 2k chars in LNURL comments 2022-02-21 13:27:02 +09:00
557594e34d Test LNUrl Pay payment method information, add doc 2022-02-21 13:22:17 +09:00
48393c3765 Add border for mobile menu (#3477)
In addition to #3469.
2022-02-21 12:20:04 +09:00
022cd666eb Sticky header updates (#3471)
* Add tag helper for sticky header

Encapsulates some of the CSS and JS required and makes the usage easier.

* Make sticky header span full content area horizontally

* Use sticky header on remaining list views

* Use sticky header on remaining edit and detail views

* Adapt pull payments view to be consistent with other list views

* Fix form markup

* PSBT test fix

* Update header actions

* Remove sticky header tag helper
2022-02-21 11:05:42 +09:00
2d0eedb132 CircleCI: Update build image (#3475)
CircleCI recently [deprecated build images](https://circleci.com/blog/ubuntu-14-16-image-deprecation/), including the classic ones we are using. I found this config working for me on another repo.
2022-02-21 11:04:15 +09:00
5d3d664ce6 Update BTCPayServer/Views/UIWallets/WalletTransactions.cshtml
Co-authored-by: d11n <mail@dennisreimann.de>
2022-02-18 10:13:50 +01:00
d1c12d8294 Add ability to clear tx label filter 2022-02-18 10:13:50 +01:00
947a67fcd2 adds border (#3469) 2022-02-18 10:56:05 +09:00
9b9540b857 PSBT test fix (#3472) 2022-02-18 10:55:54 +09:00
a3b748ffe3 Remove payment methods not currently configured when creating invoice (#3394)
* Add error message when wallet is not configured

* Adjust payment methods based on available ones

* Disable "Create invoice" page if there is an error

* Add test

* update HasErrorMessage

* Add method for checking if payment methods are available

* small pr fixes

Co-authored-by: Kukks <evilkukka@gmail.com>
2022-02-17 18:22:09 +09:00
9a3a7a3444 Add pull payment grouping options (#3177)
* Add grouping by payment methods

* Add filtering by pull payment state

* Hide "Archive" button for archived pull payments

* Don't show payment methods bar if there is only one

* Add "All" payment method option

* Remove filtering by payment method

* Update state queries to not run on the client

* Add filtering by future pull payments
2022-02-17 18:13:28 +09:00
5c8ca15ee2 Redesign Wallet UI (#3441)
* Update wallet navigation

* Find matching text color for label bg color

* Cleanup

* Extract WalletNav component

* Move PSBT link to Send and Rescan link to Settings

* Update transactions view

* Test fixes

* Adapt invoices list actions

* Show invoice actions only if there are any invoices

* Link wallet name and balance to tranactions list

* Move wallet related actions from list to settings

* Fix main menu z-index

Needs a value between fixed and the offcanvas backdrop, see https://getbootstrap.com/docs/5.1/layout/z-index/

* Update receive and send views
2022-02-17 18:07:41 +09:00
cd3807a3d8 Lightning payment info and fee handling (#3454)
* Lightning payment info and fee handling

Builds on the additions in btcpayserver/BTCPayServer.Lightning#59 and btcpayserver/BTCPayServer.Lightning#61.

Adds payment information (total amount and fees) to the API response and allows to set an optional maximum fee percentage when paying.

* Add max fee flat
2022-02-17 18:01:39 +09:00
2a884d6f38 removes redundant header (#3470) 2022-02-17 17:59:21 +09:00
6efeb60c41 Fix the PSBT signing flow (#3465) 2022-02-17 17:58:56 +09:00
dcdab5b218 Do not show storeid in the invoice filter 2022-02-16 13:43:33 +09:00
288fbda54f New API endpoint: Find 1 user by ID or by email, or list all users. (#3176)
Co-authored-by: Kukks <evilkukka@gmail.com>
2022-02-15 16:19:52 +01:00
03bc91fd1e switch to jobj 2022-02-15 12:23:54 +01:00
1c5cf29540 Greenfield: Invoices Payment Methods: Additional Data
closes #3154
2022-02-15 12:23:54 +01:00
631ddc0af2 Bump version 2022-02-15 14:33:25 +09:00
1d593df5af Bump lightning lib (#3453)
* Bump lightning lib

* Fix endianness of description hash text
2022-02-14 20:33:27 +09:00
1d3a8bb7bf App updates (#3437)
* Fix toggle alignment

* Crowdfund: Change defaults (disable sounds and Disqus)

* Crowdfund: Move callback notification URL into additional options

Same as with the Point Of Sale options.

* Crowdfund: Make enable toggle more prominent

* Crowdfund: Improve start and end date form group display

* Template Editor: Improve button spacing

* adjusts currency + target

* removes "other actions"

* adjusts text

* adjusts status message bottom margin

Co-authored-by: dstrukt <gfxdsign@gmail.com>
2022-02-14 18:14:21 +09:00
0dc9c183b5 Store guest shouldn't see the bump fee option 2022-02-14 18:13:22 +09:00
05ab43f309 Redirect to transactions list after wallet creation (#3451)
Closes #3450.
2022-02-14 17:09:57 +09:00
f4153ade92 Zcash integration (#3400)
* zcash

* Use Channel instead of Queue
2022-02-14 17:04:34 +09:00
44e84b46b8 Upgrade Lightning lib (#3446)
Prerequisite for btcpayserver/btcpayserver#3423.
2022-02-10 19:33:57 +09:00
3fe71e7bdc Avoid NRE on PermissionTagHelper 2022-02-10 18:37:07 +09:00
5d4d8a3422 Simplify swagger 2022-02-10 17:09:55 +09:00
f06199230c Add ability to add description to pull payment (#3363)
* Add ability to add description to pull payment

close #2625

* Add API support

* Remove 'Model.Description != "<br>"'
2022-02-10 14:54:00 +09:00
da9a6b835a Greenfield: Store Users (#3425)
* Greenfield: Store Users

* fixups

Co-authored-by: nicolas.dorier <nicolas.dorier@gmail.com>
2022-02-10 14:51:10 +09:00
0afc2cd2cb Add NetworkProvider.DefaultNetwork 2022-02-10 12:43:26 +09:00
9e2f7fb048 Do not register services of altcoins if not used 2022-02-10 12:36:07 +09:00
3fa694c65f Improve Lightning test scripts (#3435) 2022-02-10 12:25:14 +09:00
300d84c5d8 [UX/UI] Add CPFP (#3395)
* Add CPFP

* Sign PSBT should go back to the initial page
2022-02-10 12:24:28 +09:00
efed00f58b Setup guide: Link to first crypto if BTC not available 2022-02-10 12:23:45 +09:00
99c4ebe046 Setup guide: Link wallet setup always to BTC (#3442) 2022-02-10 12:17:15 +09:00
699231fd92 Fix payment request archival actions (#3443) 2022-02-09 23:37:15 +09:00
c18f112f31 Invoice status lookup fix (#3444)
See 4ca152da7cac87ecff7065ae077d72e0985be70b.
2022-02-09 23:35:17 +09:00
605d04580c Fix subnav on store pairing view (#3438)
Fixes #3431.
2022-02-09 12:24:25 +09:00
143211f276 Filter 'complete' = 'confirmed or settled' 2022-02-09 12:17:21 +09:00
4ca152da7c Fix paid invoice filter
Fixes #3434 by reverting the filter changes done [here](ec68d2a0e6 (diff-b7a89b0b45f062f004cdfe6ca8484f6ca519044f63485fd15986af5f7dd5ec76L219)).

The new labels are only used in the UI ­— when filtering one needs to use the old labels, as the filter docs in the view already suggest.
2022-02-09 12:12:32 +09:00
1c1f69fa50 bump 1.4.4 2022-02-08 12:21:58 +09:00
147ccd6c96 Ensure compresed public key is used for SIN generation even if uncompressed key was provided (fix #3432) (#3433) 2022-02-08 11:24:58 +09:00
c8b9906ef3 After login, redirect user to the main page even if root app configured (#3429) 2022-02-07 21:18:22 +09:00
cd94a9fac1 Make CheckNoDeadLink more reliable 2022-02-07 21:15:39 +09:00
20a9472ee2 Sticky headers (#3416)
* Make headers sticky

Closes #3344.

* Decrease headline margin bottom on mobile

* increases gap

* adds bottom padding

* Update BTCPayServer/Views/UIApps/UpdatePointOfSale.cshtml

* add "_blank" to view action

* Fix markup and tests

* Spacing updates

* Try test fix

* Re-add sticky account header and add test logs for timeout check

* Fix timeout issues

* Apply scroll padding on pages with sticky header

Co-authored-by: dstrukt <gfxdsign@gmail.com>
Co-authored-by: nicolas.dorier <nicolas.dorier@gmail.com>
2022-02-07 18:37:45 +09:00
c652a2f122 Bumping LND to 0.14.2-beta (#3424) 2022-02-07 16:30:17 +09:00
ce174d507d Prevent initial scroll to section nav (#3411)
* Prevent initial scroll to section nav

On pages taht contain a section nav (sub navigation) the previous `scrollIntoView` led to an initial scroll position start at the section nav. See the store or server settings for examples.

This fixes it so that the scroll vertical position always starts at 0.

* Mobile: Prevent anchors from disappearing underneath the fixed header

* Add content padding top to scroll padding
2022-02-06 20:39:52 +09:00
f66b1b644f docker-entrypoint would crash if missing ssh pubkey 2022-02-06 20:39:10 +09:00
5b460f0b4e Error messages when starting BTCPay Server where not shown (Fix #3404) 2022-02-06 14:37:31 +09:00
ab8d116f11 Fix null reference exception when going to LN node settings before it's been set-up (#3410)
* Fix null reference exception when going to LN node settings before it's been set-up

* Fix-up remaining null reference errors

* Update error message
2022-02-06 12:19:42 +09:00
0535e9c68f 1.4.3 2022-02-02 20:24:56 +09:00
93b52fbdb3 Redirect on 403 page rather than crashing if permission missing 2022-02-02 20:24:22 +09:00
aab1eb0d36 Ensure Swagger docs are semantically and structurally correct (#3390)
* Remove "delete" method from "/api/v1/stores/{storeId}/invoices/{invoiceId}/payment-methods" docs

* Remove "requestBody" from "delete" method of "/api/v1/stores/{storeId}/webhooks/{webhookId}"

* Rename "API Key" to "API_Key"

* Remove "scheme" from API_Key security scheme

* Remove "name" and "in" properties from "Basic"security scheme
2022-02-02 20:12:48 +09:00
c07fcc171c Fix Plugin Local Client authorization when user is provided (#3401)
* Fix Plugin Local Client authorization when user is provided

* 1337 hax
2022-02-02 20:09:08 +09:00
8e5b7d2578 Fix crash of payment request list (Fix #3392) 2022-02-02 20:08:20 +09:00
37b1e9037f files update 2022-02-02 10:19:17 +01:00
7c0999ac9f settings + PSBT constrain 2022-02-02 10:19:17 +01:00
5ce1c9d77f send + receive constrains 2022-02-02 10:19:17 +01:00
14dcb58afa constrain to lightning settings view 2022-02-02 10:19:17 +01:00
04068025c6 fixes edit payment request 2022-02-02 10:19:17 +01:00
2cd0c7a407 Fix responsive POS and Crowdfund form display
Fixes #3375.
2022-02-02 10:19:17 +01:00
f3592c4782 Update invoice doc link
close #3366
2022-02-02 10:14:36 +01:00
1e5934895d Reference correct payment type definition for webhook events in Swagger docs 2022-02-02 10:09:58 +01:00
0f5d932726 Add test IDs for Lightning and Plugins (#3402)
I came across these when writing a Selenium test for LNbank.
2022-02-02 12:47:22 +09:00
4125726be9 Fix pay button type comparison (#3403)
Fixes #3396. We need to compare the button type value loosely, because initially the type is an integer and after it gets set by Vue it is a string.
2022-02-02 12:37:56 +09:00
bcb692caf0 Pay Button Alert: Add missing alert-link classes (#3397)
* Pay Button Alert: Add missing alert-link classes

* Update alert link styles
2022-02-02 12:37:22 +09:00
ff9a1a1f55 Delete user preferences cookie on logout (#3379)
I think it is a good practice to remove those settings on logout. Otherwise they get persisted across multiple accounts, which might not be desired.
2022-02-01 10:42:31 +09:00
faef6d82ff No error in crowdfund if canvas unavailable 2022-01-31 18:15:28 +09:00
d3a123373e No error in crowdfund if canvas unavailable 2022-01-31 17:05:42 +09:00
7c66f024ed adjust footer (#3389) 2022-01-31 16:52:50 +09:00
20c7259174 Bump z-index on header (#3393)
close #3377
2022-01-31 16:52:14 +09:00
16a4c072a9 Bump 2022-01-28 22:52:56 +09:00
254e8d48f2 Fix test 2022-01-28 22:51:12 +09:00
52fe374aaa Fix new guest store redirect after login
Fixes #3373.
2022-01-28 09:59:40 +01:00
f776725096 Guest users shouldn't see Payouts menu item 2022-01-28 17:49:21 +09:00
6e864c2631 Fix error message when trying to remove last admin 2022-01-28 17:09:54 +09:00
4221554dc8 Add back plugins link in server nav
Not all plugins appear in the side nav menu, and there is no intuitive link to view all installed plugins
2022-01-28 08:56:52 +01:00
6b50fdae43 fixes stray < text (#3374) 2022-01-28 14:52:34 +09:00
7bae6b2e8f bump 2022-01-27 17:17:20 +01:00
5c6a0f22c0 fix ln address
fixes #3367
2022-01-27 17:17:20 +01:00
a9b755fa1d Changelog 1.4.0 (#3328) 2022-01-27 22:24:39 +09:00
72bdf9e0d7 Update "Close Wallet & Lightning Setup" Path (#3362)
* update path

* updates center
2022-01-27 14:33:12 +09:00
cbf8b23385 Adapt desktop breakpoints in views (#3358)
* Add XXL breakpoint

* Unify setup guide display

* Adapt desktop breakpoints in views

* Fix POS code display

* Fix syntax in home view

* store settings + constrain update

* account settings

Co-authored-by: dstrukt <gfxdsign@gmail.com>
Co-authored-by: Nicolas Dorier <nicolas.dorier@gmail.com>
2022-01-27 11:56:46 +09:00
4aacd0d23a Adapt warning message for pay button 2022-01-27 11:43:39 +09:00
69202ed752 Add loading indicator for "Pay" button in POS terminal app (#3342)
* Add loading indicator for "Pay" button in POS terminal app

close #3336

* move feature over to Vue

* replace click handler with form submit handler
2022-01-27 10:58:25 +09:00
aa762821ce Spacing fixes 2022-01-26 15:58:21 +09:00
8a7bb6bc5a Retry SaveChanges if deadlock detected in delete store 2022-01-26 15:09:06 +09:00
35cb4d4cc3 Update Plugins View (#3357)
* visual updates

* badges

* copy update
2022-01-26 15:01:49 +09:00
8ceda3eab1 Fixes (#3356)
* Improve wording

* Fix redirect action
2022-01-26 14:57:35 +09:00
cc1233e8d5 Adjust Pay Button (#3354)
* updates padding

* padding adjustments

* updates

* Redirect to paybutton enable page when disabling

* Fix test

* Fix test

Co-authored-by: nicolas.dorier <nicolas.dorier@gmail.com>
Co-authored-by: Dennis Reimann <mail@dennisreimann.de>
2022-01-26 14:55:48 +09:00
70883c0869 Simple Wallet View Inconsistencies (#3355) 2022-01-26 14:54:29 +09:00
fe9de98dd1 Merge pull request #3337 from dennisreimann/merge-general-payment
Store: Combine General and Payment settings
2022-01-25 20:26:45 +09:00
ecde91ff25 Plugins: Support plugin git remote with multiple versions of same plugins 2022-01-25 11:15:19 +01:00
240ad49a43 Add currency selection attributes 2022-01-25 06:57:55 +01:00
10adb23e71 Remove obsolete store hints 2022-01-25 06:57:55 +01:00
c2fc099439 Create store: Add default currency and rate provider fields 2022-01-25 06:57:55 +01:00
723a38da68 Store: Combine General and Payment settings 2022-01-25 06:57:55 +01:00
74037fd605 Make CanUseTorClient more reliable 2022-01-25 12:27:44 +09:00
e917796fce Set new LN defaults (#3325)
fixes #3324
2022-01-25 12:17:39 +09:00
5661798601 Allow plugins access in nav when there is no store (#3351) 2022-01-25 12:15:59 +09:00
a8adac9c5a Rename LNUrlAuthController -> UILNAuthController (#3352) 2022-01-25 11:51:14 +09:00
c62018f984 1.4.0 Final Polish (#3335)
* adds pay button icon

adds more

update icons

* reduces update app titles

* capitalize PP

* more icons

notification icon update

adds more

* Truncate long titles in nav

* Adjust "off" color state for the wallet/lightning

* Theme switch alignment

* Update store selector

* adds more space in store selector span

* Prevent form zoom on mobile Safari

* updates lightning + settings view

* updates store icon

* adjusts notification icon

* removes notifications setting button icon

* Update status colors

* Fix Lightning nav markup

* Prevent icons from shrinking

* Move main menu styles to css

* Remove max-width container for content area

* Update headlines

* Use fixed header on mobile

* Extract custom pills component

* Form field update

Co-authored-by: Dennis Reimann <mail@dennisreimann.de>
2022-01-25 11:07:52 +09:00
06f2d4425c re-add theme ui extension 2022-01-24 13:12:12 +01:00
090da6cfb6 Add configurable BOLT11Expiration for refunds (Fix #3281) (#3341)
* Add configurable BOLT11Expiration for refunds (Fix #3281)

* Add BOLT11Expiration configuration in Payment
2022-01-24 20:17:09 +09:00
28dbf10a31 Do not rely on element's id for payment button (#3339)
* Do not rely on element's id for payment button

* Update BTCPayServer/Views/UIStores/PayButton.cshtml

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

* Update BTCPayServer/Views/UIStores/PayButton.cshtml

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

* Update BTCPayServer/Views/UIStores/PayButton.cshtml

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

* Update BTCPayServer/Views/UIStores/PayButton.cshtml

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

Co-authored-by: d11n <mail@dennisreimann.de>
2022-01-24 20:05:22 +09:00
7a66d0feda Shorten environment info (#3350)
Also uses the copyright symbol (instead of an `@`).
2022-01-24 20:01:17 +09:00
e23ddf118e Add warning about the tradeoff the paybutton (#3340)
* Add warning about the security tradeoff of the paybutton

* Update BTCPayServer/Views/UIStores/PayButtonEnable.cshtml

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

* Move message in column

Co-authored-by: d11n <mail@dennisreimann.de>
2022-01-24 20:00:42 +09:00
11d6588249 Add suggestion list for currency inputs (#3347)
* Move tagHelpers in their own directory

* Add suggestion list for currency inputs
2022-01-24 20:00:13 +09:00
30db0cd4f4 Make users table responsive (#3348) 2022-01-24 14:03:56 +09:00
692b57a1ad Fix the notification dropdown not updating without page refresh 2022-01-23 15:49:43 +09:00
7505c65401 Logo Replaced
ETB logo change with a new, more consistent logo with other liquid assets.
2022-01-21 20:49:05 +01:00
54a735ffd9 Pay Button: Fix CSP violations for custom amount and slider (#3334)
Fixes #3241.
2022-01-21 11:11:08 +09:00
6a20d9036c Refactor signed out action views (login, register, etc.) (#3333)
* Refactor signed out action views (login, register, etc.)

Extract common layout and some more cleanups.

* Optimize supporters display on mobile

* Optimize footer display on mobile
2022-01-21 11:10:03 +09:00
c338846d63 Mobile navigation (#3331)
* Mobile nav: Horizontal scrolling

* Reduce nav item spacing on mobile

* Update overlay color

* Fix modal colors

* Improve mobile nav styles

* Improve navbar on mobile Safari

* Scroll active nav item into viewport
2022-01-21 10:35:12 +09:00
c419ad68bb Remove redundant payment methods from store settings (#3323)
* Add enabled toggle to wallet settings view

* Add enabled toggle to Lightning settings view

* Remove redundant payment methods from store settings

* Rename Payment Methods to Payments

* Adapt tests

* Fix invoice state toggle on details page

* Add spacing on Lightning sett8ings page
2022-01-19 20:58:02 +09:00
51c486c15a Add Lightning page with services (#3308)
* Add Lightning page with services

* Adapt other services pages

* Display Lightning services only for internal node
2022-01-19 11:52:05 +09:00
306ff3d919 Auto-submit scanned login code
Closes #3321.
2022-01-18 15:42:09 +01:00
d667b8ae8b Add LNURL support to Crowdfund 2022-01-18 12:26:15 +01:00
72d728eb47 Update BTCPayServer/Views/UIAccount/LoginWithFido2.cshtml 2022-01-18 12:25:56 +01:00
801ab862a3 Improve 2FA auth UI 2022-01-18 12:25:56 +01:00
d7b4dd2d4c Show action button for safari browsers when using FIDO2 (#3322)
fixes #3197
2022-01-18 10:23:07 +09:00
1d3f74c8bb Home sweet home (#3313)
* Link to store home, show home only if there is no store

* Handle store guest case

* Apply correct policies to nav items
2022-01-18 10:20:59 +09:00
c3f73c0de3 Content Consistency Updates (1.4.0) (#3316)
* updates

* updates

* updates

* updates

* updates

* moves api key CTA to top right

* updates

* more updates

* more updates

* Fix active state when "Account" is selected

* Update wording in subnav: Profile becomes Account

* Fix email test

* Update Emails wording

* Try to fix email test

* Make General first tab in store settings

Co-authored-by: Dennis Reimann <mail@dennisreimann.de>
2022-01-18 10:19:27 +09:00
1fc2fc7a11 Merge pull request #3317 from BTCparadigm/patch-1
Update LICENSE
2022-01-17 17:18:36 +09:00
13ea1898b6 Merge pull request #3314 from dennisreimann/theme-colors
Theme colors
2022-01-17 17:16:26 +09:00
586303f47e Merge pull request #3319 from NicolasDorier/wfuoi
Make sure the SubscribeAsync handlers are executed in order
2022-01-17 17:16:03 +09:00
ce86a838f2 Merge pull request #3315 from dennisreimann/2fa-login
Fix secondary login view
2022-01-17 17:15:51 +09:00
21e69251e3 CanSendIPN can't ensure received payment is sent first 2022-01-17 16:59:37 +09:00
a42323a527 Make sure the SubscribeAsync handlers are executed in order 2022-01-17 13:36:33 +09:00
14da3023d8 Merge pull request #3310 from NicolasDorier/niceurl
Use nicer urls, part2 (Fix #921)
2022-01-17 11:41:20 +09:00
7eb5f57478 Fix Rates page 2022-01-17 11:25:33 +09:00
2cb443df8a Update LICENSE 2022-01-16 16:11:22 +02:00
961769ebd0 Fix AssertNoError to detect page exception 2022-01-16 12:39:08 +09:00
3266cc8e3b Improve Lightning node toggle colors 2022-01-15 21:07:01 +01:00
3dec14b89d Fix secondary login view 2022-01-15 20:49:04 +01:00
a67f989dda Theme variable value updates 2022-01-15 20:20:52 +01:00
2d05464b17 Light theme: Use off-white bg for content 2022-01-15 19:56:38 +01:00
a39082e565 Add scrollbar styles 2022-01-15 19:54:50 +01:00
d1f567eade Add Include Error Details to postgres connection string 2022-01-15 14:54:06 +09:00
b9fdd54538 Use nicer urls, part2 (Fix #921) 2022-01-15 14:54:06 +09:00
7243aec213 Support LNURL Auth 2022-01-14 13:26:30 +01:00
1fb582c35d Rename the Fido2Controller 2022-01-14 18:34:30 +09:00
c6da0409b0 Merge pull request #3307 from NicolasDorier/fewiwqi
Update some code style enforcement
2022-01-14 18:05:50 +09:00
50d4b55f73 Warning if not using 'simple using' 2022-01-14 17:50:29 +09:00
c6a7e90c1a Warning if not using 'is not null' 2022-01-14 17:48:15 +09:00
5cbc2e96e7 Merge pull request #3261 from NicolasDorier/qfouq
Rename controllers
2022-01-14 16:23:47 +09:00
23a96c07ae Rename GreenField -> Greenfield 2022-01-14 13:46:04 +09:00
7a787fc945 Rename UI controllers 2022-01-14 13:46:03 +09:00
ce43de0c57 Rename greenfield controllers 2022-01-14 12:21:06 +09:00
eaf47d3739 Rename controllers Bitpay controllers 2022-01-14 12:21:06 +09:00
5eebdb6774 Use nicer urls (Fix #921) (#3304) 2022-01-14 12:20:50 +09:00
51db1593d6 Remove stores list (#3300) 2022-01-14 11:59:27 +09:00
223c71ce8b Fix tests 2022-01-13 23:50:33 +09:00
127afdb5c1 Store-Centric Minor Tweaks (#3276)
* padding above store selector + left & right content padding

* Adapt vertical spacing for content area

Co-authored-by: Dennis Reimann <mail@dennisreimann.de>
2022-01-13 20:29:38 +09:00
f34706f9f0 Update lightning lib 2022-01-13 19:18:14 +09:00
f76ce54109 Fix tests 2022-01-13 18:14:27 +09:00
f67fa6a5d6 Remove right to admins to bypass permissions to modify/view invoices or stores (#3297) 2022-01-13 17:42:32 +09:00
5ad6d77973 The notification dropdown wasn't fetching events if rootPath used (#3299) 2022-01-13 17:08:33 +09:00
69d1acc797 Empty states: Setup guide for store and wallet (#3255)
* Store Selector: Create first store button

* Add setup guide to homepage

* Policy update for stores list

* Fix test

* Initial create store button as primary

* Add notifications list to homepage

* Remove back to list from store create view

* Adapt content padding on desktop

* Add store home view with setup guide

* Fix active page nav highlighting

* Test fix

* Remove What's Next section

* Rename Store Home to Dashboard

* Fix Lightning setup link

* Add tests for store setup guide

* Update BTCPayServer/Views/Home/Home.cshtml

Co-authored-by: Pavlenex <pavle@pavle.org>

* Update BTCPayServer/Views/Stores/Dashboard.cshtml

Co-authored-by: Pavlenex <pavle@pavle.org>

* Remove setup guide on global homepage

* Remove Shopify setup link from nav

* Fix content container max-width on desktop

Co-authored-by: Pavlenex <pavle@pavle.org>
2022-01-13 17:08:15 +09:00
0c0235a56e Merge pull request #3298 from NicolasDorier/wfwiouoi
Add version to svg's href files to prevent cache issues
2022-01-13 15:55:14 +09:00
7b0558dc8e Add version to svg's href files to prevent cache issues 2022-01-13 15:54:40 +09:00
77be2fa9d5 Make CanUseWebhooks less flaky 2022-01-13 13:27:02 +09:00
8f320337e0 Merge pull request #3296 from dennisreimann/clipboard
Fix clipboard copy edge case
2022-01-13 13:23:26 +09:00
2327b97fa3 Make CanUseWebhooks less flaky 2022-01-13 13:21:54 +09:00
a411a6a81a Fix copy functionality without navigator.clipboard 2022-01-13 11:50:37 +09:00
d66f1f5513 Remove duplicate event handler 2022-01-12 16:22:56 +01:00
7503fde48c Merge pull request #3295 from NicolasDorier/foiuw
Make BTCPayServer insensitive to the working directory in which it is started (Fix #1894)
2022-01-12 20:45:09 +09:00
20c8916610 Make BTCPayServer insensitive to the working directory in which it is started (Fix #1894) 2022-01-12 20:20:26 +09:00
5a2a933b64 Add more logs to the canusetor test 2022-01-12 18:26:45 +09:00
ffc0e996db Merge pull request #3294 from NicolasDorier/fewouq
Bump Clipboard.js
2022-01-12 16:59:36 +09:00
a02ad104ee Bump Clipboard.js 2022-01-12 16:06:28 +09:00
625876ff07 Merge pull request #3293 from bolatovumar/fix/vscode-browser-launch
Adjust VSCode browser launch regex
2022-01-12 14:25:34 +09:00
b935275fd9 Adjust VSCode browser launch regex
VSCode stopped launching BTCPay in a new browser tab after this commit: ab3aab9c22 (diff-2baea61aec1a18e36f951b0060f693c9bd10d9610e2681d36277e79d101005bcR66)
2022-01-11 21:11:15 -08:00
4c032e9e6a Merge pull request #3290 from dennisreimann/tor-url-in-footer
Improve footer
2022-01-12 11:19:54 +09:00
1b770c66cd Improve footer 2022-01-11 18:56:30 +01:00
96259dfb49 Merge pull request #3289 from NicolasDorier/oiufew
Do not send email twice for bitpay API, log whether IPN is an ExtendedNotification. (Fix #968)
2022-01-12 00:42:44 +09:00
e4d9e3e22e Do not send email twice for bitpay API, log whether IPN is an ExtendedNotification. (Fix #968) 2022-01-12 00:26:12 +09:00
fbfab88257 Remove obsolete code in BitpayIPNSender 2022-01-12 00:10:55 +09:00
708f8b49df [Greenfield] Let non-admin update LN payment method with internal node if it is unchanged (Fix #2860) (#3288) 2022-01-11 23:38:05 +09:00
323e5e14a3 Update Payment Request View (#3259)
* removes "back to list"

* changes currency label + formats currency and amount

* adjust sizing

* Wording: Create and Save button

* Improve search responsive behaviour

Co-authored-by: Dennis Reimann <mail@dennisreimann.de>
Co-authored-by: Nicolas Dorier <nicolas.dorier@gmail.com>
2022-01-11 22:16:16 +09:00
5bbaa48b49 Fix change state broken in the UI and update invoice's status in payment request to new convention (Fix #3265) (#3286) 2022-01-11 21:49:56 +09:00
cd91e48713 Swagger: Added explanation for empty currency field in Create Payment Request (#3285)
* Swagger: Added explanation for empty currency field in Create Payment Request

* Added nullable true
2022-01-11 20:11:11 +09:00
7444bd06e4 [Greenfield] Fix create/update payment requests expiry field and allow null currency field (Fix #3222) (#3284) 2022-01-11 18:42:44 +09:00
0017e687db A store's guest should be able to manage lightning invoices (Fix #3212) (#3283) 2022-01-11 17:22:10 +09:00
5865fd5022 Improve Payout View (#3260)
* updates payouts

* update spacing

* improvements

* View updates

* updates spacing

* Fix spacing

* Fix markup

* Fix test

Co-authored-by: Dennis Reimann <mail@dennisreimann.de>
2022-01-11 17:15:23 +09:00
4b941a5145 Update Invoice Views (#3264)
* updates create invoice

* updates invoice list

* formats

* updates row

* updates

* Improve invoice list markup and fix mass action form

* Responsive invoice table

* Improve spacing on invoice detail view

* Improve archive message

* Responsive status change partial

* Add test case for mass archiving

* Add mass unarchiving

Closes #3270.

Co-authored-by: Nicolas Dorier <nicolas.dorier@gmail.com>
Co-authored-by: Dennis Reimann <mail@dennisreimann.de>
2022-01-11 17:14:34 +09:00
3c5d809cf9 Merge pull request #3282 from NicolasDorier/wofiq
The IPN notification manager should preserve IPN ordering
2022-01-11 15:22:07 +09:00
ba101015f6 Use the MultiProcessingQueue in IPNSender 2022-01-11 15:06:00 +09:00
6999abe1ca Rename WebhookNotificationManager -> WebhookSender 2022-01-11 13:21:38 +09:00
cb295e20d4 Rename InvoiceNotificationManager -> BitpayIPNSender 2022-01-11 13:21:38 +09:00
c6df43363f Extract MultiProcessingQueue from WebhookNotificationManager 2022-01-11 13:21:38 +09:00
81cec36b68 Merge pull request #3279 from NicolasDorier/quofwe
[Greenfield] if some json property are invalid, throw nice error instead of an exception (Fix #2795)
2022-01-10 23:56:57 +09:00
47c1ffe53f Fix doc for address preview of derivation scheme 2022-01-10 23:03:30 +09:00
90a9051827 Merge pull request #3273 from dstrukt/improve-lightning-config-view
Simple Lightning Node Selector Improvement
2022-01-10 22:13:38 +09:00
8bea3dd21e [Greenfield] if some json property are invalid, throw nice error instead of an exception (fix #2795) 2022-01-10 22:11:04 +09:00
e164b1f169 The PayButton should select the default currency of the store as default 2022-01-10 20:37:36 +09:00
383765f5fe Solve spacing via CSS 2022-01-10 12:22:12 +01:00
25a59fff4a Merge pull request #3275 from NicolasDorier/oifwuq
Improve error message for create store wallet transaction (Fix #3256)
2022-01-10 18:00:39 +09:00
03af471f65 Improve error message for create store wallet transaction (Fix #3256) 2022-01-10 11:59:13 +09:00
d189deefb4 adds secondary button look to rounded tab nav 2022-01-09 03:04:32 -08:00
e957180618 Merge pull request #3269 from btcpayserver/odqiq
Validate the name of controllers when LinkGenerator
2022-01-08 14:32:55 +09:00
47d8d3cdb1 Validate the name of controllers when LinkGenerator 2022-01-08 14:16:17 +09:00
f364451a96 Merge pull request #3262 from dstrukt/remove-back-to-list-ctas
Remove remaining "Back to list" CTAs
2022-01-08 12:21:04 +09:00
2c51b31c62 Merge pull request #3267 from dennisreimann/store-centric-account
Account menu improvement
2022-01-08 12:20:04 +09:00
0dcf240faf Account menu improvement 2022-01-07 17:25:28 +01:00
88bc1c64d2 Fix tests 2022-01-07 21:47:19 +09:00
84bd8a6e98 fix tests 2022-01-07 21:16:26 +09:00
0d657fc646 Fix tests 2022-01-07 20:54:26 +09:00
64b85ac1f9 Fix AssertNoError 2022-01-07 19:49:33 +09:00
81c1cc6728 Add rockstar friendly error 403 2022-01-07 19:46:38 +09:00
098879585a Merge pull request #3263 from NicolasDorier/qouif
Fix CookieAuthHandler and guest permission to invoice's view
2022-01-07 18:31:23 +09:00
fc91077430 A store's guest should be able to see invoice information 2022-01-07 18:10:31 +09:00
b71a04943b CookieAuthHandler shouldn't set store context if appId/payReqId/invoiceId is not found 2022-01-07 18:10:31 +09:00
dd4fb68e5b invoices - remove 2022-01-06 23:01:04 -08:00
a085a2a557 apps - remove 2022-01-06 22:58:14 -08:00
fa84e34def Fix test 2022-01-07 13:02:07 +09:00
8c3f377fc0 fix elements 2022-01-06 18:09:06 +01:00
f9d14c64ce Simple Improve Receive Wallet View (#3251)
* removes card styles

* removes card styles

* removes card style

* Minor improvements

Co-authored-by: Dennis Reimann <mail@dennisreimann.de>
2022-01-05 20:23:36 +09:00
fc687f9fc0 Fixed LND admin macaroon hexdump command (#3252)
Argument `-plain` didn't work for me in the LND container, but `-p` did. 
The error I got was `xxd: invalid number 'ain'`

Added the `-c 256` for better readability. This param maxes out at 256.
2022-01-05 20:23:21 +09:00
57071d7bc8 Replace Square Crypto with Spiral (#3254)
Closes #3253
2022-01-05 20:22:24 +09:00
324a246189 Fix dockerfile 2022-01-03 22:11:33 +09:00
a706f81760 Fix VSCode launch.json for .NET 6 (#3242) 2022-01-03 12:09:43 +09:00
ab3aab9c22 Make BTCPayServer works with dotnet watch hot reload 2022-01-01 22:05:51 +09:00
fd2e55e444 Simplify tests to take advantage of context (#3246) 2021-12-31 22:02:53 +09:00
04b8eafacb Run dotnet format (#3244) 2021-12-31 16:59:02 +09:00
e2d0b7c5f7 Store centric UI: Part 3 (#3224)
* Set store context in cookie

* Fix page id usages in view

* Move Pay Button to nav

* Move integrations to plugins nav

* Store switch links to wallet if present

* Test fixes

* Nav fixes

* Fix altcoin view

* Main nav updates

* Wallet setttings nav update

* Move storeId cookie fallback to cookie auth handler

* View fixes

* Test fixes

* Fix profile check

* Rename integrations nav extension point to store-integrations-nav-list

* Allow strings for Active page/category for plugins

* Make invoice list filter based on store context

* Do not set context if we are running authorizer through tag helper

* Fix test and unfiltered invoices

* Add permission helper for wallet links

* Add sanity checks for payment requests and invoices

* Store context in home controller

* Fix PayjoinViaUI test

* Store context for notifications

* Minor UI improvements

* Store context for userstores and vault controller

* Bring back integrations page

* Rename notifications nav pages file

* Fix user stores controller policies

* Controller policy fixes from code review

* CookieAuthHandler: Simplify CanViewInvoices case

* Revert "Controller policy fixes from code review"

This reverts commit 97e8b8379c2f2f373bac15a96632d2c8913ef4bd.

* Simplify LayoutSimple

* Fix CanViewInvoices condition

Co-authored-by: Kukks <evilkukka@gmail.com>
2021-12-31 16:36:38 +09:00
db1a124ffb Do not check certificates for SMTP settings if local server 2021-12-29 18:24:24 +09:00
0dcfbe8581 Remove internal socks http proxy and use .net60 socks support (#3240) 2021-12-28 18:57:22 +09:00
0e1b872777 Update dotnet version in README 2021-12-28 17:40:36 +09:00
ed5b159fb6 Use ArgumentNullException.ThrowIfNull everywhere (#3239) 2021-12-28 17:39:54 +09:00
9b7ca76b99 Use Outstanding amount for shopify order invoices (#3203)
* Use Outstanding amount for shopify order invoices

* consider shopify order may have multiple transactions

* Use presentment currency not just currency

fixes #2683
2021-12-28 15:56:54 +09:00
eeebb99ca3 Consistent and simplified button CTA text (#3234)
* refine pull payments cta

* payment requests cta

* invoice cta

* add user cta

* webhooks cta

* set password cta

* removes whitespace

* set password cta

* api key cta

* change password cta

* add device 2fa cta

* create token cta

Co-authored-by: Nicolas Dorier <nicolas.dorier@gmail.com>
2021-12-28 15:54:31 +09:00
e2b18cf9db Make sure dotnet test show test progress 2021-12-27 14:26:03 +09:00
955ba91770 Merge pull request #3233 from NicolasDorier/fwihqb
Bump to C#10, remove warnings
2021-12-27 14:10:23 +09:00
c0e9f91bdc Fix warnings 2021-12-27 13:58:18 +09:00
259f0b5aad Bump to C# 10 2021-12-27 13:20:57 +09:00
02419dcdd1 Migrate to .net6.0 (#3198) 2021-12-27 13:15:43 +09:00
4a66c91cac Fix app permissions (#3227)
* Fix app permissions

As pointed out by @nicolasdorier [here](https://github.com/btcpayserver/btcpayserver/pull/3205#issuecomment-999437555).

* Fix for login codes view

* Ensure app belongs to store
2021-12-26 12:20:46 +09:00
48ac996d77 Sign in with other device (quick mobile login) (#2504)
Co-authored-by: Dennis Reimann <mail@dennisreimann.de>
Co-authored-by: Nicolas Dorier <nicolas.dorier@gmail.com>
2021-12-24 09:27:00 +01:00
82b4debcac Renamed Payment Request "Created" field to "CreatedTime" for consistancy since we already have a breaking change (#3230) 2021-12-23 14:48:10 +01:00
5f5f71bf37 Normalize greenfield responses for 404s (#3220) 2021-12-23 13:32:08 +09:00
ae33fc3031 PaymentReq "Created" field is not really a unix timestamp in JSON. Also renamed to "CreatedTime" like with invoices (#3221)
* PaymentReq "Created" is not really a unix timestamp in JSON. Also renamed to "CreatedTime" like with invoices

* Renamed field so it is not a breaking change

* Update swagger.template.payment-requests.json
2021-12-23 13:30:49 +09:00
f63a9ed1a0 Added field "StoreId" to a Payment Request in Greenfield 2021-12-22 16:17:35 +01:00
9843f66bb6 Add example to cryptoCode in greenfield doc 2021-12-22 11:39:43 +09:00
b2c1846ebb Update link in README.md (#3219) 2021-12-21 09:32:39 +01:00
8e5a9251d6 Address feedback from code review
Thanks @kukks
2021-12-21 09:24:09 +01:00
3a59e2a5c4 Cache resolved store items in HTTP context 2021-12-21 09:24:09 +01:00
38ff3e5e89 Fix footer position on large breakpoints 2021-12-21 09:24:09 +01:00
1f0653985a Apply permission tag helpers to main navigation 2021-12-21 09:24:09 +01:00
a4fa61e5f6 Authorize invoice refund route
The customer gets a pull payment route to initiate the refund, so this one is only for merchants and needs to be authorized.
2021-12-21 09:24:09 +01:00
b68eae6f7d Re-add status messages to pull payments and payout views 2021-12-21 09:24:09 +01:00
2d7c5cabab Refactor page titles and active page functionality 2021-12-21 09:24:09 +01:00
42e731369e Remove section nav for pull payments and payouts 2021-12-21 09:24:09 +01:00
7d2627551b Store Settings nav update 2021-12-21 09:24:09 +01:00
f4bde164bf Changed API policy for calculating feeRate (#3217) 2021-12-20 11:16:23 +01:00
bb751793c8 Various minor UI fixes and cleanups (#3208)
* Copy to clipboard fix

* Improve invoice status change wording and JS

* Re-add ability to delete apps

Now that the list view is gone, we need to move this option to the edit view

* Clean up app and payment request bundles

* Fix for invoice status change when dismissed
2021-12-19 13:05:10 +09:00
c68141119c [Greenfield] Send forbid 403 rather than empty results on /api/v1/stores (#3215) 2021-12-19 01:01:54 +09:00
163d1a195d Fix: DateTime passed to bitpay API weren't assumed UTC, remove DateTime.Now references (#3206) 2021-12-17 15:31:06 +09:00
6de4f6a3ac Mention the missing API permission in the response of a Greenfield request (#3195)
* Mention the missing API permission in the response header or body

* Fixes + Added a unit test. 1 TODO remains.

* Added MissingPermissionDescription to the error

* Update BTCPayServer.Tests/GreenfieldAPITests.cs

Co-authored-by: Nicolas Dorier <nicolas.dorier@gmail.com>

* Fix tests

* [GreenField]: Make sure we are sending fully typed errors

Co-authored-by: Nicolas Dorier <nicolas.dorier@gmail.com>
2021-12-16 23:04:06 +09:00
89a52703f6 Merge pull request #3204 from NicolasDorier/fixlightningapi
[Greenfield] Various store's lightning api fixes
2021-12-16 14:41:46 +09:00
4f7eeea14e Greenfield: Improve error message, do not use internal lightning node on store's lightning API 2021-12-16 14:27:34 +09:00
bbddd72780 Fix permissions required for store's lightning node in doc 2021-12-16 12:31:24 +09:00
ac099aa513 Change implementation of the Smtp server (#3202)
* Change implementation of the Smtp server

* Update BTCPayServer/Services/Mails/EmailSettings.cs

Co-authored-by: Andrew Camilleri <evilkukka@gmail.com>

Co-authored-by: Andrew Camilleri <evilkukka@gmail.com>
2021-12-15 21:30:46 +09:00
ece5401121 Bump QR and LNURL libs 2021-12-15 10:14:20 +01:00
fd7b11518c Update changelog 2021-12-14 12:14:33 +09:00
9a70b4487c Fix: serverinfo 'available' wasn't set for BTC 2021-12-14 00:05:41 +09:00
19af02e71b Fix issue in invoice - changing the payment method (#3169) 2021-12-12 15:04:43 +09:00
619aa05e14 Update invoice state hint display (#3188) 2021-12-12 00:26:45 +09:00
cc60958b30 Upgrade Lightning lib (#3187) 2021-12-11 14:32:28 +09:00
bd2f35a241 Remove Ethereum support (#3182) 2021-12-11 14:31:41 +09:00
cf78987fab Fix LN Node availability check (#3189) 2021-12-11 14:31:25 +09:00
f8e6b51e9d Store-centric UI (#3091)
* Update layout structure and header

* Implement store selector

* Simplify homepage

* Update layout

* Use dropdown for store selector

* Hide global nav in store context

* Horizontal section nav

* Remove outer section and container from content views

* Update nav

* Set store context for invoice and payment request lists

* Test fixes

* Persist menu collapse state on client-side

* MainNav as view component

* Update app routes to incorporate store context

* Test fixes

* Display ticker for altcoins build only

* Plugins nav

* Incorporate category for active page as well

* Update invoice icon

* Add apps list to nav

* Add store context to app type controllers

* Incorporate id for active page as well

* Test fixes

* AppsController cleanup

* Nav: Display only apps for the current store

* Remove leftover from merge

* Nav styles optimization

* Left-align content container

* Increase sidebar padding on desktop

* Use min-width for store selector menu

* Store settings nav update

* Update app and payment request routes

* Test fixes

* Refactor MainNav component to use StoresController

* Set store context for invoice actions

* Cleanups

* Remove CurrentStore checks

The response will be "Access denied" in case the CookieAuthorizationHandler cannot resolve the store.

* Remove unnecessary store context setters

* Test fix
2021-12-11 12:32:23 +09:00
2b1436e303 Fix build warning in Invoice Testing Controller (#3191) 2021-12-10 12:31:04 +01:00
cf772bb9e0 Improvements for disabled plugins status indicators (#3168)
* Improvements for disabled plugins status indicators

close #3150

* Improve spacing

Co-authored-by: Dennis Reimann <mail@dennisreimann.de>
2021-12-08 13:47:35 +09:00
fd75008499 Allow pull payments for store guests (#3128) 2021-12-08 00:40:24 +09:00
e113c12768 Fix copy pay button code (#3175) 2021-12-04 21:12:15 +01:00
3acda5b342 Fix code display (#3172) 2021-12-04 09:20:35 +01:00
bbea9d7a27 Swagger fixes (#3170) 2021-12-04 09:20:23 +01:00
b0125adfe9 Merge pull request #3165 from MsFloofie/patch-1
Fixed spelling mistake
2021-11-30 20:56:46 +01:00
d3b28a98be Fixed spelling mistake
Changed a misspelling from "synch" to "sync" ;)
2021-11-29 16:17:38 -05:00
c679654ada Send block reward to a random address instead of the invoice address. Default mine 1 block. (#3164)
* Send block reward to a random address instead of the invoice address. Default mine 1 block.

* Using a random address for the block reward
2021-11-29 19:44:56 +09:00
26f3cffe5c Fix possible null reference exception when creating a pull payment (#3162)
Co-authored-by: Andrew Camilleri <evilkukka@gmail.com>
2021-11-29 07:26:30 +01:00
8f0d82d219 Cheat mode to mine blocks (#3163) 2021-11-29 07:23:56 +01:00
6fec929656 Remove infinite loop in test 2021-11-27 11:40:06 +09:00
ec68d2a0e6 Remove Confirmed state in UI (#3090)
* Remove Confirmed state in UI

Closes #1789.

* Add infobox & improve refund tooltip

* Update BTCPayServer/Views/Invoice/ListInvoices.cshtml

Add @dennisreimann suggestion

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

* Add "don't show again" button

Adds a "Don't Show Again" button to the infobox. Also a bugfix that was preventing the new status from showing in the invoice details page.

* Add User blob and move invoice status notice to it

Co-authored-by: d11n <mail@dennisreimann.de>
Co-authored-by: Kukks <evilkukka@gmail.com>
2021-11-26 23:13:41 +09:00
f6afb9a3f0 CheatMode should use NBXplorer RPC proxy rather than hardcoded client 2021-11-26 18:34:40 +09:00
70bb6d999e Fix lightnign flaky test 2021-11-26 15:08:28 +09:00
e9074a8ec1 Test improvement exposing failing test (#3120)
* Test improvement exposing failing test

* Test fixes

* Fix test

* update alt compose

* Fix test CanUsePullPaymentsViaUI

* Fix CanChangeUserMail

Co-authored-by: Kukks <evilkukka@gmail.com>
Co-authored-by: nicolas.dorier <nicolas.dorier@gmail.com>
2021-11-26 15:02:30 +09:00
9b730e784f Add pagination for API GetNotifications (#3145) 2021-11-26 11:55:59 +09:00
57852821f5 Remove sync modal from "Forgot password" page (#3159)
* Update "Forgot password" page layout

* Fix null reference error
2021-11-26 11:54:33 +09:00
87061ecfc0 Support BC-UR v1 wallet import (#3080)
Co-authored-by: Dennis Reimann <mail@dennisreimann.de>
2021-11-25 10:25:22 +01:00
d555d2f3f6 Fix flaky alert message lookup 2021-11-25 10:24:14 +01:00
3b3fac98ad Improve Lightning settings display 2021-11-25 10:24:14 +01:00
285a30f67a Plugins: Provide extension points for Lightning setup 2021-11-25 10:24:14 +01:00
fa83304697 Improve time helper to also work with future datetimes 2021-11-25 10:24:14 +01:00
e42ef4b2f8 Plugins: Update startup for plugin compatibility 2021-11-25 10:24:14 +01:00
cc3908cdb3 Checkout: Fix UI flickering on payment method change (#3158) 2021-11-25 10:22:45 +01:00
e3def45c83 Update Bitbank API (#3157)
Co-authored-by: Kukks <evilkukka@gmail.com>
2021-11-25 09:34:49 +01:00
4fe4cdb7bf Redirect to payment requests page instead of edit page on archive action (#3142)
* Redirect to payment requests page instead of edit page on archive action

* Remove unused "using" directive
2021-11-24 20:27:56 +09:00
11a9b10a54 Minor visual improvements to various Server Settings views (#3152) 2021-11-24 09:59:19 +01:00
5164402e27 Merge pull request #3149 from btcpayserver/qoufhe
Remove Logs static singletons
2021-11-24 17:37:47 +09:00
20f32e94a8 Run tests in parallel 2021-11-23 19:17:17 +09:00
35aad4ebf9 Remove Logs static singletons 2021-11-23 13:55:34 +09:00
d60e4f8fe4 Merge pull request #3148 from btcpayserver/fweoqh
Isolate tests requiring internet access
2021-11-23 13:28:05 +09:00
e5a5eb3547 Add third party tests to the suite, skip azure test if not configured 2021-11-23 13:26:47 +09:00
fbb4b13898 Isolate tests requiring internet access 2021-11-23 12:53:05 +09:00
573f1ddf76 Move fast tests in own class (#3144) 2021-11-23 00:49:51 +09:00
ead0f284f2 Simple Invoice Detail View Cleanup (#3100)
* changes copy to "unarchive", more clear

* adds semibold custom class

* adds class to TH elements & uppercases labels

* whitespace and padding patches

* uppercase patches

* removes class in site.css + updates class name

* Fix test

Co-authored-by: Dennis Reimann <mail@dennisreimann.de>
2021-11-22 13:57:20 +09:00
6ff659fb99 Simple Payment Request and Pull Payment Views Improvements (#3127)
* adds border radius to payment request view

* adds border radius to pull payments view

* spacings + font weights

* paddings + font weights

* updates text color

* updates font weights + text colors

* padding consistency

* switches padding to empty state

* update

* another padding fix

* Add "no details provided" when empty description

Co-authored-by: Samuel Adams <samuel.atwood@gmail.com>
2021-11-22 13:56:43 +09:00
194c0f14cb Format perk value correctly in crowdfund app (#3141)
close #3109
2021-11-22 13:55:07 +09:00
7ab78fff3f Invoice View Improvements (#3092)
* view improvements

* improves label, adds section headers, re-orders

* Available payment methods as checkboxes

* adds required label

* Update default payment method label

Thanks @woutersamaey for the suggestion.

* Move POS data and notifications to additional options

* Update display names

* adds checkbox to pull payments

* updates label

* Revert "updates label"

This reverts commit 9ed320e863951534d0dd359c13ec7dbaa4e1bd56.

* Revert "adds checkbox to pull payments"

This reverts commit 28ea6bfb6ed17df8cc44117814bffdfc80c12e70.

* removes required label

* Select all supported tx currencies by default

Slight modification to the checkbox list.

Co-authored-by: Dennis Reimann <mail@dennisreimann.de>
Co-authored-by: Samuel Adams <samuel.atwood@gmail.com>
2021-11-22 13:54:42 +09:00
eabe24bb3e changelog and bump 2021-11-20 22:45:21 +09:00
c01fae5fcd Bump LND (#3130) 2021-11-20 22:41:35 +09:00
c088e0fd55 add extension point in ui 2021-11-18 16:07:54 +01:00
cb1dbe7662 Improve invoice warning for no payment method configured
Closes #3085.
2021-11-18 10:05:37 +01:00
03f8d6693d Improve Access Tokens View (#3118)
Co-authored-by: Dennis Reimann <mail@dennisreimann.de>
2021-11-18 10:04:20 +01:00
6813a6ea63 Refactoring: Invoice UI Controller cleanups
Simple and IDE proposed changes and cleanups I came across while working on #3092.
2021-11-18 10:02:24 +01:00
4cd18a1b28 Improve Pay Button View (#3112)
Co-authored-by: Dennis Reimann <mail@dennisreimann.de>
2021-11-18 09:58:29 +01:00
90907c6306 Improve Store User View (#3117) 2021-11-18 09:56:25 +01:00
c67b2be9d2 Fix Taproot checks after code removal
Necessary additions to 8d6c5dcd651c661e27f7dd7bfeac1e9a30540afa
2021-11-17 13:40:55 +01:00
8d6c5dcd65 Remove useless code 2021-11-16 21:02:25 +09:00
e5fa6fa55a Updates Pull Payment Payment Method (#3107)
* adds checkbox to pull payment

* adds label improvement

* removes "back to list"

* Remove superfluous style block

Seems to be a copy and paste remainder

* Make custom CSS additional options

* Fix input name and test

* Improve display for case with only one payment method

* Fix test

Co-authored-by: Dennis Reimann <mail@dennisreimann.de>
2021-11-16 12:58:17 +09:00
748c92436f Improve Rates View (#3105)
* updates headers + changes copy

* type improvement

* updated copy

* updates copy

* updates copy

* Advanced rate rule scripting toggle

Co-authored-by: Dennis Reimann <mail@dennisreimann.de>
2021-11-16 12:50:35 +09:00
e98c6e69d4 Update POS accordion 2021-11-15 16:43:59 +01:00
c389aa0b99 Apply form styles to rich text editor 2021-11-15 16:43:59 +01:00
8696710ad1 Update app accordions 2021-11-15 16:43:59 +01:00
ce3bf91b29 Move custom CSS into additional options 2021-11-15 16:43:59 +01:00
2f5f397d33 Remove taproot activation code 2021-11-15 23:03:10 +09:00
b196bad75f Update changelog 2021-11-15 22:50:13 +09:00
b97dfa841a make elements regtest start with dynfed 2021-11-15 13:10:00 +01:00
31cf2671f5 Optimize admin user list 2021-11-15 10:28:45 +01:00
56c8e43ce8 Test fix 2021-11-15 09:35:56 +01:00
d7dc70c679 adds required label dot 2021-11-15 09:35:56 +01:00
ed0d7b75b5 updates left nav 2021-11-15 09:35:56 +01:00
7649f88173 updates title 2021-11-15 09:35:56 +01:00
e9b8035eae adds title and exposes delete 2021-11-15 09:35:56 +01:00
46486704ab notification updates 2021-11-15 09:35:56 +01:00
a6cee23591 2FA updates 2021-11-15 09:35:56 +01:00
33b5ade2b1 padding 2021-11-15 09:35:09 +01:00
0299eb1d24 whitespace 2021-11-15 09:35:09 +01:00
4f9ea39554 updates title 2021-11-15 09:35:09 +01:00
a2a49636e0 cleans up api key list view 2021-11-15 09:35:09 +01:00
609fd131eb Fix indentation. 2021-11-15 09:33:12 +01:00
08a3fb76fb Adding job to rebuild docs (swagger api) on new tag. 2021-11-15 09:33:12 +01:00
d5c38ef336 Add crypto code for invoice and pull payment payout API response (#3099)
* Add "cryptoCode" for invoice payment method API endpoint response

* Add "cryptoCode" for pull payment payout API endpoint response

* Add "#nullable enable" to GreenFieldInvoiceController

* Add "#nullable enable" to GreenfieldPullPaymentController
2021-11-15 14:25:59 +09:00
03d2b6eabe Checkout page of 0 amount invoices shouldn't crash, but 404 2021-11-15 13:51:36 +09:00
cbcd59c996 Prevent creation of on-chain invoices below the dust limit (#3082)
* Prevent creation of on-chain invoices below the dust limit

Fixes #3071.

* Apply suggestions from code review

Co-authored-by: Nicolas Dorier <nicolas.dorier@gmail.com>

* small fix

* Fix selenium test

0.000000012 BTC (whether rounded or not) is below the dust threshold, causing this test to fail.

* fix CanCreateTopupInvoices test

Don't apply dust threshold conditional for topup invoices.

* Fix test, and minor changes

Co-authored-by: Nicolas Dorier <nicolas.dorier@gmail.com>
2021-11-15 13:48:07 +09:00
c5dc7475a6 Fix type of property cryptoCode (#3088) 2021-11-15 13:15:48 +09:00
40dff0381b Fix bug with fraction amount display in crowdfund app (#3098)
* Update formatting

* Adjust formatting

* Adjust formatting

* Fix bug with BTC fraction amount display
2021-11-15 13:14:55 +09:00
39a1834a75 Merge pull request #3093 from satwo/fix-pull-payout-bug
Fix payout/pull payment crash when no payment method bug
2021-11-15 13:13:40 +09:00
84694d55ad Merge pull request #3101 from bolatovumar/fix/crowdfund-public-display-text
Show correct note when crowdfund is publicly visible
2021-11-15 13:10:07 +09:00
605920b421 Merge pull request #3102 from bolatovumar/fix-transaction-row-display-issues
Fix transaction row display issues
2021-11-15 13:09:32 +09:00
c2a420a291 Fix typo: "Prioriy" -> "Priority" (#3103) 2021-11-15 13:09:15 +09:00
037a77a573 Update Swagger docs for webhook event types (#3104)
close #2999
2021-11-15 13:08:54 +09:00
b366e5dbf7 Fix issue with too much padding in comment input box 2021-11-14 16:18:59 -08:00
a277072968 Fix issue with weird label buttons 2021-11-14 16:17:16 -08:00
5523b554f1 Fix issue with giant label input group button 2021-11-14 16:07:27 -08:00
6ae9dee982 Fix giant "Save comment" button issue 2021-11-14 16:02:32 -08:00
dae4577b43 Fix label display issue 2021-11-14 16:02:11 -08:00
6ac9c74028 Show correct note when crowdfund is publicly visible
See discussion here: https://github.com/btcpayserver/btcpayserver/discussions/2968
2021-11-14 15:34:18 -08:00
a7ef9c7c27 Fix payout/pull payment crash when no payment method bug
Fixes #3084.
2021-11-12 20:09:32 -05:00
08f57558da Fake payment fixes (#3058)
Fixes and various minor improvements for the fake payment form.
2021-11-11 18:31:15 +09:00
28694859c9 Wallet settings merge (#3072)
* Wallet settings merge

Merges both wallet settings screen from the wallets and the store section. Closes #2626.

* Improve wallet transactions view

* Remove unnecessary row/col construct
2021-11-11 14:30:19 +09:00
be7cef29d8 UI changes
Removes the separate column for view style and instead appends it to the App Type column.
2021-11-10 10:52:14 +01:00
e914c84ad3 Adds View Style to Apps list 2021-11-10 10:52:14 +01:00
193b209c92 Add setup links for LN URL integration (#3046) 2021-11-10 10:50:39 +01:00
d5b25dde3d Add admin badge to user list (#3033)
Co-authored-by: d11n <mail@dennisreimann.de>
2021-11-10 10:49:16 +01:00
931aa297cd Fix LockSubscription bug (#3081)
This addresses an obscure issue where `LockSubscription` is unintentionally set to `true`,
which results in a large number of tests failing. h/t to @NicholasDorier for the assist.
2021-11-10 12:28:54 +09:00
fa10249893 Update Changelog.md 2021-11-10 10:49:56 +09:00
14a708b3df bump 2021-11-09 23:34:03 +09:00
d9f535f98a Update changelog 2021-11-09 23:10:18 +09:00
e51cb43283 updates display names (#3036) 2021-11-08 22:24:28 +09:00
bbcdd5ed0d Bootstrap: Fix table styles (#3079) 2021-11-08 20:16:57 +09:00
3c13d6c195 Add test verifying JS files that we ship 2021-11-08 19:09:00 +09:00
61d89d1777 Upgrade Bootstrap to v5.1.3 (#3078)
Regular maintenance upgrade.
2021-11-08 18:53:42 +09:00
bede4a3a42 Fix: Do not crash when redirect url is not provided to Authorize page 2021-11-08 09:24:12 +01:00
befa436087 Fix: Disable LNURL if Lightning gets disabled. 2021-11-08 08:51:21 +01:00
59cf53e083 Fix: Paging in payouts did not take additional parameters in consideration 2021-11-08 08:21:07 +01:00
76a4e9e520 Fix: Payout actions button was misaligned 2021-11-08 08:15:08 +01:00
af635cdc0d Fix: Amount validation for payout creation min amount was missing 2021-11-08 08:14:49 +01:00
cbf3b3e9ea Print view improvements (#3050)
* Add ln enable link

Add print button + print-related css classes

* Modify print-specific css

-Adds @dennisreimann css suggestions to prevent page-breaks cutting off QR codes
-Removes item image and description in print view
-Add comment to explain purpose of print-specific styling in site.css

* Streamline POS print view

Co-authored-by: Dennis Reimann <mail@dennisreimann.de>
2021-11-06 00:21:33 +09:00
b0be248ca5 Attempt to fix CanUseLNAddress flakyness 2021-11-05 13:06:35 +09:00
2828ec76b4 Fix CanUseTorClient test flakyness 2021-11-05 12:30:28 +09:00
de1f94a596 Update Changelog 2021-11-05 12:20:59 +09:00
d16d4d83ea Fix maintenance view (#3068) 2021-11-05 12:20:04 +09:00
ff8adbbd37 bump 2021-11-05 12:18:13 +09:00
a47ba2df3c Add more details to lnaddress not found errors, make sure lnaddress is only for BTC (#3067)
* Add more details to lnaddress not found errors, make sure lnaddress is only for BTC

* Update BTCPayServer/LNURL/LNURLController.cs

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

* Update BTCPayServer/LNURL/LNURLController.cs

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

* Update BTCPayServer/LNURL/LNURLController.cs

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

Co-authored-by: d11n <mail@dennisreimann.de>
2021-11-05 12:16:54 +09:00
909fc71543 Make test CheckNoDeadLink less flaky 2021-11-05 00:36:05 +09:00
7f13f6f915 Changelog for 1.3.2 2021-11-05 00:29:05 +09:00
f58fc9b531 Logs all events in development 2021-11-05 00:13:40 +09:00
82649dad39 Do not logs all internal events 2021-11-05 00:09:38 +09:00
7e3cda904a Fix: Lightning address pay fails if millisatoshi is not 0 mod 1000 on LND (#3056) 2021-11-04 23:55:58 +09:00
c921b2ca7b Fix: Test Connection for lightning setup was hidding cause of failure 2021-11-04 23:28:26 +09:00
2afd02152d Fix: By default, BTC On chain, the BTC Lightning BOLT11 should be preferred 2021-11-04 18:21:38 +09:00
f3e9e2ec5f Fix: Creating a new invoice in payment request with LNURL activated would crash 2021-11-04 18:03:54 +09:00
d39ae86915 Improve error reporting in create invoice page (#3065) 2021-11-04 17:12:17 +09:00
51f0c2a5f8 Apply better messages 2021-11-04 08:53:44 +01:00
003927418c Improves maintenance domain name form element (#3045)
* switch to flexbox

* removes whitespace

* updates spacings & text color class

* more spacing updates

* updates

* back to row & col

* back to flex + removes text-secondary class
2021-11-04 16:34:51 +09:00
da92cabe4c Fix crowdfund topup issue (#3064)
closes #3048
2021-11-04 16:34:24 +09:00
45a58e1a39 Crowdfund: Fix perk value display (#3060)
Previously this didn't take into account the target currency. This leads to wrong values if the target currency is SATS and the invoice currency is BTC. This updates the value to be calculated with the rate and also takes into account the network fee. (Basically adjusting it to how the contribution values are calculated)
2021-11-04 16:34:11 +09:00
0e1a6a3d5f Bugfix #3049: Price type of edit item in PoS shows only "fixed" (#3052) 2021-11-02 21:02:33 +01:00
34969519d4 Improves upload button for files (#3044)
* reorders form, removes header

* adds flexbox + button formatting

* adjusts whitespace & flexbox class

* adjusts class for mobile
2021-11-02 00:49:12 +09:00
4f235e1d62 resolves Issue #3042 add archive status to invoice response (#3043) 2021-11-01 15:53:33 +09:00
7d0dc49435 fixes visual error with label (#3037) 2021-10-31 20:03:45 +09:00
8fed8f77ad PR for Issue #3038 adds params for getInvoices pagination (#3039)
* ##3038 add pagination elements

* correct skip to take

* updated swagger docs

* set take nullable to true
2021-10-31 19:47:12 +09:00
1c2728bbfb adds spacer (#3035) 2021-10-31 19:44:55 +09:00
fd543bcee1 Improve test flakyness 2021-10-31 14:20:43 +09:00
24b7705094 List webhook URLs (#3034)
Addresses #3000.

I limited the width of the URL field and made the full URL visible with a tooltip. The UI could probably use some sprucing up.
2021-10-30 22:40:26 +09:00
6b96f9b446 bump 2021-10-30 14:00:25 +09:00
933dc6be31 Fix: The checkout page would reload the page when changing payment method 2021-10-30 13:57:24 +09:00
d6e3fb46ee bump 2021-10-29 23:41:02 +09:00
efc05edca3 Update Changelog.md (#2993)
* Update Changelog.md

* Apply suggestions from code review

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

* Apply suggestions from code review

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

* Update

* Update

* Update Changelog.md

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

* Update

* Update

* Update

Co-authored-by: d11n <mail@dennisreimann.de>
Co-authored-by: nicolas.dorier <nicolas.dorier@gmail.com>
2021-10-29 23:25:44 +09:00
aa3d384f47 Add status message partial (#3030)
Along with #3029, this closes #2991.
2021-10-29 23:13:04 +09:00
a5aa5cf059 Fix tests 2021-10-29 23:09:19 +09:00
ccd8859d7f Add missing attribute for textSearch in get invoice 2021-10-29 22:27:21 +09:00
a28399e31d Add warning on ln address if install using rootpath 2021-10-29 22:18:33 +09:00
61f63a9996 POS Light: Add Bootstrap bundle (#3029)
So that the alert can be closed. Brought up by @satwo in this [Mattermost discussion](https://chat.btcpayserver.org/btcpayserver/pl/3f46i9yociydmkk4apncxp7shw).
2021-10-29 21:57:37 +09:00
de93c5c9d6 Fix test warning 2021-10-29 21:51:53 +09:00
94865815c7 Quick fixes before release 2021-10-29 14:50:18 +02:00
33754933d5 Add Azerbaijan language 2021-10-29 20:54:09 +09:00
560b6db480 fix refund button part 2 2021-10-29 13:46:24 +02:00
4c71167535 Fix refund button 2021-10-29 13:20:54 +02:00
707484709a Display and update App Name in settings (#3027)
* Edit and view app name in app settings

Currently the "name" property is not exposed at all in an app's settings/update page, which can result in confusion about which app is being updated, and also a general confusion between the `Title` property and the `Name` property.
This PR gives visibility to the app name in settings, and allows updating of the same.
I also changed the display label for `title` and `name` to make them more distinct and specific.

* Fix tests

* Update AltcoinTests.cs

* Update SeleniumTests.cs

* fix tests

Co-authored-by: Nicolas Dorier <nicolas.dorier@gmail.com>
2021-10-29 19:29:02 +09:00
274be7c1bc Disable build warning in layout (#3028) 2021-10-29 19:06:15 +09:00
3f176a6b6b fix lnurl setter bug 2021-10-29 11:27:36 +02:00
fc8a5ff95f Lightning address support (#2804)
Co-authored-by: Dennis Reimann <mail@dennisreimann.de>
2021-10-29 11:01:16 +02:00
25f84d000b LNURL POS Support (#3019) 2021-10-29 10:27:33 +02:00
31b7826dce make input readonly for fixed cart items 2021-10-29 09:58:59 +02:00
2d4aa52fa5 Restructure store and payment settings (#2995)
Co-authored-by: Kukks <evilkukka@gmail.com>
2021-10-29 08:25:43 +02:00
eee8008bb2 Make sure migration for apps does not crash 2021-10-28 12:23:21 +02:00
a5ae509f9f Make sure invoice show lnurl instead of bolt11 labels 2021-10-28 10:39:49 +02:00
8f117b5079 Add ability to require refund email from app level (#3013)
* Add ability to require refund email from app level

* Add ability request refund email when creating invoice manually

* Adjust labels

* Add UI tests

* Add Greenfield API support

* Rename RequiresRefundEmailType to RequiresRefundEmail

* Fix build

Co-authored-by: Nicolas Dorier <nicolas.dorier@gmail.com>
2021-10-27 23:32:56 +09:00
0b5d0349d4 Do not fire InvoiceExpired twice if invoice partially paid (Fix #3004) 2021-10-27 19:27:19 +09:00
8a0660cbd6 Add support for CryptoMarket exchange rates (#3012)
* Add support for CryptoMarket exchange rates

* Add unit test for CryptoMarket
2021-10-27 15:19:34 +09:00
f7a0b91ec1 Add boolean overPaid to the invoice settled webhook 2021-10-27 14:51:42 +09:00
1ecd1c1e54 LNURL: Add missing logic from lnurl merges and rebases 2021-10-26 14:08:09 +02:00
fccbbb6fb7 LNURL tests and small fixes 2021-10-26 13:55:59 +02:00
d1886b039e Wallet: Make account number an input instead of select (#3018) 2021-10-26 18:00:01 +09:00
79c61f01c8 Make supporter logos work across browsers (#3017) 2021-10-26 11:15:01 +09:00
e50c9266b4 [Fix] If the local culture of the server was not english, numeric values greenfield were not properly interpreted 2021-10-26 00:46:28 +09:00
fd27bd94e2 Add ability to accept tips in POS terminal (#2983)
* Add ability to accept tips in POS terminal

* Add logic for showing and hiding sections specific to a POS app type

* Fix issue with floating point error
2021-10-25 19:06:32 +09:00
05f99f3855 Merge pull request #3007 from bolatovumar/fix/typo-inlude
Fix typos
2021-10-25 18:46:23 +09:00
31ef763c05 Merge pull request #3011 from bolatovumar/add-number-formatting-crowdfund-app
Add number formatting in crowdfund app
2021-10-25 18:45:45 +09:00
c0abcbea24 Merge pull request #3015 from NicolasDorier/ewfoufeoiu
Fixes of bugs happening when using rootpath
2021-10-25 16:55:00 +09:00
a73383cd87 When creating a new apps, the default currency of the store should be used 2021-10-25 16:54:36 +09:00
951bfeefb1 LNURL Payment Method Support (#2897)
* LNURL Payment Method Support

* Merge recent Lightning controller related changes

* Fix build

* Create separate payment settings section for stores

* Improve LNURL configuration

* Prevent duplicate array entries when merging Swagger JSON

* Fix CanSetPaymentMethodLimitsLightning

* Fix CanUsePayjoinViaUI

* Adapt test for new cancel bolt invoice feature

* rebase fixes

* Fixes after rebase

* Test fixes

* Do not turn LNURL on by default, Off-Chain payment criteria should affects both BOLT11 and LNURL, Payment criteria of unset payment method shouldn't be shown

* Send better error if payment method not found

* Revert "Prevent duplicate array entries when merging Swagger JSON"

This reverts commit 5783db9eda17c29908a60fdef2c3ebe130a8b059.

* Fix LNUrl doc

* Fix some warnings

Co-authored-by: Dennis Reimann <mail@dennisreimann.de>
Co-authored-by: nicolas.dorier <nicolas.dorier@gmail.com>
2021-10-25 15:18:02 +09:00
fc7125b8cd Fix: Fonts and Home background not loading properly when using rootpath 2021-10-25 15:14:05 +09:00
26bcdbc766 Fix: Many SVG assets were not showing properly if rootpath is used 2021-10-25 15:14:05 +09:00
fb1fcbe0b9 Fix: The redirect url of crowdfund invoices wasn't set correctly if rootpath is used (Fix #2992) 2021-10-25 15:13:52 +09:00
2c45f803e4 Fix: favicon wasn't shown if using rootpath 2021-10-25 15:13:52 +09:00
fbdd2fc470 Fix flaky test for ripio exchange 2021-10-25 15:10:44 +09:00
0558631982 Improve store/selectlist labeling (#3014) 2021-10-25 13:15:08 +09:00
63e1c5807e Add number formatting in crowdfund app 2021-10-24 14:33:47 -07:00
a3cc1f2ef0 Fix typos 2021-10-23 23:14:36 -07:00
5318684e5c fix build 2021-10-23 22:10:54 +09:00
b3b9651cd8 Use buster rather than bulleyes for arm32 2021-10-23 22:09:13 +09:00
86e528e5df Use NBitcoin's Network.UriScheme rather than our own (#3005) 2021-10-23 14:47:15 +09:00
c46a69e1bd Add Paging to Pull Payments (#2997) 2021-10-22 15:10:59 +09:00
9b0d1a23dc Decouple Pull payment from wallets (#2987)
* Decouple Pull payments from wallet

* Update _Nav.cshtml

* Fixes
2021-10-22 11:17:40 +09:00
db038723f4 Payout Destination Handling (#2985)
* Payout Destination Handling

fixes #2765
This PR:
* reactivates the BIP21 support for payouts.
* allows LNUrl destinations to be reusable.
* allows addresses to be reused in claims as long as the other claims are in a final state

* Ensure bolt amount matches the payout amount

* fixes

* reduce duplicate parsing of bolt

* make hash the id of bolt

* better bolt11 tostring

* use cached payment request from lnurl
2021-10-22 00:43:02 +09:00
a193e1cbf3 Scanner: Improve QR data display 2021-10-21 17:05:44 +02:00
493f1b98c2 Upgrade vue-qr-code-reader and fix scanning issue 2021-10-21 17:05:44 +02:00
926b60df3d Fix camera scanner CSP issue 2021-10-21 17:05:44 +02:00
d8a162fb6e [Fix] CurrencyValue parsing shouldn't depend on locale 2021-10-21 19:15:02 +09:00
4cf3249e0b Add ability to set default currency for a store (#2998) 2021-10-20 23:17:40 +09:00
407f26b1dc fix netehreum warnings 2021-10-20 13:08:50 +02:00
0159588eed Merge pull request #3001 from dennisreimann/supporters
Supporters: Fix SVGs that are referenced in READMEs
2021-10-20 12:27:57 +02:00
6f7be7eb09 Supporters: Fix SVGs that are referenced in READMEs 2021-10-20 12:14:30 +02:00
09a53718bb Abort payjoin request after 30 sec of timeout 2021-10-20 17:06:27 +09:00
5655f22397 Fix default payment bug (#2975)
* Fix default payment bug

This attempts to fix the default payment bug described in #2963.

Update to complete #2986

This takes into account #2986 and @NicolasDorier 's suggestion to add a default payment type as an empty (valueless) option that is selected by default.

* Fix tests

Co-authored-by: nicolas.dorier <nicolas.dorier@gmail.com>
2021-10-20 14:34:04 +09:00
791d0abb34 Clarify payment method criteria error message (#2989)
As requested by @BTCBellyButton, this clarifies the error message shown resulting from an invalid payment method criteria.
https://github.com/btcpayserver/btcpayserver/pull/2975#issuecomment-945218280
2021-10-20 14:02:20 +09:00
13d9930955 Improve supporters display (#2994) 2021-10-20 14:01:55 +09:00
c4f40d68e9 Fix cryptic error message issue (#2978) 2021-10-18 10:42:53 +02:00
9951370321 Fix logo issue (#2977) 2021-10-18 10:41:34 +02:00
0119ad452b Order language dropdown in CheckoutExperience
Solves the same issue as described in the first part of #2971 and solved in #2972, except in the Settings instead of the checkout UI.
2021-10-18 10:40:17 +02:00
3d3016fdca Fix fallback logic for default payment method (#2986) 2021-10-18 16:56:47 +09:00
262798d577 Refactor by adding extension FindPayoutHandler (#2984) 2021-10-18 15:00:38 +09:00
cf206e64a7 Add Lightning payout support (#2517)
* Add Lightning payout support

* Adjust Greenfield API to allow other payment types for Payouts

* Pull payment view: Improve payment method select

* Pull payments view: Update JS

* Pull payments view: Table improvements

* Pull payment form: Remove duplicate name field

* Cleanup Lightning branch after rebasing

* Update swagger documnetation for Lightning support

* Remove required requirement for amount in pull payments

* Adapt Refund endpoint to support multiple playment methods

* Support LNURL Pay for Pull Payments

* Revert "Remove required requirement for amount in pull payments"

This reverts commit 96cb78939d43b7be61ee2d257800ccd1cce45c4c.

* Support Lightning address payout claims

* Fix lightning claim handling and provide better error messages

* Fix tests

Co-authored-by: Dennis Reimann <mail@dennisreimann.de>
2021-10-18 12:37:59 +09:00
5ac4135a13 fix crowdfund js 2021-10-15 12:53:45 +02:00
5176eaf4ba fix test 2021-10-15 12:53:45 +02:00
514417e888 Rename to custom and fix small css 2021-10-15 12:53:45 +02:00
f83e85dc36 addd test 2021-10-15 12:53:45 +02:00
9592a77cff use more concrete types for price type in app items 2021-10-15 12:53:45 +02:00
33a893ba31 Replace addLoadEvent with better practice 2021-10-15 12:53:45 +02:00
f89cdadde8 fix btn text 2021-10-15 12:53:45 +02:00
7d2aa28e1f Support Topup Invoices in Apps 2021-10-15 12:53:45 +02:00
9df4429fc2 Remove unreachable code (#2961) 2021-10-15 16:34:40 +09:00
843a2491ef Improve language dropdown UX/Update jquery-prettydropdowns to 4.17.0 (#2972)
* Improve language dropdown UX

Several improvements to the language selector dropdown list.

* Apply suggestions from code review

Incorporate styling suggestion from @dennisreimann

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

Co-authored-by: d11n <mail@dennisreimann.de>
2021-10-15 14:27:52 +09:00
d64fb15ac2 Greenfield: Provide negative undue when overpaid. (#2936)
* Greenfield: Provide negative undue when overpaid.

closes #2935

* Invoice's due can be negative, fix Amount field of invoice

* Update swagger.template.invoices.json

Co-authored-by: Nicolas Dorier <nicolas.dorier@gmail.com>
2021-10-15 14:23:34 +09:00
3671e7f18c Fix test 2021-10-15 14:19:40 +09:00
899bf98f45 Fix tests 2021-10-15 12:50:33 +09:00
4230ba513f Add support for rpio exchange rate (close #2960) 2021-10-15 12:18:02 +09:00
18f1b4d8c1 Bump NBitcoin (Fix perf problem on signing of big transaction) 2021-10-14 01:01:32 +09:00
75776687bc Fix bug: Importing seed with Is hot wallet checked was not working (#2966) 2021-10-12 18:37:13 +09:00
b5ebd14589 Fix NRE in BaseService.StopAsync 2021-10-12 17:39:48 +09:00
67ba64b0a1 Fix build 2021-10-12 15:45:55 +09:00
b26e8311c1 Bump NBitcoin 2021-10-12 15:42:20 +09:00
0033aab03e Remove types from BTCPayServer.Client 2021-10-11 18:01:32 +09:00
1037fe0b14 Remove unused ExpireInvoiceResponse type 2021-10-11 17:58:01 +09:00
6c688b9684 Make sure cheater scan rpc capabilities 2021-10-11 17:49:04 +09:00
601e17ed0f Fix altcoins docker-compose 2021-10-11 17:39:12 +09:00
ad86c16bc9 Bump Tor 2021-10-11 12:35:26 +09:00
791db983c7 Bumping LND to 0.13.3-beta (#2964) 2021-10-11 12:32:58 +09:00
d7a7382d00 Introduce cheat mode (#2965) 2021-10-11 12:32:09 +09:00
e842a00402 Easier payment testing (#2672)
* Easier payment testing

* WIP, more TODOs and some cleanup. Help is appreciated.

* Added dummy button to expire monitoring (doesn't work yet)

* Added TODO

* Make fake tab default if present

* Split controller and change wording from fake to testing

* Extract and simplify checkout testing UI

* Restrict testing access to regtest

Co-authored-by: Dennis Reimann <mail@dennisreimann.de>
2021-10-11 11:11:02 +09:00
78a8c8c1be Add Passport hardware wallet option to the wallet import screens (#2962)
* Add option for Passport

* Add Passport option to QR import

* Add Passport import option
2021-10-10 15:54:46 +09:00
a7c093a0eb Allow email notifications when creating invoices from Web UI (#2959)
Currently invoice email notifications are only sent when the invoice is created via the API. This commit adds an option to set an email address for notifications when an invoice is created from the Web UI.
2021-10-10 15:54:25 +09:00
86956c1e7b More CSP fixes (#2955)
* Fix CSP issue with time format switch on wallet transactions page

* Fix CSP issue with invoice modal link on invoices list page

* Fix CSP issue on FIDO2 auth page

* Fix JS error on FIDO2 auth page

* Minor UI code improvements
2021-10-10 15:52:39 +09:00
54539001f1 Allow User to delete own account (#2949)
* Allow User to delete own account

* Add User delete e2e test

* fix test

* Apply suggestions from code review

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

Co-authored-by: d11n <mail@dennisreimann.de>
2021-10-09 12:18:37 +09:00
4321cbf41a Coin selection improvements (#2956)
* Improve coin selection toggling

* Improve coin selection display

Fixes #2948.

* Improve remove destination button

* Display hide unconfirmed only if there are any unconfirmed UTXOs

* Improve label styles

* Test fix

* Add top margin for non-JS coin selection
2021-10-09 10:39:34 +09:00
8d9941bfd2 Update toggle styling to have pointer cursor (#2957) 2021-10-08 14:26:17 +09:00
f9e38deee7 Fix warnings 2021-10-07 19:08:53 +09:00
89fd044b00 Replace pruning wallet by wipe transactions (#2857) 2021-10-07 16:54:22 +09:00
039f88d14c Match Lightning payment based on payment hash if BOLT11 is not the same. (#2773)
* Match Lightning payment based on payment hash if BOLT11 is not the same.

* Fixup

* Fixup

Co-authored-by: Nicolas Dorier <nicolas.dorier@gmail.com>
2021-10-07 16:53:27 +09:00
d3f9eb38a9 Fix annoying err message in logs when a websocket is cancelled 2021-10-07 15:35:19 +09:00
768d97ac6c Fix remaining Safari inline JS CSP issues (#2954)
* fix modfiy webhook inline JS issue

* fix uncofirmed warning issue in Safari

* fix inline JS Safari issues in checkout
2021-10-07 12:27:48 +09:00
154078d46f Fix docker images 2021-10-07 11:20:50 +09:00
d74c6a30c8 Improve perk card styles 2021-10-06 19:32:26 +02:00
1407d5be8d Decrease font size and weight in selection overlay 2021-10-06 19:32:26 +02:00
721c06e157 Crowdfund: Hide theme switch when custom theme is set 2021-10-06 19:32:26 +02:00
a0265f18d9 Crowdfund: Better customization input grouping 2021-10-06 19:32:26 +02:00
8948475cad Crowdfund: Add theme switch to footer 2021-10-06 19:32:26 +02:00
faed5349fb Make theme switch a view component 2021-10-06 19:32:26 +02:00
7bcaf956e7 Grerenfield: Add availableStatusesForManualMarking to Invoice Data (#2934)
closes ##2933
2021-10-06 18:19:34 +09:00
31c2a80758 Add ability to set invoice status from details page (#2923)
* Add ability to set invoice status from details page

* Remove unnecessary "using" statements

* Add print styles

* Fix Safari issues

* Simplify JS

* Update status badge class names

* Update dropdown toggle padding

* Adjust dropdown menu padding
2021-10-06 14:49:57 +09:00
150e4b842c Make sure the process doesn't crash if exception raised in Subscribe 2021-10-06 13:22:55 +09:00
b970f64639 Remove build warnings 2021-10-06 12:53:41 +09:00
08bd13b2cd Make CanUseWebhooks more resilient 2021-10-06 11:25:21 +09:00
6e3d6125c2 Payment Settled Webhook event (#2944)
* Payment Settled Webhook event

resolves #2691

* Move payment methods to payment services
2021-10-05 18:10:41 +09:00
143d5f69c1 Fix CSP for inline handlers in Safari (#2946)
* Fix CSP for inline handlers on LND seed backup page

* Fix CSP for inline handlers on checkout page

* Fix CSP for inline handlers on wallet sign pages

* Fix CSP for inline handlers on invoices list page

* Fix CSP for inline handlers on payouts page

* Fix CSP for inline handlers on confirm API key page

* Fix CSP for inline handlers on store rates page

* Fix CSP for inline handlers on notifications page

* Fix CSP for inline handlers on dynamic DNS page

* Fix CSP for inline handlers on checkout experience page
2021-10-05 15:52:14 +09:00
156ddd24fa Make CanUsePayjoinForTopUp more resilient 2021-10-05 15:47:57 +09:00
cf2c147f4f Bumping versions of libraries and dockerfile 2021-10-05 15:29:26 +09:00
ce1903b2fa Bumping versions of libraries and dockerfile 2021-10-05 15:26:40 +09:00
ccdfe5ac86 Detect websocket connection dropping in vault 2021-10-05 14:41:03 +09:00
b0ef98dd63 Keep websocket connection alive on notifications and vault 2021-10-05 14:30:01 +09:00
5c8e62bd90 Websocket ping message for notifications and vault 2021-10-05 14:14:22 +09:00
6674d76d6d Add missing file 2021-10-05 13:58:40 +09:00
dea747a9a9 Keep connection alive on checkout page by sending ping messages 2021-10-05 13:37:30 +09:00
a32ace1dcb Shorten balance assignment 2021-10-04 17:10:07 +02:00
4785f0a4dd Remove unused Network property 2021-10-04 17:10:07 +02:00
8249d8a0f5 Fix indentation in view 2021-10-04 17:10:07 +02:00
234bc30369 Update in adherence to the design 2021-10-04 17:10:07 +02:00
b7a081b9a4 Show total balances for each currency on List Wallets Page 2021-10-04 17:10:07 +02:00
88c925017d Apply suggestions from code review 2021-10-04 17:06:11 +02:00
a3c2a9ac61 Censor based on permissions 2021-10-04 17:06:11 +02:00
7cad6302b7 Fixed wrong API permission
Viewing store payment methods needs CanViewStoreSettings instead of CanModifyStoreSettings as per the docs
2021-10-04 17:06:11 +02:00
4b34090376 Adjust invoice details header layout 2021-10-04 17:02:57 +02:00
ac554a27b6 Merge pull request #2947 from dennisreimann/faq-links
Fix FAQ links
2021-10-04 14:03:47 +02:00
e1ea7200cf Fix FAQ links
Once more (and for the last time ;)) those linsk changed in btcpayserver/btcpayserver-doc#967
2021-10-04 13:42:31 +02:00
802fec6bf3 Move payment related properties 2021-10-04 09:50:36 +02:00
67aee9bdc6 Improve display and structure of payment related configuration 2021-10-04 09:50:36 +02:00
975ad2f8ab Crowdfund: Display contributions value (#2938) 2021-10-04 07:54:06 +02:00
b0814166f5 Merge pull request #2941 from git-sgmoore/patch-1
Update README.md
2021-10-02 13:23:54 +02:00
8f397865fd Update README.md
Remove one apostrophe
2021-10-01 23:10:43 -07:00
8ffa7525c5 Merge pull request #2939 from dennisreimann/docs-links
Fix documentation links
2021-10-01 18:34:41 +02:00
6048a26511 Fix documentation links
Some links changed with the recent docs restructuring. I've also added recirects for these on the docs side now.
2021-10-01 18:18:54 +02:00
1a8a7fc27f Crowdfund: Limit max width of embedded content like video
Closes #2782.
2021-09-29 07:58:50 +02:00
64901dfc22 Bump postgres 2021-09-29 13:16:53 +09:00
6a28497d33 Fix: Impossible to see relative time of transaction in wallet list 2021-09-29 13:10:00 +09:00
ed1ec2300d Remove Coinswitch entirely 2021-09-28 10:33:11 +02:00
edfde494fa bump bitcoin core 2021-09-28 12:47:34 +09:00
a3cc573e4d Do not test hot reload in CanCreatePayRequest (unreliable) 2021-09-28 12:20:40 +09:00
44fe70ae44 Make CanCreatePayRequest more resilient 2021-09-28 12:05:46 +09:00
d05a9295b3 Make a test more resilient 2021-09-28 11:22:35 +09:00
7aa4cd8104 Plugins: Pass the current Model to the Ui extension points 2021-09-27 14:16:38 +02:00
4a6088b6b9 Bump NBX Client and Plugins packages 2021-09-27 10:26:42 +02:00
d949680d5a fix: Plugins disabled message never dissappers even after re-enabling it. 2021-09-27 09:03:59 +02:00
0cd7380af0 Make CSP accessible to plugins 2021-09-27 08:45:55 +02:00
a3afcd2a6e Crowdfund public UI re-design (#2918)
* Patch bootstrap-vue modal close button

For Bootstrap v5 compatibility, which bootstrap-vue does not have currently.

* Crowdfund: Use common global layout head (and themes)

* Crowdfund: Display disabled alert also for simple variant

* Crowdfund: Unify non-JS/simple and JS-enabled view

* Improve fireworks animation

* Improve layout

Inspired by the Bitcoin Smiles compaign, see  #2783

* Cleanup and remove views

* Fix typo

* Fix test
2021-09-27 11:46:56 +09:00
bd6c7a8c3d Properly handle InvoiceMetadata string properties (Fix #2906) 2021-09-27 11:44:55 +09:00
920955657d Fix camera not working on wallet send (Fix #2922) 2021-09-27 10:32:03 +09:00
d975ea1509 bump 2021-09-26 14:33:36 +09:00
ba5c49a8df Update Changelog 2021-09-26 14:33:36 +09:00
9f6c7180b2 Greenfield quality of life improvements from feedback (#2880)
* Greenfield quality of life improvements from feedback

fix #2854

* Greenfield quality of life improvements from feedback

fix #2855
2021-09-25 14:04:34 +09:00
ef70f4d547 Simplify code with PaymentMethodId.TryParse 2021-09-24 14:21:30 +09:00
8c061b1f07 Attempt cover scenarios of switching back to Bitcoin only after taint (#2881) 2021-09-24 14:16:25 +09:00
0aed8fdb5b Improve app update buttons (#2915)
Better responsive behaviour and clearer distinction between primary and secondary actions. Also improves the wording ("View Crowdfund/Point of Sale" vs. "View app") and gets rid of the superfluous "Back to apps list" button.
2021-09-24 14:13:38 +09:00
6125a99381 Should not be able to activate a payment method on an invoice which is not new 2021-09-24 00:12:12 +09:00
83b54b7be1 Fix infinite loop happening if payment method unavailable with on invoices with lazy activation (#2914) 2021-09-24 00:00:55 +09:00
047222b3ee Fix offcanvas on desktop 2021-09-23 13:45:05 +02:00
2fe1ab83f5 Improve offcanvas nav animation 2021-09-23 13:45:05 +02:00
5372058c33 Use offcanvas nav for mobile 2021-09-23 13:45:05 +02:00
a08261a798 Update dark mode footer colors 2021-09-23 13:44:48 +02:00
869985f005 Finetune footer; remove obsolete images 2021-09-23 13:44:48 +02:00
97b5c473c1 Removes the "Let's Get In Touch!" block from the homepage 2021-09-23 13:44:48 +02:00
337db3daab Align social links to appear above copyright 2021-09-23 13:44:48 +02:00
10da82607d Adds social links to Layout
This removes the logo credits in the base Layout and adds the
links to Github, Mattermost and Twitter.
2021-09-23 13:44:48 +02:00
7f49824783 Improve public LN node info (#2876)
* Add store name to LN info unavailable pae

* Display multiple node info items if available

Allows to view clearnet and Tor connection info side by side.

* Re-add preferOnion for certain cases

* HTML compatible node ids

* Display more node connection failure details

* Fix syntax error

* Update BTCPayServer/Payments/Lightning/LightningLikePaymentHandler.cs

Co-authored-by: Nicolas Dorier <nicolas.dorier@gmail.com>

* View updates

* Revert previous variable change

* Keep logic out of the view

Co-authored-by: Nicolas Dorier <nicolas.dorier@gmail.com>
2021-09-23 20:36:42 +09:00
5d8bc73063 Reset "all stores" values to default 2021-09-23 10:11:37 +02:00
82675384c4 Don't adjust store mode if user is performing an action 2021-09-23 10:11:37 +02:00
3dc663f4d8 Adjust view 2021-09-23 10:11:37 +02:00
2b0fcdf95c [WIP] Fix issues with Authorization Request page
closes #2858
2021-09-23 10:11:37 +02:00
d0120f1427 Fix Selenium flakyness on Circle CI (#2904) 2021-09-22 21:31:44 +09:00
ac34109da3 Support preview/codegen for custom currencies in pay button (#2896) 2021-09-22 13:10:52 +09:00
d5c96eee32 Add test 2021-09-21 09:45:41 +02:00
7b252369e9 Add GetPOSItems method 2021-09-21 09:45:41 +02:00
9d48358f2a Rename Unavailable to Disabled 2021-09-21 09:45:41 +02:00
2dcd7db797 Filter unavailable items in controller 2021-09-21 09:45:41 +02:00
c267cf0e9c Rename "hidden" to "unavailable" 2021-09-21 09:45:41 +02:00
403820cf14 Add ability to hide a product from POS app
See discussion here: https://github.com/btcpayserver/btcpayserver/discussions/2827
2021-09-21 09:45:41 +02:00
6d667e2d78 bump redoc 2021-09-21 12:52:31 +09:00
258a19fdf5 Make CSP more specific for docs 2021-09-21 12:47:46 +09:00
1a593a1ced Fix documentation page broken by CSP 2021-09-21 12:43:50 +09:00
b8ac57a5b3 Merge pull request #2893 from bolatovumar/fix/show-qr-padding
Remove padding from "Show QR" button
2021-09-20 11:37:48 +02:00
b93f3ff445 Remove padding from "Show QR" button 2021-09-18 21:31:23 -07:00
5984edb7f4 Disallow cancelling payment request when "Allow payee to create invoices in their own denomination" is not enabled (#2843)
* Disallow cancelling payment request when "Allow payee to create invoices in their own denomination" is not enabled

close #2802

* Disallow cancelling pending invoice on BE

* Update non-JS version of payment request view to disallow cancelling

* Update CanCancelPaymentWhenPossible

* Fix typo
2021-09-17 10:24:48 +09:00
603bd2692e Summernote: Fix source map reference; remove unused files 2021-09-16 07:30:33 +02:00
2e61bdf88f Update swagger example 2021-09-16 07:29:18 +02:00
e6aa73197a Move GetDefaultPaymentId out of InvoiceExtensions 2021-09-16 07:29:18 +02:00
b2f9353be1 Add tests 2021-09-16 07:29:18 +02:00
5cba59932b Add ability to specify default payment method through Greenfield API 2021-09-16 07:29:18 +02:00
809340e629 Add ability to select default payment method for invoice through UI 2021-09-16 07:29:18 +02:00
bb6a188883 bump nbx in both docker compose envs 2021-09-16 07:19:54 +02:00
24674d354c removes slack + updates columns 2021-09-16 07:18:31 +02:00
e93562b1db Do not publish NewTransactionEvent if GetValidOutputs did not match with the network's. 2021-09-15 07:28:17 +02:00
f7099cf6aa Bump NBX and elements 2021-09-15 07:28:17 +02:00
d88f012d82 Improve warning when creating invoice without wallet (#2844)
* Improve warning when creating invoice without wallet

close #2834

* Update link class name
2021-09-13 14:24:10 +09:00
f96767d3dc Bootstrap update (#2870)
* Update Bootstrap

* Fix notification checkbox styling
2021-09-13 14:23:10 +09:00
6666786b7a Unify Fido2 authentication under two-factor tab (#2866)
* Unify Fido2 authentication under two-factor tab

Closes #2754.

* Improve UI and wording

* Improve register FIDO2 device page
2021-09-13 10:16:52 +09:00
eccbe8e018 Sanitize UrlRoot in PayButton 2021-09-12 20:33:51 +09:00
aac87539ae Fix pay button CSP issue when using modal (#2872)
* Fix pay button CSP issue when using modal

Fixes #2864.

* Use event handler, refactor csp tags

* Fix script indentation

* Fix onsubmit event handler integration

Co-authored-by: nicolas.dorier <nicolas.dorier@gmail.com>
2021-09-12 20:31:35 +09:00
a8995d2bed Fix unit test fail bc shitcoin 2021-09-10 15:35:51 +09:00
7f40698bba Fix interactive XSS when entering javascript: in store's website. 2021-09-10 10:56:48 +09:00
c4f4c3138c Update Changelog 2021-09-10 00:27:27 +09:00
3b9c7db481 The page could crash if the user clicks too many time on Notificate 'Mark as Seen' 2021-09-10 00:22:33 +09:00
649f650da6 Fix build 2021-09-10 00:16:28 +09:00
4c83265de4 Update Changelog 2021-09-10 00:14:45 +09:00
ad7b62fa3d Fix CSP when there is a theme 2021-09-10 00:14:26 +09:00
650df97e50 Fix Summernote XSS possibility (#2859) 2021-09-09 22:49:30 +09:00
6f75125cf5 bump 2021-09-09 22:17:46 +09:00
26c05a8d5f Changelog 2021-09-09 22:17:22 +09:00
fc4e47cec6 Add CSP at the website level (#2863) 2021-09-09 21:51:28 +09:00
c39f1341aa Fix warnings 2021-09-09 20:31:35 +09:00
a39d1e0886 fix broken plugin page 2021-09-09 13:12:44 +02:00
435f51a777 Fix for crowdfund perk editor
With no title entered, the editor got stuck in an endless loop, because it recursively invoked the save function without checking for the ID fallback being present.

Fixes #2862.
2021-09-09 10:59:03 +02:00
de2c12c1df Fix warning 2021-09-08 18:45:12 +09:00
ae43af999b update HWI lib 2021-09-08 18:27:36 +09:00
14a10eeef8 Remove useless code (#2852) 2021-09-07 19:18:56 +09:00
180be49824 Add "#nullable enable" 2021-09-07 10:39:36 +02:00
5faa756f1c Add check for empty theme URI before saving theme settings 2021-09-07 10:39:36 +02:00
06db29dd43 Delete confirmation modals (#2614)
* Refactor confirm view: separate modal

* Add delete confirmation modals for apps and FIDO2

* Add delete confirmation modals for 2FA actions

* Add delete confirmation modals for api keys and webhooks

* Add delete confirmation modals for stores and store users

* Add delete confirmation modals for LND seed and SSH

* Add delete confirmation modals for rate rule scripting

* Test fixes and improvements

* Add delete confirmation modals for dynamic DNS

* Add delete confirmation modals for store access tokens

* Add confirmation modals for pull payment archiving

* Refactor confirm modal code

* Add confirmation input, update wording

* Update modal styles

* Upgrade ChromeDriver

* Simplify and unify confirmation input

* Test fixes

* Fix wording

* Add modals for wallet replace and removal
2021-09-07 11:55:53 +09:00
6d317937c7 Do not generate payment methods when 0 amount invoice (#2776)
* Do not generate payment methods when 0 amount invoice

* Add test for 0 amoutn invoices
2021-09-07 00:23:41 +09:00
522c990278 Allow creating top-up invoice when min/max payment amount criteria is active
closes #2831
2021-09-06 10:44:10 +02:00
e584ebe7de Decouple taproot activation from support in generate wallet (#2837) 2021-09-04 22:07:09 +09:00
1422bd8540 Decrease notification badge padding (#2841)
Fixes #2840.
2021-09-04 22:06:56 +09:00
fe18e71538 Refactor themes (#2794)
* Remove Bootstrap/Creative CSS file customizability

Customizations should be done using themes

* Remove deprecated Casa and Classic themes

They are still available in the design system repo and should be added as custom theme CSS file

* Use either standard or custom theme

* Remove deprecated themes

* Improve theme select UI

* Finish and refactor theme switching

* updates theme copy

* Update BTCPayServer/Views/Server/Theme.cshtml

Co-authored-by: Zaxounette <51208677+Zaxounette@users.noreply.github.com>

* Combine creative.css and site.css

Co-authored-by: dstrukt <gfxdsign@gmail.com>
Co-authored-by: Zaxounette <51208677+Zaxounette@users.noreply.github.com>
2021-09-03 16:16:36 +09:00
e5699f674b Taproot support for wallets (#2830)
* Support taproot for HotWallet

* Support taproot for hardware wallets

* Fix NBX version

* Undo formatting

* Do not show Taproot when not supported

* Create taproot wallet from xpub

* Bug Fix
2021-09-03 15:37:12 +09:00
203db44b4e Patch summernote to fix issues in Chrome/Chromium
As we are using a customized version for the Bootstrap 5 compatibility anyways, with this we are also including the changes proposed in summernote/summernote#4034 to fix #2816.
2021-09-02 15:35:32 +02:00
69c5f5b9e5 Reduce navbar padding 2021-09-02 12:36:02 +02:00
5a16dfced3 Cleanup site.css 2021-09-02 12:36:02 +02:00
cb46ef9e6c Revert semibold links 2021-09-02 12:36:02 +02:00
3b810e9b8d revert left sidebar font size 2021-09-02 12:36:02 +02:00
663dcecb8e Cleanup home styles 2021-09-02 12:36:02 +02:00
fbb5671f89 Cleanup styles 2021-09-02 12:36:02 +02:00
47d348359f Use util classes for navbar padding 2021-09-02 12:36:02 +02:00
ab2f460f35 converts to rem 2021-09-02 12:36:02 +02:00
c77e3a9396 navbar queries added 2021-09-02 12:36:02 +02:00
014c43f79b updates section 2021-09-02 12:36:02 +02:00
21fb3813dd adds section + media query 2021-09-02 12:36:02 +02:00
9a039a747a Move site customizations to design system 2021-09-02 12:36:02 +02:00
17578a4615 Bootstrap updates
- Increase vertical navbar padding
- Update alert close button styles
- Use semibold font for links
2021-09-02 12:36:02 +02:00
abb68d6f59 Improve fee rate component 2021-09-02 12:36:02 +02:00
3c443344a5 Ensure round notification badge 2021-09-02 12:36:02 +02:00
2887017d12 updates line-height, removes sm-table hack 2021-09-02 12:36:02 +02:00
f2286fb1be updates copy to reduce button size 2021-09-02 12:36:02 +02:00
bdd11a14ff adjusts logo size for future size update 2021-09-02 12:36:02 +02:00
18f6e5af4d left sidebar navigation updates 2021-09-02 12:36:02 +02:00
83b07e0caf Refactor tables, remove old customizations 2021-09-02 12:36:02 +02:00
840a5ac4b4 Refactor Bootstrap colors 2021-09-02 12:36:02 +02:00
4923311168 Update Bootstrap and theme variables 2021-09-02 12:36:02 +02:00
748423dfe8 Add UpdateOnChainPaymentMethodRequest 2021-09-02 10:42:41 +02:00
2f4e610900 Add UpdateLightningNetworkPaymentMethodRequest 2021-09-02 10:42:41 +02:00
d39ec97b9a Remove "enabled" option from address preview endpoint 2021-09-02 10:42:41 +02:00
0d08bd3ad1 Minor syntax changes 2021-09-02 10:39:35 +02:00
3343738bb3 Remove back links to POSTed pages 2021-09-02 10:39:35 +02:00
373b0b7850 Remove superfluous export command 2021-09-02 10:39:35 +02:00
aa24da72b9 Improve raw export options 2021-09-02 10:39:35 +02:00
aecc5f3c6e Update wording 2021-09-02 10:39:35 +02:00
3d4ef48ceb View cleanup 2021-09-02 10:39:35 +02:00
9bb74a17d8 Refine views and use cases 2021-09-02 10:39:35 +02:00
b654dfb237 Cleanup initial PSBT input view 2021-09-02 10:39:35 +02:00
1bca8c81a4 Fix Selenium test 2021-09-02 10:39:35 +02:00
4d35fd4ab3 Fix test 2021-09-02 10:39:35 +02:00
bf5ea23bc6 Streamline views 2021-09-02 10:39:35 +02:00
b4c1f695a8 Remove psbt ready view
The transaction info is now shown on the decoded PSBT page.
2021-09-02 10:39:35 +02:00
de3d966835 WIP 2021-09-02 10:39:35 +02:00
bcdb1ab1d8 Improve review/broadcast flow and fix test 2021-09-02 10:39:35 +02:00
63944792b0 Move signing views into wizard 2021-09-02 10:39:35 +02:00
3895b133a3 Move PSBT flow into wizard 2021-09-02 10:39:35 +02:00
4371b81ef3 Adjust existing PSBT views for consistency 2021-09-02 10:39:35 +02:00
cd93a5ab6b Add separate signing flow for PSBT 2021-09-02 10:39:35 +02:00
d9a8443081 lang update 2021-08-31 16:02:26 +09:00
918d3b46f0 The checkout would crash for some client if automatic detection of language was checked, and the browser was not setting the accepted language 2021-08-31 16:01:16 +09:00
f53597845e bump btcpayserver 2021-08-31 15:54:38 +09:00
e65a3efc3c Add payjoin fix to changelog 2021-08-31 15:38:14 +09:00
d74fcad9f4 update changelog 2021-08-31 15:36:01 +09:00
19b88fd986 Fix: Impossible to send to two more than two destination (Fix #2825) 2021-08-31 15:23:56 +09:00
12105ab85c Fix rounding error for the first refund option (#2778) (#2810)
* Fix rounding error for the first refund option (#2778)

* Fix rounding issue
2021-08-31 15:08:33 +09:00
723817e3f8 Fix payment request cloning and unexpire if necessary (#2820)
* Unexpire payment requests without expiry date

* Unset expiry date when cloning payment request

* Syntax and code improvements
2021-08-31 15:07:54 +09:00
101fc51787 Bump NBX (#2818) 2021-08-30 16:42:22 +09:00
58a5f88943 Hide due amount on invoice if it's zero (#2798)
address #2790
2021-08-27 16:02:20 +09:00
2e35d0e178 Fix coldcard wallet export path (#2809) 2021-08-27 16:00:57 +09:00
319efbeb4b Bump c-lightning on docker-compose altcoins 2021-08-26 15:55:07 +09:00
04e6833e22 Bump c-lightning on docker-compose altcoins 2021-08-26 14:44:57 +09:00
748c882ba1 Bump libraries 2021-08-26 14:34:20 +09:00
ab7d2959ea Update clightning 2021-08-23 13:09:29 +02:00
56d3485d49 Removed the tagline character limit in the crowdfunding app 2021-08-23 13:08:55 +02:00
119ab7b2c0 attempt EnsureNewLightningInvoiceOnPartialPayment test fix 2021-08-23 12:34:36 +02:00
d1ea4e4fa4 Fix bug with top-up invoices when used with "Only enable the payment method after user explicitly chooses it" enabled (#2780)
* Fix bug with top-up invoices when used with "Only enable the payment method after user explicitly chooses it" enabled

* Remove unused "using" directives

* Add "#nullable enable" directive

* check for top-up invoice in LightningLikePaymentHandler
2021-08-23 15:13:26 +09:00
de5ab80038 Fix typo 2021-08-15 08:26:02 +02:00
2d23f3e5d4 bump 2021-08-13 15:51:46 +09:00
77d1580ee3 Fix Display app on website root feature 2021-08-13 15:50:26 +09:00
a20906bc12 Fix paybutton like when no amount set 2021-08-12 10:04:23 +09:00
ffbf70d72b Bump BTCPayServer.Lightning nuget 2021-08-10 10:11:16 +02:00
caa3ff616c Add fix to changelog 2021-08-10 10:11:16 +02:00
7a102ee920 Bumpo Clightning to 0.10.1 2021-08-10 10:11:16 +02:00
8451f34302 Revert "Bumpo Clightning to 0.10.1"
This reverts commit e4bd8e310624aee71a84bf7210da79d57d857625.
2021-08-10 09:31:14 +02:00
e4bd8e3106 Bumpo Clightning to 0.10.1 2021-08-10 09:16:25 +02:00
bc4945c584 Fix hotwallet migration 2 2021-08-10 12:13:00 +09:00
fa96deb1de Fix hotwallet migration 2021-08-10 12:07:13 +09:00
a27217dc62 bump 2021-08-09 23:55:31 +09:00
2dfb637e2f Enhance files actions to accept arrays of fileids (#2735)
* Enhanced Files action by modifying it to accept a list of SelectedFileIds

* Added checks to verify all files passed to the files action exist, Updated tests

* Enhanced Files action to accept an array of fileIds

* Removed redundant fileId list
2021-08-09 23:40:55 +09:00
9387c2c771 1.2.0 Changelog (#2737)
Co-authored-by: d11n <mail@dennisreimann.de>
Co-authored-by: Nicolas Dorier <nicolas.dorier@gmail.com>
Co-authored-by: Pavlenex <pavlenex@btcpayserver.org>
2021-08-09 15:54:03 +02:00
e7e8ed55c2 Remove support for payout to a Bitcoin Url (#2766) 2021-08-09 22:43:38 +09:00
cf067ca51b Update successful refund message (#2764) 2021-08-09 20:57:29 +09:00
1b7517c05c Add example for orderId query string param in /api/v1/stores/{storeId}/invoices (#2759) 2021-08-09 20:33:56 +09:00
103b3b916b Show new store warning icon only if neither on-chain wallet nor LN is configured (#2760)
close #2755
2021-08-09 20:32:43 +09:00
fa91174b1a Fix finnish 2021-08-09 16:59:52 +09:00
10e3595a82 Fix bulgarian 2021-08-09 16:40:42 +09:00
965beebc66 Fix kazath 2021-08-09 16:37:55 +09:00
83ab1a3b7c Use ulong for configKey of LND rather than uint 2021-08-07 21:52:49 +09:00
7ac83575d4 Update langs 2021-08-05 20:19:51 +09:00
831f73d715 Fix: Swagger Onchain fee rate endpoint mislabeled 2021-08-05 09:28:19 +02:00
245b4ebe63 Remove missing js file from bundles 2021-08-05 07:59:56 +02:00
060f30d0bf Payouts: Unify confirm external payment and manually mark as paid actions (#2751) 2021-08-05 14:47:25 +09:00
f84b2c5160 Add proper error message if node/nbxplorer doesn't support taproot (#2752) 2021-08-05 13:56:31 +09:00
4e56ef636b Make system plugins shown as system plugins
fixes #2741
2021-08-04 16:50:25 +02:00
59d0cf666f Update Clightning to altcoin compose too 2021-08-04 16:12:39 +02:00
54cc574405 Update to Clightning 0.10.0 2021-08-04 15:02:24 +02:00
97d16523b5 Wallet send UI improvements (#2750)
* Remove autocompletion for output fields

* Use consistent wording for available balance

* Set min value and hide number spins for amount inputs

* Move add destination button to destination input field

* Fix fiat amount display for multiple destinations case

* Improve display of multiple destinations

* Fix formatting
2021-08-04 20:58:46 +09:00
80086d76a8 Improve Payment Request view (#2748)
* Improve Payment Request view

Closes #2747.

* Fix payment request invoice listing condition
2021-08-04 16:13:33 +09:00
5bf1161884 PoS UI fixes (#2744)
Fixes  #2743
2021-08-04 13:24:25 +09:00
f49954223a Merge pull request #2746 from dennisreimann/wallet-import-wording
Improve wallet import wording
2021-08-03 14:23:57 +02:00
98d9efc8d6 Merge pull request #2745 from dennisreimann/api-keys-text
Add a period in API Keys description
2021-08-03 14:22:38 +02:00
59f338a0b7 Improve wallet import wording
Closes #2740.
2021-08-03 14:22:26 +02:00
e1eac5c390 Add a period in API Keys description
Fixes #2742
2021-08-03 14:10:48 +02:00
4c818d0359 Implement topup invoices (#2730) 2021-08-03 17:03:00 +09:00
63d4ccc058 Fix missing master fingerprint/account key path on wallet import (#2727)
* Fix missing master fingerprint/account key path on wallet import

Re-adds the view model properties that got removed in 8a1d5bbc57176377a3e76fe3f55f6942bc3fe457 and passes them through the confirm addresses form.

* Add test

This test fails on current master
2021-08-03 14:27:04 +09:00
1b85ab8b54 Improve UI of immature balance, show available balance in wallet list (#2732) 2021-08-01 22:13:12 +09:00
906c7eb7ec Show Immature Balance in walletsend page (#2731)
* Wallet Send page also shows immature balance

* changes ans to and

* Immature Balance msg is not tooltip

* Make msg more clear
2021-08-01 21:12:00 +09:00
2207d836f1 Update NBXplorer again 2021-08-01 14:32:04 +09:00
a9cd27e012 Bumping LND to 0.13.1-beta (#2729) 2021-08-01 09:20:40 +09:00
eb24cf5f84 Merge pull request #2728 from dennisreimann/bg-image
Add white background to Baillie Gifford logo
2021-07-30 19:56:46 +02:00
fae396dc0d Add white background to supporter logo
Addresses btcpayserver/foundation.btcpayserver.org#19. This SVG is also used in the docs.
2021-07-30 19:43:31 +02:00
c70393c7ef Add BG to supporters readme and login page (#2726)
* add Baillie Gifford supporter in readme and login page

* re-format img
2021-07-30 17:48:07 +02:00
a9da79cc58 Use PaymentUrlBuilder for ensuring proper formatting of BIP21 addresses (#2723) 2021-07-30 18:47:02 +09:00
4c57405945 Properly clip taxIncluded and invoice's amount (#2724) 2021-07-30 18:46:49 +09:00
ad8f347989 Refactoring: Allow ViewsRazor extension to be used by plugins
Moves the `ViewsRazor` extension into Abstractions, so that it can be used by plugins.

Separated out of #2701, prerequisite for the LNbank plugin integration.
2021-07-30 08:27:33 +02:00
68595be323 Improved the names of the Invoice webhooks to reflect the event type in code + better descriptions (#2598)
* Improved the names of the Invoice webhooks to reflect the event type in code + better descriptions

* Gave proper name and better description.

* Update BTCPayServer/wwwroot/swagger/v1/swagger.template.webhooks.json

Co-authored-by: Andrew Camilleri <evilkukka@gmail.com>

Co-authored-by: Andrew Camilleri <evilkukka@gmail.com>
2021-07-30 14:33:23 +09:00
69b855a1e7 Improves create crowdfund view (#2647)
* adds sizings

* adds section headers

* adds section headers and re-ordering

* more re-ordering

* redorder change

* adds switches

* reorders checkmark

* removes spacer + updates header

* adds sizings

* adds section headers

* adds section headers and re-ordering

* more re-ordering

* redorder change

* adds switches

* reorders checkmark

* removes spacer + updates header

* Upgrade flatpickr and adapt styles

* Improve display names

* Toggle and collapse additional options

* Add missing link attributes

* adds switch + title for enabling public crowdfund

* Add helper text for public crowdfund option

Co-authored-by: Dennis Reimann <mail@dennisreimann.de>
2021-07-30 14:31:44 +09:00
6ea96efe68 Update NBitcoin, fix warnings on nullable (#2718) 2021-07-29 20:29:34 +09:00
499a231432 Fix: Payment Request status does not update on invoice marked events or when pr amount is changed (#2700)
fixes #2689
2021-07-28 22:38:26 +09:00
0054fe0886 Refactor copy to clipboard
Separated out of #2701, prerequisite for the LNbank plugin integration.
2021-07-28 08:44:32 +02:00
c59798e9c4 GreenField: Generate Store OnChain Wallet (#2708)
* GreenField: Generate Store OnChain Wallet

* Greenfield: Do not generate wallet if already configured
2021-07-27 23:53:44 +09:00
80483ba76f Start with camera off 2021-07-27 15:31:12 +02:00
5c792c9e09 Make QR Scanner able to switch between sources 2021-07-27 15:31:12 +02:00
fdae221ca5 Allow QR code multiple display modes 2021-07-27 15:31:12 +02:00
ba165ddd4f Local Greenfield Client for Plugins (#2410)
* wip

* Local GreenField Client for Plugins

* support notification handlers being missing

* Initial support for scoped btcpay client

* test out scoped local client

* wip

* small fix

* Throw exception if using local greenfield client and it has not been implemented yet

* adapt based on new changes in BTCPay

* update

* fix tests

* Allow Local client to bypass authorization handler

* Add Misc endpoints to Local API Client

* Add new endpoints

* Apply code review changes
2021-07-27 21:11:47 +09:00
14e4d2d675 Make CSSThemeManager really only focus on theme (#2457)
* Make Settings Repository cache in memory

* Make use of SettingsRepo directly instead of CssThemeManager

* Completely remove CssThemeManager
2021-07-27 21:08:54 +09:00
d505771d96 Make CanUseInternalLightningNode a sub policy of CanModifyServerSettings (#2709)
SInce CanModifyServerSettings can trivially modify any policy around lightning node sharing, it should automatically have access to the lightning node usage perm
2021-07-27 19:23:20 +09:00
d8c1c51a21 Auto-detect language on payment page (#2552)
* Auto-detect language on payment page

based on the requst Accept-Language header, which is the language you configured in your browser/OS and this 99.99% accurate

* Update BTCPayServer/Services/LanguageService.cs

Co-authored-by: britttttk <39231115+britttttk@users.noreply.github.com>

* Update BTCPayServer/Services/LanguageService.cs

Co-authored-by: Andrew Camilleri <evilkukka@gmail.com>

* Update BTCPayServer/Services/LanguageService.cs

Co-authored-by: Andrew Camilleri <evilkukka@gmail.com>

* Update BTCPayServer/Services/LanguageService.cs

Co-authored-by: Andrew Camilleri <evilkukka@gmail.com>

* Added loop for all locales in Accept-Language sorted by weight + check if know this language

* New public method so a unit test can be created for it

* Unit test for language detection

* Fix language service when not in browser context

* fall back to default lang

* Auto-detect setting + ?lang=auto support

* Added invoice param "?lang=auto" info to docs

* Using null-coalescing assignment operator

* Reduce complexity and http dependency in language service

Co-authored-by: britttttk <39231115+britttttk@users.noreply.github.com>
Co-authored-by: Andrew Camilleri <evilkukka@gmail.com>
2021-07-27 08:17:56 +02:00
71cbe716f9 fix sync modal styling 2021-07-26 16:44:41 +02:00
f4df850d25 Greenfield: Rename enabledOnly to enabled?
Allows the filter to work in both directions instead
2021-07-26 12:03:11 +02:00
4d538c61b1 Refactor Get Store Payment Methods
Add tests + docs + new pluggbale format for fetching payment method data + client
2021-07-26 12:03:11 +02:00
17e6179fec Add "stores/{storeId}/payment-methods" endpoint
address #2545
2021-07-26 12:03:11 +02:00
b7b2f16925 Improves create point of sale view (#2646)
* re-ordering

* adds section header

* updates label on "products"

* changes button to primary

* moves description

* updates partial

* re-ordering + section headers

* more section heads and ordering

* redorders

* Toggle custom amount and tips settings

* Use display name for point of sale app type

* Use switches for enabling options

* Add space before required indicator

* Set and consolidate view model display names

* Move redirects and custom CSS to additional options

* Revert to checkbox for discounts

* adds padding

* removes bs-parent for multiple open elements on accordion

* adds helper text to discount checkbox

* updates "default view" label text

* wording cleanup

* more wording adjustments

* updates

* Add display names for app types

* Extract template editor inline styles

* updates helper text

* Display names for app types

* Typo fix

* Move template back to editor

* Fix selenium test

Co-authored-by: Dennis Reimann <mail@dennisreimann.de>
2021-07-23 12:57:19 +02:00
a7f6bcf36c Updated status message when adding files and related test 2021-07-22 08:49:21 +02:00
590ca4ef56 add support for uploading multiple files to server 2021-07-22 08:49:21 +02:00
04726b3ee4 Payouts: Detect External OnChain Payouts (#2462)
* Refactor and decouple Payout logic

So that we can support lightning + external payout payments

Fixes & refactoring

almost there

final

Remove uneeded payment method checks

Refactor payouts to handle custom payment method specific actions

External onchain payments to approved payouts will now require "confirmation" from the merchant that it was sent by them.

add pill tabs for payout status

* Improve some UX around feature

* add test and some fixes

* Only listen to address tracked source and determine based on wallet get tx call from nbx

* Simplify isInternal for Payout detection

* fix test

* Fix Noreferrer test

* Make EnsureNewLightningInvoiceOnPartialPayment more resilient

* Make notifications section test more resilient in CanUsePullPaymentsViaUI
2021-07-16 09:57:37 +02:00
eb2b523800 Re-enable "Create" button for invoices on correct form input (#2694)
* Re-enable "Create" button for invoices on correct form input

fix #2693

* Use a more specific selector for form inputs
2021-07-14 23:49:06 +09:00
73b461f8d0 Greenfield: add text search terms to an invoice (#2648) 2021-07-14 23:32:20 +09:00
15be593bbd Save paymentRequestId in Metadata when creating invoice for Payment Request (#2644)
* Save paymentRequestId in Metadata when creating invoice

* Added Payment Request ID + link on invoice detail page

* Added paymentRequestId to the webhook payload

* Removed PaymentRequestId from webhook payload (rolled back previous change)

* Using strongly typed InvoiceMetadata

* Added OrderUrl metadata field to invoice + link

* Added Metadata.OrderUrl to docs

* Made orderUrl visible when no orderId is present
2021-07-14 20:43:13 +09:00
73c89ac28d Auto-select store when creating a new invoice (#2680)
* Auto-select store when creating a new invoice

* Set types as nullable in InvoiceController.UI.cs
2021-07-14 20:40:18 +09:00
45679fa29e fix typo in test/[...]/index.cshtml
Fix typo reported by following comment: 179520a211 (r53423646)
2021-07-14 11:04:21 +02:00
861e5b1530 Add webhook delivery status indicator (#2679)
* Add webhook delivery status indicator

As discussed in: https://github.com/btcpayserver/btcpayserver/discussions/2616

* Add relative delivery time to tooltips
2021-07-12 21:58:11 +09:00
d5019f61ce Expose ExplorerClientProvider to plugins via interface 2021-07-12 14:17:25 +02:00
78dd1b0476 Fix store javascript after bootstrap5 update 2021-07-12 14:16:41 +02:00
72d5c11811 Greenfield: Add CanModifyInvoices Permissions (#2595) 2021-07-11 00:30:01 +09:00
aefb81b7f0 Add "skip" and "limit" params for onchain txs API endpoint (#2688)
Discussed here: https://github.com/btcpayserver/btcpayserver/discussions/2667
2021-07-10 13:04:01 +09:00
55cc32ce0f Fix new docker compose incompatibility 2021-07-08 12:53:47 +02:00
060fc46e4f Fix system plugins resource loading 2021-07-08 12:53:34 +02:00
4bb3d60b6c Add misc/permissions to document the hierarchical structure (#2654) 2021-07-08 14:34:10 +09:00
4222d24d51 Fix: Invoice Search Text crashes invoice creation when value is too long (#2675)
This fix truncates the data to the column's max length to avoid this situation. Fixes #2641. Maybe also fixes #2585
2021-07-08 12:59:44 +09:00
6c76866f28 Update InvoiceConfirmed to InvoiceSettled in swagger (#2681)
fix #2580
2021-07-08 12:41:03 +09:00
50be6595bd update InvoiceStatusMark Swagger definition (#2674)
close #2597
2021-07-07 13:27:04 +09:00
91136d2551 remove unused code in fireworks.js (#2673)
relates to #2639
2021-07-07 13:25:34 +09:00
2e822c5878 Hiding NetworkFee row in invoice if not applicable 2021-07-06 21:20:13 +02:00
894dca2eef Update BTCPayServer/Views/Shared/Bitcoin/ViewBitcoinLikePaymentData.cshtml 2021-07-06 21:20:13 +02:00
48355129c5 Properly counting transactions that impact NetworkFee 2021-07-06 21:20:13 +02:00
edc9429e84 Displaying NetworkFee if it was present for the invoice 2021-07-06 21:20:13 +02:00
f1a222fbb3 New unit test to scan for external links/forms and if they have rel="noreferrer noopener" (#2668)
* Unit test to check for (possibly) external links

* Add rel="noreferrer noopener" to all external links so unit test passes

* Update BTCPayServer.Tests/UnitTest1.cs

Co-authored-by: Andrew Camilleri <evilkukka@gmail.com>

* Update BTCPayServer.Tests/UnitTest1.cs

Co-authored-by: Andrew Camilleri <evilkukka@gmail.com>

* Fixed bad merge from master

* PascalCasing

Co-authored-by: Andrew Camilleri <evilkukka@gmail.com>
2021-07-06 10:35:42 +02:00
40bbc5850f Greenfield doc error. Should be singular. Rewording to focus on a single result. (#2657)
* Should be singular. Rewording to focus on a single result.

* Update BTCPayServer/wwwroot/swagger/v1/swagger.template.stores-wallet.on-chain.json

Co-authored-by: Andrew Camilleri <evilkukka@gmail.com>

* Update BTCPayServer/wwwroot/swagger/v1/swagger.template.stores-wallet.on-chain.json

Co-authored-by: Andrew Camilleri <evilkukka@gmail.com>

Co-authored-by: Andrew Camilleri <evilkukka@gmail.com>
2021-07-06 10:19:18 +02:00
70baa4087c Hide referer URL to hide our BTCPay Server URL (#2655) 2021-07-05 13:51:00 +09:00
8e4f56bd52 Improves notification view (#2645)
* removes hr, adds notification settings link

* adds if else to show "no notifications" or table view

* adds icon to settings button

* Fix link to notification settings

Co-authored-by: Dennis Reimann <mail@dennisreimann.de>
2021-07-05 12:22:24 +09:00
3800780ef2 PoS: Fix images in cart view (#2649)
Fixes an issue I overlooked in #2449 and which was brought up by @dstrukt [on Mattermost](https://chat.btcpayserver.org/btcpayserver/pl/jzxqs7xw33rjfe5itorxygifbe).
2021-07-02 11:28:38 +09:00
6e154f6cbc Merge pull request #2642 from dennisreimann/patch-1
2FA: Fix login partial name
2021-06-30 12:26:19 +01:00
673b6d6733 2FA: Fix login partial name
Fixes a typo in the filename, which leads to an exception on login when 2FA is enabled.
2021-06-30 13:11:27 +02:00
6185b93b59 Upgrade to Bootstrap v5.0.2 (#2638) 2021-06-30 19:03:43 +09:00
9bbaae9dea Fix visual bug with invoices search help text overlapping invoice action buttons (#2583)
* Fix visual bug with invoices search help text overlapping invoice action buttons

close #2582

* Update BTCPayServer/Views/Invoice/ListInvoices.cshtml

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

Co-authored-by: d11n <mail@dennisreimann.de>
2021-06-30 17:05:34 +09:00
6c856aba48 Introduce Server paging for Payouts List (#2564)
* Introduce Server paging for Payouts List

* Add paging params

* Minor code and formatting improvements

* View updates

* Apply suggestions from code review

Co-authored-by: Zaxounette <51208677+Zaxounette@users.noreply.github.com>

* fix tests

Co-authored-by: Dennis Reimann <mail@dennisreimann.de>
Co-authored-by: Zaxounette <51208677+Zaxounette@users.noreply.github.com>
2021-06-30 16:59:01 +09:00
33de4cccfc Add permission key to API page (#2599)
* Better API key page

Now we can see the permission code + Fixed a margin-bottom when selecting a specific store

* Improve responsiveness of API key permissions

* Improve webhook editing UX

Jumps to edited item after submit

Co-authored-by: Dennis Reimann <mail@dennisreimann.de>
2021-06-30 16:57:38 +09:00
6a79c8a27a Improve create payment request view (#2627)
* formatting

* more edits

* adds section headers

* updates wording

* Update BTCPayServer/Views/PaymentRequest/EditPaymentRequest.cshtml

Co-authored-by: britttttk <39231115+britttttk@users.noreply.github.com>

Co-authored-by: d11n <mail@dennisreimann.de>
Co-authored-by: britttttk <39231115+britttttk@users.noreply.github.com>
2021-06-30 16:56:28 +09:00
631deb9ce7 Removes lightning setup & wallet setup back button (#2628)
* removes back button

* removes wallet back on setupwallet page

* removes navbar section completely

* remove back button on modify wallet page

Co-authored-by: Dennis Reimann <mail@dennisreimann.de>
2021-06-30 14:48:28 +09:00
cb2dd464f1 GreenField: Add StoreId to Invoice model (#2592) 2021-06-24 23:15:51 +09:00
dca376cb46 Add files via upload (#2615) 2021-06-24 23:13:06 +09:00
89d6c83504 Improves Create Store & Create App views (#2608)
* improves create store

* redorders form elements
2021-06-24 23:06:55 +09:00
2ea3baf36e Minor UI improvements (#2606)
* Added "Checkout" button to invoice detail page

* Added missing icon

All other pages have a "plus" icon on the primary button, except this page

* Button icons are always in front, not after like here was
2021-06-24 19:52:41 +09:00
3338dcac1c Richtext editor fixes (#2613)
* UPdate summernote with Bootstrap 5 integration

* Unify summernote options
2021-06-24 19:51:35 +09:00
0b9a2ee8ec Merge pull request #2581 from JimiHFord/fix-invoice-typo
fix invoice typo
2021-06-20 08:14:26 +02:00
78ac1ee15d fix invoice typo 2021-06-19 20:02:55 -07:00
886e9ab511 Update WebhookDataBase Swagger definition (#2578)
close #2577
2021-06-18 11:01:23 +09:00
3c80621dac Add payjoin option to hot wallet setup (#2450)
* Add payjoin option to hot wallet setup

Enables payjoin by default when creating a hot wallet and offers the user an opt-out.

Test fix

* Display PayJoin option only if it is available

* Test fixes

* Update hot wallet checks

* Test fix after rebase

* Use toggle buttons for enabling options
2021-06-18 10:25:17 +09:00
6b4ff4ce2c Merge pull request #2575 from NicolasDorier/refactor/wallet-cleanup
Cleanup some old code in wallet setup
2021-06-17 21:20:28 +09:00
b22aa778e1 Better webhook UI. Full URLs are visible. (#2572)
* Better webhook UI. Full URLs are visible.

* Using Bootstrap CSS class instead of a new class

* Created the generic class .sm:text-nowrap

* Renamed class

* Changed "sm" to "md"
2021-06-17 19:43:47 +09:00
1c440ed36c Update Maintenance.cshtml (#2576)
* Update Maintenance.cshtml

* fix BTCPay Server maintenance error

* Rephrase "derivation settings" to "wallet settings"

* Pay button text fix

* rephrase CoinSwitch description
2021-06-17 19:40:08 +09:00
70f56d5920 Encrypt WalletSetupViewModel.Config 2021-06-17 19:26:50 +09:00
8a1d5bbc57 Remove outdated code in UpdateWallet 2021-06-17 16:39:55 +09:00
956370592f Create a dedicated IsHotwalletProperty in the DerivationSchemeSettings 2021-06-17 15:36:22 +09:00
afd479ac69 Remove the DerivationSchemeViewmodel.Enabled property 2021-06-17 15:08:04 +09:00
39a4be5641 Remove HintAddress 2021-06-17 14:11:01 +09:00
70fcd053cd Signing context cleanup (#2568)
* Signing Context cleanup

Removes extra NBXSeedAvailable property in SigningContext, which got introduced in #2559. It is not needed since each view model involved already has it.

* Fix button in link
2021-06-15 17:35:23 +09:00
c9869922f7 Merge pull request #2569 from pavlenex/pnxbet
add pnxbet to readme
2021-06-14 18:27:15 +02:00
8b6a333cd2 add pnxbet to readme 2021-06-14 18:17:40 +02:00
ae329e371a fix link test 2021-06-14 11:32:35 +02:00
cf7c3c2bf7 LightningSupportedPaymentMethod.CryptoCode is never null 2021-06-14 18:22:00 +09:00
3d21d2724e Fix bug with LN payment method API endpoint throwing 500 (#2567)
close #2566
2021-06-14 18:19:52 +09:00
df64a93808 add pnxbet supporter 2021-06-14 08:42:05 +02:00
6068d384a4 fix missing bundle tag helper 2021-06-14 08:18:03 +02:00
3c0292f074 Wallet: Signing UI improvements (#2559)
* Refactoring to generalize wizard layout

* Wallet: Add intermediate signing options view

* Update BTCPayServer/Views/Wallets/WalletSigningOptions.cshtml

Co-authored-by: britttttk <39231115+britttttk@users.noreply.github.com>

* Skip signing options for hot wallets

* Update signing options wordings, add PSBT doc link

* Fix test

* Remove form route params

* Use decode command for PSBT

Co-authored-by: britttttk <39231115+britttttk@users.noreply.github.com>
2021-06-14 14:06:56 +09:00
371acc84a8 Do not retrieve all payouts in GetPullPayment every time 2021-06-10 18:54:27 +09:00
cd9feccf6e Mark Payouts as Paid (#2539)
* Mark Payouts as Paid

This PR allows users to mark payouts as paid manually through the UI  and through the API. It also sets up the payout proof system to be able store a manual proof that will in a later PR allow you to specify a proof of payment (link or text)

* add docs, test and greenfield client

* remove extra docs stuff

* Update BTCPayServer.Tests/GreenfieldAPITests.cs

Co-authored-by: britttttk <39231115+britttttk@users.noreply.github.com>

* clean up pull payment/payouts fetch code

* Ensure payoutis are retrieved with pull payment

Co-authored-by: britttttk <39231115+britttttk@users.noreply.github.com>
2021-06-10 18:43:45 +09:00
f1f3dffc97 Column improvements quick patch (#2562)
* removes title, switches search input with title

* adds CSS change

* Update BTCPayServer/Views/Server/ListUsers.cshtml

Breakpoint improvement

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

* Update BTCPayServer/wwwroot/main/site.css

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

* github revision fix

* spacing

* Simplify file details display

* Resolve users list conflict

* Indent fix

* Fix Tor casing

Co-authored-by: d11n <mail@dennisreimann.de>
2021-06-09 17:53:24 +09:00
e4f298acac Set lightning invoice fallback in QR code as uppercase (#2492)
* Set lightning invoice fallback in QR code as uppercase

On the lightning payment view the invoice is encoded as uppercase inside the QR code; however this is not true for the on-chain payment QR code if the invoice is set as fallback option.

This commit sets the fallback invoice as uppercase inside the QR code.

* Adds test case for uppercase fallback lightning invoice

* Apply suggestions from rockstar's review

Co-authored-by: Kukks <evilkukka@gmail.com>
2021-06-08 12:24:17 +09:00
e93b030bfe Update HWI library, warn users to run newer version (#2544)
* Update HWI library, warn users to run newer version

* Update BTCPayServer/wwwroot/js/vaultbridge.ui.js

Co-authored-by: Zaxounette <51208677+Zaxounette@users.noreply.github.com>

* Update BTCPayServer/wwwroot/js/vaultbridge.ui.js

Co-authored-by: Pavlenex <pavle@pavle.org>

Co-authored-by: Zaxounette <51208677+Zaxounette@users.noreply.github.com>
Co-authored-by: Pavlenex <pavle@pavle.org>
2021-06-06 21:02:15 +09:00
64a7abe53a Bootstrap migration fixups (#2534)
* Remove xxl breakpoint

* Remove code bg

* Form updates

* Update PoS accordion

* Update forms

* Fix webhook password toggle

* Update highlight js styles

* Page updates

* Style unformatted checkboxes

* Fix typo

* Update accordions

* Update policies domain mapping

* Update toggles and checkboxes

* Update storage pages

* Fix specter logo filename casing

* Update checkout experience view

* Update webhook view

* Re-add used negative margins

* Update bootstrap

* POS layout fixes

* Decrease size of info icon in main headline

* Update BTCPayServer/Views/Stores/ModifyWebhook.cshtml

Co-authored-by: britttttk <39231115+britttttk@users.noreply.github.com>

Co-authored-by: britttttk <39231115+britttttk@users.noreply.github.com>
2021-06-06 20:44:54 +09:00
784a40e2ed Server Settings Bootstrap/UI Tweaks (#2558)
* server > services columns cleanup

* server > services column patch

* server > files adds text-end to table action column

* server > maintenance updates column

* removes title, switches search input with title

* adds CSS change

* Update BTCPayServer/Views/Server/ListUsers.cshtml

Breakpoint improvement

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

* Update BTCPayServer/wwwroot/main/site.css

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

Co-authored-by: d11n <mail@dennisreimann.de>
2021-06-06 20:41:14 +09:00
9ecd27dc85 Merge pull request #2474 from bolatovumar/feat/test-webhooks
Add ability to send test webhook call
2021-06-04 13:01:57 +02:00
72ef23786b Merge pull request #2340 from bolatovumar/feat/greenfield-api-delete-user
Add DELETE action for api/v1/users endpoint
2021-06-04 12:30:36 +02:00
28da78fc78 Improve tests and small refactoring 2021-06-04 12:20:45 +02:00
c345e81902 Simplify template 2021-06-03 21:16:27 -07:00
1b39742919 Simplify FirstOrDefault method call 2021-06-03 21:16:27 -07:00
bc33b32522 Add delivery ID to test webhook succes message 2021-06-03 21:16:27 -07:00
4671f08b64 Augment webhook test error message 2021-06-03 21:16:26 -07:00
9f6f74df59 Show success/error message after sending test webhook 2021-06-03 21:16:26 -07:00
872c99e033 Rename SendDelivery to SendAndSaveDelivery 2021-06-03 21:16:26 -07:00
cb6e8a6937 Simplify TestWebhook method 2021-06-03 21:16:26 -07:00
7c16f8f134 Allow specifying WebhookDeliveryData webhookid right away 2021-06-03 21:16:25 -07:00
ad11b61af2 Formatting 2021-06-03 21:16:25 -07:00
120b82ae00 Update webhook test page design 2021-06-03 21:16:25 -07:00
7cf6c97d3f Return view after webhook test POST call 2021-06-03 21:16:25 -07:00
2262acf12b Add ability to send test webhook call 2021-06-03 21:16:24 -07:00
ca3f97c42f Add missing API key type description 2021-06-02 20:12:53 -07:00
8731055786 Use UserNotFound instead of NotFound 2021-06-02 20:02:31 -07:00
e943c55a91 Add basic tests for delete user endpoint 2021-06-02 20:02:31 -07:00
be05b6aa90 Specify correct return type on delete user methods 2021-06-02 20:02:31 -07:00
0b4d94faf2 Remove unnecessary null check 2021-06-02 20:02:30 -07:00
9f8f677125 Remove unused IsAdmin method 2021-06-02 20:02:30 -07:00
949d6bf584 Replace admin check with CanModifyServerSettings authorization policy 2021-06-02 20:02:30 -07:00
9fc2d2b76b Remove CanDeleteUser constraint from "/api/v1/users/{userId}" endpoint 2021-06-02 20:02:29 -07:00
d9935ada9d Add "/api/v1/users/me" endpoint 2021-06-02 20:02:29 -07:00
b4076b53e8 Add IsAdminUser method to UserService 2021-06-02 20:02:28 -07:00
53c81918a5 Enable nullable reference checking in UsersController 2021-06-02 20:02:28 -07:00
7c11736992 Enable nullable reference checking in UserService 2021-06-02 20:02:28 -07:00
49f168b7b3 Update delete user swagger description 2021-06-02 20:02:27 -07:00
104092702a Simplify DeleteUser method 2021-06-02 20:02:27 -07:00
2ed8341403 Add IsRoleAdmin to user service 2021-06-02 20:02:26 -07:00
e5a196918f Add user service 2021-06-02 20:02:26 -07:00
907ae760e0 Add CanDeleteUser policy 2021-06-02 20:02:25 -07:00
37f7c4e0f9 Add DELETE user Swagger docs 2021-06-02 20:02:25 -07:00
fe107cd23f Add DELETE action for api/v1/users endpoint 2021-06-02 20:02:22 -07:00
a830c1e812 Use ~ prefix for local PoS image references 2021-06-01 14:34:06 +02:00
8eb85acb88 Self-host PoS sample images
As brought up in #2447 and previously been worked on in #1039.
2021-06-01 14:34:06 +02:00
ea8f510eff Merge pull request #2536 from pavlenex/remove-supporters
Remove supporters
2021-05-30 17:43:58 +02:00
cbec44bb73 Fix QR Code shower 2021-05-30 10:38:21 +02:00
ac44ed56e0 fixx broken shopify links 2021-05-26 13:11:59 +02:00
dbf2f99c4e Fixing issue with mysql migration and maxLength (#2541) 2021-05-25 16:03:49 +09:00
3b04ca229f remove unused images 2021-05-20 11:05:11 +02:00
5b1a171d27 remove supporters from the front page
- BTSE (Expired)
- OkCoin (Expired)
- DGLab (Expired)
- ACINQ (Remove due to front-page tier)
2021-05-20 11:02:18 +02:00
9138c6c70a remove past supporters from the readme
Remove:
- BTSE
- OKCoin
- DGLabs
2021-05-20 10:59:27 +02:00
f1092f910a bump 2021-05-19 20:19:22 +09:00
ebc9ddfeb1 changelog 1.1.2 2021-05-19 20:18:09 +09:00
201b4d6ec0 Fix Shopify parsing (#2530) 2021-05-19 16:26:54 +09:00
3b375929c1 Support wider server sync info in greenfield server info (#2511)
fixes #2498
2021-05-19 13:07:28 +09:00
ed7031981b Bootstrap v5 migration (#2490)
* Swap bootstrap asset files

* Update themes and color definitions

* Move general bootstrap customizations

* Theme updates

Theme updates

* Remove BuildBundlerMinifier

This lead to an error, because BuildBundlerMinifier and BundlerMinifier.Core seem to conflict here. Details: https://stackoverflow.com/a/61119586

* Rewplace btn-block class with w-100

* Update badge classes

* Remove old font family head variable

* Update margin classes

* Cleanups

* Update float classes

* Update text classes

* Update padding classes

* Update border classes

* UPdate dropdown classes

* Update select classes

* Update neutral custom props

* Update bootstrap and customizations

* Update ChromeDriver; disable smooth scroll

https://github.com/SeleniumHQ/selenium/issues/8295

* Improve alert messages

* Improve bootstrap customizations

* Disable reduced motion

See also 7358282f

* Update Bootstrap data attributes

* Update file inputs

* Update input groups

* Replace deprecated jumbotron class

* Update variables; re-add negative margin util classes

* Update cards

* Update form labels

* Debug alerts

* Fix aria-labelledby associations

* Dropdown-related test fixes

* Fix CanUseWebhooks test

* Test fixes

* Nav updates

* Fix nav usage in wallet send and payouts

* Update alert and modal close buttons

* Re-add backdrop properties

* Upgrade Bootstrap to v5 final

* Update screen reader classes

* Update font-weight classes

* Update monospace font classes

* Update accordians

* Update close icon usage

* Cleanup

* Update scripts and style integrations

* Update input group texts

* Update LN node setup page

* Update more form control classes

* Update inline forms

* Add js specific test

* Upgrade Vue.js

* Remove unused JS

* Upgrade Bootstrap to v5.0.1

* Try container related test updates

* Separate jQuery bundle

* Remove jQuery from LND seed backup page

* Remove unused code

* Refactor email autofill js

* Refactor camera scanner JS

* Re-add tests

* Re-add BuildBundlerMinifier

* Do not minify bundles containing Bootstrap

Details https://github.com/madskristensen/BundlerMinifier/issues/558

* Update bundles

* Cleanup JS test

* Cleanup tests involving dropdowns

* Cleanup tests involving collapses

* Cleanup locale additions in ConfigureCore

* Cleanup bundles

* Remove duplicate status message

* Cleanup formatting

* Fix missing validation scripts

* Remove unused unminified Bootstrap js files

* Fix classic theme

* Fix Casa theme

* Fix PoS validation
2021-05-19 11:39:27 +09:00
0eace936b0 Bump 2021-05-14 17:21:32 +09:00
0d70743a47 Do not spam logs with events 2021-05-14 17:17:46 +09:00
778a0f7e8d Fix: Lightning Listener not listening on Lightning payment after activating when using lazy payments (#2524) 2021-05-14 17:17:07 +09:00
a8cf6ee8a2 add coinswitch changelog 2021-05-14 10:03:13 +02:00
06a150a558 Changelog for 1.1.1 2021-05-14 16:20:47 +09:00
c551e5cd0a Make sure to only select accounted payments where we should (#2523) 2021-05-14 16:16:19 +09:00
776ded0b7e Fix Coinswitch enabledflag and nav category 2021-05-14 09:08:32 +02:00
9e3d99ec39 Do not automatically apply our datetimeoffset binder 2021-05-14 15:47:19 +09:00
6c9c7328bb Fix: Payout Transaction not matching when rate provided longer decima… (#2518)
* Fix: Payout Transaction not matching when rate provided longer decimal precision

fixes #2513 most likely

* Do not sue rounding and ensure crypto amount is saved with correct decimal places

* Round pull payment payout to the nearest digit supported by network

Co-authored-by: nicolas.dorier <nicolas.dorier@gmail.com>
2021-05-13 17:50:08 +09:00
2961a2ed53 Merge pull request #2506 from Kukks/fix-pay-button-steps
Fix Pay Button steps and range validation
2021-05-13 17:33:34 +09:00
12836b9f60 Merge pull request #2512 from NicolasDorier/udoqnf
Make sure BTCPayServer does not take the culture of the server
2021-05-13 17:32:05 +09:00
17cef99ce8 Spelling improvement (#2520) 2021-05-13 17:31:08 +09:00
2194fe43d2 Do not show payments which are not accounted in Payment request 2021-05-12 17:46:57 +09:00
06fef563e3 Fixed 2 typos (#2514)
* Fixed 2 typos

* Update BTCPayServer/Controllers/ManageController.APIKeys.cs

Co-authored-by: Zaxounette <51208677+Zaxounette@users.noreply.github.com>

* Update BTCPayServer/Controllers/ManageController.APIKeys.cs

Co-authored-by: Zaxounette <51208677+Zaxounette@users.noreply.github.com>

Co-authored-by: Zaxounette <51208677+Zaxounette@users.noreply.github.com>
2021-05-07 18:51:10 +02:00
c38eeddc55 Update BC-UR bundle and support decoding hex format of wallet (#2505) 2021-05-08 00:35:43 +09:00
84ec33afb3 Update BitCore branding (#2501)
Co-authored-by: dalijolijo <dalijolijo@v220200132547106119.bestsrv.de>
2021-05-08 00:34:38 +09:00
4b30132d06 Make sure BTCPayServer does not take the culture of the server 2021-05-06 20:28:02 +09:00
38942aef25 remove log 2021-05-05 12:19:35 +02:00
200e8330d8 Fix Pay Button steps and range validation
There were numerous issues around different button types and the amount range validation. Also fixes #2503
2021-05-05 11:27:02 +02:00
86092fc955 Wrap more plugin loading logic in try catch to not crash fatally 2021-05-03 08:35:54 +02:00
50cd4cb3ce bump version 2021-04-29 12:52:55 +09:00
7c857118fa Update Changelog (#2480) 2021-04-29 12:51:35 +09:00
4e1b18e2bb do not crash invoice if wellknown metadata keys used with different e… (#2448)
* do not crash invoice if wellknown metadata keys used with different expected types

* fix

* add bits from alt PR
2021-04-28 16:49:10 +09:00
5fe3c1c61f U2fremove (#2496)
* Remove U2F support and JS

* fix final changes

* fix more final stuff
2021-04-28 16:22:09 +09:00
270bd98a10 Remove test code from Fido2 that got merged 2021-04-28 06:26:59 +02:00
02bf5afe0b Migrate existing U2F to Fido2 (#2484)
* Migrate existing U2F to Fido2

This seamlessly switches all u2f registrations over to the new FIDO2 support. Please note that I have not yet added a way to drop the u2f DB and its UI so that we can test the migration works properly for all.

* add testing logic

* fix u2f tests

* remove duplicate status message

* fix test and namespaces

* fix test
2021-04-28 13:14:15 +09:00
c878f63f99 Fix: Double entry for Api Key nav item in Account navigation menu 2021-04-27 14:06:34 +02:00
8083935b47 Greenfield: Deleting a store in the server, should delete only webhooks of this store 2021-04-27 18:55:38 +09:00
c7d11132e5 Merge pull request #2491 from dennisreimann/wallet-enabling-fix
Offer enabling toggle only for wallets that are set up
2021-04-27 11:16:10 +02:00
69442a49f1 Offer enabling toggle only for setup wallets 2021-04-27 09:27:52 +02:00
5f9ef0ff62 Greenfield: Human friendly error if webhook or delivery not found 2021-04-27 15:38:42 +09:00
0888cc4f97 Fix: Add Fido2 log filter to tests 2021-04-27 08:18:01 +02:00
6821a9a0a4 Fix: Coinswitch plugin missing nav specification 2021-04-27 07:37:08 +02:00
003e8a979b Fix: Plugins integrations formatting text wrap 2021-04-27 07:36:42 +02:00
08e8050ca5 Add button to copy API key to clipboard (#2439)
* Add button to copy API key to clipboard

* Update "copy API key to clipboard" button appearance
2021-04-27 11:30:26 +09:00
8d5c3c5cdd ModelBinders should not throw exception, but return error on ModelState 2021-04-26 12:55:03 +09:00
dcc4214dcb Make sure model binder error are returning error 422, use DateTimeOffsetModelBinder 2021-04-26 12:37:56 +09:00
ded55a1440 customized api/v1/invoices query parameters to filter results (#2461)
* customized api/v1/invoices query parameters to filter results

* customized api/v1/invoices query parameters to filter results

* update swagger and make parameters as arrays

* change startDate and endDate types to UnixTimestamp

* update invoice status type in swagger and better handle dateTimeoffset

* change status type to array of InvoiceStatus to match controller

* change status type to array of InvoiceStatus to match controller

Co-authored-by: somera <somera@tesla.com>
2021-04-26 11:32:44 +09:00
e0ff03068a add altcoin support for althash / htmlcoin (#2485)
* Switch Althash, keypath, hitbtc ticker

* add Althash

* add Althash

* switch to coingecko provider

* add Althash logo

* Fix stacking issue with rate call

* bump NBitcoin to 5.0.77

* bump NBXplorer.Client to 3.0.21
2021-04-26 11:31:00 +09:00
60c05cab55 Merge pull request #2477 from dennisreimann/lightning-setup-redesign
Lightning setup redesign
2021-04-22 17:39:05 +09:00
9c480580ba Merge pull request #2483 from dennisreimann/mobile-unread-count
UI: Fix unread count badge on mobile
2021-04-21 17:43:12 +02:00
f3c3f397eb UI: Fix unread count badge on mobile 2021-04-21 17:38:17 +02:00
f6c7f61ec3 Update BTCPayServer/Views/Stores/SetupLightningNode.cshtml
Co-authored-by: Zaxounette <51208677+Zaxounette@users.noreply.github.com>
2021-04-21 14:52:45 +02:00
aae5cce175 Improve custom node details toggling 2021-04-21 14:38:53 +02:00
8a9bea4603 Wording and display improvements 2021-04-20 14:52:00 +02:00
0e3f6acb0a Final tweaks and test fix 2021-04-20 12:23:50 +02:00
bbe621109f Lightning setup redesign 2021-04-20 12:09:27 +02:00
35f47bdfb7 Add and update theme colors 2021-04-20 12:09:26 +02:00
8ca0be5a4d Merge pull request #2453 from bolatovumar/unify-pos-app-card-markup
Unify POS app card markup
2021-04-20 18:29:50 +09:00
b6bd7cce6d Merge pull request #2446 from NicolasDorier/fweihnq
Give better error for greenfield API
2021-04-20 18:25:10 +09:00
a7cbb3941a Give better error for greenfield API 2021-04-20 18:21:26 +09:00
8957720c94 Merge pull request #2469 from dennisreimann/store-payment-method-toggling
Move payment method enabling toggle to store overview
2021-04-20 17:25:34 +09:00
452915478b UI: Fix duplicate status messages (#2481)
The status message is included in the NavLayout, hence the pages that use this layout should not include the status message.

Fixes #2478.
2021-04-20 16:16:21 +09:00
962c80fff8 Remove permission check
Ensured via the controller, see https://github.com/btcpayserver/btcpayserver/pull/2469#discussion_r616289628
2021-04-20 09:10:23 +02:00
aef06c7f61 Wording updates
Thanks @Zaxounette!
2021-04-20 09:09:32 +02:00
52be5746c6 Update BTCPayServer.Tests/SeleniumTester.cs
Co-authored-by: Zaxounette <51208677+Zaxounette@users.noreply.github.com>
2021-04-20 09:03:40 +02:00
b2ff64733d Update BTCPayServer/Controllers/StoresController.Onchain.cs
Co-authored-by: Zaxounette <51208677+Zaxounette@users.noreply.github.com>
2021-04-20 09:03:39 +02:00
85cf36ac4a Update BTCPayServer.Tests/SeleniumTester.cs
Co-authored-by: Zaxounette <51208677+Zaxounette@users.noreply.github.com>
2021-04-20 09:03:38 +02:00
5fda21373e Move enabling toggle to store overview 2021-04-20 09:03:37 +02:00
1ada87ca31 Fix: Do not crash if plugin folder mismatches plugin identifier 2021-04-20 08:38:37 +02:00
0554565b30 FIDO2/WebAuthN Support (#2356)
* FIDO2/WebAuthN Support

This adds initial support for WebAuthN/FIDO2 as another MFA mode. U2F is still intact and runs alongside it for now. Once this is merged, I will start work on migrating U2F support to happen over the FIDO2 protocol instead.

* Refactor and future proof system (prep work of seamless u2f migration)

* attempt js fix for mobile devices

* Apply suggestions from code review

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

* fix fido name saving

* do not spam logs and hide loader when failed

* PR Changes

* Apply suggestions from code review

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

* attempt fido2 bump

* add name if not named for credentials

Co-authored-by: d11n <mail@dennisreimann.de>
2021-04-20 14:06:32 +09:00
315284d5f5 Fix typo of webhook events property 2021-04-20 12:36:20 +09:00
99b1e391a6 bump NBitcoin 2021-04-20 12:05:48 +09:00
9b50e85d0d Merge pull request #2455 from btcpayserver/feat/improving-files-page
Improving File Storage page
2021-04-20 11:06:14 +09:00
e394474dad Update BTCPayServer/Views/Server/Files.cshtml
Co-authored-by: Zaxounette <51208677+Zaxounette@users.noreply.github.com>
2021-04-20 11:05:53 +09:00
7d1761de4f Coin Selection: Confirmed filter (#2467)
Allows provides confirmation count to Greenfield UTXO GET api
2021-04-20 11:02:06 +09:00
dfd4c967b7 fix null reference exception when no tor settings are provided 2021-04-19 07:43:11 +02:00
71305461d4 Cleaning up edit pages for storage providers not to have summary error
Error sandwich be gone
2021-04-18 14:05:12 -05:00
04a29ece3b Only display storage providers that can actually be set in dropdown 2021-04-18 14:03:22 -05:00
99dd6f3e50 Apply suggestions from code review
Co-authored-by: Zaxounette <51208677+Zaxounette@users.noreply.github.com>
2021-04-18 13:42:25 -05:00
8f6048191d Improving navigation between files and storage services and rewording info text 2021-04-18 13:42:17 -05:00
ee0fa71605 Refactor TorService (#2388)
* TorServices Refactor to make value passing easier

* Allow specifying Tor services through config

Format:

BTCPAY_TORSERVICES: "BTCPAYSERVER:URL.ONION:VIRTUALPORT;BTC-P2P:URL.ONION:VIRTUALPORT;BTC-RPC:URL.ONION:VIRTUALPORT;SOMEOTHERONIONSERVICE:URL.ONION:VIRTUALPORT"

* add tests

* Optimize Tor Services loader and ensure it is loaded as a hosted service

* Remove Task from Tor service loader

* Use options to parse Tor services

* Fix booboo

* Fix test after fixing booboo

* Adding timeout on long running CanEnumeratetorServices test

(cherry picked from commit 274b77e3175960158b803410037e2c7ff31984be)

* Renaming timeout variable to better name

* Only allow one of torrcfile or torservices

Co-authored-by: Kukks <evilkukka@gmail.com>
Co-authored-by: rockstardev <rockstardev@users.noreply.github.com>
2021-04-18 11:26:06 +09:00
475a68924e Allow accessing "misc/lang" endpoint with Greenfield auth schemes (#2471)
closes #2437
2021-04-18 11:22:50 +09:00
c0a544351b Can disable the modification of SSH settings in BTCPay Server (#2468)
* Can disable the modification of SSH settings in BTCPay Server

* Update BTCPayServer/Controllers/ServerController.cs

Co-authored-by: Zaxounette <51208677+Zaxounette@users.noreply.github.com>

* Update BTCPayServer/Controllers/ServerController.cs

Co-authored-by: Zaxounette <51208677+Zaxounette@users.noreply.github.com>

* Update BTCPayServer/Views/Server/SSHService.cshtml

Co-authored-by: Zaxounette <51208677+Zaxounette@users.noreply.github.com>

Co-authored-by: Zaxounette <51208677+Zaxounette@users.noreply.github.com>
2021-04-17 13:29:50 +09:00
15201a927e UI fixes (#2463)
* Fix formatting in bootstrap.css

This looks like it got introduced when resolving a merge conflict.

* Fix typos in views

* Fix semibold style definition
2021-04-16 15:02:40 +09:00
efa567f965 Unify POS app card markup 2021-04-14 20:00:01 -07:00
e1df1c255a Add user id in log when log in 2021-04-15 11:19:06 +09:00
64e34d0ef5 Seaparate CoinSwitch as a plugin (#2390)
* Separate coinswitch as a system plugin

* Decouple Coinswitch from Checkout UI

* remove dummy csproj

* Remove CoinSwitchTests.cs per @NicolasDorier feedback

Co-authored-by: rockstardev <rockstardev@users.noreply.github.com>
2021-04-13 20:19:48 +09:00
2e12befb8b Refactor and decouple Payout logic (#2046)
* Refactor and decouple Payout logic

So that we can support lightning and more complex flows like allowing external payments to payouts.

* fix dropdown align

* switch to simpler buttons

* rebase fixes

add some comments

* rebase fixes

add some comments

* simplify enum caveman logic

* reduce code duplication and db round trips

* Fix pull payment date format

* fix issue with payouts to send page not working correctly

* try fix some style issue

* fix bip21parse
2021-04-13 17:36:49 +09:00
98eee27b93 Remove warnings 2021-04-13 17:06:11 +09:00
8ed853a3b3 Attempt to make selenium less flaky 2021-04-13 15:12:09 +09:00
8fd4a816a6 Allow Payjoin for wallet receive addresses (#2425)
* Allow Payjoin for wallet receive addresses

* wip

* show bip21 and additional work

* style better

* add to docs

* pr changes

* remove from state when unreserved
2021-04-13 12:26:36 +09:00
b12c4c5fa0 Improve and unify page headers (#2412)
* Improve and unify page headers

* Altcoin test fixes

* Update BTCPayServer/Views/Apps/UpdateCrowdfund.cshtml

Co-authored-by: Andrew Camilleri <evilkukka@gmail.com>

* Update BTCPayServer/Views/Apps/UpdateCrowdfund.cshtml

Co-authored-by: Andrew Camilleri <evilkukka@gmail.com>

* Fix missing store name in pairing view

* Fix CanUsePairing test

* Bump header navigation font size

* Use partial tag instead of Html.PartialAsync in views

As suggested by @nicolasdorier. These are equivalent, see details [here](https://docs.microsoft.com/en-us/aspnet/core/mvc/views/partial?view=aspnetcore-3.1#partial-tag-helper).

* Fix docs link

As in #2432.

* Update BTCPayServer/Views/Wallets/SignWithSeed.cshtml

Co-authored-by: britttttk <39231115+britttttk@users.noreply.github.com>

* Update BTCPayServer/Views/Wallets/WalletSendVault.cshtml

Co-authored-by: britttttk <39231115+britttttk@users.noreply.github.com>

* Update BTCPayServer/Views/Wallets/WalletTransactions.cshtml

Co-authored-by: britttttk <39231115+britttttk@users.noreply.github.com>

Co-authored-by: Andrew Camilleri <evilkukka@gmail.com>
Co-authored-by: britttttk <39231115+britttttk@users.noreply.github.com>
2021-04-08 22:32:42 +09:00
6473da7114 Merge pull request #2444 from bolatovumar/increase-landing-page-copy-contrast
Increase landing page masthead text contrast
2021-04-08 13:38:44 +02:00
bb78ae59d4 Merge pull request #2432 from dennisreimann/fix-hot-wallet-docs-link
Fix hot wallet docs link
2021-04-08 12:21:11 +02:00
459f3c4a93 Document and handle Invoice Metadata better (#2401)
* Document and handle Invoice Metadata better

PosData would crash in certain scenarios when created via API. Invoice metadata known fields were not completely documented

* Fix value setter when null

* fix swagger conformity

* make all swagger invoice metadata optional looking in json
2021-04-08 16:42:18 +09:00
e014b30915 Remove on code warning 2021-04-08 14:33:58 +09:00
cc5a388106 Properly escape script inputs for shopify integration 2021-04-08 13:44:51 +09:00
5de93f8cc4 Abstract Store integrations (#2384)
* Decouple Shopify from Store

* Decouple shopify from store blob

* Update BTCPayServer.Tests.csproj

* Make sure shopify obj is set

* make shopify a system plugin
2021-04-08 13:37:05 +09:00
ad1b708da5 Provide more data through OnChain Wallet API (#2420)
Provides unconf/conf balanaces, keypath + address + timestamp of utxos
2021-04-08 12:43:51 +09:00
c7ff36b314 Increase landing page masthead text contrast 2021-04-07 19:37:35 -07:00
f367480857 GreenField: Add FeeRate To Wallets API (#2375)
* GreenField: Add FeeRate To Wallets API

closes #1846

* make dedicated endpoint for fee rate

* remove unused call
2021-04-07 15:16:17 +09:00
475809b1a0 Make Invoice Create Faster And Fix Gap Limit Issue (#1843)
* Make Invoice Create Faster And Fix Gap Limit Issue

This make address reserve only when user "activate" paymet method in ui. optional setting in store checkout ui.

* Fix swagger documentation around Lazy payment methods

* fix changed code signature

* Add missing GreenField API for activate feature

* Fix checkout experience styling for activate feature

* Fix issue with Checkout activate button

* Make lightning also work with activation

* Make sure PreparePaymentModel is still called on payment handlers even when unactivated

* Make payment  link return empty if not activated

* Add activate payment method method to client and add test

* remove debugger

* add e2e test

* Rearranging lazy payments position in UI to be near dependent Unified QR code

* fix rebase conflicts

* Make lazy payment method mode activate on UI load.

Co-authored-by: Kukks <evilkukka@gmail.com>
Co-authored-by: rockstardev <rockstardev@users.noreply.github.com>
Co-authored-by: Andrew Camilleri <kukks@btcpayserver.org>
2021-04-07 13:08:42 +09:00
fce7fdb3b7 Update link 2021-04-06 16:32:04 +02:00
b2c72f1d75 Merge pull request #2435 from bolatovumar/fix/2434
Set new store hints consistently for API and GUI
2021-04-06 14:50:11 +02:00
f0ac7d2c16 Set new store hints consistently for API and GUI
closes #2434
2021-04-05 21:24:34 -07:00
7099a3b394 Fix hot wallet docs link
# Conflicts:
#	BTCPayServer/Views/Server/Policies.cshtml
2021-04-05 21:29:41 +02:00
3e985d8554 Fix crash when sat is negative (liquid only) (#2418) 2021-04-05 12:39:37 +09:00
f94e8c9719 Fix typo in PoS cart view (#2428)
Noticed by @MaxHillebrand 👀
2021-04-05 12:39:02 +09:00
bbe1442c28 Merge pull request #2422 from kristapsk/explorer.bc-2.jp
Fix block explorer links for signet
2021-04-03 12:47:01 +02:00
3a248d7707 Fix block explorer links for signet 2021-04-03 09:19:36 +03:00
0bb1f16d2a Merge pull request #2416 from g33kme/patch-1
Update swagger.template.stores-wallet.on-chain.json
2021-04-01 13:59:45 +02:00
0837756152 Update swagger.template.stores-wallet.on-chain.json 2021-04-01 13:48:06 +02:00
23236c96cb Remove internal setters in BTCPayNetwork 2021-04-01 08:56:22 +02:00
6ead5c3800 Plugin FailSafe (#2351)
This introduces the concept of plugins being disabled in the case of an unrecoverable runtime error caused by a plugin.
2021-04-01 12:27:22 +09:00
64db865e1e Changelog 2021-04-01 12:16:23 +09:00
1b2399745d Remove stable and latest branch 2021-04-01 12:06:29 +09:00
94acf60100 Properly show browser date 2021-04-01 11:55:43 +09:00
a4298e8c19 Ensure root app mapping works (#2415)
close #2414
2021-04-01 11:49:46 +09:00
76985838c4 Improve Lightning setup page (#2348)
* Redesign Lightning setup page

* Improve Lightning setup page

Closes #1811.

* Test fix

* Fix LightningNetworkPaymentMethodAPITests

* Bootstrap customization fix
2021-03-31 20:23:36 +09:00
d24964e900 Merge pull request #2378 from dennisreimann/ui-improvements
UI: Header and navigation improvements
2021-03-31 16:08:37 +09:00
f4fde8f5f7 Merge pull request #2386 from btcpayserver/feat/lnd-v0.12.1-beta
Bumping LND to v0.12.1
2021-03-31 12:35:39 +09:00
3461dd6464 Changelog for 1.0.7.1 2021-03-30 23:54:43 +09:00
560671b57f Remove autocorrect and autocapitalize for seed input 2021-03-30 19:21:29 +09:00
abf3962d91 Remove old styles 2021-03-30 11:38:04 +02:00
f53a85fcd1 Bootstrap customization fix 2021-03-30 11:38:03 +02:00
73730355b8 Add active indicator for main navigation 2021-03-30 11:38:02 +02:00
8827721605 Layout: Update header and navigation 2021-03-30 11:38:01 +02:00
2497413c60 Fix test 2021-03-30 17:15:03 +09:00
a6537ef282 Update lightning charge 2021-03-30 17:08:58 +09:00
c92adc36c6 Remove useless file 2021-03-30 15:23:36 +09:00
a64f71f186 Add user email search and sort (#2305)
* Add user sort by email

* Add user search by email
2021-03-30 14:32:44 +09:00
0c766a2714 Merge pull request #2287 from bumbummen99/patch-3
Fix payment request template
2021-03-30 14:30:56 +09:00
6b7c49431a Merge pull request #2339 from AlexGidge/1725-pull-payments-display-date
Changed display date format on View Pull Payments screen
2021-03-30 14:29:46 +09:00
4b37121b75 Updated "required" form input styling (#2373) 2021-03-30 14:27:42 +09:00
120c7b9730 Ensure submitting empty currency does not break update PoS page (#2376) 2021-03-30 14:26:33 +09:00
1aa233ca47 Order files list by descending timestamp (#2374)
closes #2273
2021-03-30 14:26:02 +09:00
14e6e492dd Refactor domain mapping (#2407) 2021-03-30 11:47:03 +09:00
17bdf55bcc Remove misleading title from hint icon (#2393)
Brought up by @Zaxounette [on Mattermost](https://chat.btcpayserver.org/btcpayserver/pl/yrxqodfswbby5qj69zhpojuefc).
2021-03-30 11:18:24 +09:00
1ae6508a43 Make dates/timespan swagger docs more clear (#2399)
* Make dates/tiemspan swagger docs more clear

* fix schema conformity
2021-03-30 11:18:00 +09:00
b7b6cef880 Fix ratelimiter for forgotpassword 2021-03-28 20:56:46 +09:00
52b5c56da9 Bumping LND to use the latest docker image 2021-03-26 08:52:17 -05:00
85ba9e96a0 Rate limit password forgot 2021-03-26 18:01:59 +09:00
b4e15cb27f Fix Pay-Button url preview (#2397)
* Fix #2396

Adresses #2396 by creating a new element and setting the url as text rather as html.

* Fix closing tag
2021-03-26 16:37:15 +09:00
068cfe5e3e Decrease command timeout for selenium 2021-03-26 14:31:36 +09:00
c0449a633d Revert "Fix docker-compose for arm64 dev env"
This reverts commit 7dfce5e3061d5e0ada87ede81960f0a50d86615d.
2021-03-26 13:22:54 +09:00
7dfce5e306 Fix docker-compose for arm64 dev env 2021-03-26 12:44:55 +09:00
fd53f7476e Fix flaky test (#2392) 2021-03-24 21:33:49 +09:00
ceb541ad8a Upgrade to Bootstrap v4.6 (#2379)
Also upgrades jQuery from v3.2.1 to v3.6.0
2021-03-24 18:47:55 +09:00
d92ced6c6b Make CanUsePayjoin2 more resilient 2021-03-24 14:18:54 +09:00
0847088391 Make CanUsePayjoin2 more resilient 2021-03-24 13:55:46 +09:00
a128685b83 If an input already used in a payjoin is reused in another, we should not attempt to broadcast the original transaction. 2021-03-24 13:48:33 +09:00
749d26fafa Revert "Fix Payjoin test randomly crashing"
This reverts commit 485faf014183321420da8ae7babf5eb9e2668034.
2021-03-23 23:59:26 +09:00
485faf0141 Fix Payjoin test randomly crashing 2021-03-23 18:34:34 +09:00
af9d896510 Do not use Random 2021-03-23 17:53:23 +09:00
1fc114fec7 Check the authentication cookie every 5 min rather than 30min 2021-03-23 17:43:13 +09:00
e6938cef6f Merge pull request #2389 from pavlenex/supportercc
Add new supporter to readme
2021-03-22 17:17:42 +01:00
ffafd291ee replace the svg with an improved one 2021-03-22 17:05:46 +01:00
f532759543 add Coincards supporter to readme 2021-03-22 11:28:04 +01:00
db3ba6db3c Merge pull request #2385 from AryanJ-NYC/fix-swag-docs
fix swagger docs missing query param
2021-03-21 16:44:06 +01:00
0a333f8476 Merge pull request #2383 from bolatovumar/fix/2382
Update Swagger for "/api/v1/stores/{storeId}/payment-methods/LightningNetwork"
2021-03-21 10:50:11 +01:00
738aaeed12 Update Swagger for "/api/v1/stores/{storeId}/payment-methods/LightningNetwork" 2021-03-20 19:53:03 -07:00
ce6c9c91fc Make sure payment method uppercase logic only happens for BTC 2021-03-20 06:52:18 +01:00
7035b71ccd Fix POS item newline break (#2366)
* Fix POS item newline break

fixes #2365

* Update TemplateEditor.cshtml

* fix template editor with "

* apply sanitize on save
2021-03-19 23:25:04 +09:00
923a567822 Make cookies secure 2021-03-19 20:54:30 +09:00
9b24e9378f Explicitely disallow \ for in filename 2021-03-19 20:22:24 +09:00
779f21a1ca Make sure cookie are HttpOnly 2021-03-19 20:09:55 +09:00
73d70aa5e5 Better validate file names 2021-03-19 18:55:21 +09:00
fc78eacf8f Merge pull request #2329 from btcpayserver/addbettermenu
Make main menu show text instead of icons when on small screens
2021-03-18 19:16:21 +01:00
006af636e6 Merge pull request #2372 from nosovk/patch-1
turn of autocomplete for PrivKey input
2021-03-16 17:29:25 +01:00
4575fda10a turn of autocomplete for "BIP39 Seed (12/24 word mnemonic phrase) or HD private key" input
autocomplete not pretend to be safe store for your wallet key
2021-03-16 16:05:16 +02:00
6c960628c2 Update pull payment template 2021-03-15 13:27:14 +01:00
00aa7deaae Fix payment request template
Fix payment request template body/page height and footer style.
2021-03-15 13:25:20 +01:00
f722956864 Merge pull request #2341 from britttttk/improve-sign-seed-copy
Fix typos on wallet sign with seed page
2021-03-15 09:14:54 +01:00
8f520bff12 Merge pull request #2350 from btcpayserver/fix/selenium-tests
Attempting selenium test fix for CanUseLightningSatsFeature
2021-03-14 18:57:41 -05:00
8398534fa0 Attempting selenium test fix for CanUseLightningSatsFeature
Swithcing to using WaitForElement and simplifying finding of alert message
2021-03-14 18:43:16 -05:00
e1fed90b71 bump versions 2021-03-11 22:48:40 +09:00
5ba6e53379 Changelog for 1.0.7.0 2021-03-11 22:45:47 +09:00
d33bdfd50c Make CanUseCoinSelection less flaky 2021-03-11 22:20:25 +09:00
4f5392eb74 Fix test 2021-03-11 22:18:02 +09:00
064087a7c0 fix test 2021-03-11 22:08:36 +09:00
e13821ba49 Fix view-seed 2021-03-11 21:58:20 +09:00
c2b85779c3 Rewrite the CanUseHotWallet, check if the derivationscheme is actually a hotwallet, before retrieving the seed 2021-03-11 21:46:32 +09:00
cdfdad3e3d GreenField API: Wallet API (#2246)
* GreenField: Wallet API

* more work

* wip

* rough fiunish of transaction sending api

* Allow to create tx without broadcasting and small fixes

* Refactor Wallet Receive feature ad add greenfield api for address reserve for wallet

* add wallet api client

* add docs

* fix json converter tags

* fixes and add wallet tests

* fix tests

* fix rebase

* fixes

* just pass the tests already

* ugggh

* small cleanup

* revert int support in numeric string converter and make block id as native number in json

* fix LN endpoint

* try fix flaky test

* Revert "try fix flaky test"

This reverts commit 2e0d256325b892f7741325dcbab01196f74d182a.

* try fix other flaky test

* return proepr error if fee rate could not be fetched

* try fix test again

* reduce fee related logic for wallet api

* try reduce code changes for pr scope

* change auth logic for initial release of wallet api
2021-03-11 21:34:52 +09:00
1f7992e5da Remove some code duplication 2021-03-11 21:29:13 +09:00
4bad7d7c52 Fix issue with store payment methods after having payment method that is no longer supported (#2349) 2021-03-10 19:51:51 +09:00
1fcf39d4ab Fix new store incorrectly showing lightning enabled even if not 2021-03-09 17:56:17 +09:00
a64e304d16 Fix new store showing incorrectly being paired to internal node 2021-03-09 17:54:38 +09:00
30c7cbba96 Fix issue around new bech uppercase + vault supported flag (#2337) 2021-03-09 12:45:56 +09:00
a7d324901d Reverted "Last Refreshed" back to "Last Updated"
Co-authored-by: Zaxounette <51208677+Zaxounette@users.noreply.github.com>
2021-03-08 08:45:16 +00:00
15c87dc0b6 Fix typos on wallet sign with seed page 2021-03-07 23:30:40 -07:00
0d2de4c421 #1725 - Changed to display in user's local date time format 2021-03-07 23:19:39 +00:00
da95bd6127 #1725 - Added start date & changed display timezone 2021-03-07 22:51:50 +00:00
e31b5529b0 Fixed a typo in README.md. (#2331) 2021-03-07 20:54:36 +09:00
0836df6974 Update invoice log row styling (#2334)
closes #2328
2021-03-07 20:50:55 +09:00
de4cd55adf Update coingecko exchanges 2021-03-06 13:58:02 +09:00
6b156f2144 Reenabling uppercase BECH32 in QR codes (#2181)
* Reenabling uppercase BECH32 in QR codes

* Fixing the test now that we're uppercasing BECH32 address

* Implementing Nicolas' feedback

Co-authored-by: rockstardev <rockstardev@users.noreply.github.com>
2021-03-06 13:52:25 +09:00
2b1efd9347 Merge pull request #2296 from dennisreimann/wallet-setup-finetuning
Wallet setup finetuning
2021-03-06 13:51:01 +09:00
97dd10edc0 Fix some NRE in the FileService 2021-03-06 13:36:36 +09:00
cc4e46d212 Fix NRE if invoice not found 2021-03-06 13:25:40 +09:00
dc0671942d Make main menu show text instead of icons when on small screens 2021-03-05 08:48:15 +01:00
f79c8ab641 Xpub import: Toggle multi-sig examples 2021-03-04 11:07:05 +01:00
314fda7877 Update import wallet cells 2021-03-03 22:27:39 +01:00
aaf77515fc Update icons 2021-03-03 21:29:03 +01:00
b5f7b1aad4 Hover and active states for wizard navigation 2021-03-03 21:17:25 +01:00
d36974a47e Fix test 2021-03-02 12:26:19 +01:00
5bd16f990c Add replace confirmation; distinguish wallet types 2021-03-02 12:26:18 +01:00
28d7924077 Fix AltcoinTests 2021-03-02 12:26:17 +01:00
89ecba961c Remove old AddDerivationSchemes views 2021-03-02 12:26:16 +01:00
3481a5fd19 Fix wording 2021-03-02 12:26:15 +01:00
70a21c5136 Refactoring: Move checking condition up 2021-03-02 12:26:15 +01:00
2e2c9764f3 Remove old Stores.BTCLike controller 2021-03-02 12:26:14 +01:00
bd447b6c79 Fix test 2021-03-02 11:50:01 +09:00
4f6ec3aa32 Merge pull request #2325 from btcpayserver/fix/nextnetworkfee-null
Returning 0 for NextNetworkFee if it's null
2021-03-02 11:19:43 +09:00
e37b3179ba Reactivate CanGetRateCryptoCurrenciesByDefault for DSH 2021-03-02 11:14:52 +09:00
808214f973 Fix Rates Test (Dash rate source switched to bitfinex) (#2324)
fixes #2323
2021-03-02 11:13:05 +09:00
7e714f1ef8 Refactor how we handle and validate LN ConnectionStrings (#2314)
* Refactor how we handle and validate LN ConnectionStrings

* Migrate existing connection string to Internal Node if they are the same. Cleanup some obsolete fields

* Fix typos, remove duplicated method

* Add a InternalNodeRef to LightningSupportedPaymentMethod
2021-03-02 11:11:58 +09:00
e65e46f664 NextNetworkFee is not directly initialized, falling back to null check 2021-03-01 09:56:57 -06:00
5e7eb6635f Initializing NextNetworkFee values if GetFee returns null 2021-03-01 09:33:02 -06:00
49ae62b02e Use library for Payjoin Sender (#2158)
* Use library for Payjoin Sender

* update payjoin sender to use new package and reduce code

* fix using statements
2021-03-01 22:44:53 +09:00
c9cfe5cc6e Fix direct URL for local storage with custom root path (#2318)
* Fix direct URL for local storage with custom root path

* Remove "Context.Request.PathBase" when generating file URL display string
2021-03-01 22:43:57 +09:00
e8df010449 Add redirectAutomatically to GreenField Invoice API (#2321) 2021-03-01 22:34:07 +09:00
949136b161 GreenField API: Configure Store Lightning Payment Method v2 (#2208)
* GreenField API: Configure Store Lightning Payment Method

* Remove internal ln node endpoint and use Auth service to check internal node usage

* fix test
2021-02-26 11:58:51 +09:00
1e00c63146 Merge pull request #2308 from dennisreimann/policies-ui
Improve policies structure and wordings
2021-02-26 11:49:00 +09:00
6d9b93a407 Merge pull request #2299 from dennisreimann/pos-item-button-text
PoS: Custom buy button text per product
2021-02-26 11:45:44 +09:00
37c39ad587 Merge pull request #2309 from btcpayserver/invoice-status-marker
Allow invoice to be marked even when new
2021-02-26 11:26:09 +09:00
e3e65878aa Allow invoice to be marked even when new
fixes #2019
2021-02-26 11:17:03 +09:00
6843b0eaab Merge pull request #2301 from btcpayserver/gf/paymenttypeparse
Make payment type parsing more dynamic
2021-02-26 11:00:27 +09:00
e25f76753a Update BTCPayServer.Tests/README.md
Co-authored-by: Max Hillebrand <30683012+MaxHillebrand@users.noreply.github.com>
2021-02-24 17:16:27 +01:00
75c2fabd7f Make Selenium test more robust
Fixes an issue similar to what we fixed in #2293.
2021-02-24 15:10:05 +01:00
35aeb19fcd Controller cleanups 2021-02-24 15:10:04 +01:00
5a00f6a4fc Fix missing view name 2021-02-24 15:10:03 +01:00
3a9fc52b8c Add "vertical-align: middle;" to pay button image CSS (#2312)
closes #2311
2021-02-24 15:10:02 +01:00
64a8de938b Update BTCPayServer.Tests/README.md
Co-authored-by: Pavlenex <pavle@pavle.org>
2021-02-24 15:09:45 +01:00
605cf407a8 Update README.md
Update README.md #2210
2021-02-24 15:06:16 +01:00
9ed5297e91 Update README.md
Using Polar to test Lightning payments.
2021-02-24 15:06:15 +01:00
07da404a23 Merge pull request #2310 from dennisreimann/webhooks-controller
Webhooks controller fix and cleanup
2021-02-24 22:03:01 +09:00
21467ef65d Add "vertical-align: middle;" to pay button image CSS (#2312)
closes #2311
2021-02-24 22:01:05 +09:00
4d5b2c4033 Make Selenium test more robust
Fixes an issue similar to what we fixed in #2293.
2021-02-23 16:57:21 +01:00
5e7836b293 Controller cleanups 2021-02-23 16:51:58 +01:00
a6fe61d508 Fix missing view name 2021-02-23 16:51:11 +01:00
c0aa320f0a Improve policies structure and wordings
Closes #2307.
2021-02-23 10:39:26 +01:00
4bcc18fb41 JavaScript formatting fixes 2021-02-23 09:51:25 +01:00
32370545cb Fix variable assignment in yaml parsing loop 2021-02-23 09:50:54 +01:00
2fd8c831c0 Merge pull request #2210 from radWorx/dev-with-polar
Update README.md
2021-02-22 10:22:16 +01:00
5b4877c402 PoS: Custom buy button text for custom price 2021-02-22 08:59:59 +01:00
71c11b34f4 Make payment type parsing more dynamic
fixes bug described in #2297
2021-02-19 08:23:55 +01:00
3123718166 Crowdfund: Add custom buy button text 2021-02-18 12:32:43 +01:00
dfbec71906 PoS: Add test for custom buy button text 2021-02-18 12:20:27 +01:00
757c087afd PoS: Custom buy button text per product
Closes #2232.
2021-02-18 10:54:06 +01:00
b30aa968b0 Merge pull request #2293 from dennisreimann/flaky-selenium
Tame flaky Selenium tests
2021-02-18 09:39:28 +01:00
1e902c8dee Tests: Toggle advanced settings via JS instead 2021-02-17 15:54:05 +01:00
db5f64432e Tests: Wait for advanced settings closing animation 2021-02-17 12:34:58 +01:00
6c9c463da9 Fix plugin projects reference in solution (#2292)
Fixes #2262.
2021-02-17 10:56:48 +01:00
c73878ccca Fix missing hot wallet option on seed import (#2284)
* Fix missing hot wallet option on seed import

Thanks @kukks for spotting!

* Tests: Wait for button to be ready for interaction

* Camelcase test selectors

* Tests: Remove general ImplicitWait

* Tests: Add WaitForAndClick helper

* Tests: Refactor SetCheckbox

* Tests: Add WaitForElement helper

* Tests: Refactor and use wait.UntilJsIsReady helper

* Fix missing helper in ethereum tests

* Tests: Some more refactorings
2021-02-17 12:14:29 +09:00
41e453306d Merge pull request #2288 from bumbummen99/patch-4
Fix view payment request loading spinner alignment
2021-02-17 12:10:18 +09:00
626c6007fd Merge pull request #2286 from btcpayserver/remove-upload-limit
Remove Max body request size
2021-02-16 10:40:43 +09:00
deb88032cb Update README.md
added missing space,
moved below Using the test lightning-cli
2021-02-15 15:15:38 -05:00
eca317b3c4 Fix view payment request loading spinner alignment 2021-02-15 16:37:38 +01:00
9300326483 Remove Max body request size
Upload limit by kestrel restricts plugin upload of 30mb+. this removes that limit
2021-02-15 13:42:08 +01:00
ebc46eb7d2 fix swagger docs missing query param
fixes #2268
2021-02-15 10:05:54 +01:00
cb83669802 Merge pull request #2283 from bumbummen99/patch-2
Fix cart pay button loading spinner vertical alignment
2021-02-15 11:17:57 +09:00
f6f616a21d Fix cart pay button loading spinner vertical alignment 2021-02-14 21:05:26 +01:00
62d50c0189 Profile email change should check email's availability (#2281) 2021-02-12 16:48:43 +09:00
dd5b143c13 Update BTCPayServer/Controllers/ManageController.cs
Co-authored-by: d11n <mail@dennisreimann.de>
2021-02-12 16:48:26 +09:00
2e864c32fa Profile email change should check email's availability 2021-02-12 12:48:05 +09:00
f4fa7c927c Wallet setup redesign (#2164)
* Prepare existing layouts and views

* Add icon view component and sprite svg

* Add wallet setup basics

* Add import method view basics

* Use external sprite file instead of inline svg

* Refactor hardware wallet setup flow

* Manually enter an xpub

* Prepare other views

* Update views and models

* Finalize wallet setup flow

* Updat tests, part 1

* Update tests, part 2

* Vaul: Fix missing retry button

* Add better Scan QR subtext

Still tbd.

* Make wallet account an advanced setting

* Prevent empty xpub

* Use textarea for seed input

* Remove redundant error message for missing file upload

* Confirm store updates after generating a new wallet

* Update wording

* Modify existing wallets

* Fix proposed method name

* Suggest using ColdCard Electrum export option only

Advise the user to use the electrum export of the coldcard instead of saying either electrum or wasabi export file … the electurm one contains more info, e.g. the wasabi one doesn't include the account key path.

* More concise WalletSetupMethod setting

* Test fix

* Update wallet removal code

* Fix back navigation quirk in change wallet case

* Fix behaviour on wallet enable/disable

* Fix initial wallet setup

* Improve modify view and messages

* Test fixes

* Seed import fix

Uses the correct form url for confirming addresses

* Quickfixes from design meeting

* Add enable toggle switch on modify page

* Confirm wallet removal

* Update setup view

* Update import view

* Icon finetuning

* Improve import options page

* Refactor QR code scanner

Allow for usage with and without modal

* Update copy and instructions on import pages

* Split generate options: Hot wallet and watch-only

* Implement hot wallet options correctly

* Minor test changes

* Navbar improvements

* Fix tables

* Fix badge color

* Routing related updates

Thanks @kukks for the suggestions!

* Wording updates

Thanks @kukks for the suggestions!

* Extend address types table for xpub import

Thanks @kukks for the suggestions!

* Rename controller

* Unify precondition checks

* Improve removal warning for hot wallets

* Add tooltip on why seed import is not recommended

* Add tooltip icon

* Add Specter import info
2021-02-11 19:48:54 +09:00
3736cbc107 Merge pull request #2252 from dennisreimann/specter-wallet-file
Add Specter wallet file import
2021-02-10 23:02:26 +09:00
776825cc66 Merge pull request #2240 from dennisreimann/onchain-symbol
Invoices list: Remove icon indicator for onchain
2021-02-10 22:48:34 +09:00
5cb647e57f Merge pull request #2248 from bolatovumar/fix-2247
Ensure "No" selection is maintained for custom price in POS app
2021-02-10 22:42:55 +09:00
9c5f826bb4 Merge pull request #2256 from bumbummen99/patch-1
Fix current version
2021-02-10 22:35:34 +09:00
6b1803629d Merge pull request #2258 from dennisreimann/tabindex
Login: Improve tab navigation for input fields
2021-02-10 22:35:09 +09:00
5cea0571e3 Merge pull request #2265 from dennisreimann/checkout-tabs
Checkout: Fix scan/copy tab sizes with varying content
2021-02-10 22:34:24 +09:00
95c8afd5ba Merge pull request #2261 from ketominer/fix-mysql-2021
fixed mysql support
2021-02-10 18:26:20 +09:00
ecc9a34359 Checkout: Fix scan/copy tab sizes with varying content
Fixes #2264.
2021-02-08 17:54:40 +01:00
1fed7fb5af fix for sqlite 2021-02-07 21:14:31 +01:00
93d1ded4c2 fixed mysql support 2021-02-07 20:57:48 +01:00
f199775437 Register: Autofocus email field on page load 2021-02-05 13:04:21 +01:00
40271f420d Login: Improve tab navigation for input fields
Improves the tab indexes so that keyboard navigation goes: Email > Password > Sign in > Create account > Forgot password.

Also autofocuses the email field so that you can start typing right away.

Closes #2257.
2021-02-05 13:01:55 +01:00
9e71c02eb9 Merge pull request #2239 from pavlenex/readme-improvements
Readme overhaul
2021-02-05 11:29:16 +01:00
c9cbfe630d Fix current version 2021-02-05 03:02:15 +01:00
bf9331b147 Merge pull request #2251 from dennisreimann/api-lightning
Fix empty GetLightningClient return value
2021-02-04 11:26:15 +09:00
f223d2e00c Add Specter wallet file import
Closes #2223.
2021-02-03 16:36:45 +01:00
5246e7f035 Fix empty GetLightningClient return value 2021-02-03 11:19:35 +01:00
42de0803c9 Ensure "No" selection is maintained for custom price in POS app 2021-02-02 20:13:39 -08:00
242f9c6197 Merge pull request #2241 from btcpayserver/feat/lnd-0.12.0-beta
Updating development LND to v0.12.0-beta
2021-02-02 12:56:29 +09:00
5288198474 Updating connection to merchant_lnd for tests 2021-02-01 01:37:58 -06:00
b21353c4f9 Updating LND in altcoins docker file as well 2021-02-01 01:37:12 -06:00
65a0c6a4b3 Updating development LND to v0.12.0-beta 2021-02-01 00:55:13 -06:00
af5bd89f34 Invoices list: Remove icon indicator for onchain
As [discussed on the chat](https://chat.btcpayserver.org/btcpayserver/pl/tcjy5ornhbd8i8jm4yj9y3maie) the icon feels unnecessary and isn't clear to users. Leaving it off and only indicating Lightning transactions avoids confusion.
2021-01-30 18:53:21 +01:00
73aeffd13c Apply suggestions from code review
Co-authored-by: britttttk <39231115+britttttk@users.noreply.github.com>
2021-01-30 10:58:48 +01:00
03d2f6c017 Merge pull request #2209 from btcpayserver/invoice-metadata-test
Improve test on Greenfield Inoice metadata update
2021-01-30 11:17:11 +09:00
7e1481c43f Apply suggestions from code review
Co-authored-by: Zaxounette <51208677+Zaxounette@users.noreply.github.com>
2021-01-29 18:31:41 +01:00
8a1069bf70 Apply suggestions from code review
Co-authored-by: Zaxounette <51208677+Zaxounette@users.noreply.github.com>
2021-01-29 18:30:57 +01:00
6097ab5d12 Update README.md
Co-authored-by: d11n <mail@dennisreimann.de>
2021-01-29 14:04:35 +01:00
d951575f80 Merge branch 'readme-improvements' of https://github.com/pavlenex/btcpayserver into readme-improvements 2021-01-29 12:38:47 +01:00
d887546e58 remove chat 2021-01-29 12:37:59 +01:00
ec3b80cec9 Apply suggestions from code review
Co-authored-by: Andrew Camilleri <evilkukka@gmail.com>
2021-01-29 12:36:12 +01:00
2ef442cf83 Improve readme 2021-01-29 12:19:51 +01:00
6e5a4a7546 Update changelog.md 2021-01-29 18:36:26 +09:00
e0d46002cb Changelog 1.0.6.8 2021-01-29 18:31:40 +09:00
739f13b7a3 Merge pull request #2234 from dennisreimann/safe-browsing
Safe browsing quick fixes
2021-01-29 18:24:11 +09:00
34af74b288 Apply URL changes from code review
Co-authored-by: Andrew Camilleri <evilkukka@gmail.com>

Update BTCPayServer/Controllers/AccountController.cs

Co-authored-by: Andrew Camilleri <evilkukka@gmail.com>

Update BTCPayServer/Controllers/AccountController.cs

Co-authored-by: Andrew Camilleri <evilkukka@gmail.com>

Update BTCPayServer/Controllers/AccountController.cs

Co-authored-by: Andrew Camilleri <evilkukka@gmail.com>

Update BTCPayServer/Controllers/AccountController.cs

Co-authored-by: Andrew Camilleri <evilkukka@gmail.com>

Update BTCPayServer/Controllers/AccountController.cs

Co-authored-by: Andrew Camilleri <evilkukka@gmail.com>

Update BTCPayServer/Controllers/AccountController.cs

Co-authored-by: Andrew Camilleri <evilkukka@gmail.com>
2021-01-28 12:33:12 +01:00
4ee0cc8145 Remove clipboard code from main-bundle
See https://github.com/btcpayserver/btcpayserver/issues/2139#issuecomment-768216462
2021-01-28 10:48:06 +01:00
4984674b1d Remove Tor URL from login and register page
Brave and Tor Browser now show availaibility of Tor automatically in the url box of the browser.
2021-01-28 10:47:28 +01:00
f5ee67aafb Remove allowtransparency from checkout overlay 2021-01-28 10:34:34 +01:00
98a1b0da71 Update public account URLs
- /Account/Login -> /login
- /Account/Register -> /register
- /Account/ForgotPassword -> /forgot-password
2021-01-28 10:08:22 +01:00
074ff76d49 Merge pull request #2221 from dennisreimann/selenium-tests
Selenium tests: Remove hacks, make them more reliable
2021-01-27 17:50:57 +09:00
b75409a6bf Remove Firefox as option for Selenium tests 2021-01-27 09:35:14 +01:00
94abda6e3e bump lightning libs 2021-01-27 17:21:18 +09:00
68419a9510 Improve password reset email copy (#2211)
* Reset password email copy unified and updated

* Grammar fix for reset email copy

* Email strings added to facilitate html and style and call to action

* First pass html. Saving for later

* Compacted the html and inline styles and removed logo

Co-authored-by: Salie Hendricks <salie@safarinow.com>
2021-01-27 08:42:47 +01:00
db0854f203 Update NBitcoin, NetworkType => ChainName, signet support (#2224) 2021-01-27 14:39:38 +09:00
994301ea4c Bump Bitcoin Core and NBXPlorer (#2222) 2021-01-26 21:01:32 +09:00
5e344b9be7 Fix missing user secrets code 2021-01-26 10:22:17 +01:00
66d3da8ac9 Remove function checks as they didn't help 2021-01-26 09:40:31 +01:00
71bb876c9e Configure browser settings with user secrets
Default to headless Chrome
2021-01-25 17:23:08 +01:00
1e029f3290 Fix EthereumTests 2021-01-25 16:49:20 +01:00
7926b689fd Default to headless, add Firefox, update Chrome 2021-01-25 15:01:53 +01:00
4638f781f9 Fix JS error 2021-01-25 14:11:11 +01:00
8bea1505dd Cleanups, remove WaitForPageLoad hack 2021-01-25 14:10:40 +01:00
e567f7a80c Refactor tests
Remove the hacky `ScrollTo`, `ForceClick` and `WaitForElement`.
Add the hacky `WaitForPageLoad`.
2021-01-25 13:04:58 +01:00
3774e8dc51 Merge pull request #2207 from btcpayserver/feat/new-error-pages
New Error Pages
2021-01-24 23:49:36 -06:00
dc27ffa6ba Http error page 406 for our dear man Jack
Yes, acceptable
2021-01-24 13:41:30 -06:00
ca25eedfbc Extracting common layout for Error Pages 2021-01-24 13:33:34 -06:00
1627c05224 Fixing typos and grammar
Co-authored-by: Umar Bolatov <bolatovumar@gmail.com>
2021-01-24 13:19:26 -06:00
f65ca04507 Http error 502, Miles page 2021-01-24 13:19:26 -06:00
a662b6ef6a Http error 417, page for Pavlenex 2021-01-24 13:19:26 -06:00
bd6d38b3b0 Tests: Move extension method 2021-01-22 12:57:46 +01:00
a890d5300b Update BTCPayServer.Tests/README.md
Co-authored-by: Pavlenex <pavle@pavle.org>
2021-01-19 13:30:45 -05:00
eb8411611a Update README.md
Update README.md #2210
2021-01-19 13:07:19 -05:00
9360ddf294 Merge branch 'dev-with-polar' of https://github.com/radworx/btcpayserver into dev-with-polar 2021-01-19 13:04:32 -05:00
e3c138fa98 Update README.md
Update README.md #2210
2021-01-19 13:02:26 -05:00
7147dadb2a Remove dependency to DBriize 2021-01-19 17:19:32 +09:00
8d03738a50 Update BTCPayServer.Tests/README.md
Co-authored-by: britttttk <39231115+britttttk@users.noreply.github.com>
2021-01-18 22:52:21 -05:00
e5540ee79f Update BTCPayServer.Tests/README.md
Co-authored-by: britttttk <39231115+britttttk@users.noreply.github.com>
2021-01-18 22:52:09 -05:00
2ccbb6d6a7 Update BTCPayServer.Tests/README.md
Co-authored-by: britttttk <39231115+britttttk@users.noreply.github.com>
2021-01-18 22:51:59 -05:00
3dce7e7e9f Update README.md
Using Polar to test Lightning payments.
2021-01-18 22:15:52 -05:00
79e8ce9226 Improve test on Greenfield Inoice metadata update 2021-01-18 14:24:38 +01:00
89857ca77c Merge pull request #2202 from btcpayserver/fix/error-pages
Improving styling of error pages in preparation for adding new ones
2021-01-17 10:10:02 -06:00
5ce60be78a Update BTCPayServer/Views/Shared/_BTCPaySupporters.cshtml
Co-authored-by: d11n <mail@dennisreimann.de>
2021-01-17 10:09:50 -06:00
600cc20423 changelog 2021-01-17 21:50:02 +09:00
987d09041d bump 2021-01-17 21:45:54 +09:00
df52d01a1d Revert "GreenField API: Configure Store Lightning Payment Method"
This reverts commit b40095f6039dbce20ee92b2da8cd4530c7b8b486.
2021-01-17 21:40:16 +09:00
07de4af581 Revert "Apply suggestions from code review"
This reverts commit 48b2e682bf758ad76b8a50ddcc4473a19f5b0836.
2021-01-17 21:39:20 +09:00
95c50dcc0d Changelog and new release (#2204)
* Changelog and new release

* Update Changelog.md
2021-01-17 19:14:36 +09:00
71a192d0ba Fix SQLite COnnection string setter 2021-01-17 10:02:59 +01:00
9acb8c2ba2 Restoring project name in partial 2021-01-16 16:26:35 -06:00
307f7b6bd7 Improving styling of error pages in preparation for adding new ones 2021-01-16 14:55:31 -06:00
83dd80ae86 Prevent access to wallet features if derivation scheme isn't set (#2196) 2021-01-16 19:48:05 +09:00
ccfa85b5e0 fix compile errors 2021-01-16 09:22:07 +01:00
e59821caa1 GetInvoiceRaw used its own dbContext while calling code used a different one which causes the calling context not to track changes - thus nothing is saved. (#2197)
Co-authored-by: Salie Hendricks <salie@safarinow.com>
2021-01-16 09:00:19 +01:00
2215e5e069 Merge pull request #2194 from btcpayserver/gf/ln-payment-emthod
GreenField API: Configure Store Lightning Payment Method
2021-01-14 10:07:00 +01:00
48b2e682bf Apply suggestions from code review
Co-authored-by: Dennis Reimann <mail@dennisreimann.de>
2021-01-14 09:19:16 +01:00
5750da574a Add info on how to run the altcoin docker-compose (#2193) 2021-01-13 19:26:53 +01:00
b40095f603 GreenField API: Configure Store Lightning Payment Method 2021-01-12 09:25:35 +01:00
ec11585223 Update Changelog 2021-01-11 23:46:17 +09:00
eedf189d44 Improve logs of the invoice text search import 2021-01-11 23:41:05 +09:00
f027d36db8 Do not spam logs for inventory events 2021-01-11 23:33:21 +09:00
0c79474e0c Do not index metadata 2021-01-11 23:32:32 +09:00
610f9e2b22 Log text search migration progress 2021-01-11 23:06:59 +09:00
4db4b28369 Fix crash if DerivationSchemeSettings.Parse parse a 2-of scheme 2021-01-11 22:47:32 +09:00
18464f5cd5 bump 2021-01-11 19:12:48 +09:00
cf24c1307a Changelog 1.0.6.5 (#2192)
* Changelog 1.0.6.5

* Update Changelog.md

Co-authored-by: Zaxounette <51208677+Zaxounette@users.noreply.github.com>

Co-authored-by: Zaxounette <51208677+Zaxounette@users.noreply.github.com>
2021-01-11 19:12:00 +09:00
35e870a8e7 Revert "Remove tests of chaincoin default rate provider (#2189)"
This reverts commit 56daf347b914cf60a99128b96fdca94072af95a5.
2021-01-11 12:11:25 +09:00
01be74b219 Add Bitcoin Output descriptor support (#2169)
* Add Output descriptor support

* Fix exception message and fix Parse Deriv Scheme Settings when electrum

* fix test
2021-01-11 11:22:42 +09:00
b8da6847b9 Plugins flexibility PR (#2129)
* Plugins flexibility PR

* Makes the BTCPayServerOptions.LoadArgs async to support Plugin hooks and actions
* relax the private set modifiers in the BTCPayNetwork
* Separate IPluginHookService from PluginService to reduce dependencies on DI
* fix some small bugs around image path
* Fix bug with new dbreeze migration where data dir was incorrect

* Update BTCPayServer/Plugins/PluginHookService.cs

Co-authored-by: rockstardev <5191402+rockstardev@users.noreply.github.com>

* Update BTCPayServer/Plugins/PluginHookService.cs

Co-authored-by: rockstardev <5191402+rockstardev@users.noreply.github.com>

Co-authored-by: rockstardev <5191402+rockstardev@users.noreply.github.com>
2021-01-07 14:49:53 +01:00
e2e37a0db4 Make sure that the invoice currency is normalized to uppercase (Fix #2146) 2021-01-07 22:30:57 +09:00
56daf347b9 Remove tests of chaincoin default rate provider (#2189) 2021-01-07 22:11:14 +09:00
5098f63175 Merge pull request #2188 from dennisreimann/patch-1
UI: Wrap notification text
2021-01-07 14:01:21 +01:00
d9b12a6927 UI: Wrap notification text
Fixes #2187.
2021-01-07 13:58:23 +01:00
fe4ffcfc62 Update notification dropdown styling (#2167)
* Update notification dropdown strings

* Update notification dropdown styling

address #2131

* Update border color

* Update notification hover color

* Revert "was confirmed paid" to "has been paid" change

* Move styles to site.css

* Update style="border-bottom: 0;" to border-bottom-0

* Update heading

* Add icon sprite

* Add default icon styles

* Use "currentColor" instead of specific color for icon

* Update icon color definition

* Adjust dropdown position

* Update h4 to h5
2021-01-07 18:07:42 +09:00
64a68b95b0 Add API Key QR scan + click to reveal api key in List view (#2174) 2021-01-07 17:56:35 +09:00
58d01738ab More Options refactoring (#2179)
* More Options refactoring

Continues refactoring config classes to use the propert Options pattern where possible.
DataDirectories and DatabaseOptions are now configured the Options pattern and the BTCPayOptions is now moved alongside the other config setup

* Move COnfigure logic for Options to the Startup
2021-01-06 23:51:13 +09:00
a18dae6d04 Merge pull request #2185 from btcpayserver/fix/deleting-dbriize
Deleting DBriize database folder if present
2021-01-06 10:59:24 +09:00
b2959e583a Use default color for label if the color of a label is not set 2021-01-05 16:33:24 +09:00
a38a4d6f69 Merge pull request #2180 from btcpayserver/attempt-onion-modal-fix
Do not tell tor browser to redirect if invoice is loaded as a modal
2021-01-05 14:04:14 +09:00
0a6ea59254 Rewrite the condition to show Onion-Location in a more readable way 2021-01-05 13:44:08 +09:00
04984a51e6 Fixing bug when MigratedInvoiceTextSearchPages is null 2021-01-04 22:40:50 -06:00
8947f13dbe Deleting legacy DBriize database if present 2021-01-04 22:35:00 -06:00
c0549d872c Bump HtmlSanitizer from 4.0.217 to 5.0.372 in /BTCPayServer (#2183)
Bumps [HtmlSanitizer](https://github.com/mganss/HtmlSanitizer) from 4.0.217 to 5.0.372.
- [Release notes](https://github.com/mganss/HtmlSanitizer/releases)
- [Commits](https://github.com/mganss/HtmlSanitizer/compare/v4.0.217...v5.0.372)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-01-05 13:22:39 +09:00
adcd5f0737 Update year (#2184) 2021-01-05 12:38:30 +09:00
0929857b12 Attempt to solve webhooks disappearing (#2178) 2021-01-05 12:38:12 +09:00
7d21b39534 Do not tell browser to redirect if invoice is loaded as a modal
fixes #2089
2021-01-03 14:29:19 +01:00
aaf85216eb Split Options in BTCPayOptions (#2175)
* Split Options in BTCPayOptions

* fix spacing
2021-01-02 13:44:28 +01:00
2c87100ffb Restoring tracking of selected objects so updates work as expected 2021-01-01 02:01:33 -06:00
6c22546577 Merge pull request #2172 from btcpayserver/fix/db-refactoring
Refactoring db entities to follow conventions
2021-01-01 01:58:52 -06:00
24177ffc46 Removing partial class since Emperor requested it 2020-12-31 14:08:58 -06:00
8ae4315d43 Database Migration: Removing migration with wrong table name and refreshing 2020-12-31 14:08:58 -06:00
a588c72e6c Database Migration: Renaming InvoiceSearches table to follow convention 2020-12-31 14:08:58 -06:00
a656f86003 Refactoring ApplicationDbContext to order tables and OnModelCreating calls 2020-12-31 14:08:58 -06:00
c9dc60be7b Refactoring Data entities to fit one standard convention 2020-12-31 14:08:57 -06:00
91cb9129ab FGreenField: Add DefaultPaymentMethod to Stores API (#2171) 2020-12-29 18:33:44 +09:00
ae32fdeea7 Introduce Additional Data to Store Blob and move obsolete props to migration (#2065)
* Introduce Additional Data to Store Blob and move obsolete props to migration

* Fixes and tests

* Small adjustements to prevent tracking too many objects

Co-authored-by: nicolas.dorier <nicolas.dorier@gmail.com>
2020-12-29 17:58:35 +09:00
5803512820 Remove Default from OnChainPayment Method (#2170)
Makes more sense to do it on the Store endpoint after thinking about it.
2020-12-29 17:38:31 +09:00
553b1f139b Updating links to Zap wallet now that domain moved 2020-12-28 17:18:12 -06:00
623347bc48 Add Label and accountKeyPath to the on chain payment methods (#2166) 2020-12-28 13:59:01 +01:00
f64f86fbb6 Make sure the invoice migration loop can be interrupted 2020-12-28 19:13:00 +09:00
39b5462809 Remove only dependency on Dbriize (TextSearch in new invoice column) (#2029)
* Remove only dependency on Dbriize (TextSearch in new invoice column)

* Switch to table for invoice text search

* Adding missing using after rebase

* Removing database migration in preparation for refresh

* Database Migration: Adding InvoiceSearchData

* Refactoring InvoicesRepository to make AddToTextSearch static and non-async

Operation as async is too expensive for simple filtering and AddRange

* Renaming InvoiceQuery property to Take

More inline with what property does by convention, Take is used in conjuction with Skip

* Refactoring SettingsRepository so update of settings can happen in another context

* Adding DbMigrationsHostedService that performs long running data migrations

* Commenting special placing of MigrationStartupTask

* Simplifying code and leaving comment on expected flow

* Resolving problems after merge

* Database Migration: Refreshing database migration, ensuring no unintended changes on ModelSnapshot

Co-authored-by: rockstardev <rockstardev@users.noreply.github.com>
Co-authored-by: Nicolas Dorier <nicolas.dorier@gmail.com>
2020-12-28 19:10:53 +09:00
1798 changed files with 139317 additions and 102980 deletions

View File

@ -2,15 +2,15 @@ version: 2
jobs:
fast_tests:
machine:
enabled: true
image: ubuntu-2004:202111-02
steps:
- checkout
- run:
command: |
cd .circleci && ./run-tests.sh "Fast=Fast" && ./can-build.sh
cd .circleci && ./run-tests.sh "Fast=Fast|ThirdParty=ThirdParty" && ./can-build.sh
selenium_tests:
machine:
enabled: true
image: ubuntu-2004:202111-02
steps:
- checkout
- run:
@ -18,85 +18,77 @@ jobs:
cd .circleci && ./run-tests.sh "Selenium=Selenium"
integration_tests:
machine:
enabled: true
image: ubuntu-2004:202111-02
steps:
- checkout
- run:
command: |
cd .circleci && ./run-tests.sh "Integration=Integration"
external_tests:
trigger_docs_build:
machine:
enabled: true
image: ubuntu-2004:202111-02
steps:
- checkout
- run:
command: |
if [ "$CIRCLE_PROJECT_USERNAME" == "btcpayserver" ] && [ "$CIRCLE_PROJECT_REPONAME" == "btcpayserver" ]; then
cd .circleci && ./run-tests.sh "ExternalIntegration=ExternalIntegration"
else
echo "Skipping running ExternalIntegration tests outside of context of main user and repository that have access to secrets"
fi
curl -X POST -H "Authorization: token $GH_PAT" -H "Accept: application/vnd.github.everest-preview+json" -H "Content-Type: application/json" https://api.github.com/repos/btcpayserver/btcpayserver-doc/dispatches --data '{"event_type": "build_docs"}'
# publish jobs require $DOCKERHUB_REPO, $DOCKERHUB_USER, $DOCKERHUB_PASS defined
amd64:
machine:
enabled: true
image: ubuntu-2004:202111-02
steps:
- checkout
- checkout
- run:
command: |
LATEST_TAG=${CIRCLE_TAG:1} #trim v from tag
GIT_COMMIT=$(git rev-parse HEAD)
#
sudo docker build --pull -t $DOCKERHUB_REPO:$LATEST_TAG-amd64 -f amd64.Dockerfile .
sudo docker build --pull --build-arg CONFIGURATION_NAME=Altcoins-Release -t $DOCKERHUB_REPO:$LATEST_TAG-altcoins-amd64 -f amd64.Dockerfile .
sudo docker build --build-arg GIT_COMMIT=${GIT_COMMIT} --pull -t $DOCKERHUB_REPO:$LATEST_TAG-amd64 -f amd64.Dockerfile .
sudo docker build --build-arg GIT_COMMIT=${GIT_COMMIT} --pull --build-arg CONFIGURATION_NAME=Altcoins-Release -t $DOCKERHUB_REPO:$LATEST_TAG-altcoins-amd64 -f amd64.Dockerfile .
sudo docker login --username=$DOCKERHUB_USER --password=$DOCKERHUB_PASS
sudo docker push $DOCKERHUB_REPO:$LATEST_TAG-amd64
sudo docker push $DOCKERHUB_REPO:$LATEST_TAG-altcoins-amd64
arm32v7:
machine:
enabled: true
image: ubuntu-2004:202111-02
steps:
- checkout
- checkout
- run:
command: |
sudo docker run --rm --privileged multiarch/qemu-user-static:register --reset
LATEST_TAG=${CIRCLE_TAG:1} #trim v from tag
GIT_COMMIT=$(git rev-parse HEAD)
#
sudo docker build --pull -t $DOCKERHUB_REPO:$LATEST_TAG-arm32v7 -f arm32v7.Dockerfile .
sudo docker build --pull --build-arg CONFIGURATION_NAME=Altcoins-Release -t $DOCKERHUB_REPO:$LATEST_TAG-altcoins-arm32v7 -f arm32v7.Dockerfile .
sudo docker build --build-arg GIT_COMMIT=${GIT_COMMIT} --pull -t $DOCKERHUB_REPO:$LATEST_TAG-arm32v7 -f arm32v7.Dockerfile .
sudo docker build --build-arg GIT_COMMIT=${GIT_COMMIT} --pull --build-arg CONFIGURATION_NAME=Altcoins-Release -t $DOCKERHUB_REPO:$LATEST_TAG-altcoins-arm32v7 -f arm32v7.Dockerfile .
sudo docker login --username=$DOCKERHUB_USER --password=$DOCKERHUB_PASS
sudo docker push $DOCKERHUB_REPO:$LATEST_TAG-arm32v7
sudo docker push $DOCKERHUB_REPO:$LATEST_TAG-altcoins-arm32v7
arm64v8:
machine:
enabled: true
image: ubuntu-2004:202111-02
steps:
- checkout
- checkout
- run:
command: |
sudo docker run --rm --privileged multiarch/qemu-user-static:register --reset
LATEST_TAG=${CIRCLE_TAG:1} #trim v from tag
GIT_COMMIT=$(git rev-parse HEAD)
#
sudo docker build --pull -t $DOCKERHUB_REPO:$LATEST_TAG-arm64v8 -f arm64v8.Dockerfile .
sudo docker build --build-arg CONFIGURATION_NAME=Altcoins-Release --pull -t $DOCKERHUB_REPO:$LATEST_TAG-altcoins-arm64v8 -f arm64v8.Dockerfile .
sudo docker build --build-arg GIT_COMMIT=${GIT_COMMIT} --pull -t $DOCKERHUB_REPO:$LATEST_TAG-arm64v8 -f arm64v8.Dockerfile .
sudo docker build --build-arg GIT_COMMIT=${GIT_COMMIT} --build-arg CONFIGURATION_NAME=Altcoins-Release --pull -t $DOCKERHUB_REPO:$LATEST_TAG-altcoins-arm64v8 -f arm64v8.Dockerfile .
sudo docker login --username=$DOCKERHUB_USER --password=$DOCKERHUB_PASS
sudo docker push $DOCKERHUB_REPO:$LATEST_TAG-arm64v8
sudo docker push $DOCKERHUB_REPO:$LATEST_TAG-altcoins-arm64v8
multiarch:
machine:
enabled: true
image: circleci/classic:201808-01
image: ubuntu-2004:202201-02
steps:
- run:
command: |
# Turn on Experimental features
sudo mkdir $HOME/.docker
sudo sh -c 'echo "{ \"experimental\": \"enabled\" }" >> $HOME/.docker/config.json'
#
sudo docker login --username=$DOCKERHUB_USER --password=$DOCKERHUB_PASS
#
LATEST_TAG=${CIRCLE_TAG:1} #trim v from tag
@ -105,8 +97,7 @@ jobs:
sudo docker manifest annotate $DOCKERHUB_REPO:$LATEST_TAG $DOCKERHUB_REPO:$LATEST_TAG-arm32v7 --os linux --arch arm --variant v7
sudo docker manifest annotate $DOCKERHUB_REPO:$LATEST_TAG $DOCKERHUB_REPO:$LATEST_TAG-arm64v8 --os linux --arch arm64 --variant v8
sudo docker manifest push $DOCKERHUB_REPO:$LATEST_TAG -p
sudo docker manifest create --amend $DOCKERHUB_REPO:$LATEST_TAG-altcoins $DOCKERHUB_REPO:$LATEST_TAG-altcoins-amd64 $DOCKERHUB_REPO:$LATEST_TAG-altcoins-arm32v7 $DOCKERHUB_REPO:$LATEST_TAG-altcoins-arm64v8
sudo docker manifest annotate $DOCKERHUB_REPO:$LATEST_TAG-altcoins $DOCKERHUB_REPO:$LATEST_TAG-altcoins-amd64 --os linux --arch amd64
sudo docker manifest annotate $DOCKERHUB_REPO:$LATEST_TAG-altcoins $DOCKERHUB_REPO:$LATEST_TAG-altcoins-arm32v7 --os linux --arch arm --variant v7
@ -120,12 +111,15 @@ workflows:
- fast_tests
- selenium_tests
- integration_tests
- external_tests:
filters:
branches:
only: master
publish:
jobs:
- trigger_docs_build:
filters:
branches:
ignore: /.*/
# only act on version tags
tags:
only: /(v[1-9]+(\.[0-9]+)*(-[a-z0-9-]+)?)|(v[a-z0-9-]+)/
- amd64:
filters:
# ignore any commit on any branch by default
@ -135,7 +129,6 @@ workflows:
# OR feature tags like vlndseedbackup
# OR features on specific versions like v1.0.0.88-lndseedbackup-1
tags:
only: /(v[1-9]+(\.[0-9]+)*(-[a-z0-9-]+)?)|(v[a-z0-9-]+)/
- arm32v7:
filters:

View File

@ -4,6 +4,15 @@ set -e
cd ../BTCPayServer.Tests
docker-compose -v
docker-compose -f "docker-compose.altcoins.yml" down --v
docker-compose -f "docker-compose.altcoins.yml" pull
# For some reason, docker-compose pull fails time to time, so we try several times
n=0
until [ "$n" -ge 10 ]
do
docker-compose -f "docker-compose.altcoins.yml" pull && break
n=$((n+1))
sleep 5
done
docker-compose -f "docker-compose.altcoins.yml" build
docker-compose -f "docker-compose.altcoins.yml" run -e "TEST_FILTERS=$1" tests

View File

@ -11,10 +11,14 @@ insert_final_newline = true
indent_style = space
indent_size = 4
charset = utf-8
space_before_self_closing = true
[launchSettings.json]
[*.json]
indent_size = 2
[swagger*.json]
indent_size = 4
# C# files
[*.cs]
# New line preferences
@ -67,7 +71,7 @@ dotnet_naming_symbols.private_internal_fields.applicable_kinds = field
dotnet_naming_symbols.private_internal_fields.applicable_accessibilities = private, internal
dotnet_naming_style.camel_case_underscore_style.required_prefix = _
dotnet_naming_style.camel_case_underscore_style.capitalization = camel_case
dotnet_naming_style.camel_case_underscore_style.capitalization = camel_case
# Code style defaults
dotnet_sort_system_directives_first = true
@ -121,8 +125,11 @@ csharp_space_between_method_declaration_name_and_open_parenthesis = false
csharp_space_between_method_declaration_parameter_list_parentheses = false
csharp_space_between_parentheses = false
csharp_space_between_square_brackets = false
csharp_style_prefer_null_check_over_type_check = true:warning
csharp_prefer_simple_using_statement = true:warning
# C++ Files
[*.{cpp,h,in}]
curly_bracket_next_line = true
indent_brace_style = Allman

View File

@ -1,63 +0,0 @@
---
name: "\U0001F41B Bug report"
about: Report a bug or a technical issue
---
<!--
Thank you for reporting a technical issue.
This issue tracker is only for bug reports and problems.
For general questions please read our documentation docs.btcpayserver.org. You can ask technical questions in discussions https://github.com/btcpayserver/btcpayserver/discussions and general support on our community chat chat.btcpayserver.org
Please fill in as much of the template below as you're able.
-->
**Describe the bug**
A clear and concise description of what the bug is.
**To Reproduce the bug**
Steps to reproduce the reported bug:
1. Go to '...'
2. Click on '....'
3. Scroll down to '....'
4. See error
**Expected behavior**
<!--
A clear and concise description of what you expected to happen.
-->
**Screenshots**
<!--
If applicable, add screenshots to help explain your problem.
-->
**Your BTCPay Environment (please complete the following information):**
- BTCPay Server Version: <!--[available in the right bottom corner of footer] -->
- Deployment Method: <!--[e.g. Docker, Manual, Third-Party-host]-->
- Browser: <!--[e.g. Chrome, Safari]-->
**Logs (if applicable)**
<!--
Basic logs can be found in Server Settings > Logs.
More logs https://docs.btcpayserver.org/Troubleshooting/#2-looking-through-the-logs
-->
**Setup Parameters**
<!--
If you're reporting a deployment issue run `. btcpay-setup.sh -i` and paste the setup parameters here with your private information removed or obscured.
-->
**Additional context**
<!--
Add any other context about the problem here.
-->

68
.github/ISSUE_TEMPLATE/bug_report.yml vendored Normal file
View File

@ -0,0 +1,68 @@
name: 🐛 Bug Report
description: File a bug report
title: "[Bug]: "
labels: ["bug"]
body:
- type: markdown
attributes:
value: |
Thanks for taking the time to fill out this bug report! Please provide as much information as you can. It helps us better understand the problem and fix it faster.
- type: textarea
id: version
attributes:
label: What is your BTCPay version?
description: You can see the version in the footer's bottom right corner
placeholder: I'm running BTCPay v1.X.X.X
validations:
required: true
- type: textarea
id: deployment
attributes:
label: How did you deploy BTCPay Server?
description: Docker, manual, third-party host? Read more on deployment methods [here](https://docs.btcpayserver.org/Deployment/)
placeholder: I'm running BTCPay Server on a...
validations:
required: true
- type: textarea
id: what-happened
attributes:
label: What happened?
description: A clear and concise description of what the bug is.
placeholder: Tell us what you see!
validations:
required: true
- type: textarea
id: reproduce
attributes:
label: How did you encounter this bug?
description: Step by step describe how did you encounter the bug?
placeholder: 1. I clicked X 2. Then I clicked Y 3. See error
validations:
required: true
- type: textarea
id: logoutput
attributes:
label: Relevant log output
description: Please copy and paste any relevant log output. This will be automatically formatted into code, so no need for backticks. Logs can be found in Server Settings > Logs. Here's how you can [troubleshoot an issue](https://docs.btcpayserver.org/Troubleshooting/)
render: shell
- type: textarea
id: browser
attributes:
label: What browser do you use?
description: Provide your browser and it's version. If you replicated issues on multiple browsers, let us know which ones.
placeholder: For example Safari 15.00, Chrome 10.0, Tor, Edge, etc
validations:
required: false
- type: textarea
id: additonal
attributes:
label: Additional information
description: Feel free to provide additional information. Screenshots are always helpful.
- type: checkboxes
id: terms
attributes:
label: Are you sure this is a bug report?
description: By submitting this report, you agree that this is not a support or a feature request. For general questions please read our [documentation](https://docs.btcpayserver.org). You can ask questions in [discussions](https://github.com/btcpayserver/btcpayserver/discussions) and [on our community chat](https://chat.btcpayserver.org)
options:
- label: I confirm this is a bug report
required: true

View File

@ -1,11 +1,17 @@
blank_issues_enabled: false
contact_links:
- name: 🚀 Discussions
url: https://github.com/btcpayserver/btcpayserver/discussions
about: Technical discussions, questions and feature requests
blank_issues_enabled: true
contact_links:
- name: 💡 Request a feature
url: https://github.com/btcpayserver/btcpayserver/discussions/categories/ideas-feature-requests
about: Submit a feature request or vote on ideas posted by others. Features with most upvotes become roadmap candidates
- name: 🧑‍💻 Ask a technical question
url: https://github.com/btcpayserver/btcpayserver/discussions/new?category=technical-support
about: If you're experiencing a technical problem post it to our community support forum
- name: 🔌 Report a problem with a plugin
url: https://github.com/btcpayserver/btcpayserver/discussions/new?category=plugins-integrations
about: Experiencing a problem with a third-party plugin? Post it here and we will tag their developers to assist
- name: 📝 Official Documentation
url: https://docs.btcpayserver.org
about: Check our documentation for answers to common questions
- name: 💬 Community Support Chat
about: Check our documentation for answers to common questions
- name: 💬 Community Support Chat
url: https://chat.btcpayserver.org/
about: Ask general questions and get community support in real-time

2
.github/codeql/codeql-config.yml vendored Normal file
View File

@ -0,0 +1,2 @@
paths-ignore:
- 'BTCPayServer/wwwroot/vendor/**/*.js'

80
.github/workflows/codeql.yml vendored Normal file
View File

@ -0,0 +1,80 @@
# For most projects, this workflow file will not need changing; you simply need
# to commit it to your repository.
#
# You may wish to alter this file to override the set of languages analyzed,
# or to provide custom queries or build logic.
#
# ******** NOTE ********
# We have attempted to detect the languages in your repository. Please check
# the `language` matrix defined below to confirm you have the correct set of
# supported CodeQL languages.
#
name: "CodeQL"
on:
# Allow running tests manually. Usefull if scan failure, or need to rescan before next scheduled date.
workflow_dispatch:
# We scan only on a schedule for now, can uncomment the following to scan on commit or PR merge later on if deemed appropriate.
# push:
# branches: [ "master" ]
# pull_request:
# branches: [ "master" ]
schedule:
# Scan every Monday 06:00 UTC.
- cron: '0 6 * * 1'
jobs:
analyze:
name: Analyze
runs-on: ubuntu-latest
permissions:
actions: read
contents: read
security-events: write
strategy:
fail-fast: false
matrix:
language: [ 'javascript', 'csharp' ]
# CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python', 'ruby' ]
# Use only 'java' to analyze code written in Java, Kotlin or both
# Use only 'javascript' to analyze code written in JavaScript, TypeScript or both
# Learn more about CodeQL language support at https://aka.ms/codeql-docs/language-support
steps:
- name: Checkout repository
uses: actions/checkout@v3
# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v2
with:
languages: ${{ matrix.language }}
config-file: ./.github/codeql/codeql-config.yml
# If you wish to specify custom queries, you can do so here or in a config file.
# By default, queries listed here will override any specified in a config file.
# Prefix the list here with "+" to use these queries and those in the config file.
# Details on CodeQL's query packs refer to : https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs
# queries: security-extended,security-and-quality
# Autobuild attempts to build any compiled languages (C/C++, C#, Go, or Java).
# If this step fails, then you should remove it and run the build manually (see below)
- name: Autobuild
uses: github/codeql-action/autobuild@v2
# Command-line programs to run using the OS shell.
# 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun
# If the Autobuild fails above, remove it and uncomment the following three lines.
# modify them (or add more) to build your code if your project, please refer to the EXAMPLE below for guidance.
# - run: |
# echo "Run, Build Application using script"
# ./location_of_script_within_repo/buildscript.sh
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v2
with:
category: "/language:${{matrix.language}}"

8
.gitignore vendored
View File

@ -288,10 +288,6 @@ __pycache__/
*.xsd.cs
/BTCPayServer/Build/dockerfiles
# Bundling JS/CSS
BTCPayServer/wwwroot/bundles/*
!BTCPayServer/wwwroot/bundles/.gitignore
.vscode/*
!.vscode/launch.json
!.vscode/tasks.json
@ -299,3 +295,7 @@ BTCPayServer/wwwroot/bundles/*
BTCPayServer/testpwd
.DS_Store
Packed Plugins
Plugins/packed
BTCPayServer/wwwroot/swagger/v1/openapi.json
BTCPayServer/appsettings.dev.json

View File

@ -1,6 +0,0 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="Build and pack plugins" type="CompoundRunConfigurationType">
<toRun name="Pack Test Plugin" type="DotNetProject" />
<method v="2" />
</configuration>
</component>

View File

@ -1,21 +0,0 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="Pack Test Plugin" type="DotNetProject" factoryName=".NET Project" singleton="false">
<option name="EXE_PATH" value="$PROJECT_DIR$/BTCPayServer.PluginPacker/bin/Debug/netcoreapp3.1/BTCPayServer.PluginPacker.dll" />
<option name="PROGRAM_PARAMETERS" value="../../../../BTCPayServer.Plugins.Test\bin\Debug\netcoreapp3.1 BTCPayServer.Plugins.Test &quot;../../../../Packed Plugins&quot;" />
<option name="WORKING_DIRECTORY" value="$PROJECT_DIR$/BTCPayServer.PluginPacker/bin/Debug/netcoreapp3.1" />
<option name="PASS_PARENT_ENVS" value="1" />
<option name="USE_EXTERNAL_CONSOLE" value="0" />
<option name="USE_MONO" value="0" />
<option name="RUNTIME_ARGUMENTS" value="" />
<option name="PROJECT_PATH" value="$PROJECT_DIR$/BTCPayServer.PluginPacker/BTCPayServer.PluginPacker.csproj" />
<option name="PROJECT_EXE_PATH_TRACKING" value="1" />
<option name="PROJECT_ARGUMENTS_TRACKING" value="1" />
<option name="PROJECT_WORKING_DIRECTORY_TRACKING" value="1" />
<option name="PROJECT_KIND" value="DotNetCore" />
<option name="PROJECT_TFM" value=".NETCoreApp,Version=v3.1" />
<method v="2">
<option name="Build" default="false" projectName="BTCPayServer.Plugins.Test" projectPath="C:\Git\btcpayserver\BTCPayServer.Plugins.Test\BTCPayServer.Plugins.Test.csproj" />
<option name="Build" />
</method>
</configuration>
</component>

4
.vscode/launch.json vendored
View File

@ -10,14 +10,14 @@
"request": "launch",
"preLaunchTask": "build",
// If you have changed target frameworks, make sure to update the program path.
"program": "${workspaceFolder}/BTCPayServer/bin/Debug/netcoreapp3.1/BTCPayServer.dll",
"program": "${workspaceFolder}/BTCPayServer/bin/Debug/net6.0/BTCPayServer.dll",
"args": [],
"cwd": "${workspaceFolder}/BTCPayServer",
"stopAtEntry": false,
// Enable launching a web browser when ASP.NET Core starts. For more information: https://aka.ms/VSCode-CS-LaunchJson-WebBrowser
"serverReadyAction": {
"action": "openExternally",
"pattern": "\\bListening on\\s+(https?://\\S+)"
"pattern": "\\bNow listening on:\\s+(https?://\\S+)"
},
"env": {
"ASPNETCORE_ENVIRONMENT": "Development"

View File

@ -31,9 +31,13 @@
<None Include="icon.png" Pack="true" PackagePath="\" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="3.1.4" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="3.1.4" />
<PackageReference Include="Npgsql.EntityFrameworkCore.PostgreSQL" Version="3.1.4" />
<PackageReference Include="Pomelo.EntityFrameworkCore.MySql" Version="3.1.1" />
<PackageReference Include="HtmlSanitizer" Version="5.0.372" />
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="6.0.9" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="6.0.9" />
<PackageReference Include="Npgsql.EntityFrameworkCore.PostgreSQL" Version="6.0.7" />
<PackageReference Include="Pomelo.EntityFrameworkCore.MySql" Version="6.0.1" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\BTCPayServer.Client\BTCPayServer.Client.csproj" />
</ItemGroup>
</Project>

View File

@ -0,0 +1,18 @@
using Newtonsoft.Json;
namespace BTCPayServer.Abstractions
{
public class CamelCaseSerializerSettings
{
static CamelCaseSerializerSettings()
{
Settings = new JsonSerializerSettings()
{
ContractResolver = new Newtonsoft.Json.Serialization.CamelCasePropertyNamesContractResolver()
};
Serializer = JsonSerializer.Create(Settings);
}
public static readonly JsonSerializerSettings Settings;
public static readonly JsonSerializer Serializer;
}
}

View File

@ -0,0 +1,20 @@
using System.IO;
namespace BTCPayServer.Configuration
{
public class DataDirectories
{
public string DataDir { get; set; }
public string PluginDir { get; set; }
public string TempStorageDir { get; set; }
public string StorageDir { get; set; }
public string TempDir { get; set; }
public string ToDatadirFullPath(string path)
{
if (Path.IsPathRooted(path))
return path;
return Path.Combine(DataDir, path);
}
}
}

View File

@ -0,0 +1,7 @@
namespace BTCPayServer.Abstractions.Constants;
public class WellKnownTempData
{
public const string SuccessMessage = nameof(SuccessMessage);
public const string ErrorMessage = nameof(ErrorMessage);
}

View File

@ -1,29 +1,32 @@
using System;
using System.Data.Common;
using BTCPayServer.Abstractions.Models;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Metadata;
using Microsoft.EntityFrameworkCore.Migrations;
using Microsoft.Extensions.Options;
using Npgsql.EntityFrameworkCore.PostgreSQL.Migrations;
using Npgsql.EntityFrameworkCore.PostgreSQL.Migrations.Operations;
namespace BTCPayServer.Abstractions.Contracts
{
public abstract class BaseDbContextFactory<T> where T: DbContext
public abstract class BaseDbContextFactory<T> where T : DbContext
{
private readonly DatabaseOptions _options;
private readonly IOptions<DatabaseOptions> _options;
private readonly string _schemaPrefix;
public BaseDbContextFactory(DatabaseOptions options, string schemaPrefix)
public BaseDbContextFactory(IOptions<DatabaseOptions> options, string schemaPrefix)
{
_options = options;
_schemaPrefix = schemaPrefix;
}
public abstract T CreateContext();
class CustomNpgsqlMigrationsSqlGenerator : NpgsqlMigrationsSqlGenerator
{
public CustomNpgsqlMigrationsSqlGenerator(MigrationsSqlGeneratorDependencies dependencies, IMigrationsAnnotationProvider annotations, Npgsql.EntityFrameworkCore.PostgreSQL.Infrastructure.Internal.INpgsqlOptions opts) : base(dependencies, annotations, opts)
#pragma warning disable EF1001 // Internal EF Core API usage.
public CustomNpgsqlMigrationsSqlGenerator(MigrationsSqlGeneratorDependencies dependencies, Npgsql.EntityFrameworkCore.PostgreSQL.Infrastructure.Internal.INpgsqlSingletonOptions opts) : base(dependencies, opts)
#pragma warning restore EF1001 // Internal EF Core API usage.
{
}
@ -65,10 +68,10 @@ namespace BTCPayServer.Abstractions.Contracts
public void ConfigureBuilder(DbContextOptionsBuilder builder)
{
switch (_options.DatabaseType)
switch (_options.Value.DatabaseType)
{
case DatabaseType.Sqlite:
builder.UseSqlite(_options.ConnectionString, o =>
builder.UseSqlite(_options.Value.ConnectionString, o =>
{
if (!string.IsNullOrEmpty(_schemaPrefix))
{
@ -78,7 +81,7 @@ namespace BTCPayServer.Abstractions.Contracts
break;
case DatabaseType.Postgres:
builder
.UseNpgsql(_options.ConnectionString, o =>
.UseNpgsql(_options.Value.ConnectionString, o =>
{
o.EnableRetryOnFailure(10);
if (!string.IsNullOrEmpty(_schemaPrefix))
@ -89,10 +92,10 @@ namespace BTCPayServer.Abstractions.Contracts
.ReplaceService<IMigrationsSqlGenerator, CustomNpgsqlMigrationsSqlGenerator>();
break;
case DatabaseType.MySQL:
builder.UseMySql(_options.ConnectionString, o =>
builder.UseMySql(_options.Value.ConnectionString, ServerVersion.AutoDetect(_options.Value.ConnectionString), o =>
{
o.EnableRetryOnFailure(10);
if (!string.IsNullOrEmpty(_schemaPrefix))
{
o.MigrationsHistoryTable(_schemaPrefix);
@ -103,6 +106,6 @@ namespace BTCPayServer.Abstractions.Contracts
throw new ArgumentOutOfRangeException();
}
}
}
}

View File

@ -0,0 +1,12 @@
using System.Threading.Tasks;
using BTCPayServer.Client;
using Microsoft.AspNetCore.Http;
namespace BTCPayServer.Abstractions.Contracts
{
public interface IBTCPayServerClientFactory
{
Task<BTCPayServerClient> Create(string userId, params string[] storeIds);
Task<BTCPayServerClient> Create(string userId, string[] storeIds, HttpContext httpRequest);
}
}

View File

@ -28,5 +28,5 @@ namespace BTCPayServer.Abstractions.Contracts
}
}
}
}

View File

@ -0,0 +1,17 @@
#nullable enable
using System;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Http;
namespace BTCPayServer.Abstractions.Contracts;
public interface IFileService
{
Task<bool> IsAvailable();
Task<IStoredFile> AddFile(IFormFile file, string userId);
Task<IStoredFile> AddFile(Uri file, string userId);
Task<string?> GetFileUrl(Uri baseUri, string fileId);
Task<string?> GetTemporaryFileUrl(Uri baseUri, string fileId, DateTimeOffset expiry,
bool isDownload);
Task RemoveFile(string fileId, string userId);
}

View File

@ -7,7 +7,7 @@ namespace BTCPayServer.Abstractions.Contracts
public abstract string Identifier { get; }
public abstract string NotificationType { get; }
}
public interface INotificationHandler
{
string NotificationType { get; }
@ -15,10 +15,12 @@ namespace BTCPayServer.Abstractions.Contracts
public (string identifier, string name)[] Meta { get; }
void FillViewModel(object notification, NotificationViewModel vm);
}
public class NotificationViewModel
{
public string Id { get; set; }
public string Identifier { get; set; }
public string Type { get; set; }
public DateTimeOffset Created { get; set; }
public string Body { get; set; }
public string ActionLink { get; set; }

View File

@ -5,7 +5,7 @@ namespace BTCPayServer.Abstractions.Contracts
public interface IPluginHookFilter
{
public string Hook { get; }
Task<object> Execute(object args);
}
}

View File

@ -0,0 +1,7 @@
#nullable enable
namespace BTCPayServer.Abstractions.Contracts;
public interface IScopeProvider
{
string? GetCurrentStoreId();
}

View File

@ -1,3 +1,4 @@
#nullable enable
using System.Threading;
using System.Threading.Tasks;
@ -5,8 +6,8 @@ namespace BTCPayServer.Abstractions.Contracts
{
public interface ISettingsRepository
{
Task<T> GetSettingAsync<T>(string name = null);
Task UpdateSetting<T>(T obj, string name = null);
Task<T> WaitSettingsChanged<T>(CancellationToken cancellationToken = default);
Task<T?> GetSettingAsync<T>(string? name = null) where T : class;
Task UpdateSetting<T>(T obj, string? name = null) where T : class;
Task<T> WaitSettingsChanged<T>(CancellationToken cancellationToken = default) where T : class;
}
}

View File

@ -0,0 +1,12 @@
#nullable enable
using System.Collections.Generic;
using System.Threading.Tasks;
namespace BTCPayServer.Abstractions.Contracts;
public interface IStoreRepository
{
Task<T?> GetSettingAsync<T>(string storeId, string name) where T : class;
Task<Dictionary<string, T?>> GetSettingsAsync<T>(string name) where T : class;
Task UpdateSetting<T>(string storeId, string name, T obj) where T : class;
}

View File

@ -0,0 +1,12 @@
using System;
namespace BTCPayServer.Abstractions.Contracts;
public interface IStoredFile
{
string Id { get; set; }
string FileName { get; set; }
string StorageFileName { get; set; }
DateTime Timestamp { get; set; }
string ApplicationUserId { get; set; }
}

View File

@ -0,0 +1,9 @@
using System.Threading.Tasks;
using Newtonsoft.Json.Linq;
namespace BTCPayServer.Abstractions.Contracts;
public interface ISwaggerProvider
{
Task<JObject> Fetch();
}

View File

@ -1,3 +1,5 @@
using System.Collections.Generic;
namespace BTCPayServer.Abstractions.Contracts
{
public interface ISyncSummaryProvider
@ -5,5 +7,12 @@ namespace BTCPayServer.Abstractions.Contracts
bool AllAvailable();
string Partial { get; }
IEnumerable<ISyncStatus> GetStatuses();
}
public interface ISyncStatus
{
public string CryptoCode { get; set; }
public bool Available { get; }
}
}

View File

@ -3,7 +3,7 @@ namespace BTCPayServer.Abstractions.Contracts
public interface IUIExtension
{
string Partial { get; }
string Location { get; }
}
}

View File

@ -0,0 +1,13 @@
using System.Collections.Generic;
using System.Threading.Tasks;
using NBitcoin;
namespace BTCPayServer.Payments.PayJoin;
public interface IUTXOLocker
{
Task<bool> TryLock(OutPoint outpoint);
Task<bool> TryUnlock(params OutPoint[] outPoints);
Task<bool> TryLockInputs(OutPoint[] outPoints);
Task<HashSet<OutPoint>> FindLocks(OutPoint[] outpoints);
}

View File

@ -0,0 +1,19 @@
namespace BTCPayServer.Abstractions.Custodians.Client;
public class AssetQuoteResult
{
public string FromAsset { get; set; }
public string ToAsset { get; set; }
public decimal Bid { get; set; }
public decimal Ask { get; set; }
public AssetQuoteResult() { }
public AssetQuoteResult(string fromAsset, string toAsset, decimal bid, decimal ask)
{
FromAsset = fromAsset;
ToAsset = toAsset;
Bid = bid;
Ask = ask;
}
}

View File

@ -0,0 +1,12 @@
namespace BTCPayServer.Abstractions.Custodians;
public class AssetBalancesUnavailableException : CustodianApiException
{
public AssetBalancesUnavailableException(System.Exception e) : base(500, "asset-balances-unavailable", $"Cannot fetch the asset balances: {e.Message}", e)
{
}
public AssetBalancesUnavailableException(string errorMsg) : base(500, "asset-balances-unavailable", $"Cannot fetch the asset balances: {errorMsg}")
{
}
}

View File

@ -0,0 +1,13 @@
using BTCPayServer.Client.Models;
namespace BTCPayServer.Abstractions.Custodians;
public class AssetQuoteUnavailableException : CustodianApiException
{
public AssetPairData AssetPair { get; }
public AssetQuoteUnavailableException(AssetPairData assetPair) : base(400, "asset-price-unavailable", "Cannot find a quote for pair " + assetPair)
{
this.AssetPair = assetPair;
}
}

View File

@ -0,0 +1,13 @@
using System;
namespace BTCPayServer.Abstractions.Custodians;
public class BadConfigException : CustodianApiException
{
public string[] BadConfigKeys { get; set; }
public BadConfigException(string[] badConfigKeys) : base(500, "bad-custodian-account-config", "Wrong config values: " + String.Join(", ", badConfigKeys))
{
this.BadConfigKeys = badConfigKeys;
}
}

View File

@ -0,0 +1,13 @@
namespace BTCPayServer.Abstractions.Custodians;
public class CannotWithdrawException : CustodianApiException
{
public CannotWithdrawException(ICustodian custodian, string paymentMethod, string message) : base(403, "cannot-withdraw", message)
{
}
public CannotWithdrawException(ICustodian custodian, string paymentMethod, string targetAddress, CustodianApiException originalException) : base(403, "cannot-withdraw", $"{custodian.Name} cannot withdraw {paymentMethod} to '{targetAddress}': {originalException.Message}")
{
}
}

View File

@ -0,0 +1,18 @@
using System;
namespace BTCPayServer.Abstractions.Custodians;
public class CustodianApiException : Exception
{
public int HttpStatus { get; }
public string Code { get; }
public CustodianApiException(int httpStatus, string code, string message, System.Exception ex) : base(message, ex)
{
HttpStatus = httpStatus;
Code = code;
}
public CustodianApiException(int httpStatus, string code, string message) : this(httpStatus, code, message, null)
{
}
}

View File

@ -0,0 +1,8 @@
namespace BTCPayServer.Abstractions.Custodians;
public class CustodianFeatureNotImplementedException : CustodianApiException
{
public CustodianFeatureNotImplementedException(string message) : base(400, "not-implemented", message)
{
}
}

View File

@ -0,0 +1,8 @@
namespace BTCPayServer.Abstractions.Custodians;
public class DepositsUnavailableException : CustodianApiException
{
public DepositsUnavailableException(string message) : base(404, "deposits-unavailable", message)
{
}
}

View File

@ -0,0 +1,8 @@
namespace BTCPayServer.Abstractions.Custodians;
public class InsufficientFundsException : CustodianApiException
{
public InsufficientFundsException(string message) : base(400, "insufficient-funds", message)
{
}
}

View File

@ -0,0 +1,9 @@
namespace BTCPayServer.Abstractions.Custodians;
public class InvalidWithdrawalTargetException : CustodianApiException
{
public InvalidWithdrawalTargetException(ICustodian custodian, string paymentMethod, string targetAddress, CustodianApiException originalException) : base(403, "invalid-withdrawal-target", $"{custodian.Name} cannot withdraw {paymentMethod} to '{targetAddress}': {originalException.Message}")
{
}
}

View File

@ -0,0 +1,9 @@
namespace BTCPayServer.Abstractions.Custodians;
public class PermissionDeniedCustodianApiException : CustodianApiException
{
public PermissionDeniedCustodianApiException(ICustodian custodian) : base(403, "custodian-api-permission-denied", $"{custodian.Name}'s API reported that you don't have permission.")
{
}
}

View File

@ -0,0 +1,11 @@
namespace BTCPayServer.Abstractions.Custodians;
public class TradeNotFoundException : CustodianApiException
{
private string tradeId { get; }
public TradeNotFoundException(string tradeId) : base(404, "trade-not-found", "Could not find trade ID " + tradeId)
{
this.tradeId = tradeId;
}
}

View File

@ -0,0 +1,11 @@
namespace BTCPayServer.Abstractions.Custodians;
public class WithdrawalNotFoundException : CustodianApiException
{
private string WithdrawalId { get; }
public WithdrawalNotFoundException(string withdrawalId) : base(404, "withdrawal-not-found", $"Could not find withdrawal ID {withdrawalId}.")
{
WithdrawalId = withdrawalId;
}
}

View File

@ -0,0 +1,9 @@
namespace BTCPayServer.Abstractions.Custodians;
public class WrongTradingPairException : CustodianApiException
{
public const int HttpCode = 404;
public WrongTradingPairException(string fromAsset, string toAsset) : base(HttpCode, "wrong-trading-pair", $"Cannot find a trading pair for converting {fromAsset} into {toAsset}.")
{
}
}

View File

@ -0,0 +1,29 @@
using System.Collections.Generic;
using BTCPayServer.Client.Models;
namespace BTCPayServer.Abstractions.Custodians.Client;
/**
* The result of a market trade. Used as a return type for custodians implementing ICanTrade
*/
public class MarketTradeResult
{
public string FromAsset { get; }
public string ToAsset { get; }
/**
* The ledger entries that show the balances that were affected by the trade.
*/
public List<LedgerEntryData> LedgerEntries { get; }
/**
* The unique ID of the trade that was executed.
*/
public string TradeId { get; }
public MarketTradeResult(string fromAsset, string toAsset, List<LedgerEntryData> ledgerEntries, string tradeId)
{
this.FromAsset = fromAsset;
this.ToAsset = toAsset;
this.LedgerEntries = ledgerEntries;
this.TradeId = tradeId;
}
}

View File

@ -0,0 +1,28 @@
using System.Collections.Generic;
using BTCPayServer.Client.Models;
using BTCPayServer.JsonConverters;
namespace BTCPayServer.Abstractions.Custodians.Client;
public class SimulateWithdrawalResult
{
public string PaymentMethod { get; }
public string Asset { get; }
public decimal MinQty { get; }
public decimal MaxQty { get; }
public List<LedgerEntryData> LedgerEntries { get; }
// Fee can be NULL if unknown.
public decimal? Fee { get; }
public SimulateWithdrawalResult(string paymentMethod, string asset, List<LedgerEntryData> ledgerEntries,
decimal minQty, decimal maxQty)
{
PaymentMethod = paymentMethod;
Asset = asset;
LedgerEntries = ledgerEntries;
MinQty = minQty;
MaxQty = maxQty;
}
}

View File

@ -0,0 +1,29 @@
using System;
using System.Collections.Generic;
using BTCPayServer.Client.Models;
namespace BTCPayServer.Abstractions.Custodians.Client;
public class WithdrawResult
{
public string PaymentMethod { get; }
public string Asset { get; set; }
public List<LedgerEntryData> LedgerEntries { get; }
public string WithdrawalId { get; }
public WithdrawalResponseData.WithdrawalStatus Status { get; }
public DateTimeOffset CreatedTime { get; }
public string TargetAddress { get; }
public string TransactionId { get; }
public WithdrawResult(string paymentMethod, string asset, List<LedgerEntryData> ledgerEntries, string withdrawalId, WithdrawalResponseData.WithdrawalStatus status, DateTimeOffset createdTime, string targetAddress, string transactionId)
{
PaymentMethod = paymentMethod;
Asset = asset;
LedgerEntries = ledgerEntries;
WithdrawalId = withdrawalId;
CreatedTime = createdTime;
Status = status;
TargetAddress = targetAddress;
TransactionId = transactionId;
}
}

View File

@ -0,0 +1,17 @@
using System.Threading;
using System.Threading.Tasks;
using BTCPayServer.Client.Models;
using Newtonsoft.Json.Linq;
namespace BTCPayServer.Abstractions.Custodians;
public interface ICanDeposit
{
/**
* Get the address where we can deposit for the chosen payment method (crypto code + network).
* The result can be a string in different formats like a bitcoin address or even a LN invoice.
*/
public Task<DepositAddressData> GetDepositAddressAsync(string paymentMethod, JObject config, CancellationToken cancellationToken);
public string[] GetDepositablePaymentMethods();
}

View File

@ -0,0 +1,31 @@
using System.Collections.Generic;
using System.Threading;
using System.Threading.Tasks;
using BTCPayServer.Abstractions.Custodians.Client;
using BTCPayServer.Client.Models;
using Newtonsoft.Json.Linq;
namespace BTCPayServer.Abstractions.Custodians;
public interface ICanTrade
{
/**
* A list of tradable asset pairs, or NULL if the custodian cannot trade/convert assets. if thr asset pair contains fiat, fiat is always put last. If both assets are a cyrptocode or both are fiat, the pair is written alphabetically. Always in uppercase. Example: ["BTC/EUR","BTC/USD", "EUR/USD", "BTC/ETH",...]
*/
public List<AssetPairData> GetTradableAssetPairs();
/**
* Execute a market order right now.
*/
public Task<MarketTradeResult> TradeMarketAsync(string fromAsset, string toAsset, decimal qty, JObject config, CancellationToken cancellationToken);
/**
* Get the details about a previous market trade.
*/
public Task<MarketTradeResult> GetTradeInfoAsync(string tradeId, JObject config, CancellationToken cancellationToken);
public Task<AssetQuoteResult> GetQuoteForAssetAsync(string fromAsset, string toAsset, JObject config, CancellationToken cancellationToken);
}

View File

@ -0,0 +1,20 @@
using System.Threading;
using System.Threading.Tasks;
using BTCPayServer.Abstractions.Custodians.Client;
using Newtonsoft.Json.Linq;
namespace BTCPayServer.Abstractions.Custodians;
/// <summary>
/// Interface for custodians that can move funds to the store wallet.
/// </summary>
public interface ICanWithdraw
{
public Task<WithdrawResult> WithdrawToStoreWalletAsync(string paymentMethod, decimal amount, JObject config, CancellationToken cancellationToken);
public Task<SimulateWithdrawalResult> SimulateWithdrawalAsync(string paymentMethod, decimal qty, JObject config, CancellationToken cancellationToken);
public Task<WithdrawResult> GetWithdrawalInfoAsync(string paymentMethod, string withdrawalId, JObject config, CancellationToken cancellationToken);
public string[] GetWithdrawablePaymentMethods();
}

View File

@ -0,0 +1,26 @@
#nullable enable
using System.Collections.Generic;
using System.Threading;
using System.Threading.Tasks;
using BTCPayServer.Client.Models;
using Newtonsoft.Json.Linq;
namespace BTCPayServer.Abstractions.Custodians;
public interface ICustodian
{
/**
* Get the unique code that identifies this custodian.
*/
string Code { get; }
string Name { get; }
/**
* Get a list of assets and their qty in custody.
*/
Task<Dictionary<string, decimal>> GetAssetBalancesAsync(JObject config, CancellationToken cancellationToken);
public Task<Form.Form> GetConfigForm(JObject config, CancellationToken cancellationToken = default);
}

View File

@ -0,0 +1,14 @@
#nullable enable
using System.Collections.Generic;
using System.Linq;
using BTCPayServer.Abstractions.Custodians;
namespace BTCPayServer.Abstractions.Extensions;
public static class CustodianExtensions
{
public static ICustodian? GetCustodianByCode(this IEnumerable<ICustodian> custodians, string code)
{
return custodians.FirstOrDefault(custodian => custodian.Code == code);
}
}

View File

@ -1,20 +0,0 @@
using System.Text.Json;
using BTCPayServer.Abstractions.Models;
using Microsoft.AspNetCore.Mvc.ViewFeatures;
namespace BTCPayServer.Abstractions.Extensions
{
public static class SetStatusMessageModelExtensions
{
public static void SetStatusMessageModel(this ITempDataDictionary tempData, StatusMessageModel statusMessage)
{
if (statusMessage == null)
{
tempData.Remove("StatusMessageModel");
return;
}
tempData["StatusMessageModel"] = JsonSerializer.Serialize(statusMessage, new JsonSerializerOptions());
}
}
}

View File

@ -0,0 +1,47 @@
using System.Collections.Generic;
using BTCPayServer.Client.Models;
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc.ModelBinding;
namespace BTCPayServer.Abstractions.Extensions;
public static class GreenfieldExtensions
{
public static IActionResult UserNotFound(this ControllerBase ctrl)
{
return ctrl.CreateAPIError(404, "user-not-found", "The user was not found");
}
public static IActionResult CreateValidationError(this ControllerBase controller, ModelStateDictionary modelState)
{
return controller.UnprocessableEntity(modelState.ToGreenfieldValidationError());
}
public static List<GreenfieldValidationError> ToGreenfieldValidationError(this ModelStateDictionary modelState)
{
List<GreenfieldValidationError> errors = new List<GreenfieldValidationError>();
foreach (var error in modelState)
{
foreach (var errorMessage in error.Value.Errors)
{
errors.Add(new GreenfieldValidationError(error.Key, errorMessage.ErrorMessage));
}
}
return errors;
}
public static IActionResult CreateAPIError(this ControllerBase controller, string errorCode, string errorMessage)
{
return controller.BadRequest(new GreenfieldAPIError(errorCode, errorMessage));
}
public static IActionResult CreateAPIError(this ControllerBase controller, int httpCode, string errorCode, string errorMessage)
{
return controller.StatusCode(httpCode, new GreenfieldAPIError(errorCode, errorMessage));
}
public static IActionResult CreateAPIPermissionError(this ControllerBase controller, string missingPermission, string message = null)
{
return controller.StatusCode(403, new GreenfieldPermissionAPIError(missingPermission, message));
}
}

View File

@ -0,0 +1,120 @@
using System;
using Microsoft.AspNetCore.Http;
namespace BTCPayServer.Abstractions.Extensions;
public static class HttpRequestExtensions
{
public static bool IsOnion(this HttpRequest request)
{
if (request?.Host.Host == null)
return false;
return request.Host.Host.EndsWith(".onion", StringComparison.OrdinalIgnoreCase);
}
public static string GetAbsoluteRoot(this HttpRequest request)
{
return string.Concat(
request.Scheme,
"://",
request.Host.ToUriComponent(),
request.PathBase.ToUriComponent());
}
public static Uri GetAbsoluteRootUri(this HttpRequest request)
{
return new Uri(request.GetAbsoluteRoot());
}
public static string GetCurrentUrl(this HttpRequest request)
{
return string.Concat(
request.Scheme,
"://",
request.Host.ToUriComponent(),
request.PathBase.ToUriComponent(),
request.Path.ToUriComponent());
}
public static string GetCurrentPath(this HttpRequest request)
{
return string.Concat(
request.PathBase.ToUriComponent(),
request.Path.ToUriComponent());
}
public static string GetCurrentPathWithQueryString(this HttpRequest request)
{
return request.PathBase + request.Path + request.QueryString;
}
/// <summary>
/// If 'toto' and RootPath is 'rootpath' returns '/rootpath/toto'
/// If 'toto' and RootPath is empty returns '/toto'
/// </summary>
/// <param name="request"></param>
/// <param name="path"></param>
/// <returns></returns>
public static string GetRelativePath(this HttpRequest request, string path)
{
if (path.Length > 0 && path[0] != '/')
path = $"/{path}";
return string.Concat(
request.PathBase.ToUriComponent(),
path);
}
/// <summary>
/// If 'https://example.com/toto' returns 'https://example.com/toto'
/// If 'toto' and RootPath is 'rootpath' returns '/rootpath/toto'
/// If 'toto' and RootPath is empty returns '/toto'
/// </summary>
/// <param name="request"></param>
/// <param name="path"></param>
/// <returns></returns>
public static string GetRelativePathOrAbsolute(this HttpRequest request, string path)
{
if (!Uri.TryCreate(path, UriKind.RelativeOrAbsolute, out var uri) ||
uri.IsAbsoluteUri)
return path;
if (path.Length > 0 && path[0] != '/')
path = $"/{path}";
return string.Concat(
request.PathBase.ToUriComponent(),
path);
}
public static string GetAbsoluteUri(this HttpRequest request, string redirectUrl)
{
bool isRelative =
(redirectUrl.Length > 0 && redirectUrl[0] == '/')
|| !new Uri(redirectUrl, UriKind.RelativeOrAbsolute).IsAbsoluteUri;
return isRelative ? request.GetAbsoluteRoot() + redirectUrl : redirectUrl;
}
/// <summary>
/// Will return an absolute URL.
/// If `relativeOrAsbolute` is absolute, returns it.
/// If `relativeOrAsbolute` is relative, send absolute url based on the HOST of this request (without PathBase)
/// </summary>
/// <param name="request"></param>
/// <param name="relativeOrAbsolte"></param>
/// <returns></returns>
public static Uri GetAbsoluteUriNoPathBase(this HttpRequest request, Uri relativeOrAbsolute = null)
{
if (relativeOrAbsolute == null)
{
return new Uri(string.Concat(
request.Scheme,
"://",
request.Host.ToUriComponent()), UriKind.Absolute);
}
if (relativeOrAbsolute.IsAbsoluteUri)
return relativeOrAbsolute;
return new Uri(string.Concat(
request.Scheme,
"://",
request.Host.ToUriComponent()) + relativeOrAbsolute.ToString().WithStartingSlash(), UriKind.Absolute);
}
}

View File

@ -0,0 +1,59 @@
using System.Text.Json;
using BTCPayServer.Abstractions.Constants;
using BTCPayServer.Abstractions.Models;
using Microsoft.AspNetCore.Mvc.ViewFeatures;
using Newtonsoft.Json.Linq;
namespace BTCPayServer.Abstractions.Extensions;
public static class SetStatusMessageModelExtensions
{
public static void SetStatusMessageModel(this ITempDataDictionary tempData, StatusMessageModel statusMessage)
{
if (statusMessage == null)
{
tempData.Remove("StatusMessageModel");
return;
}
tempData["StatusMessageModel"] = JsonSerializer.Serialize(statusMessage, new JsonSerializerOptions());
}
public static StatusMessageModel GetStatusMessageModel(this ITempDataDictionary tempData)
{
tempData.TryGetValue(WellKnownTempData.SuccessMessage, out var successMessage);
tempData.TryGetValue(WellKnownTempData.ErrorMessage, out var errorMessage);
tempData.TryGetValue("StatusMessageModel", out var model);
if (successMessage != null || errorMessage != null)
{
var parsedModel = new StatusMessageModel();
parsedModel.Message = (string)successMessage ?? (string)errorMessage;
if (successMessage != null)
{
parsedModel.Severity = StatusMessageModel.StatusSeverity.Success;
}
else
{
parsedModel.Severity = StatusMessageModel.StatusSeverity.Error;
}
return parsedModel;
}
else if (model != null && model is string str)
{
return JObject.Parse(str).ToObject<StatusMessageModel>();
}
return null;
}
public static bool HasStatusMessage(this ITempDataDictionary tempData)
{
return (tempData.Peek(WellKnownTempData.SuccessMessage) ??
tempData.Peek(WellKnownTempData.ErrorMessage) ??
tempData.Peek("StatusMessageModel")) != null;
}
public static bool HasErrorMessage(this ITempDataDictionary tempData)
{
return GetStatusMessageModel(tempData)?.Severity == StatusMessageModel.StatusSeverity.Error;
}
}

View File

@ -0,0 +1,43 @@
using System;
using System.IO;
using System.Linq;
namespace BTCPayServer.Abstractions.Extensions;
public static class StringExtensions
{
public static bool IsValidFileName(this string fileName)
{
return !fileName.ToCharArray().Any(c => Path.GetInvalidFileNameChars().Contains(c)
|| c == Path.AltDirectorySeparatorChar
|| c == Path.DirectorySeparatorChar
|| c == Path.PathSeparator
|| c == '\\');
}
public static string Truncate(this string value, int maxLength)
{
if (string.IsNullOrEmpty(value))
return value;
return value.Length <= maxLength ? value : value.Substring(0, maxLength);
}
public static string WithTrailingSlash(this string str)
{
if (str.EndsWith("/", StringComparison.InvariantCulture))
return str;
return str + "/";
}
public static string WithStartingSlash(this string str)
{
if (str.StartsWith("/", StringComparison.InvariantCulture))
return str;
return $"/{str}";
}
public static string WithoutEndingSlash(this string str)
{
if (str.EndsWith("/", StringComparison.InvariantCulture))
return str.Substring(0, str.Length - 1);
return str;
}
}

View File

@ -0,0 +1,139 @@
using System;
using System.Collections.Generic;
using System.Globalization;
using System.Linq;
using Microsoft.AspNetCore.Html;
using Microsoft.AspNetCore.Mvc.ViewFeatures;
namespace BTCPayServer.Abstractions.Extensions
{
public static class ViewsRazor
{
private const string ACTIVE_CATEGORY_KEY = "ActiveCategory";
private const string ACTIVE_PAGE_KEY = "ActivePage";
private const string ACTIVE_ID_KEY = "ActiveId";
private const string ActivePageClass = "active";
public enum DateDisplayFormat
{
Localized,
Relative
}
public static void SetActivePage<T>(this ViewDataDictionary viewData, T activePage, string title = null, string activeId = null)
where T : IConvertible
{
SetActivePage(viewData, activePage.ToString(), activePage.GetType().ToString(), title, activeId);
}
public static void SetActivePage(this ViewDataDictionary viewData, string activePage, string category, string title = null, string activeId = null)
{
// Page Title
viewData["Title"] = title ?? activePage;
// Navigation
viewData[ACTIVE_PAGE_KEY] = activePage;
viewData[ACTIVE_ID_KEY] = activeId;
SetActiveCategory(viewData, category);
}
public static void SetActiveCategory<T>(this ViewDataDictionary viewData, T activeCategory)
{
SetActiveCategory(viewData, activeCategory.ToString());
}
public static void SetActiveCategory(this ViewDataDictionary viewData, string activeCategory)
{
viewData[ACTIVE_CATEGORY_KEY] = activeCategory;
}
public static string IsActiveCategory<T>(this ViewDataDictionary viewData, T category, object id = null)
{
return IsActiveCategory(viewData, category.ToString(), id);
}
public static string IsActiveCategory(this ViewDataDictionary viewData, string category, object id = null)
{
if (!viewData.ContainsKey(ACTIVE_CATEGORY_KEY))
{
return null;
}
var activeId = viewData[ACTIVE_ID_KEY];
var activeCategory = viewData[ACTIVE_CATEGORY_KEY]?.ToString();
var categoryMatch = category.Equals(activeCategory, StringComparison.InvariantCultureIgnoreCase);
var idMatch = id == null || activeId == null || id.Equals(activeId);
return categoryMatch && idMatch ? ActivePageClass : null;
}
public static string IsActivePage<T>(this ViewDataDictionary viewData, T page, object id = null)
where T : IConvertible
{
return IsActivePage(viewData, page.ToString(), page.GetType().ToString(), id);
}
public static string IsActivePage<T>(this ViewDataDictionary viewData, IEnumerable<T> pages, object id = null)
where T : IConvertible
{
return pages.Any(page => IsActivePage(viewData, page.ToString(), page.GetType().ToString(), id) == ActivePageClass)
? ActivePageClass
: null;
}
public static string IsActivePage(this ViewDataDictionary viewData, string page, string category, object id = null)
{
if (!viewData.ContainsKey(ACTIVE_PAGE_KEY))
{
return null;
}
var activeId = viewData[ACTIVE_ID_KEY];
var activePage = viewData[ACTIVE_PAGE_KEY]?.ToString();
var activeCategory = viewData[ACTIVE_CATEGORY_KEY]?.ToString();
var categoryAndPageMatch = (category == null || activeCategory.Equals(category, StringComparison.InvariantCultureIgnoreCase)) && page.Equals(activePage, StringComparison.InvariantCultureIgnoreCase);
var idMatch = id == null || activeId == null || id.Equals(activeId);
return categoryAndPageMatch && idMatch ? ActivePageClass : null;
}
public static HtmlString ToBrowserDate(this DateTimeOffset date, DateDisplayFormat format = DateDisplayFormat.Localized)
{
var relative = date.ToTimeAgo();
var initial = format.ToString().ToLower();
var dateTime = date.ToString("o", CultureInfo.InvariantCulture);
var displayDate = format == DateDisplayFormat.Relative ? relative : date.ToString("g", CultureInfo.InvariantCulture);
return new HtmlString($"<time datetime=\"{dateTime}\" data-relative=\"{relative}\" data-initial=\"{initial}\">{displayDate}</time>");
}
public static HtmlString ToBrowserDate(this DateTime date, DateDisplayFormat format = DateDisplayFormat.Localized)
{
var relative = date.ToTimeAgo();
var initial = format.ToString().ToLower();
var dateTime = date.ToString("o", CultureInfo.InvariantCulture);
var displayDate = format == DateDisplayFormat.Relative ? relative : date.ToString("g", CultureInfo.InvariantCulture);
return new HtmlString($"<time datetime=\"{dateTime}\" data-relative=\"{relative}\" data-initial=\"{initial}\">{displayDate}</time>");
}
public static string ToTimeAgo(this DateTimeOffset date) => (DateTimeOffset.UtcNow - date).ToTimeAgo();
public static string ToTimeAgo(this DateTime date) => (DateTimeOffset.UtcNow - date).ToTimeAgo();
public static string ToTimeAgo(this TimeSpan diff) => diff.TotalSeconds > 0 ? $"{diff.TimeString()} ago" : $"in {diff.Negate().TimeString()}";
public static string TimeString(this TimeSpan timeSpan)
{
if (timeSpan.TotalMinutes < 1)
{
return $"{(int)timeSpan.TotalSeconds} second{Plural((int)timeSpan.TotalSeconds)}";
}
if (timeSpan.TotalHours < 1)
{
return $"{(int)timeSpan.TotalMinutes} minute{Plural((int)timeSpan.TotalMinutes)}";
}
return timeSpan.Days < 1
? $"{(int)timeSpan.TotalHours} hour{Plural((int)timeSpan.TotalHours)}"
: $"{(int)timeSpan.TotalDays} day{Plural((int)timeSpan.TotalDays)}";
}
private static string Plural(int value)
{
return value == 1 ? string.Empty : "s";
}
}
}

View File

@ -0,0 +1,37 @@
using Newtonsoft.Json;
using Newtonsoft.Json.Converters;
namespace BTCPayServer.Abstractions.Form;
public class AlertMessage
{
// Corresponds to the Bootstrap CSS "alert alert-xxx" messages:
// Success = green
// Warning = orange
// Danger = red
// Info = blue
public enum AlertMessageType
{
Success,
Warning,
Danger,
Info
}
[JsonConverter(typeof(StringEnumConverter))]
public AlertMessageType Type;
// The translated message to be shown to the user
public string Message;
public AlertMessage()
{
}
public AlertMessage(AlertMessageType type, string message)
{
this.Type = type;
this.Message = message;
}
}

View File

@ -0,0 +1,64 @@
using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using Microsoft.AspNetCore.Mvc.ModelBinding;
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
namespace BTCPayServer.Abstractions.Form;
public class Field
{
public static Field Create(string label, string name, string value, bool required, string helpText, string type = "text")
{
return new Field
{
Label = label,
Name = name,
Value = value,
OriginalValue = value,
Required = required,
HelpText = helpText,
Type = type
};
}
// The name of the HTML5 node. Should be used as the key for the posted data.
public string Name;
public bool Constant;
// HTML5 compatible type string like "text", "textarea", "email", "password", etc.
public string Type;
public static Field CreateFieldset()
{
return new Field { Type = "fieldset" };
}
// The value field is what is currently in the DB or what the user entered, but possibly not saved yet due to validation errors.
// If this is the first the user sees the form, then value and original value are the same. Value changes as the user starts interacting with the form.
public string Value;
public bool Required;
// The translated label of the field.
public string Label;
// The original value is the value that is currently saved in the backend. A "reset" button can be used to revert back to this. Should only be set from the constructor.
public string OriginalValue;
// A useful note shown below the field or via a tooltip / info icon. Should be translated for the user.
public string HelpText;
[JsonExtensionData] public IDictionary<string, JToken> AdditionalData { get; set; }
public List<Field> Fields { get; set; } = new();
// The field is considered "valid" if there are no validation errors
public List<string> ValidationErrors = new();
public virtual bool IsValid()
{
return ValidationErrors.Count == 0 && Fields.All(field => field.IsValid());
}
}

View File

@ -0,0 +1,135 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using Microsoft.AspNetCore.Http;
using Microsoft.Extensions.Primitives;
using Newtonsoft.Json.Linq;
using Npgsql.Internal.TypeHandlers.GeometricHandlers;
namespace BTCPayServer.Abstractions.Form;
public class Form
{
#nullable enable
public static Form Parse(string str)
{
ArgumentNullException.ThrowIfNull(str);
return JObject.Parse(str).ToObject<Form>(CamelCaseSerializerSettings.Serializer) ?? throw new InvalidOperationException("Impossible to deserialize Form");
}
public override string ToString()
{
return JObject.FromObject(this, CamelCaseSerializerSettings.Serializer).ToString(Newtonsoft.Json.Formatting.Indented);
}
#nullable restore
// Messages to be shown at the top of the form indicating user feedback like "Saved successfully" or "Please change X because of Y." or a warning, etc...
public List<AlertMessage> TopMessages { get; set; } = new();
// Groups of fields in the form
public List<Field> Fields { get; set; } = new();
// Are all the fields valid in the form?
public bool IsValid()
{
if (TopMessages?.Any(t => t.Type == AlertMessage.AlertMessageType.Danger) is true)
return false;
return Fields.Select(f => f.IsValid()).All(o => o);
}
public Field GetFieldByFullName(string fullName)
{
foreach (var f in GetAllFields())
{
if (f.FullName == fullName)
return f.Field;
}
return null;
}
public IEnumerable<(string FullName, List<string> Path, Field Field)> GetAllFields()
{
HashSet<string> nameReturned = new();
foreach (var f in GetAllFieldsCore(new List<string>(), Fields))
{
var fullName = string.Join('_', f.Path.Where(s => !string.IsNullOrEmpty(s)));
if (!nameReturned.Add(fullName))
continue;
yield return (fullName, f.Path, f.Field);
}
}
public bool ValidateFieldNames(out List<string> errors)
{
errors = new List<string>();
HashSet<string> nameReturned = new();
foreach (var f in GetAllFieldsCore(new List<string>(), Fields))
{
var fullName = string.Join('_', f.Path.Where(s => !string.IsNullOrEmpty(s)));
if (!nameReturned.Add(fullName))
{
errors.Add($"Form contains duplicate field names '{fullName}'");
}
}
return errors.Count == 0;
}
IEnumerable<(List<string> Path, Field Field)> GetAllFieldsCore(List<string> path, List<Field> fields)
{
foreach (var field in fields)
{
List<string> thisPath = new(path.Count + 1);
thisPath.AddRange(path);
if (!string.IsNullOrEmpty(field.Name))
{
thisPath.Add(field.Name);
yield return (thisPath, field);
}
foreach (var descendant in GetAllFieldsCore(thisPath, field.Fields))
{
descendant.Field.Constant = field.Constant || descendant.Field.Constant;
yield return descendant;
}
}
}
public void ApplyValuesFromForm(IEnumerable<KeyValuePair<string, StringValues>> form)
{
var values = form.GroupBy(f => f.Key, f => f.Value).ToDictionary(g => g.Key, g => g.First());
foreach (var f in GetAllFields())
{
if (f.Field.Constant || !values.TryGetValue(f.FullName, out var val))
continue;
f.Field.Value = val;
}
}
public void SetValues(JObject values)
{
var fields = GetAllFields().ToDictionary(k => k.FullName, k => k.Field);
SetValues(fields, new List<string>(), values);
}
private void SetValues(Dictionary<string, Field> fields, List<string> path, JObject values)
{
foreach (var prop in values.Properties())
{
List<string> propPath = new List<string>(path.Count + 1);
propPath.AddRange(path);
propPath.Add(prop.Name);
if (prop.Value.Type == JTokenType.Object)
{
SetValues(fields, propPath, (JObject)prop.Value);
}
else if (prop.Value.Type == JTokenType.String)
{
var fullName = string.Join('_', propPath.Where(s => !string.IsNullOrEmpty(s)));
if (fields.TryGetValue(fullName, out var f) && !f.Constant)
f.Value = prop.Value.Value<string>();
}
}
}
}

View File

@ -8,20 +8,53 @@ namespace BTCPayServer.Abstractions.Models
{
public abstract class BaseBTCPayServerPlugin : IBTCPayServerPlugin
{
public abstract string Identifier { get; }
public abstract string Name { get; }
public virtual string Identifier
{
get
{
return GetType().GetTypeInfo().Assembly.GetName().Name;
}
}
public virtual string Name
{
get
{
return GetType().GetTypeInfo().Assembly
.GetCustomAttribute<AssemblyProductAttribute>()?
.Product ?? "???";
}
}
public virtual Version Version
{
get
{
return Assembly.GetAssembly(GetType())?.GetName().Version ?? new Version(1, 0, 0, 0);
return GetVersion(GetType().GetTypeInfo().Assembly
.GetCustomAttribute<AssemblyInformationalVersionAttribute>()?
.InformationalVersion) ??
Assembly.GetAssembly(GetType())?.GetName()?.Version ??
new Version(1, 0, 0, 0);
}
}
public abstract string Description { get; }
private static Version GetVersion(string informationalVersion)
{
if (informationalVersion is null)
return null;
Version.TryParse(informationalVersion, out var r);
return r;
}
public virtual string Description
{
get
{
return GetType().GetTypeInfo().Assembly
.GetCustomAttribute<AssemblyDescriptionAttribute>()?
.Description ?? string.Empty;
}
}
public bool SystemPlugin { get; set; }
public bool SystemExtension { get; set; }
public virtual IBTCPayServerPlugin.PluginDependency[] Dependencies { get; } = Array.Empty<IBTCPayServerPlugin.PluginDependency>();
public virtual void Execute(IApplicationBuilder applicationBuilder,

View File

@ -0,0 +1,34 @@
using System;
namespace BTCPayServer.Abstractions.Models
{
public class ConfirmModel
{
private const string ButtonClassDefault = "btn-danger";
public ConfirmModel() { }
public ConfirmModel(string title, string desc, string action = null, string buttonClass = ButtonClassDefault, string actionName = null, string controllerName = null)
{
Title = title;
Description = desc;
Action = action;
ActionName = actionName;
ControllerName = controllerName;
ButtonClass = buttonClass;
if (Description.Contains("<strong>", StringComparison.InvariantCultureIgnoreCase))
{
DescriptionHtml = true;
}
}
public string Title { get; set; }
public string Description { get; set; }
public bool DescriptionHtml { get; set; }
public string Action { get; set; }
public string ActionName { get; set; }
public string ControllerName { get; set; }
public string ButtonClass { get; set; } = ButtonClassDefault;
}
}

View File

@ -1,43 +1,7 @@
using System;
using System.IO;
using System.Runtime.InteropServices.ComTypes;
using Microsoft.Extensions.Configuration;
namespace BTCPayServer.Abstractions.Models
{
public class DatabaseOptions
{
public DatabaseOptions(IConfiguration conf, string dataDir)
{
var postgresConnectionString = conf["postgres"];
var mySQLConnectionString = conf["mysql"];
var sqliteFileName = conf["sqlitefile"];
if (!string.IsNullOrEmpty(postgresConnectionString))
{
DatabaseType = DatabaseType.Postgres;
ConnectionString = postgresConnectionString;
}
else if (!string.IsNullOrEmpty(mySQLConnectionString))
{
DatabaseType = DatabaseType.MySQL;
ConnectionString = mySQLConnectionString;
}
else if (!string.IsNullOrEmpty(sqliteFileName))
{
var connStr = "Data Source=" + (Path.IsPathRooted(sqliteFileName)
? sqliteFileName
: Path.Combine(dataDir, sqliteFileName));
DatabaseType = DatabaseType.Sqlite;
ConnectionString = sqliteFileName;
}
else
{
throw new InvalidOperationException("No database option was configured.");
}
}
public DatabaseType DatabaseType { get; set; }
public string ConnectionString { get; set; }
}

View File

@ -0,0 +1,27 @@
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Http;
namespace BTCPayServer.Security;
public class AuthorizationFilterHandle
{
public AuthorizationHandlerContext Context { get; }
public PolicyRequirement Requirement { get; }
public HttpContext HttpContext { get; }
public bool Success { get; private set; }
public AuthorizationFilterHandle(
AuthorizationHandlerContext context,
PolicyRequirement requirement,
HttpContext httpContext)
{
Context = context;
Requirement = requirement;
HttpContext = httpContext;
}
public void MarkSuccessful()
{
Success = true;
}
}

View File

@ -2,6 +2,7 @@ using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using NBitcoin.Crypto;
namespace BTCPayServer.Security
{
@ -9,6 +10,8 @@ namespace BTCPayServer.Security
{
public ConsentSecurityPolicy(string name, string value)
{
if (value.Contains(';', StringComparison.OrdinalIgnoreCase))
throw new FormatException();
_Value = value;
_Name = name;
}
@ -67,13 +70,55 @@ namespace BTCPayServer.Security
}
readonly HashSet<ConsentSecurityPolicy> _Policies = new HashSet<ConsentSecurityPolicy>();
/// <summary>
/// Allow a specific script as event handler
/// </summary>
/// <param name="script"></param>
public void AllowUnsafeHashes(string script = null)
{
if (!allowUnsafeHashes)
{
Add("script-src", $"'unsafe-hashes'");
allowUnsafeHashes = true;
}
if (script != null)
{
var sha = GetSha256(script);
Add("script-src", $"'sha256-{sha}'");
}
}
bool allowUnsafeHashes = false;
/// <summary>
/// Allow the injection of script tag with the following script
/// </summary>
/// <param name="script"></param>
public void AllowInline(string script)
{
ArgumentNullException.ThrowIfNull(script);
var sha = GetSha256(script);
Add("script-src", $"'sha256-{sha}'");
}
static string GetSha256(string script)
{
return Convert.ToBase64String(Hashes.SHA256(Encoding.UTF8.GetBytes(script.Replace("\r\n", "\n", StringComparison.Ordinal))));
}
public void Add(string name, string value)
{
Add(new ConsentSecurityPolicy(name, value));
}
public void Add(ConsentSecurityPolicy policy)
{
if (_Policies.Any(p => p.Name == policy.Name && p.Value == policy.Name))
return;
_Policies.Add(policy);
}
public void UnsafeEval()
{
Add("script-src", "'unsafe-eval'");
}
public IEnumerable<ConsentSecurityPolicy> Rules => _Policies;
public bool HasRules => _Policies.Count != 0;
@ -87,34 +132,19 @@ namespace BTCPayServer.Security
{
value.Append(';');
}
List<string> values = new List<string>();
HashSet<string> values = new HashSet<string>();
List<string> valuesList = new List<string>();
values.Add(group.Key);
valuesList.Add(group.Key);
foreach (var v in group)
{
values.Add(v.Value);
if (values.Add(v.Value))
valuesList.Add(v.Value);
}
foreach (var i in authorized)
{
values.Add(i);
}
value.Append(String.Join(" ", values.OfType<object>().ToArray()));
value.Append(String.Join(" ", valuesList.OfType<object>().ToArray()));
firstGroup = false;
}
return value.ToString();
}
internal void Clear()
{
authorized.Clear();
_Policies.Clear();
}
readonly HashSet<string> authorized = new HashSet<string>();
internal void AddAllAuthorized(string v)
{
authorized.Add(v);
}
public IEnumerable<string> Authorized => authorized;
}
}

View File

@ -7,8 +7,7 @@ namespace BTCPayServer.Security
{
public PolicyRequirement(string policy)
{
if (policy == null)
throw new ArgumentNullException(nameof(policy));
ArgumentNullException.ThrowIfNull(policy);
Policy = policy;
}
public string Policy { get; }

View File

@ -3,9 +3,9 @@ using BTCPayServer.Abstractions.Contracts;
namespace BTCPayServer.Abstractions.Services
{
public abstract class PluginAction<T>:IPluginHookAction
public abstract class PluginAction<T> : IPluginHookAction
{
public string Hook { get; }
public abstract string Hook { get; }
public Task Execute(object args)
{
return Execute(args is T args1 ? args1 : default);

View File

@ -3,9 +3,10 @@ using BTCPayServer.Abstractions.Contracts;
namespace BTCPayServer.Abstractions.Services
{
public abstract class PluginHookFilter<T>:IPluginHookFilter
public abstract class PluginHookFilter<T> : IPluginHookFilter
{
public string Hook { get; }
public abstract string Hook { get; }
public Task<object> Execute(object args)
{
return Execute(args is T args1 ? args1 : default).ContinueWith(task => task.Result as object);

View File

@ -2,7 +2,7 @@ using Ganss.XSS;
using Microsoft.AspNetCore.Html;
using Microsoft.AspNetCore.Mvc.Rendering;
namespace BTCPayServer.Services
namespace BTCPayServer.Abstractions.Services
{
public class Safe
{

View File

@ -2,7 +2,7 @@ using BTCPayServer.Abstractions.Contracts;
namespace BTCPayServer.Abstractions.Services
{
public class UIExtension: IUIExtension
public class UIExtension : IUIExtension
{
public UIExtension(string partial, string location)
{

View File

@ -0,0 +1,30 @@
using System;
using BTCPayServer.Security;
using Microsoft.AspNetCore.Razor.TagHelpers;
namespace BTCPayServer.Abstractions.TagHelpers;
/// <summary>
/// Add sha256- to allow inline event handlers in a:href=javascript:
/// </summary>
[HtmlTargetElement("a", Attributes = "csp-allow")]
public class CSPA : TagHelper
{
private readonly ContentSecurityPolicies _csp;
public CSPA(ContentSecurityPolicies csp)
{
_csp = csp;
}
public override void Process(TagHelperContext context, TagHelperOutput output)
{
output.Attributes.RemoveAll("csp-allow");
if (output.Attributes.TryGetAttribute("href", out var attr))
{
var v = attr.Value.ToString();
if (v.StartsWith("javascript:", StringComparison.OrdinalIgnoreCase))
{
_csp.AllowUnsafeHashes(v);
}
}
}
}

View File

@ -0,0 +1,37 @@
using System.Collections.Generic;
using System.Linq;
using BTCPayServer.Security;
using Microsoft.AspNetCore.Razor.TagHelpers;
namespace BTCPayServer.Abstractions.TagHelpers;
/// <summary>
/// Add 'unsafe-hashes' and sha256- to allow inline event handlers in CSP
/// </summary>
[HtmlTargetElement(Attributes = "onclick")]
[HtmlTargetElement(Attributes = "onkeypress")]
[HtmlTargetElement(Attributes = "onchange")]
[HtmlTargetElement(Attributes = "onsubmit")]
public class CSPEventTagHelper : TagHelper
{
public const string EventNames = "onclick,onkeypress,onchange,onsubmit";
private readonly ContentSecurityPolicies _csp;
readonly static HashSet<string> EventSet = EventNames.Split(',')
.ToHashSet();
public CSPEventTagHelper(ContentSecurityPolicies csp)
{
_csp = csp;
}
public override void Process(TagHelperContext context, TagHelperOutput output)
{
foreach (var attr in output.Attributes)
{
var n = attr.Name.ToLowerInvariant();
if (EventSet.Contains(n))
{
_csp.AllowUnsafeHashes(attr.Value.ToString());
}
}
}
}

View File

@ -0,0 +1,33 @@
using BTCPayServer.Security;
using Microsoft.AspNetCore.Razor.TagHelpers;
using NBitcoin;
namespace BTCPayServer.Abstractions.TagHelpers;
/// <summary>
/// Add a nonce-* so the inline-script can pass CSP rule when they are rendered server-side
/// </summary>
[HtmlTargetElement("script")]
public class CSPInlineScriptTagHelper : TagHelper
{
private readonly ContentSecurityPolicies _csp;
public CSPInlineScriptTagHelper(ContentSecurityPolicies csp)
{
_csp = csp;
}
public override void Process(TagHelperContext context, TagHelperOutput output)
{
if (output.Attributes.ContainsName("src"))
return;
if (output.Attributes.TryGetAttribute("type", out var attr))
{
if (attr.Value?.ToString() != "text/javascript")
return;
}
var nonce = RandomUtils.GetUInt256().ToString().Substring(0, 32);
output.Attributes.Add(new TagHelperAttribute("nonce", nonce));
_csp.Add("script-src", $"'nonce-{nonce}'");
}
}

View File

@ -0,0 +1,25 @@
using System.Threading.Tasks;
using BTCPayServer.Security;
using Microsoft.AspNetCore.Razor.TagHelpers;
namespace BTCPayServer.Abstractions.TagHelpers;
/// <summary>
/// Add sha256- to allow inline event handlers in CSP
/// </summary>
[HtmlTargetElement("template", Attributes = "csp-allow")]
public class CSPTemplate : TagHelper
{
private readonly ContentSecurityPolicies _csp;
public CSPTemplate(ContentSecurityPolicies csp)
{
_csp = csp;
}
public override async Task ProcessAsync(TagHelperContext context, TagHelperOutput output)
{
output.Attributes.RemoveAll("csp-allow");
var childContent = await output.GetChildContentAsync();
var content = childContent.GetContent();
_csp.AllowInline(content);
}
}

View File

@ -0,0 +1,52 @@
using System.Threading.Tasks;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Razor.TagHelpers;
using Microsoft.Extensions.Logging;
namespace BTCPayServer.Abstractions.TagHelpers;
[HtmlTargetElement(Attributes = "[permission]")]
[HtmlTargetElement(Attributes = "[not-permission]" )]
public class PermissionTagHelper : TagHelper
{
private readonly IAuthorizationService _authorizationService;
private readonly IHttpContextAccessor _httpContextAccessor;
private readonly ILogger<PermissionTagHelper> _logger;
public PermissionTagHelper(IAuthorizationService authorizationService, IHttpContextAccessor httpContextAccessor, ILogger<PermissionTagHelper> logger)
{
_authorizationService = authorizationService;
_httpContextAccessor = httpContextAccessor;
_logger = logger;
}
public string Permission { get; set; }
public string NotPermission { get; set; }
public string PermissionResource { get; set; }
public override async Task ProcessAsync(TagHelperContext context, TagHelperOutput output)
{
if (string.IsNullOrEmpty(Permission) && string.IsNullOrEmpty(NotPermission))
return;
if (_httpContextAccessor.HttpContext is null)
return;
var expectedResult = !string.IsNullOrEmpty(Permission);
var key = $"{Permission??NotPermission}_{PermissionResource}";
if (!_httpContextAccessor.HttpContext.Items.TryGetValue(key, out var o) ||
o is not AuthorizationResult res)
{
res = await _authorizationService.AuthorizeAsync(_httpContextAccessor.HttpContext.User,
PermissionResource,
Permission);
_httpContextAccessor.HttpContext.Items.Add(key, res);
}
if (expectedResult != res.Succeeded)
{
output.SuppressOutput();
}
}
}

View File

@ -0,0 +1,42 @@
using System;
using System.Collections.Generic;
using System.Diagnostics.CodeAnalysis;
using System.IO;
using System.Text.Encodings.Web;
using Microsoft.AspNetCore.Html;
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc.Razor.TagHelpers;
using Microsoft.AspNetCore.Mvc.Rendering;
using Microsoft.AspNetCore.Mvc.Routing;
using Microsoft.AspNetCore.Mvc.ViewFeatures;
using Microsoft.AspNetCore.Razor.TagHelpers;
namespace BTCPayServer.Abstractions.TagHelpers;
// Make sure that <svg><use href=/ are correctly working if rootpath is present
[HtmlTargetElement("use", Attributes = "href")]
public class SVGUse : UrlResolutionTagHelper2
{
private readonly IFileVersionProvider _fileVersionProvider;
public SVGUse(IUrlHelperFactory urlHelperFactory, HtmlEncoder htmlEncoder, IFileVersionProvider fileVersionProvider) : base(urlHelperFactory, htmlEncoder)
{
_fileVersionProvider = fileVersionProvider;
}
public override void Process(TagHelperContext context, TagHelperOutput output)
{
var attr = output.Attributes["href"].Value.ToString();
var symbolIndex = attr!.IndexOf("#", StringComparison.InvariantCulture);
var start = attr.IndexOf("~", StringComparison.InvariantCulture) + 1;
var length = (symbolIndex != -1 ? symbolIndex : attr.Length) - start;
var filePath = attr.Substring(start, length);
if (!string.IsNullOrEmpty(filePath))
{
var versioned = _fileVersionProvider.AddFileVersionToPath(ViewContext.HttpContext.Request.PathBase, filePath);
attr = attr.Replace(filePath, versioned);
}
output.Attributes.SetAttribute("href", attr);
base.Process(context, output);
}
}

View File

@ -0,0 +1,31 @@
using BTCPayServer.Abstractions.Services;
using BTCPayServer.Security;
using Microsoft.AspNetCore.Razor.TagHelpers;
using NBitcoin;
namespace BTCPayServer.Abstractions.TagHelpers;
[HtmlTargetElement("srv-model")]
public class SrvModel : TagHelper
{
private readonly Safe _safe;
private readonly ContentSecurityPolicies _csp;
public SrvModel(Safe safe, ContentSecurityPolicies csp)
{
_safe = safe;
_csp = csp;
}
public string VarName { get; set; } = "srvModel";
public object Model { get; set; }
public override void Process(TagHelperContext context, TagHelperOutput output)
{
output.TagName = "script";
output.TagMode = TagMode.StartTagAndEndTag;
output.Attributes.Add(new TagHelperAttribute("type", "text/javascript"));
var nonce = RandomUtils.GetUInt256().ToString().Substring(0, 32);
output.Attributes.Add(new TagHelperAttribute("nonce", nonce));
_csp.Add("script-src", $"'nonce-{nonce}'");
output.Content.SetHtmlContent($"var {VarName} = {_safe.Json(Model)};");
}
}

View File

@ -0,0 +1,314 @@
#nullable enable
using System;
using System.Collections.Generic;
using System.Diagnostics.CodeAnalysis;
using System.IO;
using System.Text.Encodings.Web;
using Microsoft.AspNetCore.Html;
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc.Razor.TagHelpers;
using Microsoft.AspNetCore.Mvc.Rendering;
using Microsoft.AspNetCore.Mvc.Routing;
using Microsoft.AspNetCore.Mvc.ViewFeatures;
using Microsoft.AspNetCore.Razor.TagHelpers;
namespace BTCPayServer.Abstractions.TagHelpers
{
// A copy of https://github.com/dotnet/aspnetcore/blob/39f0e0b8f40b4754418f81aef0de58a9204a1fe5/src/Mvc/Mvc.Razor/src/TagHelpers/UrlResolutionTagHelper.cs
// slightly modified to also work on use tag.
public class UrlResolutionTagHelper2 : TagHelper
{
// Valid whitespace characters defined by the HTML5 spec.
private static readonly char[] ValidAttributeWhitespaceChars =
new[] { '\t', '\n', '\u000C', '\r', ' ' };
private static readonly Dictionary<string, string[]> ElementAttributeLookups =
new(StringComparer.OrdinalIgnoreCase)
{
{ "use", new[] { "href" } },
{ "a", new[] { "href" } },
{ "applet", new[] { "archive" } },
{ "area", new[] { "href" } },
{ "audio", new[] { "src" } },
{ "base", new[] { "href" } },
{ "blockquote", new[] { "cite" } },
{ "button", new[] { "formaction" } },
{ "del", new[] { "cite" } },
{ "embed", new[] { "src" } },
{ "form", new[] { "action" } },
{ "html", new[] { "manifest" } },
{ "iframe", new[] { "src" } },
{ "img", new[] { "src", "srcset" } },
{ "input", new[] { "src", "formaction" } },
{ "ins", new[] { "cite" } },
{ "link", new[] { "href" } },
{ "menuitem", new[] { "icon" } },
{ "object", new[] { "archive", "data" } },
{ "q", new[] { "cite" } },
{ "script", new[] { "src" } },
{ "source", new[] { "src", "srcset" } },
{ "track", new[] { "src" } },
{ "video", new[] { "poster", "src" } },
};
/// <summary>
/// Creates a new <see cref="UrlResolutionTagHelper"/>.
/// </summary>
/// <param name="urlHelperFactory">The <see cref="IUrlHelperFactory"/>.</param>
/// <param name="htmlEncoder">The <see cref="HtmlEncoder"/>.</param>
public UrlResolutionTagHelper2(IUrlHelperFactory urlHelperFactory, HtmlEncoder htmlEncoder)
{
UrlHelperFactory = urlHelperFactory;
HtmlEncoder = htmlEncoder;
}
/// <inheritdoc />
public override int Order => -1000 - 999;
/// <summary>
/// The <see cref="IUrlHelperFactory"/>.
/// </summary>
protected IUrlHelperFactory UrlHelperFactory { get; }
/// <summary>
/// The <see cref="HtmlEncoder"/>.
/// </summary>
protected HtmlEncoder HtmlEncoder { get; }
/// <summary>
/// The <see cref="ViewContext"/>.
/// </summary>
[HtmlAttributeNotBound]
[ViewContext]
public ViewContext ViewContext { get; set; } = default!;
/// <inheritdoc />
public override void Process(TagHelperContext context, TagHelperOutput output)
{
ArgumentNullException.ThrowIfNull(context);
ArgumentNullException.ThrowIfNull(output);
if (output.TagName == null)
{
return;
}
if (ElementAttributeLookups.TryGetValue(output.TagName, out var attributeNames))
{
for (var i = 0; i < attributeNames.Length; i++)
{
ProcessUrlAttribute(attributeNames[i], output);
}
}
// itemid can be present on any HTML element.
ProcessUrlAttribute("itemid", output);
}
/// <summary>
/// Resolves and updates URL values starting with '~/' (relative to the application's 'webroot' setting) for
/// <paramref name="output"/>'s <see cref="TagHelperOutput.Attributes"/> whose
/// <see cref="TagHelperAttribute.Name"/> is <paramref name="attributeName"/>.
/// </summary>
/// <param name="attributeName">The attribute name used to lookup values to resolve.</param>
/// <param name="output">The <see cref="TagHelperOutput"/>.</param>
protected void ProcessUrlAttribute(string attributeName, TagHelperOutput output)
{
ArgumentNullException.ThrowIfNull(attributeName);
ArgumentNullException.ThrowIfNull(output);
var attributes = output.Attributes;
// Read interface .Count once rather than per iteration
var attributesCount = attributes.Count;
for (var i = 0; i < attributesCount; i++)
{
var attribute = attributes[i];
if (!string.Equals(attribute.Name, attributeName, StringComparison.OrdinalIgnoreCase))
{
continue;
}
if (attribute.Value is string stringValue)
{
if (TryResolveUrl(stringValue, resolvedUrl: out string? resolvedUrl))
{
attributes[i] = new TagHelperAttribute(
attribute.Name,
resolvedUrl,
attribute.ValueStyle);
}
}
else
{
if (attribute.Value is IHtmlContent htmlContent)
{
var htmlString = htmlContent as HtmlString;
if (htmlString != null)
{
// No need for a StringWriter in this case.
stringValue = htmlString.ToString();
}
else
{
using var writer = new StringWriter();
htmlContent.WriteTo(writer, HtmlEncoder);
stringValue = writer.ToString();
}
if (TryResolveUrl(stringValue, resolvedUrl: out IHtmlContent? resolvedUrl))
{
attributes[i] = new TagHelperAttribute(
attribute.Name,
resolvedUrl,
attribute.ValueStyle);
}
else if (htmlString == null)
{
// Not a ~/ URL. Just avoid re-encoding the attribute value later.
attributes[i] = new TagHelperAttribute(
attribute.Name,
new HtmlString(stringValue),
attribute.ValueStyle);
}
}
}
}
}
/// <summary>
/// Tries to resolve the given <paramref name="url"/> value relative to the application's 'webroot' setting.
/// </summary>
/// <param name="url">The URL to resolve.</param>
/// <param name="resolvedUrl">Absolute URL beginning with the application's virtual root. <c>null</c> if
/// <paramref name="url"/> could not be resolved.</param>
/// <returns><c>true</c> if the <paramref name="url"/> could be resolved; <c>false</c> otherwise.</returns>
protected bool TryResolveUrl(string url, out string? resolvedUrl)
{
resolvedUrl = null;
var start = FindRelativeStart(url);
if (start == -1)
{
return false;
}
var trimmedUrl = CreateTrimmedString(url, start);
var urlHelper = UrlHelperFactory.GetUrlHelper(ViewContext);
resolvedUrl = urlHelper.Content(trimmedUrl);
return true;
}
/// <summary>
/// Tries to resolve the given <paramref name="url"/> value relative to the application's 'webroot' setting.
/// </summary>
/// <param name="url">The URL to resolve.</param>
/// <param name="resolvedUrl">
/// Absolute URL beginning with the application's virtual root. <c>null</c> if <paramref name="url"/> could
/// not be resolved.
/// </param>
/// <returns><c>true</c> if the <paramref name="url"/> could be resolved; <c>false</c> otherwise.</returns>
protected bool TryResolveUrl(string url, [NotNullWhen(true)] out IHtmlContent? resolvedUrl)
{
resolvedUrl = null;
var start = FindRelativeStart(url);
if (start == -1)
{
return false;
}
var trimmedUrl = CreateTrimmedString(url, start);
var urlHelper = UrlHelperFactory.GetUrlHelper(ViewContext);
var appRelativeUrl = urlHelper.Content(trimmedUrl);
var postTildeSlashUrlValue = trimmedUrl.Substring(2);
if (!appRelativeUrl.EndsWith(postTildeSlashUrlValue, StringComparison.Ordinal))
{
throw new InvalidOperationException();
}
resolvedUrl = new EncodeFirstSegmentContent(
appRelativeUrl,
appRelativeUrl.Length - postTildeSlashUrlValue.Length,
postTildeSlashUrlValue);
return true;
}
private static int FindRelativeStart(string url)
{
if (url == null || url.Length < 2)
{
return -1;
}
var maxTestLength = url.Length - 2;
var start = 0;
for (; start < url.Length; start++)
{
if (start > maxTestLength)
{
return -1;
}
if (!IsCharWhitespace(url[start]))
{
break;
}
}
// Before doing more work, ensure that the URL we're looking at is app-relative.
if (url[start] != '~' || url[start + 1] != '/')
{
return -1;
}
return start;
}
private static string CreateTrimmedString(string input, int start)
{
var end = input.Length - 1;
for (; end >= start; end--)
{
if (!IsCharWhitespace(input[end]))
{
break;
}
}
var len = end - start + 1;
// Substring returns same string if start == 0 && len == Length
return input.Substring(start, len);
}
private static bool IsCharWhitespace(char ch)
{
return ValidAttributeWhitespaceChars.AsSpan().IndexOf(ch) != -1;
}
private sealed class EncodeFirstSegmentContent : IHtmlContent
{
private readonly string _firstSegment;
private readonly int _firstSegmentLength;
private readonly string _secondSegment;
public EncodeFirstSegmentContent(string firstSegment, int firstSegmentLength, string secondSegment)
{
_firstSegment = firstSegment;
_firstSegmentLength = firstSegmentLength;
_secondSegment = secondSegment;
}
public void WriteTo(TextWriter writer, HtmlEncoder encoder)
{
encoder.Encode(writer, _firstSegment, 0, _firstSegmentLength);
writer.Write(_secondSegment);
}
}
}
}

View File

@ -2,6 +2,7 @@
<PropertyGroup>
<TargetFramework>netstandard2.1</TargetFramework>
<LangVersion>10.0</LangVersion>
<Company>BTCPay Server</Company>
<Copyright>Copyright © BTCPay Server 2020</Copyright>
<Description>A client library for BTCPay Server Greenfield API</Description>
@ -11,9 +12,11 @@
<PackageLicenseExpression>MIT</PackageLicenseExpression>
<RepositoryUrl>https://github.com/btcpayserver/btcpayserver</RepositoryUrl>
<RepositoryType>git</RepositoryType>
<Configurations>Debug;Release;Altcoins-Debug;Altcoins-Release</Configurations>
<Platforms>AnyCPU</Platforms>
</PropertyGroup>
<PropertyGroup>
<Version Condition=" '$(Version)' == '' ">1.2.0</Version>
<Version Condition=" '$(Version)' == '' ">1.7.2</Version>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)' == 'Release' ">
<PublishRepositoryUrl>true</PublishRepositoryUrl>
@ -27,9 +30,9 @@
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.0.0" PrivateAssets="All" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="NBitcoin" Version="5.0.60" />
<PackageReference Include="BTCPayServer.Lightning.Common" Version="1.2.0" />
<PackageReference Include="Newtonsoft.Json" Version="12.0.3" />
<PackageReference Include="BTCPayServer.Lightning.Common" Version="1.3.21" />
<PackageReference Include="NBitcoin" Version="7.0.24" />
<PackageReference Include="Newtonsoft.Json" Version="13.0.1" />
</ItemGroup>
<ItemGroup>
<None Include="icon.png" Pack="true" PackagePath="\" />

View File

@ -1,4 +1,5 @@
using System;
using System.Collections.Generic;
using System.Net.Http;
using System.Threading;
using System.Threading.Tasks;
@ -22,6 +23,15 @@ namespace BTCPayServer.Client
return await HandleResponse<ApiKeyData>(response);
}
public virtual async Task<ApiKeyData> CreateAPIKey(string userId, CreateApiKeyRequest request, CancellationToken token = default)
{
if (request == null)
throw new ArgumentNullException(nameof(request));
var response = await _httpClient.SendAsync(CreateHttpRequest($"api/v1/users/{userId}/api-keys",
bodyPayload: request, method: HttpMethod.Post), token);
return await HandleResponse<ApiKeyData>(response);
}
public virtual async Task RevokeCurrentAPIKeyInfo(CancellationToken token = default)
{
var response = await _httpClient.SendAsync(CreateHttpRequest("api/v1/api-keys/current", null, HttpMethod.Delete), token);
@ -35,5 +45,14 @@ namespace BTCPayServer.Client
var response = await _httpClient.SendAsync(CreateHttpRequest($"api/v1/api-keys/{apikey}", null, HttpMethod.Delete), token);
await HandleResponse(response);
}
public virtual async Task RevokeAPIKey(string userId, string apikey, CancellationToken token = default)
{
if (apikey == null)
throw new ArgumentNullException(nameof(apikey));
if (userId is null)
throw new ArgumentNullException(nameof(userId));
var response = await _httpClient.SendAsync(CreateHttpRequest($"api/v1/users/{userId}/api-keys/{apikey}", null, HttpMethod.Delete), token);
await HandleResponse(response);
}
}
}

View File

@ -0,0 +1,103 @@
using System;
using System.Net.Http;
using System.Threading;
using System.Threading.Tasks;
using BTCPayServer.Client.Models;
namespace BTCPayServer.Client
{
public partial class BTCPayServerClient
{
public virtual async Task<PointOfSaleAppData> CreatePointOfSaleApp(string storeId,
CreatePointOfSaleAppRequest request, CancellationToken token = default)
{
if (request == null)
throw new ArgumentNullException(nameof(request));
var response = await _httpClient.SendAsync(
CreateHttpRequest($"api/v1/stores/{storeId}/apps/pos", bodyPayload: request,
method: HttpMethod.Post), token);
return await HandleResponse<PointOfSaleAppData>(response);
}
public virtual async Task<CrowdfundAppData> CreateCrowdfundApp(string storeId,
CreateCrowdfundAppRequest request, CancellationToken token = default)
{
if (request == null)
throw new ArgumentNullException(nameof(request));
var response = await _httpClient.SendAsync(
CreateHttpRequest($"api/v1/stores/{storeId}/apps/crowdfund", bodyPayload: request,
method: HttpMethod.Post), token);
return await HandleResponse<CrowdfundAppData>(response);
}
public virtual async Task<PointOfSaleAppData> UpdatePointOfSaleApp(string appId,
CreatePointOfSaleAppRequest request, CancellationToken token = default)
{
if (request == null)
throw new ArgumentNullException(nameof(request));
var response = await _httpClient.SendAsync(
CreateHttpRequest($"api/v1/apps/pos/{appId}", bodyPayload: request,
method: HttpMethod.Put), token);
return await HandleResponse<PointOfSaleAppData>(response);
}
public virtual async Task<AppDataBase> GetApp(string appId, CancellationToken token = default)
{
if (appId == null)
throw new ArgumentNullException(nameof(appId));
var response = await _httpClient.SendAsync(
CreateHttpRequest($"api/v1/apps/{appId}",
method: HttpMethod.Get), token);
return await HandleResponse<AppDataBase>(response);
}
public virtual async Task<AppDataBase[]> GetAllApps(string storeId, CancellationToken token = default)
{
if (storeId == null)
throw new ArgumentNullException(nameof(storeId));
var response = await _httpClient.SendAsync(
CreateHttpRequest($"api/v1/stores/{storeId}/apps",
method: HttpMethod.Get), token);
return await HandleResponse<AppDataBase[]>(response);
}
public virtual async Task<AppDataBase[]> GetAllApps(CancellationToken token = default)
{
var response = await _httpClient.SendAsync(
CreateHttpRequest($"api/v1/apps",
method: HttpMethod.Get), token);
return await HandleResponse<AppDataBase[]>(response);
}
public virtual async Task<PointOfSaleAppData> GetPosApp(string appId, CancellationToken token = default)
{
if (appId == null)
throw new ArgumentNullException(nameof(appId));
var response = await _httpClient.SendAsync(
CreateHttpRequest($"api/v1/apps/pos/{appId}",
method: HttpMethod.Get), token);
return await HandleResponse<PointOfSaleAppData>(response);
}
public virtual async Task<CrowdfundAppData> GetCrowdfundApp(string appId, CancellationToken token = default)
{
if (appId == null)
throw new ArgumentNullException(nameof(appId));
var response = await _httpClient.SendAsync(
CreateHttpRequest($"api/v1/apps/crowdfund/{appId}",
method: HttpMethod.Get), token);
return await HandleResponse<CrowdfundAppData>(response);
}
public virtual async Task DeleteApp(string appId, CancellationToken token = default)
{
if (appId == null)
throw new ArgumentNullException(nameof(appId));
var response = await _httpClient.SendAsync(
CreateHttpRequest($"api/v1/apps/{appId}",
method: HttpMethod.Delete), token);
await HandleResponse(response);
}
}
}

View File

@ -0,0 +1,102 @@
using System.Collections.Generic;
using System.Net.Http;
using System.Threading;
using System.Threading.Tasks;
using BTCPayServer.Client.Models;
namespace BTCPayServer.Client
{
public partial class BTCPayServerClient
{
public virtual async Task<IEnumerable<CustodianAccountData>> GetCustodianAccounts(string storeId, bool includeAssetBalances = false, CancellationToken token = default)
{
var queryPayload = new Dictionary<string, object>();
if (includeAssetBalances)
{
queryPayload.Add("assetBalances", "true");
}
var response = await _httpClient.SendAsync(CreateHttpRequest($"api/v1/stores/{storeId}/custodian-accounts", queryPayload), token);
return await HandleResponse<IEnumerable<CustodianAccountData>>(response);
}
public virtual async Task<CustodianAccountResponse> GetCustodianAccount(string storeId, string accountId, bool includeAssetBalances = false, CancellationToken token = default)
{
var queryPayload = new Dictionary<string, object>();
if (includeAssetBalances)
{
queryPayload.Add("assetBalances", "true");
}
var response = await _httpClient.SendAsync(CreateHttpRequest($"api/v1/stores/{storeId}/custodian-accounts/{accountId}", queryPayload), token);
return await HandleResponse<CustodianAccountResponse>(response);
}
public virtual async Task<CustodianAccountData> CreateCustodianAccount(string storeId, CreateCustodianAccountRequest request, CancellationToken token = default)
{
var response = await _httpClient.SendAsync(CreateHttpRequest($"api/v1/stores/{storeId}/custodian-accounts", bodyPayload: request, method: HttpMethod.Post), token);
return await HandleResponse<CustodianAccountData>(response);
}
public virtual async Task<CustodianAccountData> UpdateCustodianAccount(string storeId, string accountId, CreateCustodianAccountRequest request, CancellationToken token = default)
{
var response = await _httpClient.SendAsync(CreateHttpRequest($"api/v1/stores/{storeId}/custodian-accounts/{accountId}", bodyPayload: request, method: HttpMethod.Put), token);
return await HandleResponse<CustodianAccountData>(response);
}
public virtual async Task DeleteCustodianAccount(string storeId, string accountId, CancellationToken token = default)
{
var response = await _httpClient.SendAsync(CreateHttpRequest($"api/v1/stores/{storeId}/custodian-accounts/{accountId}", method: HttpMethod.Delete), token);
await HandleResponse(response);
}
public virtual async Task<DepositAddressData> GetCustodianAccountDepositAddress(string storeId, string accountId, string paymentMethod, CancellationToken token = default)
{
var response = await _httpClient.SendAsync(CreateHttpRequest($"api/v1/stores/{storeId}/custodian-accounts/{accountId}/addresses/{paymentMethod}"), token);
return await HandleResponse<DepositAddressData>(response);
}
public virtual async Task<MarketTradeResponseData> MarketTradeCustodianAccountAsset(string storeId, string accountId, TradeRequestData request, CancellationToken token = default)
{
//var response = await _httpClient.SendAsync(CreateHttpRequest("api/v1/users", null, request, HttpMethod.Post), token);
//return await HandleResponse<ApplicationUserData>(response);
var internalRequest = CreateHttpRequest($"api/v1/stores/{storeId}/custodian-accounts/{accountId}/trades/market", null,
request, HttpMethod.Post);
var response = await _httpClient.SendAsync(internalRequest, token);
return await HandleResponse<MarketTradeResponseData>(response);
}
public virtual async Task<MarketTradeResponseData> GetCustodianAccountTradeInfo(string storeId, string accountId, string tradeId, CancellationToken token = default)
{
var response = await _httpClient.SendAsync(CreateHttpRequest($"api/v1/stores/{storeId}/custodian-accounts/{accountId}/trades/{tradeId}", method: HttpMethod.Get), token);
return await HandleResponse<MarketTradeResponseData>(response);
}
public virtual async Task<TradeQuoteResponseData> GetCustodianAccountTradeQuote(string storeId, string accountId, string fromAsset, string toAsset, CancellationToken token = default)
{
var queryPayload = new Dictionary<string, object>();
queryPayload.Add("fromAsset", fromAsset);
queryPayload.Add("toAsset", toAsset);
var response = await _httpClient.SendAsync(CreateHttpRequest($"api/v1/stores/{storeId}/custodian-accounts/{accountId}/trades/quote", queryPayload), token);
return await HandleResponse<TradeQuoteResponseData>(response);
}
public virtual async Task<WithdrawalResponseData> CreateCustodianAccountWithdrawal(string storeId, string accountId, WithdrawRequestData request, CancellationToken token = default)
{
var response = await _httpClient.SendAsync(CreateHttpRequest($"api/v1/stores/{storeId}/custodian-accounts/{accountId}/withdrawals", bodyPayload: request, method: HttpMethod.Post), token);
return await HandleResponse<WithdrawalResponseData>(response);
}
public virtual async Task<WithdrawalSimulationResponseData> SimulateCustodianAccountWithdrawal(string storeId, string accountId, WithdrawRequestData request, CancellationToken token = default)
{
var response = await _httpClient.SendAsync(CreateHttpRequest($"api/v1/stores/{storeId}/custodian-accounts/{accountId}/withdrawals/simulation", bodyPayload: request, method: HttpMethod.Post), token);
return await HandleResponse<WithdrawalSimulationResponseData>(response);
}
public virtual async Task<WithdrawalResponseData> GetCustodianAccountWithdrawalInfo(string storeId, string accountId, string paymentMethod, string withdrawalId, CancellationToken token = default)
{
var response = await _httpClient.SendAsync(CreateHttpRequest($"api/v1/stores/{storeId}/custodian-accounts/{accountId}/withdrawals/{paymentMethod}/{withdrawalId}", method: HttpMethod.Get), token);
return await HandleResponse<WithdrawalResponseData>(response);
}
}
}

View File

@ -0,0 +1,16 @@
using System.Collections.Generic;
using System.Threading;
using System.Threading.Tasks;
using BTCPayServer.Client.Models;
namespace BTCPayServer.Client
{
public partial class BTCPayServerClient
{
public virtual async Task<IEnumerable<CustodianData>> GetCustodians(CancellationToken token = default)
{
var response = await _httpClient.SendAsync(CreateHttpRequest("api/v1/custodians"), token);
return await HandleResponse<IEnumerable<CustodianData>>(response);
}
}
}

View File

@ -1,21 +1,56 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net.Http;
using System.Threading;
using System.Threading.Tasks;
using BTCPayServer.Client.Models;
using NBitcoin;
namespace BTCPayServer.Client
{
public partial class BTCPayServerClient
{
public virtual async Task<IEnumerable<InvoiceData>> GetInvoices(string storeId, bool includeArchived = false,
public virtual async Task<IEnumerable<InvoiceData>> GetInvoices(string storeId, string[] orderId = null,
InvoiceStatus[] status = null,
DateTimeOffset? startDate = null,
DateTimeOffset? endDate = null,
string textSearch = null,
bool includeArchived = false,
int? skip = null,
int? take = null,
CancellationToken token = default)
{
Dictionary<string, object> queryPayload = new Dictionary<string, object>();
queryPayload.Add(nameof(includeArchived), includeArchived);
if (startDate is DateTimeOffset s)
queryPayload.Add(nameof(startDate), Utils.DateTimeToUnixTime(s));
if (endDate is DateTimeOffset e)
queryPayload.Add(nameof(endDate), Utils.DateTimeToUnixTime(e));
if (orderId != null)
queryPayload.Add(nameof(orderId), orderId);
if (textSearch != null)
queryPayload.Add(nameof(textSearch), textSearch);
if (status != null)
queryPayload.Add(nameof(status), status.Select(s => s.ToString().ToLower()).ToArray());
if (skip != null)
{
queryPayload.Add(nameof(skip), skip);
}
if (take != null)
{
queryPayload.Add(nameof(take), take);
}
var response =
await _httpClient.SendAsync(
CreateHttpRequest($"api/v1/stores/{storeId}/invoices",
new Dictionary<string, object>() {{nameof(includeArchived), includeArchived}}), token);
queryPayload), token);
return await HandleResponse<IEnumerable<InvoiceData>>(response);
}
@ -70,7 +105,7 @@ namespace BTCPayServer.Client
{
if (request == null)
throw new ArgumentNullException(nameof(request));
if (request.Status!= InvoiceStatus.Settled && request.Status!= InvoiceStatus.Invalid)
if (request.Status != InvoiceStatus.Settled && request.Status != InvoiceStatus.Invalid)
throw new ArgumentOutOfRangeException(nameof(request.Status), "Status can only be Invalid or Complete");
var response = await _httpClient.SendAsync(
CreateHttpRequest($"api/v1/stores/{storeId}/invoices/{invoiceId}/status", bodyPayload: request,
@ -81,9 +116,30 @@ namespace BTCPayServer.Client
public virtual async Task<InvoiceData> UnarchiveInvoice(string storeId, string invoiceId, CancellationToken token = default)
{
var response = await _httpClient.SendAsync(
CreateHttpRequest($"api/v1/stores/{storeId}/invoices/{invoiceId}/unarchive",
CreateHttpRequest($"api/v1/stores/{storeId}/invoices/{invoiceId}/unarchive",
method: HttpMethod.Post), token);
return await HandleResponse<InvoiceData>(response);
}
public virtual async Task ActivateInvoicePaymentMethod(string storeId, string invoiceId, string paymentMethod, CancellationToken token = default)
{
var response = await _httpClient.SendAsync(
CreateHttpRequest($"api/v1/stores/{storeId}/invoices/{invoiceId}/payment-methods/{paymentMethod}/activate",
method: HttpMethod.Post), token);
await HandleResponse(response);
}
public virtual async Task<PullPaymentData> RefundInvoice(
string storeId,
string invoiceId,
RefundInvoiceRequest request,
CancellationToken token = default
)
{
var response = await _httpClient.SendAsync(
CreateHttpRequest($"api/v1/stores/{storeId}/invoices/{invoiceId}/refund", bodyPayload: request,
method: HttpMethod.Post), token);
return await HandleResponse<PullPaymentData>(response);
}
}
}

View File

@ -0,0 +1,59 @@
using System.Collections.Generic;
using System.Net.Http;
using System.Threading;
using System.Threading.Tasks;
using BTCPayServer.Client.Models;
namespace BTCPayServer.Client
{
public partial class BTCPayServerClient
{
public virtual async Task<IEnumerable<LNURLPayPaymentMethodData>>
GetStoreLNURLPayPaymentMethods(string storeId, bool? enabled = null,
CancellationToken token = default)
{
var query = new Dictionary<string, object>();
if (enabled != null)
{
query.Add(nameof(enabled), enabled);
}
var response =
await _httpClient.SendAsync(
CreateHttpRequest($"api/v1/stores/{storeId}/payment-methods/LNURLPay",
query), token);
return await HandleResponse<IEnumerable<LNURLPayPaymentMethodData>>(response);
}
public virtual async Task<LNURLPayPaymentMethodData> GetStoreLNURLPayPaymentMethod(
string storeId,
string cryptoCode, CancellationToken token = default)
{
var response =
await _httpClient.SendAsync(
CreateHttpRequest($"api/v1/stores/{storeId}/payment-methods/LNURLPay/{cryptoCode}"), token);
return await HandleResponse<LNURLPayPaymentMethodData>(response);
}
public virtual async Task RemoveStoreLNURLPayPaymentMethod(string storeId,
string cryptoCode, CancellationToken token = default)
{
var response =
await _httpClient.SendAsync(
CreateHttpRequest($"api/v1/stores/{storeId}/payment-methods/LNURLPay/{cryptoCode}",
method: HttpMethod.Delete), token);
await HandleResponse(response);
}
public virtual async Task<LNURLPayPaymentMethodData> UpdateStoreLNURLPayPaymentMethod(
string storeId,
string cryptoCode, LNURLPayPaymentMethodData paymentMethod,
CancellationToken token = default)
{
var response = await _httpClient.SendAsync(
CreateHttpRequest($"api/v1/stores/{storeId}/payment-methods/LNURLPay/{cryptoCode}",
bodyPayload: paymentMethod, method: HttpMethod.Put), token);
return await HandleResponse<LNURLPayPaymentMethodData>(response);
}
}
}

View File

@ -9,7 +9,7 @@ namespace BTCPayServer.Client
{
public partial class BTCPayServerClient
{
public async Task<LightningNodeInformationData> GetLightningNodeInfo(string cryptoCode,
public virtual async Task<LightningNodeInformationData> GetLightningNodeInfo(string cryptoCode,
CancellationToken token = default)
{
var response = await _httpClient.SendAsync(
@ -18,7 +18,16 @@ namespace BTCPayServer.Client
return await HandleResponse<LightningNodeInformationData>(response);
}
public async Task ConnectToLightningNode(string cryptoCode, ConnectToNodeRequest request,
public virtual async Task<LightningNodeBalanceData> GetLightningNodeBalance(string cryptoCode,
CancellationToken token = default)
{
var response = await _httpClient.SendAsync(
CreateHttpRequest($"api/v1/server/lightning/{cryptoCode}/balance",
method: HttpMethod.Get), token);
return await HandleResponse<LightningNodeBalanceData>(response);
}
public virtual async Task ConnectToLightningNode(string cryptoCode, ConnectToNodeRequest request,
CancellationToken token = default)
{
if (request == null)
@ -29,7 +38,7 @@ namespace BTCPayServer.Client
await HandleResponse(response);
}
public async Task<IEnumerable<LightningChannelData>> GetLightningNodeChannels(string cryptoCode,
public virtual async Task<IEnumerable<LightningChannelData>> GetLightningNodeChannels(string cryptoCode,
CancellationToken token = default)
{
var response = await _httpClient.SendAsync(
@ -38,24 +47,23 @@ namespace BTCPayServer.Client
return await HandleResponse<IEnumerable<LightningChannelData>>(response);
}
public async Task<string> OpenLightningChannel(string cryptoCode, OpenLightningChannelRequest request,
public virtual async Task OpenLightningChannel(string cryptoCode, OpenLightningChannelRequest request,
CancellationToken token = default)
{
var response = await _httpClient.SendAsync(
CreateHttpRequest($"api/v1/server/lightning/{cryptoCode}/channels", bodyPayload: request,
method: HttpMethod.Post), token);
return await HandleResponse<string>(response);
await HandleResponse(response);
}
public async Task<string> GetLightningDepositAddress(string cryptoCode, CancellationToken token = default)
public virtual async Task<string> GetLightningDepositAddress(string cryptoCode, CancellationToken token = default)
{
var response = await _httpClient.SendAsync(
CreateHttpRequest($"api/v1/server/lightning/{cryptoCode}/address", method: HttpMethod.Post), token);
return await HandleResponse<string>(response);
}
public async Task PayLightningInvoice(string cryptoCode, PayLightningInvoiceRequest request,
public virtual async Task<LightningPaymentData> PayLightningInvoice(string cryptoCode, PayLightningInvoiceRequest request,
CancellationToken token = default)
{
if (request == null)
@ -63,10 +71,21 @@ namespace BTCPayServer.Client
var response = await _httpClient.SendAsync(
CreateHttpRequest($"api/v1/server/lightning/{cryptoCode}/invoices/pay", bodyPayload: request,
method: HttpMethod.Post), token);
await HandleResponse(response);
return await HandleResponse<LightningPaymentData>(response);
}
public async Task<LightningInvoiceData> GetLightningInvoice(string cryptoCode,
public virtual async Task<LightningPaymentData> GetLightningPayment(string cryptoCode,
string paymentHash, CancellationToken token = default)
{
if (paymentHash == null)
throw new ArgumentNullException(nameof(paymentHash));
var response = await _httpClient.SendAsync(
CreateHttpRequest($"api/v1/server/lightning/{cryptoCode}/payments/{paymentHash}",
method: HttpMethod.Get), token);
return await HandleResponse<LightningPaymentData>(response);
}
public virtual async Task<LightningInvoiceData> GetLightningInvoice(string cryptoCode,
string invoiceId, CancellationToken token = default)
{
if (invoiceId == null)
@ -77,7 +96,43 @@ namespace BTCPayServer.Client
return await HandleResponse<LightningInvoiceData>(response);
}
public async Task<LightningInvoiceData> CreateLightningInvoice(string cryptoCode, CreateLightningInvoiceRequest request,
public virtual async Task<LightningInvoiceData[]> GetLightningInvoices(string cryptoCode,
bool? pendingOnly = null, long? offsetIndex = null, CancellationToken token = default)
{
var queryPayload = new Dictionary<string, object>();
if (pendingOnly is bool v)
{
queryPayload.Add("pendingOnly", v.ToString());
}
if (offsetIndex is > 0)
{
queryPayload.Add("offsetIndex", offsetIndex);
}
var response = await _httpClient.SendAsync(
CreateHttpRequest($"api/v1/server/lightning/{cryptoCode}/invoices", queryPayload), token);
return await HandleResponse<LightningInvoiceData[]>(response);
}
public virtual async Task<LightningPaymentData[]> GetLightningPayments(string cryptoCode,
bool? includePending = null, long? offsetIndex = null, CancellationToken token = default)
{
var queryPayload = new Dictionary<string, object>();
if (includePending is bool v)
{
queryPayload.Add("includePending", v.ToString());
}
if (offsetIndex is > 0)
{
queryPayload.Add("offsetIndex", offsetIndex);
}
var response = await _httpClient.SendAsync(
CreateHttpRequest($"api/v1/server/lightning/{cryptoCode}/payments", queryPayload), token);
return await HandleResponse<LightningPaymentData[]>(response);
}
public virtual async Task<LightningInvoiceData> CreateLightningInvoice(string cryptoCode, CreateLightningInvoiceRequest request,
CancellationToken token = default)
{
if (request == null)

View File

@ -9,7 +9,7 @@ namespace BTCPayServer.Client
{
public partial class BTCPayServerClient
{
public async Task<LightningNodeInformationData> GetLightningNodeInfo(string storeId, string cryptoCode,
public virtual async Task<LightningNodeInformationData> GetLightningNodeInfo(string storeId, string cryptoCode,
CancellationToken token = default)
{
var response = await _httpClient.SendAsync(
@ -18,7 +18,16 @@ namespace BTCPayServer.Client
return await HandleResponse<LightningNodeInformationData>(response);
}
public async Task ConnectToLightningNode(string storeId, string cryptoCode, ConnectToNodeRequest request,
public virtual async Task<LightningNodeBalanceData> GetLightningNodeBalance(string storeId, string cryptoCode,
CancellationToken token = default)
{
var response = await _httpClient.SendAsync(
CreateHttpRequest($"api/v1/stores/{storeId}/lightning/{cryptoCode}/balance",
method: HttpMethod.Get), token);
return await HandleResponse<LightningNodeBalanceData>(response);
}
public virtual async Task ConnectToLightningNode(string storeId, string cryptoCode, ConnectToNodeRequest request,
CancellationToken token = default)
{
if (request == null)
@ -29,7 +38,7 @@ namespace BTCPayServer.Client
await HandleResponse(response);
}
public async Task<IEnumerable<LightningChannelData>> GetLightningNodeChannels(string storeId, string cryptoCode,
public virtual async Task<IEnumerable<LightningChannelData>> GetLightningNodeChannels(string storeId, string cryptoCode,
CancellationToken token = default)
{
var response = await _httpClient.SendAsync(
@ -38,16 +47,16 @@ namespace BTCPayServer.Client
return await HandleResponse<IEnumerable<LightningChannelData>>(response);
}
public async Task<string> OpenLightningChannel(string storeId, string cryptoCode, OpenLightningChannelRequest request,
public virtual async Task OpenLightningChannel(string storeId, string cryptoCode, OpenLightningChannelRequest request,
CancellationToken token = default)
{
var response = await _httpClient.SendAsync(
CreateHttpRequest($"api/v1/stores/{storeId}/lightning/{cryptoCode}/channels", bodyPayload: request,
method: HttpMethod.Post), token);
return await HandleResponse<string>(response);
await HandleResponse(response);
}
public async Task<string> GetLightningDepositAddress(string storeId, string cryptoCode,
public virtual async Task<string> GetLightningDepositAddress(string storeId, string cryptoCode,
CancellationToken token = default)
{
var response = await _httpClient.SendAsync(
@ -56,7 +65,7 @@ namespace BTCPayServer.Client
return await HandleResponse<string>(response);
}
public async Task PayLightningInvoice(string storeId, string cryptoCode, PayLightningInvoiceRequest request,
public virtual async Task<LightningPaymentData> PayLightningInvoice(string storeId, string cryptoCode, PayLightningInvoiceRequest request,
CancellationToken token = default)
{
if (request == null)
@ -64,10 +73,21 @@ namespace BTCPayServer.Client
var response = await _httpClient.SendAsync(
CreateHttpRequest($"api/v1/stores/{storeId}/lightning/{cryptoCode}/invoices/pay", bodyPayload: request,
method: HttpMethod.Post), token);
await HandleResponse(response);
return await HandleResponse<LightningPaymentData>(response);
}
public async Task<LightningInvoiceData> GetLightningInvoice(string storeId, string cryptoCode,
public virtual async Task<LightningPaymentData> GetLightningPayment(string storeId, string cryptoCode,
string paymentHash, CancellationToken token = default)
{
if (paymentHash == null)
throw new ArgumentNullException(nameof(paymentHash));
var response = await _httpClient.SendAsync(
CreateHttpRequest($"api/v1/stores/{storeId}/lightning/{cryptoCode}/payments/{paymentHash}",
method: HttpMethod.Get), token);
return await HandleResponse<LightningPaymentData>(response);
}
public virtual async Task<LightningInvoiceData> GetLightningInvoice(string storeId, string cryptoCode,
string invoiceId, CancellationToken token = default)
{
if (invoiceId == null)
@ -78,7 +98,43 @@ namespace BTCPayServer.Client
return await HandleResponse<LightningInvoiceData>(response);
}
public async Task<LightningInvoiceData> CreateLightningInvoice(string storeId, string cryptoCode,
public virtual async Task<LightningInvoiceData[]> GetLightningInvoices(string storeId, string cryptoCode,
bool? pendingOnly = null, long? offsetIndex = null, CancellationToken token = default)
{
var queryPayload = new Dictionary<string, object>();
if (pendingOnly is bool v)
{
queryPayload.Add("pendingOnly", v.ToString());
}
if (offsetIndex is > 0)
{
queryPayload.Add("offsetIndex", offsetIndex);
}
var response = await _httpClient.SendAsync(
CreateHttpRequest($"api/v1/stores/{storeId}/lightning/{cryptoCode}/invoices", queryPayload), token);
return await HandleResponse<LightningInvoiceData[]>(response);
}
public virtual async Task<LightningPaymentData[]> GetLightningPayments(string storeId, string cryptoCode,
bool? includePending = null, long? offsetIndex = null, CancellationToken token = default)
{
var queryPayload = new Dictionary<string, object>();
if (includePending is bool v)
{
queryPayload.Add("includePending", v.ToString());
}
if (offsetIndex is > 0)
{
queryPayload.Add("offsetIndex", offsetIndex);
}
var response = await _httpClient.SendAsync(
CreateHttpRequest($"api/v1/stores/{storeId}/lightning/{cryptoCode}/payments", queryPayload), token);
return await HandleResponse<LightningPaymentData[]>(response);
}
public virtual async Task<LightningInvoiceData> CreateLightningInvoice(string storeId, string cryptoCode,
CreateLightningInvoiceRequest request, CancellationToken token = default)
{
if (request == null)

View File

@ -0,0 +1,48 @@
using System.Net.Http;
using System.Threading;
using System.Threading.Tasks;
using BTCPayServer.Client.Models;
namespace BTCPayServer.Client
{
public partial class BTCPayServerClient
{
public virtual async Task<LightningAddressData[]> GetStoreLightningAddresses(string storeId,
CancellationToken token = default)
{
var response = await _httpClient.SendAsync(
CreateHttpRequest($"api/v1/stores/{storeId}/lightning-addresses",
method: HttpMethod.Get), token);
return await HandleResponse<LightningAddressData[]>(response);
}
public virtual async Task<LightningAddressData> GetStoreLightningAddress(string storeId, string username,
CancellationToken token = default)
{
var response = await _httpClient.SendAsync(
CreateHttpRequest($"api/v1/stores/{storeId}/lightning-addresses/{username}",
method: HttpMethod.Get), token);
return await HandleResponse<LightningAddressData>(response);
}
public virtual async Task RemoveStoreLightningAddress(string storeId, string username,
CancellationToken token = default)
{
var response = await _httpClient.SendAsync(
CreateHttpRequest($"api/v1/stores/{storeId}/lightning-addresses/{username}",
method: HttpMethod.Delete), token);
await HandleResponse(response);
}
public virtual async Task<LightningAddressData> AddOrUpdateStoreLightningAddress(string storeId,
string username, LightningAddressData data,
CancellationToken token = default)
{
var response = await _httpClient.SendAsync(
CreateHttpRequest($"api/v1/stores/{storeId}/lightning-addresses/{username}",
method: HttpMethod.Post, bodyPayload: data), token);
return await HandleResponse<LightningAddressData>(response);
}
}
}

View File

@ -0,0 +1,59 @@
using System.Collections.Generic;
using System.Net.Http;
using System.Threading;
using System.Threading.Tasks;
using BTCPayServer.Client.Models;
namespace BTCPayServer.Client
{
public partial class BTCPayServerClient
{
public virtual async Task<IEnumerable<LightningNetworkPaymentMethodData>>
GetStoreLightningNetworkPaymentMethods(string storeId, bool? enabled = null,
CancellationToken token = default)
{
var query = new Dictionary<string, object>();
if (enabled != null)
{
query.Add(nameof(enabled), enabled);
}
var response =
await _httpClient.SendAsync(
CreateHttpRequest($"api/v1/stores/{storeId}/payment-methods/LightningNetwork",
query), token);
return await HandleResponse<IEnumerable<LightningNetworkPaymentMethodData>>(response);
}
public virtual async Task<LightningNetworkPaymentMethodData> GetStoreLightningNetworkPaymentMethod(
string storeId,
string cryptoCode, CancellationToken token = default)
{
var response =
await _httpClient.SendAsync(
CreateHttpRequest($"api/v1/stores/{storeId}/payment-methods/LightningNetwork/{cryptoCode}"), token);
return await HandleResponse<LightningNetworkPaymentMethodData>(response);
}
public virtual async Task RemoveStoreLightningNetworkPaymentMethod(string storeId,
string cryptoCode, CancellationToken token = default)
{
var response =
await _httpClient.SendAsync(
CreateHttpRequest($"api/v1/stores/{storeId}/payment-methods/LightningNetwork/{cryptoCode}",
method: HttpMethod.Delete), token);
await HandleResponse(response);
}
public virtual async Task<LightningNetworkPaymentMethodData> UpdateStoreLightningNetworkPaymentMethod(
string storeId,
string cryptoCode, UpdateLightningNetworkPaymentMethodRequest paymentMethod,
CancellationToken token = default)
{
var response = await _httpClient.SendAsync(
CreateHttpRequest($"api/v1/stores/{storeId}/payment-methods/LightningNetwork/{cryptoCode}",
bodyPayload: paymentMethod, method: HttpMethod.Put), token);
return await HandleResponse<LightningNetworkPaymentMethodData>(response);
}
}
}

View File

@ -0,0 +1,23 @@
using System;
using System.Collections.Generic;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
using BTCPayServer.Client.Models;
namespace BTCPayServer.Client
{
public partial class BTCPayServerClient
{
public virtual async Task<PermissionMetadata[]> GetPermissionMetadata(CancellationToken token = default)
{
var response = await _httpClient.SendAsync(CreateHttpRequest("misc/permissions"), token);
return await HandleResponse<PermissionMetadata[]>(response);
}
public virtual async Task<Language[]> GetAvailableLanguages(CancellationToken token = default)
{
var response = await _httpClient.SendAsync(CreateHttpRequest("misc/lang"), token);
return await HandleResponse<Language[]>(response);
}
}
}

View File

@ -9,13 +9,22 @@ namespace BTCPayServer.Client
{
public partial class BTCPayServerClient
{
public virtual async Task<IEnumerable<NotificationData>> GetNotifications(bool? seen = null,
CancellationToken token = default)
public virtual async Task<IEnumerable<NotificationData>> GetNotifications(bool? seen = null, int? skip = null,
int? take = null, CancellationToken token = default)
{
var response =
await _httpClient.SendAsync(
CreateHttpRequest($"api/v1/users/me/notifications",
seen != null ? new Dictionary<string, object>() {{nameof(seen), seen}} : null), token);
Dictionary<string, object> queryPayload = new Dictionary<string, object>();
if (seen != null)
queryPayload.Add(nameof(seen), seen);
if (skip != null)
queryPayload.Add(nameof(skip), skip);
if (take != null)
queryPayload.Add(nameof(take), take);
var response = await _httpClient.SendAsync(
CreateHttpRequest($"api/v1/users/me/notifications",
queryPayload), token);
return await HandleResponse<IEnumerable<NotificationData>>(response);
}
@ -32,7 +41,7 @@ namespace BTCPayServer.Client
{
var response = await _httpClient.SendAsync(
CreateHttpRequest($"api/v1/users/me/notifications/{notificationId}",
method: HttpMethod.Put, bodyPayload: new UpdateNotification() {Seen = seen}), token);
method: HttpMethod.Put, bodyPayload: new UpdateNotification() { Seen = seen }), token);
return await HandleResponse<NotificationData>(response);
}

View File

@ -9,11 +9,19 @@ namespace BTCPayServer.Client
public partial class BTCPayServerClient
{
public virtual async Task<IEnumerable<OnChainPaymentMethodData>> GetStoreOnChainPaymentMethods(string storeId,
bool? enabled = null,
CancellationToken token = default)
{
var query = new Dictionary<string, object>();
if (enabled != null)
{
query.Add(nameof(enabled), enabled);
}
var response =
await _httpClient.SendAsync(
CreateHttpRequest($"api/v1/stores/{storeId}/payment-methods/Onchain"), token);
CreateHttpRequest($"api/v1/stores/{storeId}/payment-methods/onchain",
query), token);
return await HandleResponse<IEnumerable<OnChainPaymentMethodData>>(response);
}
@ -22,7 +30,7 @@ namespace BTCPayServer.Client
{
var response =
await _httpClient.SendAsync(
CreateHttpRequest($"api/v1/stores/{storeId}/payment-methods/Onchain/{cryptoCode}"), token);
CreateHttpRequest($"api/v1/stores/{storeId}/payment-methods/onchain/{cryptoCode}"), token);
return await HandleResponse<OnChainPaymentMethodData>(response);
}
@ -31,31 +39,31 @@ namespace BTCPayServer.Client
{
var response =
await _httpClient.SendAsync(
CreateHttpRequest($"api/v1/stores/{storeId}/payment-methods/Onchain/{cryptoCode}",
CreateHttpRequest($"api/v1/stores/{storeId}/payment-methods/onchain/{cryptoCode}",
method: HttpMethod.Delete), token);
await HandleResponse(response);
}
public virtual async Task<OnChainPaymentMethodData> UpdateStoreOnChainPaymentMethod(string storeId,
string cryptoCode, OnChainPaymentMethodData paymentMethod,
string cryptoCode, UpdateOnChainPaymentMethodRequest paymentMethod,
CancellationToken token = default)
{
var response = await _httpClient.SendAsync(
CreateHttpRequest($"api/v1/stores/{storeId}/payment-methods/Onchain/{cryptoCode}",
CreateHttpRequest($"api/v1/stores/{storeId}/payment-methods/onchain/{cryptoCode}",
bodyPayload: paymentMethod, method: HttpMethod.Put), token);
return await HandleResponse<OnChainPaymentMethodData>(response);
}
public virtual async Task<OnChainPaymentMethodPreviewResultData>
PreviewProposedStoreOnChainPaymentMethodAddresses(
string storeId, string cryptoCode, OnChainPaymentMethodData paymentMethod, int offset = 0,
string storeId, string cryptoCode, UpdateOnChainPaymentMethodRequest paymentMethod, int offset = 0,
int amount = 10,
CancellationToken token = default)
{
var response = await _httpClient.SendAsync(
CreateHttpRequest($"api/v1/stores/{storeId}/payment-methods/Onchain/{cryptoCode}/preview",
CreateHttpRequest($"api/v1/stores/{storeId}/payment-methods/onchain/{cryptoCode}/preview",
bodyPayload: paymentMethod,
queryPayload: new Dictionary<string, object>() {{"offset", offset}, {"amount", amount}},
queryPayload: new Dictionary<string, object>() { { "offset", offset }, { "amount", amount } },
method: HttpMethod.Post), token);
return await HandleResponse<OnChainPaymentMethodPreviewResultData>(response);
}
@ -65,10 +73,22 @@ namespace BTCPayServer.Client
CancellationToken token = default)
{
var response = await _httpClient.SendAsync(
CreateHttpRequest($"api/v1/stores/{storeId}/payment-methods/Onchain/{cryptoCode}/preview",
queryPayload: new Dictionary<string, object>() {{"offset", offset}, {"amount", amount}},
CreateHttpRequest($"api/v1/stores/{storeId}/payment-methods/onchain/{cryptoCode}/preview",
queryPayload: new Dictionary<string, object>() { { "offset", offset }, { "amount", amount } },
method: HttpMethod.Get), token);
return await HandleResponse<OnChainPaymentMethodPreviewResultData>(response);
}
public virtual async Task<OnChainPaymentMethodDataWithSensitiveData> GenerateOnChainWallet(string storeId,
string cryptoCode, GenerateOnChainWalletRequest request,
CancellationToken token = default)
{
var response = await _httpClient.SendAsync(
CreateHttpRequest($"api/v1/stores/{storeId}/payment-methods/onchain/{cryptoCode}/generate",
bodyPayload: request,
method: HttpMethod.Post), token);
return await HandleResponse<OnChainPaymentMethodDataWithSensitiveData>(response);
}
}
}

View File

@ -0,0 +1,82 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net.Http;
using System.Threading;
using System.Threading.Tasks;
using BTCPayServer.Client.Models;
using NBitcoin;
namespace BTCPayServer.Client
{
public partial class BTCPayServerClient
{
public virtual async Task<OnChainWalletObjectData> GetOnChainWalletObject(string storeId, string cryptoCode, OnChainWalletObjectId objectId, bool? includeNeighbourData = null, CancellationToken token = default)
{
Dictionary<string, object> parameters = new Dictionary<string, object>();
if (includeNeighbourData is bool v)
parameters.Add("includeNeighbourData", v);
var response =
await _httpClient.SendAsync(
CreateHttpRequest($"api/v1/stores/{storeId}/payment-methods/onchain/{cryptoCode}/wallet/objects/{objectId.Type}/{objectId.Id}", parameters, method: HttpMethod.Get), token);
try
{
return await HandleResponse<OnChainWalletObjectData>(response);
}
catch (GreenfieldAPIException err) when (err.APIError.Code == "wallet-object-not-found")
{
return null;
}
}
public virtual async Task<OnChainWalletObjectData[]> GetOnChainWalletObjects(string storeId, string cryptoCode, GetWalletObjectsRequest query = null, CancellationToken token = default)
{
Dictionary<string, object> parameters = new Dictionary<string, object>();
if (query?.Type is string s)
parameters.Add("type", s);
if (query?.Ids is string[] ids)
parameters.Add("ids", ids);
if (query?.IncludeNeighbourData is bool v)
parameters.Add("includeNeighbourData", v);
var response =
await _httpClient.SendAsync(
CreateHttpRequest($"api/v1/stores/{storeId}/payment-methods/onchain/{cryptoCode}/wallet/objects", parameters, method: HttpMethod.Get), token);
return await HandleResponse<OnChainWalletObjectData[]>(response);
}
public virtual async Task RemoveOnChainWalletObject(string storeId, string cryptoCode, OnChainWalletObjectId objectId,
CancellationToken token = default)
{
var response =
await _httpClient.SendAsync(
CreateHttpRequest($"api/v1/stores/{storeId}/payment-methods/onchain/{cryptoCode}/wallet/objects/{objectId.Type}/{objectId.Id}", method: HttpMethod.Delete), token);
await HandleResponse(response);
}
public virtual async Task<OnChainWalletObjectData> AddOrUpdateOnChainWalletObject(string storeId, string cryptoCode, AddOnChainWalletObjectRequest request,
CancellationToken token = default)
{
var response =
await _httpClient.SendAsync(
CreateHttpRequest($"api/v1/stores/{storeId}/payment-methods/onchain/{cryptoCode}/wallet/objects", method: HttpMethod.Post, bodyPayload: request), token);
return await HandleResponse<OnChainWalletObjectData>(response);
}
public virtual async Task AddOrUpdateOnChainWalletLink(string storeId, string cryptoCode,
OnChainWalletObjectId objectId,
AddOnChainWalletObjectLinkRequest request = null,
CancellationToken token = default)
{
var response =
await _httpClient.SendAsync(
CreateHttpRequest($"api/v1/stores/{storeId}/payment-methods/onchain/{cryptoCode}/wallet/objects/{objectId.Type}/{objectId.Id}/links", method: HttpMethod.Post, bodyPayload: request), token);
await HandleResponse(response);
}
public virtual async Task RemoveOnChainWalletLinks(string storeId, string cryptoCode,
OnChainWalletObjectId objectId,
OnChainWalletObjectId link,
CancellationToken token = default)
{
var response =
await _httpClient.SendAsync(
CreateHttpRequest($"api/v1/stores/{storeId}/payment-methods/onchain/{cryptoCode}/wallet/objects/{objectId.Type}/{objectId.Id}/links/{link.Type}/{link.Id}", method: HttpMethod.Delete), token);
await HandleResponse(response);
}
}
}

View File

@ -0,0 +1,140 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net.Http;
using System.Threading;
using System.Threading.Tasks;
using BTCPayServer.Client.Models;
using NBitcoin;
namespace BTCPayServer.Client
{
public partial class BTCPayServerClient
{
public virtual async Task<OnChainWalletOverviewData> ShowOnChainWalletOverview(string storeId, string cryptoCode,
CancellationToken token = default)
{
var response =
await _httpClient.SendAsync(
CreateHttpRequest($"api/v1/stores/{storeId}/payment-methods/onchain/{cryptoCode}/wallet"), token);
return await HandleResponse<OnChainWalletOverviewData>(response);
}
public virtual async Task<OnChainWalletFeeRateData> GetOnChainFeeRate(string storeId, string cryptoCode, int? blockTarget = null,
CancellationToken token = default)
{
Dictionary<string, object> queryParams = new Dictionary<string, object>();
if (blockTarget != null)
{
queryParams.Add("blockTarget", blockTarget);
}
var response =
await _httpClient.SendAsync(
CreateHttpRequest($"api/v1/stores/{storeId}/payment-methods/onchain/{cryptoCode}/wallet/feeRate", queryParams), token);
return await HandleResponse<OnChainWalletFeeRateData>(response);
}
public virtual async Task<OnChainWalletAddressData> GetOnChainWalletReceiveAddress(string storeId, string cryptoCode, bool forceGenerate = false,
CancellationToken token = default)
{
var response =
await _httpClient.SendAsync(
CreateHttpRequest($"api/v1/stores/{storeId}/payment-methods/onchain/{cryptoCode}/wallet/address", new Dictionary<string, object>()
{
{"forceGenerate", forceGenerate}
}), token);
return await HandleResponse<OnChainWalletAddressData>(response);
}
public virtual async Task UnReserveOnChainWalletReceiveAddress(string storeId, string cryptoCode,
CancellationToken token = default)
{
var response =
await _httpClient.SendAsync(
CreateHttpRequest($"api/v1/stores/{storeId}/payment-methods/onchain/{cryptoCode}/wallet/address", method: HttpMethod.Delete), token);
await HandleResponse(response);
}
public virtual async Task<IEnumerable<OnChainWalletTransactionData>> ShowOnChainWalletTransactions(
string storeId, string cryptoCode, TransactionStatus[] statusFilter = null, string labelFilter = null,
CancellationToken token = default)
{
var query = new Dictionary<string, object>();
if (statusFilter?.Any() is true)
{
query.Add(nameof(statusFilter), statusFilter);
}
if (labelFilter != null)
{
query.Add(nameof(labelFilter), labelFilter);
}
var response =
await _httpClient.SendAsync(
CreateHttpRequest($"api/v1/stores/{storeId}/payment-methods/onchain/{cryptoCode}/wallet/transactions", query), token);
return await HandleResponse<IEnumerable<OnChainWalletTransactionData>>(response);
}
public virtual async Task<OnChainWalletTransactionData> GetOnChainWalletTransaction(
string storeId, string cryptoCode, string transactionId,
CancellationToken token = default)
{
var response =
await _httpClient.SendAsync(
CreateHttpRequest($"api/v1/stores/{storeId}/payment-methods/onchain/{cryptoCode}/wallet/transactions/{transactionId}"), token);
return await HandleResponse<OnChainWalletTransactionData>(response);
}
public virtual async Task<OnChainWalletTransactionData> PatchOnChainWalletTransaction(
string storeId, string cryptoCode, string transactionId,
PatchOnChainTransactionRequest request,
bool force = false, CancellationToken token = default)
{
var response =
await _httpClient.SendAsync(
CreateHttpRequest($"api/v1/stores/{storeId}/payment-methods/onchain/{cryptoCode}/wallet/transactions/{transactionId}", queryPayload: new Dictionary<string, object>()
{
{"force", force}
}, bodyPayload: request, HttpMethod.Patch), token);
return await HandleResponse<OnChainWalletTransactionData>(response);
}
public virtual async Task<IEnumerable<OnChainWalletUTXOData>> GetOnChainWalletUTXOs(string storeId,
string cryptoCode,
CancellationToken token = default)
{
var response =
await _httpClient.SendAsync(
CreateHttpRequest($"api/v1/stores/{storeId}/payment-methods/onchain/{cryptoCode}/wallet/utxos"), token);
return await HandleResponse<IEnumerable<OnChainWalletUTXOData>>(response);
}
public virtual async Task<OnChainWalletTransactionData> CreateOnChainTransaction(string storeId,
string cryptoCode, CreateOnChainTransactionRequest request,
CancellationToken token = default)
{
if (!request.ProceedWithBroadcast)
{
throw new ArgumentOutOfRangeException(nameof(request.ProceedWithBroadcast),
"Please use CreateOnChainTransactionButDoNotBroadcast when wanting to only create the transaction");
}
var response =
await _httpClient.SendAsync(
CreateHttpRequest($"api/v1/stores/{storeId}/payment-methods/onchain/{cryptoCode}/wallet/transactions", null, request, HttpMethod.Post), token);
return await HandleResponse<OnChainWalletTransactionData>(response);
}
public virtual async Task<Transaction> CreateOnChainTransactionButDoNotBroadcast(string storeId,
string cryptoCode, CreateOnChainTransactionRequest request, Network network,
CancellationToken token = default)
{
if (request.ProceedWithBroadcast)
{
throw new ArgumentOutOfRangeException(nameof(request.ProceedWithBroadcast),
"Please use CreateOnChainTransaction when wanting to also broadcast the transaction");
}
var response =
await _httpClient.SendAsync(
CreateHttpRequest($"api/v1/stores/{storeId}/payment-methods/onchain/{cryptoCode}/wallet/transactions", null, request, HttpMethod.Post), token);
return Transaction.Parse(await HandleResponse<string>(response), network);
}
}
}

View File

@ -16,7 +16,7 @@ namespace BTCPayServer.Client
var response =
await _httpClient.SendAsync(
CreateHttpRequest($"api/v1/stores/{storeId}/payment-requests",
new Dictionary<string, object>() {{nameof(includeArchived), includeArchived}}), token);
new Dictionary<string, object>() { { nameof(includeArchived), includeArchived } }), token);
return await HandleResponse<IEnumerable<PaymentRequestData>>(response);
}
@ -37,6 +37,20 @@ namespace BTCPayServer.Client
await HandleResponse(response);
}
public virtual async Task<Client.Models.InvoiceData> PayPaymentRequest(string storeId, string paymentRequestId, PayPaymentRequestRequest request, CancellationToken token = default)
{
if (request == null)
throw new ArgumentNullException(nameof(request));
if (storeId is null)
throw new ArgumentNullException(nameof(storeId));
if (paymentRequestId is null)
throw new ArgumentNullException(nameof(paymentRequestId));
var response = await _httpClient.SendAsync(
CreateHttpRequest($"api/v1/stores/{storeId}/payment-requests/{paymentRequestId}/pay", bodyPayload: request,
method: HttpMethod.Post), token);
return await HandleResponse<Client.Models.InvoiceData>(response);
}
public virtual async Task<PaymentRequestData> CreatePaymentRequest(string storeId,
CreatePaymentRequestRequest request, CancellationToken token = default)
{

View File

@ -0,0 +1,18 @@
#nullable enable
using System.Collections.Generic;
using System.Threading;
using System.Threading.Tasks;
using BTCPayServer.Client.Models;
namespace BTCPayServer.Client
{
public partial class BTCPayServerClient
{
public virtual async Task<IEnumerable<PayoutProcessorData>> GetPayoutProcessors(
CancellationToken token = default)
{
var response = await _httpClient.SendAsync(CreateHttpRequest("api/v1/payout-processors"), token);
return await HandleResponse<IEnumerable<PayoutProcessorData>>(response);
}
}
}

View File

@ -9,18 +9,18 @@ namespace BTCPayServer.Client
{
public partial class BTCPayServerClient
{
public async Task<PullPaymentData> CreatePullPayment(string storeId, CreatePullPaymentRequest request, CancellationToken cancellationToken = default)
public virtual async Task<PullPaymentData> CreatePullPayment(string storeId, CreatePullPaymentRequest request, CancellationToken cancellationToken = default)
{
var response = await _httpClient.SendAsync(CreateHttpRequest($"api/v1/stores/{HttpUtility.UrlEncode(storeId)}/pull-payments", bodyPayload: request, method: HttpMethod.Post), cancellationToken);
return await HandleResponse<PullPaymentData>(response);
}
public async Task<PullPaymentData> GetPullPayment(string pullPaymentId, CancellationToken cancellationToken = default)
public virtual async Task<PullPaymentData> GetPullPayment(string pullPaymentId, CancellationToken cancellationToken = default)
{
var response = await _httpClient.SendAsync(CreateHttpRequest($"api/v1/pull-payments/{HttpUtility.UrlEncode(pullPaymentId)}", method: HttpMethod.Get), cancellationToken);
return await HandleResponse<PullPaymentData>(response);
}
public async Task<PullPaymentData[]> GetPullPayments(string storeId, bool includeArchived = false, CancellationToken cancellationToken = default)
public virtual async Task<PullPaymentData[]> GetPullPayments(string storeId, bool includeArchived = false, CancellationToken cancellationToken = default)
{
Dictionary<string, object> query = new Dictionary<string, object>();
query.Add("includeArchived", includeArchived);
@ -28,34 +28,84 @@ namespace BTCPayServer.Client
return await HandleResponse<PullPaymentData[]>(response);
}
public async Task ArchivePullPayment(string storeId, string pullPaymentId, CancellationToken cancellationToken = default)
public virtual async Task ArchivePullPayment(string storeId, string pullPaymentId, CancellationToken cancellationToken = default)
{
var response = await _httpClient.SendAsync(CreateHttpRequest($"api/v1/stores/{HttpUtility.UrlEncode(storeId)}/pull-payments/{HttpUtility.UrlEncode(pullPaymentId)}", method: HttpMethod.Delete), cancellationToken);
await HandleResponse(response);
}
public async Task<PayoutData[]> GetPayouts(string pullPaymentId, bool includeCancelled = false, CancellationToken cancellationToken = default)
public virtual async Task<PayoutData[]> GetPayouts(string pullPaymentId, bool includeCancelled = false, CancellationToken cancellationToken = default)
{
Dictionary<string, object> query = new Dictionary<string, object>();
query.Add("includeCancelled", includeCancelled);
var response = await _httpClient.SendAsync(CreateHttpRequest($"api/v1/pull-payments/{HttpUtility.UrlEncode(pullPaymentId)}/payouts", queryPayload: query, method: HttpMethod.Get), cancellationToken);
return await HandleResponse<PayoutData[]>(response);
}
public async Task<PayoutData> CreatePayout(string pullPaymentId, CreatePayoutRequest payoutRequest, CancellationToken cancellationToken = default)
public virtual async Task<PayoutData[]> GetStorePayouts(string storeId, bool includeCancelled = false, CancellationToken cancellationToken = default)
{
Dictionary<string, object> query = new Dictionary<string, object>();
query.Add("includeCancelled", includeCancelled);
var response = await _httpClient.SendAsync(CreateHttpRequest($"api/v1/stores/{storeId}/payouts", queryPayload: query, method: HttpMethod.Get), cancellationToken);
return await HandleResponse<PayoutData[]>(response);
}
public virtual async Task<PayoutData> CreatePayout(string pullPaymentId, CreatePayoutRequest payoutRequest, CancellationToken cancellationToken = default)
{
var response = await _httpClient.SendAsync(CreateHttpRequest($"api/v1/pull-payments/{HttpUtility.UrlEncode(pullPaymentId)}/payouts", bodyPayload: payoutRequest, method: HttpMethod.Post), cancellationToken);
return await HandleResponse<PayoutData>(response);
}
public async Task CancelPayout(string storeId, string payoutId, CancellationToken cancellationToken = default)
public virtual async Task<PayoutData> GetPullPaymentPayout(string pullPaymentId, string payoutId, CancellationToken cancellationToken = default)
{
var response = await _httpClient.SendAsync(CreateHttpRequest($"api/v1/pull-payments/{HttpUtility.UrlEncode(pullPaymentId)}/payouts/{payoutId}", method: HttpMethod.Get), cancellationToken);
return await HandleResponse<PayoutData>(response);
}
public virtual async Task<PayoutData> GetStorePayout(string storeId, string payoutId, CancellationToken cancellationToken = default)
{
var response = await _httpClient.SendAsync(CreateHttpRequest($"api/v1/stores/{storeId}/payouts/{payoutId}", method: HttpMethod.Get), cancellationToken);
return await HandleResponse<PayoutData>(response);
}
public virtual async Task<PayoutData> CreatePayout(string storeId, CreatePayoutThroughStoreRequest payoutRequest, CancellationToken cancellationToken = default)
{
var response = await _httpClient.SendAsync(CreateHttpRequest($"api/v1/stores/{storeId}/payouts", bodyPayload: payoutRequest, method: HttpMethod.Post), cancellationToken);
return await HandleResponse<PayoutData>(response);
}
public virtual async Task CancelPayout(string storeId, string payoutId, CancellationToken cancellationToken = default)
{
var response = await _httpClient.SendAsync(CreateHttpRequest($"api/v1/stores/{HttpUtility.UrlEncode(storeId)}/payouts/{HttpUtility.UrlEncode(payoutId)}", method: HttpMethod.Delete), cancellationToken);
await HandleResponse(response);
}
public async Task<PayoutData> ApprovePayout(string storeId, string payoutId, ApprovePayoutRequest request, CancellationToken cancellationToken = default)
public virtual async Task<PayoutData> ApprovePayout(string storeId, string payoutId, ApprovePayoutRequest request, CancellationToken cancellationToken = default)
{
var response = await _httpClient.SendAsync(CreateHttpRequest($"api/v1/stores/{HttpUtility.UrlEncode(storeId)}/payouts/{HttpUtility.UrlEncode(payoutId)}", bodyPayload: request, method: HttpMethod.Post), cancellationToken);
return await HandleResponse<PayoutData>(response);
}
public virtual async Task MarkPayoutPaid(string storeId, string payoutId,
CancellationToken cancellationToken = default)
{
var response = await _httpClient.SendAsync(
CreateHttpRequest(
$"api/v1/stores/{HttpUtility.UrlEncode(storeId)}/payouts/{HttpUtility.UrlEncode(payoutId)}/mark-paid",
method: HttpMethod.Post), cancellationToken);
await HandleResponse(response);
}
public virtual async Task MarkPayout(string storeId, string payoutId, MarkPayoutRequest request,
CancellationToken cancellationToken = default)
{
var response = await _httpClient.SendAsync(
CreateHttpRequest(
$"api/v1/stores/{HttpUtility.UrlEncode(storeId)}/payouts/{HttpUtility.UrlEncode(payoutId)}/mark",
method: HttpMethod.Post, bodyPayload: request), cancellationToken);
await HandleResponse(response);
}
public virtual async Task<PullPaymentLNURL> GetPullPaymentLNURL(string pullPaymentId,
CancellationToken cancellationToken = default)
{
var response = await _httpClient.SendAsync(
CreateHttpRequest(
$"/api/v1/pull-payments/{pullPaymentId}/lnurl",
method: HttpMethod.Get), cancellationToken);
return await HandleResponse<PullPaymentLNURL>(response);
}
}
}

View File

@ -1,3 +1,4 @@
using System.Collections.Generic;
using System.Threading;
using System.Threading.Tasks;
using BTCPayServer.Client.Models;
@ -11,5 +12,11 @@ namespace BTCPayServer.Client
var response = await _httpClient.SendAsync(CreateHttpRequest("api/v1/server/info"), token);
return await HandleResponse<ServerInfoData>(response);
}
public virtual async Task<List<RoleData>> GetServerRoles(CancellationToken token = default)
{
using var response = await _httpClient.SendAsync(CreateHttpRequest($"api/v1/server/roles"), token);
return await HandleResponse<List<RoleData>>(response);
}
}
}

View File

@ -0,0 +1,37 @@
using System.Net.Http;
using System.Threading;
using System.Threading.Tasks;
using BTCPayServer.Client.Models;
namespace BTCPayServer.Client
{
public partial class BTCPayServerClient
{
public virtual async Task<EmailSettingsData> GetStoreEmailSettings(string storeId,
CancellationToken token = default)
{
using var response = await _httpClient.SendAsync(
CreateHttpRequest($"api/v1/stores/{storeId}/email", method: HttpMethod.Get),
token);
return await HandleResponse<EmailSettingsData>(response);
}
public virtual async Task<EmailSettingsData> UpdateStoreEmailSettings(string storeId, EmailSettingsData request,
CancellationToken token = default)
{
using var response = await _httpClient.SendAsync(
CreateHttpRequest($"api/v1/stores/{storeId}/email", bodyPayload: request, method: HttpMethod.Put),
token);
return await HandleResponse<EmailSettingsData>(response);
}
public virtual async Task SendEmail(string storeId, SendEmailRequest request,
CancellationToken token = default)
{
using var response = await _httpClient.SendAsync(
CreateHttpRequest($"api/v1/stores/{storeId}/email/send", bodyPayload: request, method: HttpMethod.Post),
token);
await HandleResponse(response);
}
}
}

Some files were not shown because too many files have changed in this diff Show More