Commit Graph

451 Commits

Author SHA1 Message Date
d11n
1c921030dc Store users: Ensure the last owner cannot be downgraded (#6654)
* Store users: Ensure the last owner cannot be downgraded

Changes the behaviour of the `AddOrUpdateStoreUser` method to throw errors for the failure cases, so that the UI and API can report the actual problem. A role change might fail if the user already has that role or if they are the last owner of the store.

* Cleanup code

---------

Co-authored-by: nicolas.dorier <nicolas.dorier@gmail.com>
2025-04-08 17:21:07 +09:00
Nicolas Dorier
ce83e4d96d Fix: PaymentRequests created via API never expires (#6657) 2025-04-08 14:17:31 +09:00
nicolas.dorier
c373f1e08f Refactor UserService.IsDisabled to a property 2025-04-04 16:42:27 +09:00
nicolas.dorier
ead74a985f Remove deprecated properties 2025-04-04 16:28:44 +09:00
d11n
a916ae81be Greenfield: Expand user data (#6649) 2025-04-04 16:15:33 +09:00
Nicolas Dorier
658ddd1f27 Fix: Refunds through API were ignoring BOLT11 expiration at store level (#6644) 2025-03-31 09:32:12 +09:00
nicolas.dorier
c3c6473e35 Disable cold wallet creation by default 2025-03-13 19:23:23 +09:00
nicolas.dorier
2911771f19 Feature: RBF and UX improvement to fee bumping 2025-03-11 17:44:18 +09:00
rockstardev
1da2cedffd Reverting changes, validate email only if it was provided 2025-03-05 22:49:07 -06:00
rockstardev
18852af241 Refactoring and commenting 2025-03-05 22:49:06 -06:00
rockstardev
8094800cfc IsMailboxAddress already checks for null, simplifying code 2025-03-05 22:49:06 -06:00
nicolas.dorier
be8ecb823e Refactor email endpoints 2025-03-05 22:49:06 -06:00
rockstardev
a7e3cbb105 Adding endpoint to set server email settings (#6601)
* Adding endpoint in Greenfield to allow server email settings

* Adding related swagger file

* Refactoring EmailSettingsData to be more readable

* Adding server email masking

* Adding tests

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

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

* Masking smtp server email returned over greenfield api and test

* Retaining password if password mask is used

* Remove magic string *****

* Flatten request for server's settings. Fix bug on shared setting instances

* Remove useless doc

* Simplify code

* Fix Store Email settings page

---------

Co-authored-by: d11n <mail@dennisreimann.de>
Co-authored-by: nicolas.dorier <nicolas.dorier@gmail.com>
2025-02-27 15:59:17 +09:00
nicolas.dorier
bbe95d780f Fix: Incorrect enabled value for v1/stores/{storeId}/payment-methods/{paymentMethod} 2025-01-21 17:48:37 +09:00
nicolas.dorier
d3d6b2d15c Make HtmlTags safer, properly sanitize in the view as well 2025-01-19 11:00:09 +09:00
Nicolas Dorier
92a92a7fff Rename and add to greenfield HtmlTags and HtmlMetaTags for apps (#6557) 2025-01-15 23:48:10 +09:00
d11n
637c06fc01 Greenfield: Improve invoice receipt (#6483)
Assembles and provides the same data as the UIInvoiceController. Merging the invoice's receipt options with the store ones was missing in Greenfield.
2024-12-23 09:25:05 +09:00
Nicolas Dorier
8acf1c2d62 Refactoring: Introduce IUrlHelper.ActionAbsolute (#6513) 2024-12-21 00:16:04 +09:00
d11n
44dc6499cd POS: Fix form redirect in conjunction with root path setting (#6506)
* POS: Fix form redirect in conjunction with root path setting

Fixes #6493 and also adds missing status messages on the forms pages.

* Fix other occurrences
2024-12-20 22:59:07 +09:00
d11n
d24e0cd1a2 Greenfield: Remove authorization requirement for app data (#6499)
As discussed with @NicolasDorier on Mattermost: Right now only store owners can access the app data, which doesn't contain sensitive info or something beyond what one would see as a regular customer. The app would need a way to access the data for roles other than `Owner` as well, e.g. `Employee`.
2024-12-19 09:54:28 +09:00
Dennis Reimann
fe3bccf3ce Greenfield: Resolve store user's image URL
Amendment to #6427.
2024-12-15 10:02:13 +01:00
d11n
00cc16455c App: Add events which the app subscribes to (#6435)
* App: Add events which the app subscribes to

Various events, which are relevant for the app to react to changes made on the server.

* Refactor events

* Do not extend NewBlockEvent

* Refactoring events

* Add store role events

* Refactoring: Rename StoreUserEvent

* Fix: Subscribe to UserEvent.Invited

---------

Co-authored-by: nicolas.dorier <nicolas.dorier@gmail.com>
2024-12-11 20:11:51 +09:00
d11n
898f0f4481 Greenfield: Improve store users API (#6427)
* Greenfield: Improve store users API

- Adds an endpoint to update store users (before they had to be removed ad re-added)
- Checks for the existance of a user and responds with 404 in that case (fixes #6423)
- Allows retrieval of user by user id or email for add and update (consistent with the other endpoints)
- Improves the API docs for the store users endpoints

* Swagger: Reuse UserIdOrEmail parameter component

* Add details to store user data
2024-12-02 15:35:33 +01:00
d11n
d3315c2fa6 Integrate mobile-working-branch part 1 (#6428) 2024-11-26 14:17:40 +09:00
d11n
d6211327db Greenfield: Users API fixes (#6425)
* Do not crash when creatuing users without password

* More precise error message for user approval toggling
2024-11-25 09:38:44 +09:00
nicolas.dorier
8e688b7f28 Fix: Getting notifications via API would crash 2024-11-14 21:53:37 +09:00
Nicolas Dorier
31b73f0d82 Fix: Boltcard would get bricked during reset from the balance view with wrong card (#6400) 2024-11-14 13:14:36 +09:00
Nicolas Dorier
fdbee350b8 Greenfield: Create Pull Request payoutMethods is now optional (#6396) 2024-11-13 18:31:55 +09:00
Nicolas Dorier
894f68f2ae Improve error messages for on-chain related greenfield operations (#6393)
* Improve error messages for on-chain related greenfield operations

* Fix test
2024-11-13 10:11:04 +09:00
d11n
a129114603 Greenfield: Add image upload for app items (#6226)
Upload endpoints for app item images. Follow-up to #6075.
Tested to work with the app item editor.

Uses UploadImage consistently in API and UI.
2024-11-07 10:43:22 +09:00
d11n
641bdcff31 Histograms: Add Lightning data and API endpoints (#6217)
* Histograms: Add Lightning data and API endpoints

Ported over from the mobile-working-branch.

Adds histogram data for Lightning and exposes the wallet/lightning histogram data via the API. It also add a dashboard graph for the Lightning balance.

Caveat: The Lightning histogram is calculated by using the current channel balance and going backwards through as much invoices and transactions as we have. The "start" of the LN graph data might not be accurate though. That's because we don't track (and not even have) the LN onchain data. It is calculated by using the current channel balance and going backwards through as much invoices and transactions as we have. So the historic graph data for LN is basically a best effort of trying to reconstruct it with what we have: The LN channel transactions.

* More timeframes

* Refactoring: Remove redundant WalletHistogram types

* Remove store property from dashboard tile view models

* JS error fixes
2024-11-05 21:40:37 +09:00
d11n
ff79a31066 Refactoring: Move AppItem to Client lib and use the class for item list (#6258)
* Refactoring: Move AppItem to Client lib and use the class for item list

This makes it available for the app, which would otherwise have to replicate the model. Also uses the proper class for the item/perk list of the app models.

* Remove unused app item payment methods property

* Do not ignore nullable values in JSON

* Revert to use Newtonsoft types
2024-11-05 11:49:30 +09:00
Nicolas Dorier
cc0ea0b3f8 Refactor payouts processing (#6314) 2024-10-19 21:33:34 +09:00
Nicolas Dorier
7b6a115adc [Greenfield] Select default payoutMethodId if none are selected in the Refund route (#6315) 2024-10-17 22:54:59 +09:00
nicolas.dorier
b7affb1d34 Fix monero payments 2024-10-17 18:55:00 +09:00
nicolas.dorier
e4f79f046a Remove unused field from automated payout settings 2024-10-09 13:13:10 +09:00
Nicolas Dorier
64ba8248d2 Can inject currency data in CurrencyNameTable (#6276) 2024-10-04 22:24:44 +09:00
Nicolas Dorier
5704919b3a BlockExplorer links should be using payment method ids (#6273) 2024-10-04 16:58:13 +09:00
Chukwuleta Tobechi
3a71c45a89 Add updated image upload support on Crowdfund plugin (#6254)
* Add updated image upload support on Crowdfund plugin

* Refactor crowdfund image upload fix

* update crowdfund url for greenfield api

* Resolve integration test assertion

* Remove superfluous and unused command argument

* Fix missing validation error

* Minor API controller update

* Property and usage fixes

* Fix test after merge

---------

Co-authored-by: Dennis Reimann <mail@dennisreimann.de>
2024-10-03 10:39:41 +09:00
Nicolas Dorier
9ba4b030ed Fix: Do not expose xpub without modify store permission (#6212) 2024-09-27 15:27:04 +09:00
nicolas.dorier
b5590a38fe Add better error message if v1 routes are used. 2024-09-26 19:09:27 +09:00
d11n
443a350bad App Service: Validate IDs when parsing items template (#6228)
Validates missing and duplicate IDs on the edit actions and when creating/updating apps via the API.
Fails gracefully by excluding existing items without ID or with duplicate ID for the rest of the cases.

Fixes #6227.
2024-09-26 15:52:16 +09:00
Nicolas Dorier
363b60385b Renaming various properties in the Payouts API (#6246)
* Rename Payouts Currency/OriginalCurrency

* Rename Payout Processor PayoutMethodIds

* Rename paymentMethods to payoutMethodIds

* Rename payoutMethodIds to payoutMethods
2024-09-26 11:25:45 +09:00
Nicolas Dorier
056f850268 Optimize load time of StoreRoles related pages/routes (#6245) 2024-09-25 23:10:13 +09:00
d11n
7348a6a62f Store Branding: Apply brand color to backend as well (#5992)
* Store Branding: Apply brand color to backend as well

Closes #5990.

* Add adjustments for different theme scenarios

* Add description text

* Make it optional to apply the brand color to the backend

* Toggle color fixes
2024-09-13 21:39:21 +09:00
d11n
666445e8f7 Greenfield: App endpoints for sales statistics (#6103) 2024-09-12 16:17:16 +09:00
Nicolas Dorier
36bada8feb Uniformize Wallet API's path (#6209)
* Uniformize Wallet API's path

* Rewrite old API path to new API

* Rename routes
2024-09-12 15:19:10 +09:00
Nicolas Dorier
b4946f4db1 Fix divisibility in invoice details of lightning amounts (#6202)
* Fix divisibility in invoice details of lightning amounts

This PR will show 11 decimal in the invoice details for BTC amount
of lightning payment methods.

It also hacks around the fact that some
lightning clients don't create the requested amount of sats, which
resulted in over or under payments. (Blink not supporting msats, and
strike)

Now, In that case, a payment method fee (which can be negative) called tweak fee
will be added to the prompt.

We are also hiding this tweak fee from the user in the checkout page in
order to not disturb the UI with inconsequential fee of 0.000000001 sats.

* Only show 8 digits in checkout, even if amount is 11 digits
2024-09-12 12:43:08 +09:00
d11n
3342122be2 Make Role Permissions more human legible (#6191)
Had to rename `CanModifyStoreWebhooks` to `CanModifyWebhooks` for this, but the value stayed the same, so I don't think it's a big deal.

Closes #6183.
2024-09-12 12:29:10 +09:00
Nicolas Dorier
c93497af10 Rename PaymentMethod => PaymentMethodId (#6198)
* Rename PaymentMethod => PaymentMethodId

* Rename DB Columns
2024-09-06 13:24:33 +09:00