Skip to content

Commit 560297f

Browse files
committed
feat: remove issuer
1 parent 5bec79c commit 560297f

File tree

3 files changed

+4
-20
lines changed

3 files changed

+4
-20
lines changed

app/controllers/members/payments_controller.rb

+3-4
Original file line numberDiff line numberDiff line change
@@ -35,10 +35,10 @@ def pay_activities
3535
redirect_to(member_payments_path)
3636
return
3737
end
38+
3839
payment = Payment.new(
3940
description: description,
4041
amount: amount,
41-
issuer: transaction_params[:bank],
4242
member: member,
4343
payment_type: :ideal,
4444
transaction_id: unpaid.pluck(:activity_id),
@@ -97,13 +97,12 @@ def add_funds
9797
description: description,
9898
amount: amount,
9999
member: member,
100-
issuer: transaction_params[:bank],
101100
payment_type: :ideal,
102-
103101
transaction_id: nil,
104102
transaction_type: :checkout,
105103
redirect_uri: member_payments_path
106104
)
105+
107106
if payment.save
108107
redirect_to(payment.payment_uri)
109108
else
@@ -115,6 +114,6 @@ def add_funds
115114
private
116115

117116
def transaction_params
118-
params.permit(:amount, :bank, :activity_ids, :payment_type)
117+
params.permit(:amount, :activity_ids, :payment_type)
119118
end
120119
end

app/models/payment.rb

-12
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,6 @@ def request_payment
5959
payment = Mollie::Payment.create(
6060
amount: { value: format('%.2f', amount), currency: 'EUR' },
6161
method: 'ideal', # only ideal for now
62-
issuer: issuer,
6362
description: description,
6463
webhook_url: webhook_url,
6564
redirect_url: redirect_url
@@ -143,17 +142,6 @@ def transaction_fee
143142
end
144143
end
145144

146-
def self.ideal_issuers
147-
# cache the payment issuers for 12 hours, don't request it to often. Stored in tmp/cache
148-
return [] if ENV['MOLLIE_TOKEN'].blank?
149-
150-
Rails.cache.fetch('mollie_issuers', expires_in: 12.hours) do
151-
method = Mollie::Method.get('ideal', include: 'issuers')
152-
153-
method.issuers.map { |issuer| [issuer["name"], issuer["id"]] }
154-
end
155-
end
156-
157145
def activities
158146
Activity.find(transaction_id) if activity?
159147
end

app/views/members/payments/index.html.haml

+1-4
Original file line numberDiff line numberDiff line change
@@ -42,13 +42,10 @@
4242
%tr
4343
%td
4444
%td
45-
.ideal-activities
46-
= I18n.t("members.payments.unpaid_activity.footer.bank")
47-
.float-xl-right= f.select :bank, options_for_select(Payment::ideal_issuers), {}, {style: '', class:'ideal-activities'}
4845
%td
4946
%div
5047
= I18n.t("members.payments.unpaid_activity.footer.transactioncosts")
51-
%span.transaction_cost_activities.ideal-activities{:price =>@transaction_costs}= number_to_currency(@transaction_costs, :unit => '€')
48+
%span.transaction_cost_activities.ideal-activities{:price => @transaction_costs}= number_to_currency(@transaction_costs, :unit => '€')
5249
%tr
5350
%td
5451
%td

0 commit comments

Comments
 (0)