Commit Graph

35 Commits

Author SHA1 Message Date
tomFlowee fdfea02669 Add 'disable' action to Android notification
When a repeat payment is detected to soon be eligable for sending, but
the user has not approve it yet, we show a notification from the
background process to entice the users to go and approve it.

This popup now also carries a 'disable' text which disables the repeat
payment, effectively shutting up this and further notifications.

The tricky part to make this work is that the notification is showing
while the application is (likely) not actually active.

This takes the strategy that the notification carries some extra
details. Among others a newly introduced unique id for a notification
itself, and also some text to show on actually processing the disable
action.

The processing just writes a file, to avoid complexity and side-effects.
The file will then be read on start up (either foreground of background)
to action on the lines in there. So the item will be disabled on first
load.
2026-02-25 16:04:42 +01:00
tomFlowee 4878091862 Make the repeatPayments screen more robust
This shows more details, like the target address.
This also made the screen able to handle multiple outputs in a payment,
though that is a bit tricky with regards to which values we allow
editing.
2026-02-04 21:36:29 +01:00
tomFlowee d92f330857 Make saving of payment object configurable
When the user manually pastes an address, this would also be a payment
object and that makes no sense to save. So make it configurable
and have external payment protocols (i.e. 3rd party invoices) as well as
repeated payments get saved.
2026-02-04 14:47:15 +01:00
tomFlowee 45ab9b23bb Wrap Wallet in shared_ptr
The Wallet object used to have a guarenteed lifetime longer than the App
singleton, but then we started allowing people to delete their wallet
(argh!).
Also "external" modules, especially living outside of the main tree,
would be much more stable if they can avoid using raw pointers for core
concepts like the Wallet.
2025-10-08 22:54:27 +02:00
tomFlowee 89ce639070 Show notifications for repeat payments.
Repeat payments are handled in the background process and issues and
indeed successes need to be shared to the user via notifications.

We now have notifications for:
∙ successfully sending a repeat payment
∙ when a payment is due soon, but not approved.
∙ when a payment is due soon, but not enough funds are in wallet.
2025-09-09 20:22:57 +02:00
tomFlowee b455ed01a0 Add a context menu to pay screen for a planned payment 2025-07-10 16:31:23 +02:00
tomFlowee 74285e3fa2 Backend for saved payments data. 2025-06-24 18:34:46 +02:00
tomFlowee 179d184640 Store repeat Payments on Flowee Pay and persist them.
The application will thus be able to remember payments between restarts.
2025-06-23 11:28:48 +02:00
tomFlowee 5b40359ee6 Add tdd Payment saving code 2025-06-08 12:46:00 +02:00
tomFlowee 2b13984e82 Start the save method 2025-06-07 22:23:34 +02:00
tomFlowee 487cf3e875 Start RepeatPaymentDetails 2025-06-06 20:52:44 +02:00
tomFlowee 8ce6b744ae Make the broadcast of a tx more generic
The tx-broadcast was tied completely to a 'payment' object, this is now
more made into individual parts that can be reused outside of the
'payment' usecase.
2024-10-05 20:34:39 +02:00
tomFlowee d1dfeb1a02 Stop using deprecatd q_enums 2024-10-05 11:00:30 +02:00
tomFlowee f1f97f5347 Add op-return creation UI for desktop 2024-10-01 17:55:05 +02:00
tomFlowee 17e05d69a2 Loosen reading from Payment methods
The Payment specific methods paymentAmount and paymentAmountFiat are now
made to return the data from the first output and no longer required
there to be exactly one.
This allows these methods to still give useful info in the case of
payment protocol based creation of more complex payment objects.
2024-09-24 21:22:52 +02:00
tomFlowee a49f6ee0a1 Add basic support for bip21 op-return argument.
This takes the concept added some 5 years ago to Electron-Cash and adds
this to Flowee Pay as well.
In a nutshell, it allows a bip21 style payment request to include a
'comment' with the argument op_return_raw

This comment is expected to be a hex-encoded data payload that then will
be added as a single output to the transaction we build to fullfill the
payment request.

As a natural consequence of how uri's work, adding the argument multiple
times will cause multiple outputs to be generated. We check that this
does not exceed the expected max sizing for op-return.
2024-09-23 22:51:10 +02:00
tomFlowee c63460c6f6 Refactor the broadcast of transactions
This changes two implementations of the BroadcastTxData baseclass
to now use one which is a lot more robust and thread-safe as
well as fixing various smaller issues.
2024-01-19 00:03:16 +01:00
tomFlowee 6f9f17a46b Make scanning simple QRs better.
This specifically allows pasting and scanning of bitcoincash addresses
without the 'bitcoincash' prefix.
Additionally this cleans up the QRScanner API a little and merges two
methods.

Last, at popular request, this makes showing the address on the
confirmation screen default to be on.
This allows people to actually verify the address they pay to.

Except when paying to a BIP70 payment because that is practically
speaking a system that avoids talking about addresses in the first
place. No point in trying to verify the actual address THERE.
2023-12-22 19:25:16 +01:00
tomFlowee 02288299fc Improve BIP activation on startup
For desktop we now properly support starting a payment when
the user clicks on a bitcoincash link in a browser.

For Android the activation logic _should_ work, except that the
Android specific way has yet to be tied to our app.
2023-09-05 20:45:32 +02:00
tomFlowee 69e0fe8869 Finish up BIP70 feature
Squash of 12 commits, this makes the UX actually useful and
we detect errors and show errors and warnings to the user.
This also adds an 'editable' bool to OutputDetail in order to
disable editing of a payment request address.
Additionally, this introduces the ability for a Payment to carry
a raw script instead of an address. So op-return or more complex
payment requests will be sent just fine.

Fun fact is that our broadcast is INV/SendData, which is two
roundtrips and thus slow, which is needed to be sure we get proper
rejection messages.
The sending of the transaction via BIP70 causes the network to
already know about the tx because the server we send it to has
likely much better Internet than we do.
So confirmation from the payment provider is used to show success
instead of the normal way.
2023-09-05 13:38:24 +02:00
tomFlowee fcf8e82511 Implement BIP70 (protocolbuffers) payment protocol
This adds the basic support of bip70 style payments.
Some todos are left which are mostly about interaction with
other parts of the app and require bigger changes to make
it work smoothly.
2023-08-31 23:39:35 +02:00
tomFlowee f649d8e39a Fix crash on pay-to-many-addressses.
Hide target address if there is more than one.
2023-07-07 10:54:38 +02:00
tomFlowee 7e375f50b5 Bugfix how we handle numbers from user input
This is a long overdue cleanup around the ideas of entering
numbers in Flowee Pay.

The core dataclass BitcoinValue now keeps track where the number
came from, either user input or some calculation. This allows
us to have the Fiat and the Coin price stay in sync without weird
problems.
The one we type uses a string, the price field that we are not typing in
is then a slave and we follow the auto-generated number as the
source.

This solves a host of known issues:

* Editing of value objects is much more consistnnt and predictable now.
* Switching to a different fiat type now properly re-calculates the
  values that are slaved. So if the primary is a BCH value then the fiat
  value gets the new exhange rate instantly applied.
* Switching to a different fiat type properly applies having a separator
  So if you go from euro to Japanese yen, we now remove the separator
  and the numbers behind it.
* Changing the app setting from BCH to mBCH now properly updates all
  amounts. Notice that the user-typed string wins, if you typed 2 and
  then change to mBCH we assume you wanted 2, not 2000.
* Paste now works more logcally.
* Cursor is no longer sometimes invisible, requiring backspace to make
  it show up.

And last we now protect against too large numbers. It is seen as an
error to type a number above 21 million BCH.

Fixes #19
2023-06-23 10:35:35 +02:00
tomFlowee 752cc9b68a Respect amount of incoming payment request.
A payment request, for instance a QR code, which includes an amount to
be paid is expected to not change the to-be-paid amount, uses being
dropped
in the price editing UI is therefore a bit weird. Almost an
anti-pattern.

This honors that concept and when the price is included in the scanned
QR, we change the UI layout to removed the editing widgets and show
static display widgets instead.

This also adds a header menu item to edit the amount to be paid and
get back to the old UI.
Additionally, a new UI is added to show the address we are about to pay
to, likewise reachable from the header menu.
2023-05-31 15:20:11 +02:00
tomFlowee 66ed55823d Tie instapay check to payment-address parsing.
The basic usecases of instapay is that the payment request is filled in
one go (from QR for instance) and thus we try to send.
If that fails (not enough funds or whatever), we disable instapay in
order to avoid 'magic happens' user experiences.
2023-05-31 11:14:12 +02:00
tomFlowee 7806914fc3 Various small fixes and UX improvements. 2023-05-18 21:52:51 +02:00
tomFlowee 38345aba5a Further design the InstaPay dataset
This is essentially the backend work for the instapay setup.
GUI still needs to be done.
2023-05-16 20:16:12 +02:00
tomFlowee 9daefb38d2 Start work on the destination edit page 2023-03-11 22:05:15 +01:00
tomFlowee 457edc20b4 Simplify the payment and amounts getters
This merges the paymentAmount and effectiveBchAmount methods because they
did 99% the same.
Same with the paymentAmountFiat and effectiveFiatAmount.

This removes the 'effective*' set of properties.
2023-02-22 15:28:06 +01:00
tomFlowee a8264538c0 Payment::reset() should not delete the exchange rate
to reset the payment removes all user set properties, giving you a clean
payment object.
Since the exchange rate is both not user-set and also not something that
is expected to change between one payment and the next, it is now no
longer cleared on reset().
2023-02-18 16:25:33 +01:00
tomFlowee 155647d7ac Add docs and make input selector work again
Document various of the Payment properties better and make the input
selector use the multi-detail getter for price.
2023-02-17 19:22:24 +01:00
tomFlowee 9f39a9f54f Make the logic simpler
Move the logic for fiat to the payment object too and simplify the need
for code by defining this can only be called in the single-output mode.
2023-02-08 20:55:24 +01:00
tomFlowee a475a99371 Add feature: autoprepare
For the payment object it now is possible to insta-commit to changes and
as such always prepare a transaction ready to be sent with the latest of
the settings.

This is enabled with a boolean property 'autoPrepare' (default off).
2023-02-08 14:14:06 +01:00
tomFlowee ed918d6039 Small API fixes
Move the signals to the right class and remove an include from the
header file.
Also provide a context object in QTimer::singleShot. Useful to avoid
dangling pointers being dereferenced on shutdown.
2022-12-20 15:20:16 +01:00
tomFlowee 163e615613 Move sources into the src subdir
Slowly the amount of cpp sources has been growing to the point
where its just too much to store in the root of the project.
I think they are more happy in a subdir as well, getting an elevated
position for themselves.
2022-12-13 11:54:03 +01:00