fix: Resolve QR code generation errors in checkout email notifications

This fixes the 'data must be a String, QRSegment, or an Array' error that was
preventing checkout completion.

Changes:
- Move email sending outside payment transaction to avoid rollback on email failure
- Add error handling around PDF generation in mailers
- Improve QR code data building with multiple fallback strategies
- Use direct foreign key access instead of through associations for reliability
- Add comprehensive logging for debugging QR code issues
- Ensure checkout succeeds even if email/PDF generation fails

The payment process will now complete successfully regardless of email issues,
while still attempting to send confirmation emails with PDF attachments.
This commit is contained in:
kbe
2025-09-06 13:33:22 +02:00
parent 241256e373
commit c3f5d72a91
5 changed files with 74 additions and 30 deletions

View File

@@ -25,6 +25,6 @@ module Aperonight
# config.eager_load_paths << Rails.root.join("extras")
config.i18n.load_path += Dir[Rails.root.join("my", "locales", "*.{rb,yml}")]
config.i18n.default_locale = :fr
# config.i18n.default_locale = :fr
end
end