From ad24351bb31c91fcc98757db156a9e56682c7b3e Mon Sep 17 00:00:00 2001 From: Jean-Baptiste Bellet Date: Mon, 20 Dec 2021 15:18:29 +0100 Subject: [PATCH] Reorganize CSS to display error correctly `.card-errors` is no more child of `.stripe-card` --- .../payment/_stripe_sca.html.haml | 23 ++++++++++--------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/app/views/split_checkout/payment/_stripe_sca.html.haml b/app/views/split_checkout/payment/_stripe_sca.html.haml index 876f8c482e..17c0f9b52a 100644 --- a/app/views/split_checkout/payment/_stripe_sca.html.haml +++ b/app/views/split_checkout/payment/_stripe_sca.html.haml @@ -12,17 +12,18 @@ %label = t('split_checkout.step2.form.stripe.use_new_card') - %div.stripe-card{ "data-controller": "stripe", "data-stripe-key": "#{Stripe.publishable_key}", "data-stripe-target": "stripeElementsForm" } - = hidden_field_tag "order[payments_attributes][][source_attributes][first_name]", @order.bill_address.first_name - = hidden_field_tag "order[payments_attributes][][source_attributes][last_name]", @order.bill_address.last_name - = hidden_field_tag "order[payments_attributes][][source_attributes][month]", nil, { "data-stripe-target": "expMonth" } - = hidden_field_tag "order[payments_attributes][][source_attributes][year]", nil, { "data-stripe-target": "expYear" } - = hidden_field_tag "order[payments_attributes][][source_attributes][cc_type]", nil, { "data-stripe-target": "brand" } - = hidden_field_tag "order[payments_attributes][][source_attributes][last_digits]", nil, { "data-stripe-target": "last4" } - = hidden_field_tag "order[payments_attributes][][source_attributes][gateway_payment_profile_id]", nil, { "data-stripe-target": "pmId" } - - %div.card-element{ "data-stripe-target": "cardElement" } - %div.card-errors{ "data-stripe-target": "cardErrors" } + %div{ "data-controller": "stripe", "data-stripe-key": "#{Stripe.publishable_key}", "data-stripe-target": "stripeElementsForm" } + .stripe-card + = hidden_field_tag "order[payments_attributes][][source_attributes][first_name]", @order.bill_address.first_name + = hidden_field_tag "order[payments_attributes][][source_attributes][last_name]", @order.bill_address.last_name + = hidden_field_tag "order[payments_attributes][][source_attributes][month]", nil, { "data-stripe-target": "expMonth" } + = hidden_field_tag "order[payments_attributes][][source_attributes][year]", nil, { "data-stripe-target": "expYear" } + = hidden_field_tag "order[payments_attributes][][source_attributes][cc_type]", nil, { "data-stripe-target": "brand" } + = hidden_field_tag "order[payments_attributes][][source_attributes][last_digits]", nil, { "data-stripe-target": "last4" } + = hidden_field_tag "order[payments_attributes][][source_attributes][gateway_payment_profile_id]", nil, { "data-stripe-target": "pmId" } + %div.card-element{ "data-stripe-target": "cardElement" } + + %div.error.card-errors{ "data-stripe-target": "cardErrors" } - if spree_current_user .checkout-input