Files
openfoodnetwork/app/views/checkout/_payment.html.haml
luisramos0 9fa4bad0b4 Add stripe SCA checkotu payment template and move stripe object definition to it and the other stripe template
We need to set the stripe object with the stripe account id to work with the payment intents api but we cannot set it to work with the stripe charges api

This makes the two payment methods incompatible: a given enterprise cannot use both the old stripe integration and this new one at the same time.
2020-02-21 10:52:29 +00:00

40 lines
1.7 KiB
Plaintext

%fieldset#payment
%ng-form{"ng-controller" => "PaymentCtrl", name: "payment"}
%h5{"ng-class" => "{valid: payment.$valid, dirty: payment.$dirty || submitted}"}
%span.right
%label.label.round.alert.right
%i.ofn-i_009-close
%label.label.round.success.right
%i.ofn-i_051-check-big
= t :checkout_payment
%accordion-group{"is-open" => "accordion.payment",
"ng-class" => "{valid: payment.$valid, open: accordion.payment}"}
= render 'checkout/accordion_heading'
-# TODO render this in Angular instead of server-side
-# The problem being how to render the partials
.row
.small-12.medium-12.large-6.columns
- available_payment_methods.each do |method|
.row
.small-12.columns
%label
= radio_button_tag "order[payments_attributes][][payment_method_id]", method.id, false,
required: true,
name: "order.payment_method_id",
"ng-model" => "order.payment_method_id"
= method.name
= "(#{payment_method_price(method, @order)})"
%small.error.medium.input-text{"ng-show" => "!fieldValid('order.payment_method_id')"}
= "{{ fieldErrors('order.payment_method_id') }}"
.row{"ng-if" => "order.payment_method_id == #{method.id}"}
.small-12.columns
= render partial: "spree/checkout/payment/#{method.method_type}", :locals => { :payment_method => method }
.small-12.medium-12.large-6.columns
#distributor_address.panel{"ng-show" => "Checkout.paymentMethod().description"}
%span.pre-wrap {{ Checkout.paymentMethod().description }}