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.
* 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>
* Introduce very flexible form input system
* Refactorings after rebase
* Test fix
* Update BTCPayServer/Forms/FormDataService.cs
---------
Co-authored-by: Dennis Reimann <mail@dennisreimann.de>
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.
* 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>
* 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>
* 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>
Fixes comparisons of `long` and `LightMoney`, which did not work, because the `amount` provided was in sats and Lightmoney compares to millisats.
Closes#4663.
* 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>
* 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>
* 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
* 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>
* 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
* 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>
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.