Simplify partial selecting and rename stripe_sca partial

This commit is contained in:
Matt-Yorkley
2021-11-30 13:25:42 +00:00
parent 33887e8b6e
commit 8105f0ebf3
2 changed files with 3 additions and 6 deletions

View File

@@ -21,12 +21,9 @@
- if payment_method.description && !payment_method.description.empty?
.paymentmethod-description.panel
#{payment_method.description}
.paymentmethod-form
- if payment_method.method_type == "stripe_sca"
- method = "stripe"
-else
- method = payment_method.method_type
= render partial: "split_checkout/payment/#{method}", locals: { payment_method: payment_method, f: f }
= render partial: "split_checkout/payment/#{payment_method.method_type}", locals: { payment_method: payment_method, f: f }
%div.checkout-substep
= t("split_checkout.step2.explaination")

View File

@@ -8,7 +8,7 @@
.checkout-input
%label
= t('split_checkout.step2.form.stripe.use_saved_card')
= select_tag :card, options_for_select(@saved_credit_cards.map {|cc| [ "#{cc.brand} #{cc.last_digits} #{I18n.t(:card_expiry_abbreviation)}:#{cc.month.to_s.rjust(2, '0')}/#{cc.year}", cc.id ] } + [[t('split_checkout.step2.form.stripe.create_new_card'), ""]], @selected_card), { "data-action": "change->stripe#onSelectCard", "data-stripe-target": "select" }
= select_tag :card, options_for_select(@saved_credit_cards.map {|cc| [ "#{cc.brand} #{cc.last_digits} #{I18n.t(:card_expiry_abbreviation)}:#{cc.month.to_s.rjust(2, '0')}/#{cc.year}", cc.id ] } + [[t('split_checkout.step2.form.stripe.create_new_card'), ""]], @selected_card), { "data-action": "change->stripe#onSelectCard", "data-stripe-target": "select" }
.checkout-input{"data-stripe-target": "stripeelements"}
- if @saved_credit_cards.length == 0