Test mode so we can test payment flows without actually paying with BTC or tBTC #917
Replies: 21 comments 25 replies
-
Hey @woutersamaey are you familiar with testnet and regtest?
Not completely sure that's what you're looking for. |
Beta Was this translation helpful? Give feedback.
-
@pavlenex I am familiar, but:
|
Beta Was this translation helpful? Give feedback.
-
How about just using Lightning to pay? creating 1sat invoices on mainnet will not break the bank and are instant anyway :) |
Beta Was this translation helpful? Give feedback.
-
@Kukks for this we need to have test products set up to cost just 1 sat or 0,01 USD. Also takes time to change the prices, again the wallet problem, etc. |
Beta Was this translation helpful? Give feedback.
-
When you put it in that perspective, I see why you need it, I usually use LN as Kukks said, or just mark invoices as completed manually. Will mark this as a feature request, if you wish to expand more on it feel free to do so. |
Beta Was this translation helpful? Give feedback.
-
@pavlenex I am willing to work on this, but I'm not a C# dev. I have installed VS Code on my Mac and can read and understand the code (looks a bit like Java Spring MVC to me). |
Beta Was this translation helpful? Give feedback.
-
@woutersamaey Awesome, we do have a #developers chat on Mattermost at chat.btcpayserver.org where I'm sure some of the devs will be more than happy to help you out when you have the time join us and let's keep improving this, also thanks for your contributions so far. |
Beta Was this translation helpful? Give feedback.
-
If I'm correct, the following scenario's are possible. Can someone confirm or add? I'd suggest making a "test payment" page that looks like the real payment page, except that the QR An extra flag when the invoice is created on BTCPay Server can indicate the customer is going for a test payment. Before expiration
After expiration
Non-payment
Anything else you can think of that a merchant would want to have test flows for? |
Beta Was this translation helpful? Give feedback.
-
@woutersamaey all of those situations look okay. Some indeed look a bit extreme. For
Invalid |
Beta Was this translation helpful? Give feedback.
-
Is it possible to manually mark invoices as all possible variables? It's to debug and so on. If it can be done, how can I do it? Thanks! |
Beta Was this translation helpful? Give feedback.
-
@royserpa You can manually change certain states by clicking on a single invoice drop-down in Invoices > Status column. |
Beta Was this translation helpful? Give feedback.
-
You are right, I saw that. But I don't think it's possible to mark invoices as paid, confirmed, complete :/ |
Beta Was this translation helpful? Give feedback.
-
Without sending any btc/tbtc or lightning btc :/ |
Beta Was this translation helpful? Give feedback.
-
It is not possible without sending anything. That's I think what this issue is about. But payments flow is way better tested in regtest and dev environment where you don't have to spend anything. |
Beta Was this translation helpful? Give feedback.
-
@woutersamaey I have the same issue as you. I use a WooCommerce store but it will be great to have some switch in BTCPay plugin to test payments. Any news on this? Have you managed to solve it? |
Beta Was this translation helpful? Give feedback.
-
@danielcharrua no this issue is still open. In development, you can run a command on the command line to fake a payment. @pavlenex an easier to use test payment would still be helpful, but I guess it would require huge refactoring? |
Beta Was this translation helpful? Give feedback.
-
With greenfield, you can use an api command to mark an invoice as complete.
Would that be enough?
…On Sat, 26 Jun 2021, 22:31 Wouter Samaey, ***@***.***> wrote:
@danielcharrua <https://github.com/danielcharrua> no this issue is still
open.
In development, you can run a command on the command line to fake a
payment.
A solution might be to run a 2nd install in regtest (developer mode) and
run this CLI command to fake a payment automatically. It’s not an easy
setup, but if you want fully automated end-to-end tests, this would be a
way forward.
@pavlenex <https://github.com/pavlenex> and easier to use test payment
would still be helpful, but I guess it would require huge refactoring?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#917 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAN357WR6KZTFJZIFJ3QTVDTUY2IPANCNFSM47LU2XRA>
.
|
Beta Was this translation helpful? Give feedback.
-
Here you can see how Stripe for example in WooCommerce handles the test mode with different API keys for each |
Beta Was this translation helpful? Give feedback.
-
@NicolasDorier @Kukks would it be technically feasible to:
I imagine this is quite the refactor, but would it work if the DB is altered this way? Mostly asking because I have no idea if this is a DB manipulation or if payments are loaded / synced from the blockchain, making this more difficult. |
Beta Was this translation helpful? Give feedback.
-
A sandbox function is desperately needed still. |
Beta Was this translation helpful? Give feedback.
-
Looks like the regtest setup is separate from the the standard Docker installation, it's clearly intended for developing BTCPay Server itself. Looking at the docs it's not clear if and how I can put my existing BTCPay Server in "regtest" mode with this additional network running locally. Maybe a guide is needed? Does anyone have some tips? From my perspective I just need to test my simple Python integration against a standard server. The free testnet coins are so hard to get, people are selling them for real money. 🤣 I'm still waiting for my 5 cents. This is really way more complicated than it should be, we're missing functionality that's standard in any payment service as mentioned above. Pretty huge gap in what is otherwise a great open source solution! Waiting for real payments to clear can also be very slow for development/testing. |
Beta Was this translation helpful? Give feedback.
-
I am testing BTCPay Server integration with Magento 2 and was wondering if I can put BTCPay Server in "test mode" where I don't actually have to pay with BTC on the payment page.
Some payment providers allow you to put your store in "test mode" and a few buttons will appear on the payment page:
If you click on "Simulate full payment", the payment is considered OK and you proceed to the next step.
The other buttons can be similar and trigger other scenarios.
This is only for integration testing.
Another idea that might be handy is that instead of putting the store in test mode, the payment request itself indicates that it is a test request so in automated testing or end-to-end testing situations, one does not need to keep enabling and disabling test mode all the time.
Or, there could be a "test user" who is always in test mode while the rest is in production mode.
Beta Was this translation helpful? Give feedback.
All reactions