From cdbd4a7e012e758f38e265bb54aaec453af193d4 Mon Sep 17 00:00:00 2001 From: Guillaume AGNIERAY Date: Wed, 7 Oct 2026 14:42:10 +0200 Subject: [PATCH 1/2] Add specific success message for delayed payments --- .../Controllers/StripeController.php | 3 ++- templates/default/stripe_success.html.twig | 20 ++++++++++++------- 2 files changed, 15 insertions(+), 8 deletions(-) diff --git a/lib/GaletteStripe/Controllers/StripeController.php b/lib/GaletteStripe/Controllers/StripeController.php index 825af19..e063b3b 100644 --- a/lib/GaletteStripe/Controllers/StripeController.php +++ b/lib/GaletteStripe/Controllers/StripeController.php @@ -588,7 +588,8 @@ public function successUrl(Request $request, Response $response): Response 'amount' => $stripe->isZeroDecimal($stripe->getCurrency()) ? $payment_intent->amount_received : $payment_intent->amount_received / 100, 'date' => $payment_intent->created, 'method' => $payment_intent->payment_method_types[0], - 'reason' => $metadata['item_name'] + 'reason' => $metadata['item_name'], + 'status' => $payment_intent->status ]; $params = [ diff --git a/templates/default/stripe_success.html.twig b/templates/default/stripe_success.html.twig index a474dfa..b0a17c9 100644 --- a/templates/default/stripe_success.html.twig +++ b/templates/default/stripe_success.html.twig @@ -10,19 +10,25 @@ {% if details is not empty %} {% set amount = stripe.isZeroDecimal(stripe.getCurrency()) ? details.amount|round : details.amount %}
- +
- {{ _T('Your payment has succeeded', "stripe") }} + {% if details.status == 'processing' %} + {{ _T('Your payment is being processed', "stripe") }} + {% else %} + {{ _T('Your payment has succeeded', "stripe") }} + {% endif %}
-

{{ _T('You will receive an email with the following details', 'stripe') }}

+

{{ _T('A receipt will be sent to you by email once it has been validated', 'stripe') }}

- - - - + {% if details.status != 'processing' %} + + + + + {% endif %} From c2aec71e28527d59e163247b779634ff5c9259fa Mon Sep 17 00:00:00 2001 From: Guillaume AGNIERAY Date: Wed, 7 Oct 2026 21:12:31 +0200 Subject: [PATCH 2/2] Extract new locales --- lang/stripe.pot | 37 ++++++++++++++++++++---------------- lang/stripe_en_US.po | 45 ++++++++++++++++++++++++-------------------- 2 files changed, 46 insertions(+), 36 deletions(-) diff --git a/lang/stripe.pot b/lang/stripe.pot index 43330d8..716249e 100644 --- a/lang/stripe.pot +++ b/lang/stripe.pot @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: translations@galette.eu\n" -"POT-Creation-Date: 2026-09-30 12:25+0200\n" +"POT-Creation-Date: 2026-10-07 14:40+0200\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -60,7 +60,7 @@ msgid "An error occurred loading the checkout form." msgstr "" #: ../lib/GaletteStripe/Controllers/StripeController.php:221 -#: ../lib/GaletteStripe/PluginGaletteStripe.php:55 +#: ../lib/GaletteStripe/PluginGaletteStripe.php:56 msgid "Stripe History" msgstr "" @@ -80,48 +80,53 @@ msgstr "" msgid "An error occurred saving stripe settings." msgstr "" -#: ../lib/GaletteStripe/Controllers/StripeController.php:592 +#: ../lib/GaletteStripe/Controllers/StripeController.php:596 msgid "Payment done" msgstr "" -#: ../lib/GaletteStripe/Controllers/StripeController.php:624 +#: ../lib/GaletteStripe/Controllers/StripeController.php:628 msgid "Your payment has been aborted!" msgstr "" -#: ../lib/GaletteStripe/PluginGaletteStripe.php:47 +#: ../lib/GaletteStripe/PluginGaletteStripe.php:48 msgid "Stripe" msgstr "" -#: ../lib/GaletteStripe/PluginGaletteStripe.php:82 -#: ../lib/GaletteStripe/PluginGaletteStripe.php:106 +#: ../lib/GaletteStripe/PluginGaletteStripe.php:83 +#: ../lib/GaletteStripe/PluginGaletteStripe.php:111 +#: ../lib/GaletteStripe/PluginGaletteStripe.php:129 msgid "Payment form" msgstr "" -#: ../lib/GaletteStripe/StripeHistory.php:182 +#: ../lib/GaletteStripe/StripeHistory.php:202 msgid "None" msgstr "" -#: ../templates/default/stripe_success.html.twig:16 +#: ../templates/default/stripe_success.html.twig:17 +msgid "Your payment is being processed" +msgstr "" + +#: ../templates/default/stripe_success.html.twig:19 msgid "Your payment has succeeded" msgstr "" -#: ../templates/default/stripe_success.html.twig:18 -msgid "You will receive an email with the following details" +#: ../templates/default/stripe_success.html.twig:22 +msgid "A receipt will be sent to you by email once it has been validated" msgstr "" -#: ../templates/default/stripe_success.html.twig:23 +#: ../templates/default/stripe_success.html.twig:28 msgid "Amount paid" msgstr "" -#: ../templates/default/stripe_success.html.twig:27 +#: ../templates/default/stripe_success.html.twig:33 msgid "Payment date" msgstr "" -#: ../templates/default/stripe_success.html.twig:31 +#: ../templates/default/stripe_success.html.twig:37 msgid "Payment method" msgstr "" -#: ../templates/default/stripe_success.html.twig:35 +#: ../templates/default/stripe_success.html.twig:41 #: ../templates/default/stripe_form.html.twig:15 msgid "Payment reason" msgstr "" @@ -271,6 +276,6 @@ msgid "" "the contributions types settings." msgstr "" -#: ../templates/default/stripe_preferences.html.twig:149 +#: ../templates/default/stripe_preferences.html.twig:150 msgid "Select a currency" msgstr "" diff --git a/lang/stripe_en_US.po b/lang/stripe_en_US.po index 4ab31c7..e06141d 100644 --- a/lang/stripe_en_US.po +++ b/lang/stripe_en_US.po @@ -6,14 +6,14 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2026-09-30 12:25+0200\n" -"PO-Revision-Date: 2026-09-30 12:25+0200\n" +"Report-Msgid-Bugs-To: translations@galette.eu\n" +"POT-Creation-Date: 2026-10-07 14:40+0200\n" +"PO-Revision-Date: 2026-10-07 14:40+0200\n" "Last-Translator: Automatically generated\n" "Language-Team: none\n" "Language: en_US\n" "MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=ASCII\n" +"Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" @@ -67,7 +67,7 @@ msgid "An error occurred loading the checkout form." msgstr "An error occurred loading the checkout form." #: ../lib/GaletteStripe/Controllers/StripeController.php:221 -#: ../lib/GaletteStripe/PluginGaletteStripe.php:55 +#: ../lib/GaletteStripe/PluginGaletteStripe.php:56 msgid "Stripe History" msgstr "Stripe History" @@ -87,48 +87,53 @@ msgstr "Stripe settings have been saved." msgid "An error occurred saving stripe settings." msgstr "An error occurred saving stripe settings." -#: ../lib/GaletteStripe/Controllers/StripeController.php:592 +#: ../lib/GaletteStripe/Controllers/StripeController.php:596 msgid "Payment done" msgstr "Payment done" -#: ../lib/GaletteStripe/Controllers/StripeController.php:624 +#: ../lib/GaletteStripe/Controllers/StripeController.php:628 msgid "Your payment has been aborted!" msgstr "Your payment has been aborted!" -#: ../lib/GaletteStripe/PluginGaletteStripe.php:47 +#: ../lib/GaletteStripe/PluginGaletteStripe.php:48 msgid "Stripe" msgstr "Stripe" -#: ../lib/GaletteStripe/PluginGaletteStripe.php:82 -#: ../lib/GaletteStripe/PluginGaletteStripe.php:106 +#: ../lib/GaletteStripe/PluginGaletteStripe.php:83 +#: ../lib/GaletteStripe/PluginGaletteStripe.php:111 +#: ../lib/GaletteStripe/PluginGaletteStripe.php:129 msgid "Payment form" msgstr "Payment form" -#: ../lib/GaletteStripe/StripeHistory.php:182 +#: ../lib/GaletteStripe/StripeHistory.php:202 msgid "None" msgstr "None" -#: ../templates/default/stripe_success.html.twig:16 +#: ../templates/default/stripe_success.html.twig:17 +msgid "Your payment is being processed" +msgstr "Your payment is being processed" + +#: ../templates/default/stripe_success.html.twig:19 msgid "Your payment has succeeded" msgstr "Your payment has succeeded" -#: ../templates/default/stripe_success.html.twig:18 -msgid "You will receive an email with the following details" -msgstr "You will receive an email with the following details" +#: ../templates/default/stripe_success.html.twig:22 +msgid "A receipt will be sent to you by email once it has been validated" +msgstr "A receipt will be sent to you by email once it has been validated" -#: ../templates/default/stripe_success.html.twig:23 +#: ../templates/default/stripe_success.html.twig:28 msgid "Amount paid" msgstr "Amount paid" -#: ../templates/default/stripe_success.html.twig:27 +#: ../templates/default/stripe_success.html.twig:33 msgid "Payment date" msgstr "Payment date" -#: ../templates/default/stripe_success.html.twig:31 +#: ../templates/default/stripe_success.html.twig:37 msgid "Payment method" msgstr "Payment method" -#: ../templates/default/stripe_success.html.twig:35 +#: ../templates/default/stripe_success.html.twig:41 #: ../templates/default/stripe_form.html.twig:15 msgid "Payment reason" msgstr "Payment reason" @@ -282,6 +287,6 @@ msgstr "" "reason on the form. You can disable this reason, or set a positive value in " "the contributions types settings." -#: ../templates/default/stripe_preferences.html.twig:149 +#: ../templates/default/stripe_preferences.html.twig:150 msgid "Select a currency" msgstr "Select a currency"
{{ _T('Amount paid', 'stripe') }}{{ amount|format_currency(stripe.getCurrency(), {}, i18n.getWebID()) }}
{{ _T('Amount paid', 'stripe') }}{{ amount|format_currency(stripe.getCurrency(), {}, i18n.getWebID()) }}
{{ _T('Payment date', 'stripe') }} {{ details.date|date("Y-m-d H:i") }}