user upgrades: add links to Stripe payment & receipt page.

Add links to the Stripe payment page and the Stripe receipt page on
completed user upgrades.

The Stripe payment link is a link to the payment details on the Stripe
dashboard and is only visible to the owner.
This commit is contained in:
evazion
2020-12-28 22:25:09 -06:00
parent e29e2da8be
commit 87af02f689
8 changed files with 154 additions and 6 deletions

View File

@@ -10,4 +10,12 @@ class UserUpgradePolicy < ApplicationPolicy
def show?
record.recipient == user || record.purchaser == user || user.is_owner?
end
def receipt?
(record.purchaser == user || user.is_owner?) && record.has_receipt?
end
def payment?
user.is_owner? && record.has_payment?
end
end