Implement bitcoin donations via BTCPay

This commit is contained in:
2024-02-14 11:09:03 +01:00
parent 26d613bdca
commit 079ee8833c
46 changed files with 1142 additions and 114 deletions

View File

@@ -0,0 +1,9 @@
class ChangeDonationAmountsAndCurrency < ActiveRecord::Migration[7.1]
def change
rename_column :donations, :amount_usd, :fiat_amount
add_column :donations, :fiat_currency, :string, default: "USD"
remove_column :donations, :amount_eur, :integer
Donation.update_all(fiat_currency: 'USD')
end
end

View File

@@ -0,0 +1,7 @@
class AddNewDonationFields < ActiveRecord::Migration[7.1]
def change
add_column :donations, :donation_method, :string
add_column :donations, :payment_method, :string, default: nil
add_column :donations, :btcpay_invoice_id, :string, default: nil
end
end

View File

@@ -0,0 +1,8 @@
class AddPaymentStatusToDonations < ActiveRecord::Migration[7.1]
def change
add_column :donations, :payment_status, :string, default: nil
add_index :donations, :payment_status
Donation.completed.update_all payment_status: "settled"
end
end