refactor(pricing): implement hybrid fee model (€0.50 + 1.5%) deducted from promoter payout
- Remove 1€ fixed fee from orders and Stripe invoices - Add platform_fee_cents, promoter_payout_cents methods to Order model - Update views to show clean ticket totals without added fees - Update tests for new fee calculation logic - Update pricing docs with implemented model
This commit is contained in:
@@ -50,7 +50,7 @@
|
||||
<div>
|
||||
<h3 class="font-medium text-blue-800 mb-1">Nouvelle tentative de paiement</h3>
|
||||
<p class="text-blue-700 text-sm">
|
||||
Tentative <%= @order.payment_attempts + 1 %> sur <%= @order.class::MAX_PAYMENT_ATTEMPTS %>.
|
||||
Tentative <%= @order.payment_attempts + 1 %> sur <%= @order.class::MAX_PAYMENT_ATTEMPTS %>.
|
||||
<% if @order.payment_attempts >= @order.class::MAX_PAYMENT_ATTEMPTS - 1 %>
|
||||
<strong>Dernière tentative avant expiration !</strong>
|
||||
<% end %>
|
||||
@@ -79,7 +79,7 @@
|
||||
<!-- Order Items -->
|
||||
<div class="space-y-4 mb-6">
|
||||
<h3 class="text-lg font-semibold text-gray-900 mb-4">Récapitulatif de votre commande</h3>
|
||||
|
||||
|
||||
<% @tickets.each do |ticket| %>
|
||||
<div class="flex items-center justify-between py-3 border-b border-gray-100 last:border-b-0">
|
||||
<div class="flex-1 min-w-0">
|
||||
@@ -100,16 +100,8 @@
|
||||
</div>
|
||||
|
||||
<!-- Order Total -->
|
||||
<div class="border-t border-gray-200 pt-6">
|
||||
<div class=" pt-12">
|
||||
<div class="space-y-2">
|
||||
<div class="flex items-center justify-between">
|
||||
<span class="text-gray-600">Sous-total</span>
|
||||
<span class="text-gray-900"><%= @order.total_amount_euros - 1.0 %>€</span>
|
||||
</div>
|
||||
<div class="flex items-center justify-between">
|
||||
<span class="text-gray-600">Frais de service</span>
|
||||
<span class="text-gray-900">1.00€</span>
|
||||
</div>
|
||||
<div class="flex items-center justify-between text-lg pt-2 border-t border-gray-200">
|
||||
<span class="font-medium text-gray-900">Total</span>
|
||||
<span class="font-bold text-2xl text-purple-600"><%= @order.total_amount_euros %>€</span>
|
||||
@@ -139,8 +131,8 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<button
|
||||
id="checkout-button"
|
||||
<button
|
||||
id="checkout-button"
|
||||
data-order-id="<%= @order.id %>"
|
||||
data-increment-url="/api/v1/orders/<%= @order.id %>/increment_payment_attempt"
|
||||
data-session-id="<%= @checkout_session.id if @checkout_session.present? %>"
|
||||
@@ -179,7 +171,7 @@
|
||||
|
||||
console.log('Initializing Stripe with publishable key:', '<%= Rails.application.config.stripe[:publishable_key] %>');
|
||||
const stripe = Stripe('<%= Rails.application.config.stripe[:publishable_key] %>');
|
||||
|
||||
|
||||
const checkoutButton = document.getElementById('checkout-button');
|
||||
if (!checkoutButton) {
|
||||
console.error('Checkout button not found');
|
||||
@@ -230,7 +222,7 @@
|
||||
Redirection vers le paiement...
|
||||
</div>
|
||||
`;
|
||||
|
||||
|
||||
// Redirect to Stripe
|
||||
const sessionId = checkoutButton.dataset.sessionId;
|
||||
console.log('Redirecting to Stripe with session ID:', sessionId);
|
||||
@@ -290,4 +282,4 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user