user upgrades: add ability to refund upgrades.

This commit is contained in:
evazion
2020-12-29 03:50:43 -06:00
parent 87af02f689
commit 4b171bf97e
8 changed files with 111 additions and 10 deletions

View File

@@ -27,6 +27,14 @@ class UserUpgradesController < ApplicationController
respond_with(@user_upgrade)
end
def refund
@user_upgrade = authorize UserUpgrade.find(params[:id])
@user_upgrade.refund!
flash[:notice] = "Upgrade refunded"
respond_with(@user_upgrade)
end
def receipt
@user_upgrade = authorize UserUpgrade.find(params[:id])
redirect_to @user_upgrade.receipt_url