<%= render 'components/breadcrumb', crumbs: [ { name: 'Accueil', path: root_path }, { name: 'Événements', path: events_path }, { name: @order.event.name, path: event_path(@order.event.slug, @order.event) }, { name: "Commande ##{@order.id}", path: nil } ] %>
<% if @expiring_soon %>

Attention - Commande bientôt expirée

Votre commande va expirer dans quelques minutes. Veuillez procéder rapidement au paiement pour éviter son expiration automatique.

<% end %> <% if @order.payment_attempts > 0 %>

Nouvelle tentative de paiement

Tentative <%= @order.payment_attempts + 1 %> sur <%= @order.class::MAX_PAYMENT_ATTEMPTS %>. <% if @order.payment_attempts >= @order.class::MAX_PAYMENT_ATTEMPTS - 1 %> Dernière tentative avant expiration ! <% end %>

<% end %>

Commande pour <%= @order.event.name %>

<% if @order.expires_at %> Expire dans <%= time_ago_in_words(@order.expires_at, include_seconds: true) %> <% end %>
Commande #<%= @order.id %>

Récapitulatif de votre commande

<% @tickets.each do |ticket| %>

<%= ticket.ticket_type.name %>

<%= ticket.first_name %> <%= ticket.last_name %>
<%= ticket.price_euros %>€
<% if ticket.ticket_type.description.present? %>
<%= truncate(ticket.ticket_type.description, length: 30) %>
<% end %>
<% end %>
<% if @order.promotion_codes.any? %>
<% @order.promotion_codes.each do |promo_code| %>
Code: <%= promo_code.code %> -<%= promo_code.discount_amount_euros %>€
<% end %>
<% end %>
Sous-total <%= @order.subtotal_amount_euros %>€
<% if @order.discount_amount_cents > 0 %>
Réduction -<%= @order.discount_amount_euros %>€
<% end %>
Total <% if @order.total_amount_cents == 0 %> GRATUIT <% else %> <%= @order.total_amount_euros %>€ <% end %>

TVA incluse

Paiement sécurisé

Procédez au paiement pour finaliser votre commande

<%= form_tag checkout_order_path(@order), method: :get, class: "mb-6" do %>
<%= text_field_tag :promotion_code, params[:promotion_code], class: "flex-1 border-none bg-transparent focus:ring-0 text-sm", placeholder: "Code promotionnel (optionnel)" %> <%= button_tag type: "submit", class: "ml-2 btn btn-secondary py-2 px-4 text-sm" do %> Appliquer <% end %>
<% end %> <% if @checkout_session.present? %>

Paiement 100% sécurisé

Vos données bancaires sont protégées par le cryptage SSL et traitées par Stripe, leader mondial du paiement en ligne.

Visa Mastercard Sécurisé par Stripe
<% else %>

Paiement temporairement indisponible

Le système de paiement n'est pas encore configuré. Veuillez contacter l'organisateur pour plus d'informations.

<% end %>
<%= link_to event_path(@order.event.slug, @order.event), class: "block w-full text-center py-3 px-4 border border-gray-300 rounded-lg text-gray-700 hover:bg-gray-50 transition-colors" do %>
Retour à l'événement
<% end %>