node-btcpay
node-btcpay copied to clipboard
Accessing The Invoice Data In The Redirect String?
We have a landing page for when a user successfully completes the payment.
"localhost:8080/buy/pay-invoice/{{ invoice.id }}/complete"
Is it possible to dynamically access the invoice id?
TY
Can you explain what you’re trying to do and how you’ve tried to implement it and had some problems? I’m finding it a bit difficult understanding your question.
Sure.
In the Bitpay documentation the redirectURL string looks like this...
"redirectURL": "https://merchantwebsite.com/shop/return"
Our goal is to have the redirectURL string computed like this...
"redirectURL": "https://merchantwebsite.com/shop/{{ invoice.id }}/return"
Here is our current flow...
- User adds personal information ("/us/en/buy/crypto/create-invoice/personal")
- User selects the number of coins to purchase ("/us/en/buy/crypto/create-invoice/order") // We create the invoice
- User pays the invoice ("/us/en/buy/crypto/pay-invoice/U4v2czMgLdTXNaa5xmMiYi") // We use the invoice id in the url, so the user can refresh the page or send the link to another user
- User paid the invoice and hits our confirmation view ("/us/en/buy/crypto/pay-invoice/U4v2czMgLdTXNaa5xmMiYi/complete")
So ultimately, we want #4 to be computed because that view will also act as a statement of the transaction.
What do you think @takinbo?
Also, we are creating our own UI and QR code for invoice in step #3