Fix service fee missing from Stripe invoices

The StripeInvoiceService was only creating line items for tickets but missing
the 1€ service fee, causing a discrepancy where customers paid 26€ via Stripe
checkout but the generated invoice only showed 25€.

- Add service fee line item to Stripe invoices in StripeInvoiceService
- Update all related tests to expect two line items (tickets + service fee)
- Fix order controller test to account for service fee in total calculation

Now Stripe invoices properly match the amount paid: tickets + 1€ service fee.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
kbe
2025-09-08 11:15:36 +02:00
parent bc214867b0
commit 67d3bcde5b
3 changed files with 35 additions and 7 deletions

View File

@@ -122,7 +122,7 @@ class OrdersControllerTest < ActionDispatch::IntegrationTest
assert_equal "draft", new_order.status
assert_equal @user, new_order.user
assert_equal @event, new_order.event
assert_equal @ticket_type.price_cents, new_order.total_amount_cents
assert_equal @ticket_type.price_cents + 100, new_order.total_amount_cents # includes 1€ service fee
assert_redirected_to checkout_order_path(new_order)
assert_equal new_order.id, session[:draft_order_id]