* 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 5783db9eda.
* Fix LNUrl doc
* Fix some warnings
Co-authored-by: Dennis Reimann <mail@dennisreimann.de>
Co-authored-by: nicolas.dorier <nicolas.dorier@gmail.com>
* 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
* 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>
* 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>
* 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>
* 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
* 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
* 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
* 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
* Fix missing master fingerprint/account key path on wallet import
Re-adds the view model properties that got removed in 8a1d5bbc57 and passes them through the confirm addresses form.
* Add test
This test fails on current master
* 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
* 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>
* 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>
* 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
* 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>
* 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
* 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>
* 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>
* 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>
* 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
* 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>
* 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>
* 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>
* 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>
* 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
* 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>
* 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>