Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove external payment options from payment request modal #212

Closed
positiveblue opened this issue Apr 25, 2024 · 4 comments · Fixed by #214
Closed

Remove external payment options from payment request modal #212

positiveblue opened this issue Apr 25, 2024 · 4 comments · Fixed by #214

Comments

@positiveblue
Copy link
Contributor

Problem

The payment request modal currently offers users two options:

  • Connect a wallet using one of the provided connectors
  • Pay the invoice externally using a QR code or by copying the encoded invoice

Screenshot 2024-04-24 at 6 15 19 PM

I am integrating bitcoin-connect into a service based on the L402 protocol. For the protocol to function correctly, it is essential that the client has access to the invoice preimage. Allowing the user to pay the invoice with an external wallet that is not connected introduces complications and makes it difficult to properly implement the L402 protocol.

Proposed solution

I propose making the "or + QR + copy invoice" HTML components optional in the payment request modal UI.

By providing a way to disable or hide these elements when needed, we make it really hard for the user to "accidentally" pay the invoice in a way that the client does not have access to the preimage.

Alternative Solution/Workarounds

  • Let the user manually introduce the preiamge: it's own can of worms (some wallets do not give it to the user) + bad UX
  • Polling the server to check if the payment has been received: introduces additional complexity and potential problems that I would like to avoid.

I am more than happy to create a PR adding the prop + logic to hide this section of the html but I want to hear professional advice first :)

@rolznz
Copy link
Collaborator

rolznz commented Apr 25, 2024

Hi @positiveblue

Optimally Polling the server to check if the payment has been received would be the best option, but I can see it might not always be possible.

Maybe we can have a allowExternalPayment boolean that is default to true. If false, it hides the external payment options.

CC @reneaaron @bumi

@positiveblue
Copy link
Contributor Author

Polling the server to check if the payment has been received would be the best option

Agree. We take the preimage as proof of payment so it's possible that the server/service that takes the credentials does not have access to an invoice status.

Maybe we can have a allowExternalPayment boolean that is default to true.

I agree that by default most of the people want it set to true. So whatever route we follow (showEncodedInvocie or hideEncodedInvoice the default should to have the QR visible.

Also, should we consider yet another section with a text field (from) for introducing the preimage manually (I would go with no, but in case you see it necessary)

@rolznz
Copy link
Collaborator

rolznz commented Apr 25, 2024

should we consider yet another section with a text field (from) for introducing the preimage manually

No, I think users should never have to manually paste a preimage. Most people have no idea what it is, and I'm not sure what they gain from doing this or even where they get that preimage from

@rolznz
Copy link
Collaborator

rolznz commented Apr 29, 2024

It also makes sense to only show the external options in some cases. I wonder if instead we add a property paymentMethods which can be "all" or "internal" or "external"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants