* Specify mailto: prefix for emails in Server Settings
* resolve test failure
* Update wording
* Apply mailto-prefix on setting change
---------
Co-authored-by: Dennis Reimann <mail@dennisreimann.de>
* Onboarding: Invite new users
- Separates the user self-registration and invite cases
- Adds invitation email for users created by the admin
- Adds invitation tokens to verify user was invited
- Adds handler action for invite links
- Refactors `UserEventHostedService`
- Fixes#5726.
* Add permissioned form tag helper
* Better way of changing a user's role
* Test fixes
* Providing additional parameter for info message
* Refactoring code to remove parameter and only set status message in LoadFromBIP21 if not present
* Update BTCPayServer/Controllers/UIWalletsController.cs
---------
Co-authored-by: Andrew Camilleri <evilkukka@gmail.com>
* Add admin option to show item list for keypad view
* Refactor common POS Vue mixin
* Add item list to POS keypad
* Add recent transactions to cart
* Keypad: Pass tip and discount as cart does
* Keypad and cart tests
* Improve offcanvas button
---------
Co-authored-by: Andrew Camilleri <evilkukka@gmail.com>
* If pull payment opened in mobile, use deeplink to setup card
* Allow passing LNURLW to register boltcard
* debug
* debug
* debug
* Only show setup/reset when the page is fully loaded
* Apply suggestions from code review
---------
Co-authored-by: Andrew Camilleri <evilkukka@gmail.com>
* (bug) treat xmr wallet directory as required
The wallet directory configuration setting is required
because the `UIMoneroLikeStoreController`'s
`GetMoneroLikePaymentMethodViewModel` method checks if the wallet file
exists, and to do that in needs the directory.
* (feat) xmr settlement thresholds
Adds the ability to select zero, 1, 10, or a custom number of
confirmations as the payment settlement threshold.
* (review) fix validation message not showing
---------
Co-authored-by: Henry Hollingworth <henry.hollingworth@alcoa.com>
* PoS app to show POS view for easy setup
* update selenium test
* Updates
* Add QR code icon
---------
Co-authored-by: Dennis Reimann <mail@dennisreimann.de>
* Apps: Make app name the default title
Successor of #5762 with a way simpler approach. Allows the user-facing title to be set, but defaults it to the app name instead of "Tea shop".
* Test fixes
As discussed on #5718, there is no need for the store logo to be provided in square dimension. As it populates its own row on the public page layouts, we can remove that restriction and make it adaptable by providing only maximum height and width.
* Server Users: More precise message when inviting users
This lets the admin who invited a new user know whether or not an email has been sent. If the SMTP server hasn't been set up, they need to share the invite link with the user.
* Onboarding: Invite new users
- Separates the user self-registration and invite cases
- Adds invitation email for users created by the admin
- Adds invitation tokens to verify user was invited
- Adds handler action for invite links
- Refactors `UserEventHostedService`
* Remove duplicate status message from views that use the wizard layout
* Auto-approve users created by an admin
* Notify admins via email if a new account requires approval
* Update wording
* Fix update user error
* Fix redirect to email confirmation in invite action
* Fix precondition checks after signup
* Improve admin notification
Send notification only if the user does not require email confirmation or when they confirmed their email address. Rationale: We want to inform admins only about qualified users and not annoy them with bot registrations.
* Allow approval alongside resending confirm email
* Use user email in log messages instead of ID
* Prevent unnecessary notification after email confirmation
* Use ApplicationUser type explicitly
* Fix after rebase
* Refactoring: Do not subclass UserRegisteredEvent
* Reposition the camera scan icon in the wallet > send functionality
* refactored changes
* Minor adjustments
---------
Co-authored-by: Dennis Reimann <mail@dennisreimann.de>
* UI: Deprecate the custom CSS options
As discussed with @pavlenex we are deprecating the custom CSS options for particular entities (payemnt request, pull payment, POS, crowdfund) in favor of the store branding approach.
This displays the custom CSS section only if these values are set already.
* Add IDs to html element
This will allow styling of individual entities.
* Admin overview of the stores on the instance
POC/Draft for #5674.
* Enable admin to access foreign stores
* Remove stores list link
* UI updates
* Grant admins guest access to foreign stores
* Optimize cookie auth handler
* Test fix
* Revert changes related to StoreRepository.FindStore with isAdmin
* webhook tests
* fixes and add docs
* Do not update FormResponse and StoreId in update/create PullPayment
---------
Co-authored-by: nicolas.dorier <nicolas.dorier@gmail.com>
* Server Settings: Customize instance name and add contact URL
- The custom instance name would improve #5563
- Added contact URL closes#4806
* Fix custom logo display
* Crowfund : Add Buyer information / Additional information(forms) like POS
* PR 5659 - changes
* Cleanups
* fix perk
* Crowdfund form tests
* Add Selenium test for Crowfund
* Selenium update
* update Selenium
* selenium update
* update selenium
* Test fixes and view improvements
* Cleanups
* do not use hacky form element for form detection
---------
Co-authored-by: nisaba <infos@nisaba.solutions>
Co-authored-by: Dennis Reimann <mail@dennisreimann.de>
Co-authored-by: Kukks <evilkukka@gmail.com>
Closes#5773.
- Adds seconds to the displayed date and time
- Adds a tooltip that displays the full date and time including milliseconds
- Reintroduced the colored text in case of unusual events/states (this didn't work before)
* Clarifying that only onchain funds will be restored to the wallet
Off chain recovery would need to be done with channel.backup file which is not part of this process
* Adding powershell version of lncli invoker
* Bumping LND to 0.17.4-beta-rc1
* Bumping LND to 0.17.4-beta
* Users list: Cleanups
* Policies: Flip registration settings
* Policies: Add RequireUserApproval setting
* Add approval to user
* Require approval on login and for API key
* API handling
* AccountController cleanups
* Test fix
* Apply suggestions from code review
Co-authored-by: Nicolas Dorier <nicolas.dorier@gmail.com>
* Add missing imports
* Communicate login requirements to user on account creation
* Add login requirements to basic auth handler
* Cleanups and test fix
* Encapsulate approval logic in user service and log approval changes
* Send follow up "Account approved" email
Closes#5656.
* Add notification for admins
* Fix creating a user via the admin view
* Update list: Unify flags into status column, add approve action
* Adjust "Resend email" wording
* Incorporate feedback from code review
* Remove duplicate test server policy reset
---------
Co-authored-by: Nicolas Dorier <nicolas.dorier@gmail.com>
* Store Email Settings: Improve configuration
This works with the existing settings and provides better guidance about the different store email cases. Closes#5623.
* Split email and notification settings
Fixes#5698. Before this, the app lookup was constrained by the user having at least `CanModifyStoreSettings` permissions. This changes it to require the user being associated with a store, leaving the fine-grained authorization checks up to the individual actions.
This ensures that guests land on the invoices list, which tehy are allowed to see — rather than the dashboard, which they don't have permissions for.
Fixes#5688.
When testing the webhook for payment requests, we were incorrectly creating a payout webhook instead of a payment request. This would cause an error (but nothing fatal as it is only a test webhook(
* Fix: Plugin updates do not work
* Offer install on disabled plugins when different version
This will:
* Clear any previous pending actions of a plugin if you click uninstall
* Show the plugin version that was disabled
* Show an update button on disabled plugins instead of install
* if a plugin is scheduled to be installed/updated, it will show which version was scheduled to be updated. If a newer version if available than the scheduled one, it will show an option to switch to that
* Ensure disabled plugins don't get loaded
* View fixes
---------
Co-authored-by: d11n <mail@dennisreimann.de>
* Refactor fee provider
The fee provider ended up glued with a hardcoded factory. This PR:
* removes this glue and uses the DI to register fee provider for a network. (allows plugins to add their own fee providers, for any network
* Add a 10 second timeout to mempoolspace fee fetching as they are slow at times
* use linear interpolation for mempool space fee estimation
* fix upper bound
* Add tests, rollback pluginify FeeProvider
---------
Co-authored-by: nicolas.dorier <nicolas.dorier@gmail.com>
* Refactor Wallet import code
The code for wallet import was incredibly messy as it evolved over time from various requests.
This PR:
* splits up each supported format into its own file
* Supports taproot descriptors (through a hack until NBitcoin supports it internally) fixes#5518
* Reduces different paths for handling electrum/non-electrum xpubs
* Allows plugins to add their own import support formats for onchain wallets.
* Update NBitcoin to parse tr descriptors
* Fix warnings
* Use dedicated type OnChainWalletParsers
---------
Co-authored-by: nicolas.dorier <nicolas.dorier@gmail.com>
When a POS has a form, which results in an error state, the store branding property was not set. This adds the missing property and also does not render the store branding partial, in case the model property isn't present.
Fixes#5655.
* Checkout v2: Clicking QR code copies full payment URI
Before it copied only the destination value (Bitcoin address or Lightning BOLT11). This didn't include the BOLT11 in case of the unified QR code. Now it will copy the full payment URI, which is the same as the QR represents:
- Unified: `bitcoin:ADDRESS?amount=AMOUNT&lightning=BOLT11`
- Bitcoin: `bitcoin:ADDRESS?amount=AMOUNT`
- Lightning: `lightning:BOLT11`
Fixes#5625.
* Test fix
* Prevent payment request to be created when a wallet is not set up
* Created an extension method for store wallet checks
* fix for invoice and payment request selenium test
* refactoring payment request controller
* removing unused variable
* Unify behaviour across controllers
---------
Co-authored-by: Dennis Reimann <mail@dennisreimann.de>
* Propose linking Greenfield API information within the Legacy API view
* Propose linking Greenfield API information within the Legacy API view
* moved Greenfield API section up
* moved Greenfield API section up
* Fix link
* Wording
* Adjust button alignment
---------
Co-authored-by: Dennis Reimann <mail@dennisreimann.de>
* Make tips and discount properties disabled in POS setting
* Update discount and tips boolean properties in model and swagger json
* update pos tests to cater for default tip and discount state
* Remove custom IDs and unify tests
---------
Co-authored-by: Dennis Reimann <mail@dennisreimann.de>
There are apps, which do not have a template and hence no inventory. Accessing it via `settings[templatePath]!.Value` causes exceptions in those cases.
When a plugin is disabled, we should at least show the uninstall option in the plugin option. Eventually we should also detect what version was disabled and offer an update instead
Allows to specify the text alignment in the description container via the richt text editor. Before it was center aligned, no matter what one did in the editor.
This is feedback we got in yesterdays call with Start9.
* Store Branding: Refactoring and logo as favicon
- Encapsulates store branding properties into their own view model
- Uses the logo as favicon on public pages
* Refactorings
* Updates
Cam across this while browsing the API docs: The checkout type setting isn't used for the POS, so we should simply remove it as this is configured on the store-level.
* Use Mempoolspace fees
Since bitcoind's fee estiomates are horrible, I would use an altenrative, but that adds a third party to the mix. We can either:
* Accept the risk (it is only for fee estimation anyway)
* Offer a toggle in the server settings
* Move this code to a plugin
* refactor
* Refactor
---------
Co-authored-by: nicolas.dorier <nicolas.dorier@gmail.com>
* Fix additional div
* Don't show payment number if there is only one
* Bump max-width to prevent wrapping in top container
* Fix colspan
* Re-add POS data
Closes#5498.
* Right-align amounts
* Re-order
* Don't show redundant receive date if there is only one payment
* Table improvements
* Unify crypto amount display
* More formatting improvements
* Only show Subtotal if there are calculations applicable to it
* Making margin on the bottom smaller to reduce expansion on Bitcoinize machines
---------
Co-authored-by: rockstardev <5191402+rockstardev@users.noreply.github.com>
* Domain mapping: Redirect root app to canonical URL
We already redirect public app URLs to the canonical URL if there's a domain mapping — this adds the same behaviour for apps that are defined as root app as well.
* Refactor
* Refactor once more
Minor cleanups
---------
Co-authored-by: nicolas.dorier <nicolas.dorier@gmail.com>
* Support the new LN lib
* fix test
* do not cache factories
* try without useless userinfo in lnd
* Remove monero wallet files
* support simpler DI too
---------
Co-authored-by: Dennis Reimann <mail@dennisreimann.de>
Based on #5413 and needs it to get merged first.
- Uses `--wrap-max-width` on `.public-page-wrap` rather than inner `.container` classes
- Applies `.tile` class to boxes and makes them connect to the edge of the screen below `400px` width.
* Theme Switch: Refactor and add system option
Before, we had no way to reset the theme option to the system default. This introduces that option and refactors the theme switch to work in a simpler manner.
* Prevent account menu close on click inside
Context: #5476
* Apps: Filter list lookups by available app types
Uniunstalling a plugin might lead to then unavailable app types, as the entries remain in the database. The list lookups need to account for that, otherwise unavailable apps cause crashes and misbehaviour.
Fixes#5480.
* Make a hashset
---------
Co-authored-by: nicolas.dorier <nicolas.dorier@gmail.com>
There's an [ongoing discussion](https://github.com/wardi/jsonlines/issues/19) about what the MIME type for [JSONL](https://jsonlines.org/) files should be. Making it `application/jsonl` leads to the file being downloaded according to my testing, which prevents browsers from opening them in a new window and parsing them as JSON, which fixes#5488.
* Payment Request: Improve public view
Closes#4450.
* Test fix
* Extract Vue utils
* Improve payment history
* Fix amount display
* Unify receipt and payment request tables
* Re-add text confirmation for copying to clipboard
* Minor print optimizations
* Wording: Rename Description to Memo
* Open view links in new window
* View updates
* POS and Crowdfund: Improve item editor
Makes it work the same way as the form editor: Drag and drop for reordering and inline editing without modal.
* Upload component
* Invoice: Unify status display and functionality
Consolidates the invoice status display and functionality (mark setted or invalid) across the dashboard, list and details pages.
* Test fix
---------
Co-authored-by: Nicolas Dorier <nicolas.dorier@gmail.com>
If there are no perks configured, do not display the perks sidebar and contribute custom amount directly, when the main CTA "Contribute" is clicked.
Before it opened a mopdal, where one had to select the only option (custom amount) manually — so this gets rid of the extra step.
Closes#5376.
* Ripio had api changed
* Exchange rate host now requires an api key so removed
* Removed unused argoneum rate provider code
* switched cop and ugx to yadio
* bumped exchange sharp lib as poloniex api changed and rate source was not working
This was due to Blazor which attempt to reconnect when the connection
is broken.
Before this, it would try again indefinitely, with this PR, it tries
only for around 3 minutes.
After this, the Blazor circuit should be dead anyway, so it's useless
to try again.
* Improve receipt info display
Displays the info in correct order and adds optional info if tip was given with a percentage.
* Test fix
---------
Co-authored-by: Nicolas Dorier <nicolas.dorier@gmail.com>
* API: Document payment method IDs
This seems to be a source of confusion (see e.g. #5330), so I thought it'd be best to document the payment method IDs as an enum, so that we can refer to it in the several places they are used.
* Remove enum
* Introduce archive pull payment permission
* Add show qr option on pull payments
* Fix test
* update docs
* fix test
* Minor UI updates
* Update wording
---------
Co-authored-by: Dennis Reimann <mail@dennisreimann.de>
The `submit()` method cannot be invoked on forms without a submit button. This changes it to call the method via the JS prototype, which can be seen as a workaround.
Checked this in Firefox and Chrome. Fixes#5335.
Applies default subject and body text on editing to simplify email rule setup. Once the text is edited manually, the defaus aren't applied on switching the rule type.
Also documents the placeholders that can be used.
Adjust the prior number of transactions metric as discussed with @pavlenex. We now show the number of paid invoices instead of transactions, as this metric is more meaningful.
Closes#5300.
Minor updates to the cheating options:
- Some browsers do not submit disabled fields, hence I made the amount field readonly in case of Lightning.
- Convert remaining amount when switching from onchain BTC to Lightning sats.
* BUmp LNURL
* Show app view link in nav when not enoguh permission to modify
* FIx permission misalignment on create pull payments
We have explicit permissions for pull payment creation, even allow them to be created through the invoices, but the create ui and cta were blocked behind canmodify store permission.
* Make Ln address pass an invoiceId in the context to resolve breaking change
Potential fix for #5266 — see the discussion in that issue for details.
This change should be non-invasive, I tested the links in regular as well as modal mode and they worked in Firefox, Brave and Chrome.
Came across this while testing things and the "Please fill all required fields before testing" message wasn't clear, because the required fields were not marked.
Co-authored-by: Andrew Camilleri <evilkukka@gmail.com>
* Checkout v2: Play sound when invoice is paid
Closes#5085.
* Refactoring: Use low-level audio API to play the sound
Allows to play the sound regardless of browser permissions.
* Add audio file detection
* Use model state for file upload errors
* Add default sound and customizing option
* Fix mp3 detection
* Add sounds
* Update defaults
* Add nfcread and error sounds
* Improve label wording
* Replace sound
---------
Co-authored-by: nicolas.dorier <nicolas.dorier@gmail.com>
* Support accepting 0 amount bolt 11 invoices for payouts
* add test
* handle validation better
* fix case when we just want pp to provide amt
* Update BTCPayServer/HostedServices/PullPaymentHostedService.cs
* Update BTCPayServer/HostedServices/PullPaymentHostedService.cs
* Update BTCPayServer/Data/Payouts/LightningLike/UILightningLikePayoutController.cs
* Update UILightningLikePayoutController.cs
* fix null
* fix payments of payouts on cln
* add comment
* bump lightning lib
---------
Co-authored-by: Nicolas Dorier <nicolas.dorier@gmail.com>
* Add reporting feature
* Remove nodatime
* Add summaries
* work...
* Add chart title
* Fix error
* Allow to set hour in the field
* UI updates
* Fix fake data
* ViewDefinitions can be dynamic
* Add items sold
* Sticky table headers
* Update JS and remove jQuery usages
* JS click fix
* Handle tag all invoices for app
* fix dup row in items report
* Can cancel invoice request
* Add tests
* Fake data for items sold
* Rename Items to Products, improve navigation F5
* Use bordered table for summaries
---------
Co-authored-by: Dennis Reimann <mail@dennisreimann.de>
* Quality of life improvements to payout processors
* Allows more fleixble intervals for payout processing from 10-60 mins to 1min-24hours(requested by users)
* Cancel ln payotus that expired (bolt11)
* Allow cancelling of ln payotus that have failed to be paid after x attempts
* Allow conifguring a threshold for when to process on-chain payouts (reduces fees)
# Conflicts:
# BTCPayServer.Tests/SeleniumTests.cs
* Simplify the code
* switch to concurrent dictionary
* Allow ProcessNewPayoutsInstantly
* refactor plugin hook service to have events available and change processor hooks to actions with better args
* add procesor extended tests
* Update BTCPayServer.Tests/GreenfieldAPITests.cs
* fix concurrency issue
* Update BTCPayServer/PayoutProcessors/BaseAutomatedPayoutProcessor.cs
---------
Co-authored-by: nicolas.dorier <nicolas.dorier@gmail.com>
* Fix constant fields being editable on UI
* fix redirect to checkout if invoice is settled (redirect to receipt instead)
* enhance: make mirror field type able to map values
* Introduce invoice amount adjustment fields for form
* Integrate invoice amount adjustment fields for form on pos
* Support mirror in editor
* Indicate when special field names are used
* polsih mirror view and name suggestions for fields
* clarify
* hide hidden field from ui
* Minor adjustmentts
* Improve mirror field editing
---------
Co-authored-by: Dennis Reimann <mail@dennisreimann.de>
* Refactor logic for calculating due amount of invoices
* Remove Money type from the accounting
* Fix tests
* Fix a corner case
* fix bug
* Rename PaymentCurrency to Currency
* Fix bug
* Rename PaymentCurrency -> Currency
* Payment objects should have access to the InvoiceEntity
* Set Currency USD in tests
* Simplify some code
* Remove useless code
* Simplify code, kukks comment
* When WebSocket disconnects, we should continue polling via XHR
* Update BTCPayServer/wwwroot/checkout-v2/checkout.js
Co-authored-by: d11n <mail@dennisreimann.de>
---------
Co-authored-by: d11n <mail@dennisreimann.de>
* POS: Backwards-compatible price parsing
Fixes#5159 and a regression introduced in bbff9710bf: The price in posData needs to be parsed in a backwards-compatible manner, as the old format of price as an object exists in the invoice metadata.
* Test corner cases
---------
Co-authored-by: nicolas.dorier <nicolas.dorier@gmail.com>
* Custom Forms: Allow HTML in labels and help text
Fixes#5003.
* Vue: Sanitize labels and helper text input
* Form editor: Fix blur on input for select option values
---------
Co-authored-by: Nicolas Dorier <nicolas.dorier@gmail.com>
* Removes Chaincoin shitcoin which is so dead even its website is gone
* Add ExchangeRateHost and FreeCurrencyRates as new rate providers
* Add recommended rate providers for UGX and RSD
* Fix BTX rate by switching to graviex
* Fix BTC rate by switching to exmo
* Fix LCAD rate script
Domains are case-insensitive, so this comparision should be too.
I encountered this issue with a Citadel user who accidentially named their domain an uppercase name (Pay.example.com), but browsers automatically converted it to pay.example.com
* Add grouping feature to the PoS with Cart
* Improve UI
* Rename groups to categories
* Make it easier to select categories of the items
* Refactor TemplateEditor, use TomSelect for categories
* Prevent Vue code insertion
* Prevent empty categories
* Add label ids
* Add test case
---------
Co-authored-by: Dennis Reimann <mail@dennisreimann.de>
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.
* 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>
* 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
* 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
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]
```
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()
```