Let users donate sats via BTCPay Server #176
Loading…
x
Reference in New Issue
Block a user
No description provided.
Delete Branch "feature/donations_btcpay"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Introducing the first option for accepting donations in akkounts: one-time donations via BTCPay.
Supports both on-chain and Lightning options. For on-chain donations, the donation is shown as pending until confirmed, while Lightning donations are confirmed instantly, of course. There is also an email notification once on-chain donations have been confirmed, so you don't have to remember to follow up on it.
Furthermore, you can choose the amount either in EUR, USD, or sats. When choosing an amount in sats, the exchange rate will be fetched after receiving the payment notification from BTCPay and added to the donation record then. When choosing a fiat amount, the conversion is already done by BTCPay, so we just add the amount of sats we see from the payment notification already.
In order to test the functionality directly against https://btcpay.kosmos.org, please DM me for a testing API key.
(This PR already includes a small refactoring commit that will make it easier to integrate the next option, which is sats directly from one's Kosmos LndHub account, which can then also be done as a monthly subscription that is automatically debited.)
refs #31
@ -10,0 +27,4 @@
def create
if params[:currency] == "sats"
fiat_amount = nil
fiat_currency = nil
Isn't a
amount_sats = params[:amount_sats]
missing here?I couldn't see the
amount_sats
being assigned anywhere other than tonil
when a different currency is selected, but it is being used further down in this action.Good catch! Since I did actual donations using sats for the amount, it must have gotten lost for the commit somehow. Added a spec to catch that, since that spec was missing in the first place.
@galfert Want to give it your stamp of approval?
When trying to create a contribution I'm getting an error (see screenshot).
I'm in the Zerotier network and when I GET
http://10.1.1.163:23001/api/v1/health
from my computer directly, I get a correct response ofWhen I do the same from within the web container, the request times out.
Code looks alright. Wasn't able to test it yet, because of the error I commented above.
As discussed during the last call, we'll merge this and test in production, since I am unable to debug macOS Docker issues and connecting to our private network in dev should not be a prerequisite.