Class: CatarseCredits::CreditsController

Inherits:
ApplicationController
  • Object
show all
Defined in:
app/controllers/catarse_credits/credits_controller.rb

Instance Method Summary collapse

Instance Method Details

#payObject



9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
# File 'app/controllers/catarse_credits/credits_controller.rb', line 9

def pay
  if is_contribution_user?
    if has_credits_to_do_contribution?
      return failed_contribution
    end

    unless contribution.confirmed?
      contribution.update_attributes({ credits: true, payment_method: 'Credits' })
      contribution.update_current_billing_info
      contribution.confirm!
    end

    flash[:success] = t('projects.contributions.checkout.success')
    redirect_to main_app.project_contribution_path(project_id: contribution.project.id, id: contribution.id)
  else
    failed_contribution
  end
end

#reviewObject



6
7
# File 'app/controllers/catarse_credits/credits_controller.rb', line 6

def review
end