Let users donate sats via BTCPay Server #176

Merged
raucao merged 9 commits from feature/donations_btcpay into master 2024-03-13 16:31:54 +00:00
Showing only changes of commit 7f2df3b025 - Show all commits

View File

@ -28,6 +28,7 @@ class Contributions::DonationsController < ApplicationController
if params[:currency] == "sats"
fiat_amount = nil
fiat_currency = nil
raucao marked this conversation as resolved
Review

Isn't a amount_sats = params[:amount_sats] missing here?

I couldn't see the amount_sats being assigned anywhere other than to nil when a different currency is selected, but it is being used further down in this action.

Isn't a `amount_sats = params[:amount_sats]` missing here? I couldn't see the `amount_sats` being assigned anywhere other than to `nil` when a different currency is selected, but it is being used further down in this action.
Review

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.

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.
amount_sats = params[:amount]
else
fiat_amount = params[:amount].to_i
fiat_currency = params[:currency]