Implement bitcoin donations via BTCPay
This commit is contained in:
@@ -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
|
||||
7
db/migrate/20240214121049_add_new_donation_fields.rb
Normal file
7
db/migrate/20240214121049_add_new_donation_fields.rb
Normal 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
|
||||
@@ -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
|
||||
Reference in New Issue
Block a user