Commit Graph

776 Commits

Author SHA1 Message Date
Andrew Camilleri
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
Andrew Camilleri
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
Wouter Samaey
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
Kukks
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
dstrukt
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
Andrew Camilleri
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
Nicolas Dorier
73b461f8d0
Greenfield: add text search terms to an invoice (#2648) 2021-07-14 23:32:20 +09:00
Wouter Samaey
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
Nicolas Dorier
4bb3d60b6c
Add misc/permissions to document the hierarchical structure (#2654) 2021-07-08 14:34:10 +09:00
Andrew Camilleri
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
nicolas.dorier
956370592f
Create a dedicated IsHotwalletProperty in the DerivationSchemeSettings 2021-06-17 15:36:22 +09:00
Umar Bolatov
b4076b53e8
Add IsAdminUser method to UserService 2021-06-02 20:02:28 -07:00
Umar Bolatov
7c11736992
Enable nullable reference checking in UserService 2021-06-02 20:02:28 -07:00
Umar Bolatov
2ed8341403
Add IsRoleAdmin to user service 2021-06-02 20:02:26 -07:00
Umar Bolatov
e5a196918f
Add user service 2021-06-02 20:02:26 -07:00
Andrew Camilleri
3b375929c1
Support wider server sync info in greenfield server info (#2511)
fixes #2498
2021-05-19 13:07:28 +09:00
Andrew Camilleri
778a0f7e8d
Fix: Lightning Listener not listening on Lightning payment after activating when using lazy payments (#2524) 2021-05-14 17:17:07 +09:00
Nicolas Dorier
c551e5cd0a
Make sure to only select accounted payments where we should (#2523) 2021-05-14 16:16:19 +09:00
Andrew Camilleri
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
Andrew Camilleri
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
nicolas.dorier
8083935b47
Greenfield: Deleting a store in the server, should delete only webhooks of this store 2021-04-27 18:55:38 +09:00
Andrew Camilleri
7d1761de4f
Coin Selection: Confirmed filter (#2467)
Allows provides confirmation count to Greenfield UTXO GET api
2021-04-20 11:02:06 +09:00
Kukks
dfd4c967b7 fix null reference exception when no tor settings are provided 2021-04-19 07:43:11 +02:00
Jonathan Underwood
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
Nicolas Dorier
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
Andrew Camilleri
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
nicolas.dorier
8ed853a3b3
Attempt to make selenium less flaky 2021-04-13 15:12:09 +09:00
Andrew Camilleri
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
Andrew Camilleri
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
Andrew Camilleri
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
Andrew Camilleri
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
xpayserver
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
Umar Bolatov
f0ac7d2c16
Set new store hints consistently for API and GUI
closes #2434
2021-04-05 21:24:34 -07:00
Andrew Camilleri
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
Andrew Camilleri
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 2e0d256325.

* 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
nicolas.dorier
97dd10edc0
Fix some NRE in the FileService 2021-03-06 13:36:36 +09:00
Nicolas Dorier
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
Andrew Camilleri
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
Nicolas Dorier
1e00c63146
Merge pull request #2308 from dennisreimann/policies-ui
Improve policies structure and wordings
2021-02-26 11:49:00 +09:00
Nicolas Dorier
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
Kukks
e3e65878aa
Allow invoice to be marked even when new
fixes #2019
2021-02-26 11:17:03 +09:00
Dennis Reimann
c0aa320f0a
Improve policies structure and wordings
Closes #2307.
2021-02-23 10:39:26 +01:00
Dennis Reimann
757c087afd
PoS: Custom buy button text per product
Closes #2232.
2021-02-18 10:54:06 +01:00
Nicolas Dorier
db0854f203
Update NBitcoin, NetworkType => ChainName, signet support (#2224) 2021-01-27 14:39:38 +09:00
nicolas.dorier
7147dadb2a
Remove dependency to DBriize 2021-01-19 17:19:32 +09:00
Salie Hendricks
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
nicolas.dorier
0c79474e0c
Do not index metadata 2021-01-11 23:32:32 +09:00
nicolas.dorier
e2e37a0db4
Make sure that the invoice currency is normalized to uppercase (Fix #2146) 2021-01-07 22:30:57 +09:00
Umar Bolatov
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
nicolas.dorier
b2959e583a
Use default color for label if the color of a label is not set 2021-01-05 16:33:24 +09:00