From 9979ecf8b457c6c2d364adec9c8442a0fcd6338a Mon Sep 17 00:00:00 2001 From: Matt-Yorkley <9029026+Matt-Yorkley@users.noreply.github.com> Date: Thu, 2 Dec 2021 14:17:37 +0000 Subject: [PATCH] Update view to use new Stimulus controller for Stripe card form --- .../split_checkout/payment/_stripe_sca.html.haml | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/app/views/split_checkout/payment/_stripe_sca.html.haml b/app/views/split_checkout/payment/_stripe_sca.html.haml index 639a4370b0..c65b41d12d 100644 --- a/app/views/split_checkout/payment/_stripe_sca.html.haml +++ b/app/views/split_checkout/payment/_stripe_sca.html.haml @@ -1,8 +1,3 @@ -- content_for :injection_data do - - if Stripe.publishable_key - :javascript - angular.module('Darkswarm').value("stripeObject", Stripe("#{Stripe.publishable_key}")) - %div{"data-controller": "stripe-cards"} - if @saved_credit_cards.any? .checkout-input @@ -16,8 +11,12 @@ - if @saved_credit_cards.none? %label = t('split_checkout.step2.form.stripe.use_new_card') - %stripe-elements + %div{ "data-controller": "stripe", "data-stripe-key": "#{Stripe.publishable_key}" } + = f.hidden_field :token, { "data-target": "stripe.responseToken" } + + %div.card-element{ "data-target": "stripe.cardElement" } + %div.card-errors{ "data-target": "stripe.cardErrors" } - if spree_current_user .checkout-input