Skip to content

Commit

Permalink
bug: migrate intro page to new mollie sdk
Browse files Browse the repository at this point in the history
  • Loading branch information
leuke-naam committed Jan 28, 2025
1 parent 552f169 commit b4aac7b
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 12 deletions.
9 changes: 0 additions & 9 deletions app/controllers/public/home_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,9 @@ def create
activities = Activity.find(public_post_params[:participant_attributes].to_h.select { |_, participant| participant['participate'].nil? || participant['participate'].to_b == true }.map { |_, participant| participant['id'].to_i })
total = 0

flash[:error] = I18n.t(:no_bank_provided, scope: 'activerecord.errors.subscribe') if non_master_omits_bank
@member.valid? unless flash[:error].nil?

if flash[:error].nil? && @member.save

# create account and send welcome email
user = User.create_on_member_enrollment!(@member)
user.resend_confirmation!(:activation_instructions)
Expand Down Expand Up @@ -53,9 +51,7 @@ def create
transaction = Payment.new(
description: I18n.t("form.introduction", user: @member.name),
amount: total - Settings.mongoose_ideal_costs, # Transaction costs are paid by the association
issuer: params[:bank],
member: @member,

transaction_id: activities.map(&:id),
transaction_type: :activity,
payment_type: :ideal,
Expand Down Expand Up @@ -120,12 +116,7 @@ def public_post_params
:student_id,
:birth_date,
:join_date,
:bank,
participant_attributes: [:id, :participate],
educations_attributes: [:id, :study_id, :_destroy])
end

def non_master_omits_bank
params[:bank].blank? && @member.educations.none? { |education| Study.find(education.study_id).masters }
end
end
3 changes: 0 additions & 3 deletions app/views/public/home/index.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -249,9 +249,6 @@
.form-group.field
%label{for: ''}= I18n.t(:payment_method, scope: 'form')
= select_tag 'method', options_for_select(['IDEAL'], @method), { :class => 'form-control' }
.form-group.field
%label{for: '', :id => 'bank'}= I18n.t(:bank, scope: 'form')
= select_tag 'bank', options_for_select(Payment::ideal_issuers, @bank), { :class => 'form-control' }

%button.btn.btn-primary{type: 'submit'}= I18n.t(:finish_signup, scope: 'form')

Expand Down

0 comments on commit b4aac7b

Please sign in to comment.