From 5721e51e81bf5b9ce89c849ef9488acdf83b232d Mon Sep 17 00:00:00 2001 From: Sean Delaney Date: Thu, 4 Jun 2026 16:35:30 +0100 Subject: [PATCH] fix(SFT-2801): minimum amount value used in Stripe payment intents --- .../PaymentGateways/Stripe/Fields/StripeField.php | 2 +- .../PaymentGateways/Stripe/Services/StripePriceService.php | 6 ++++++ packages/plugin/src/translations/de/freeform.php | 1 + packages/plugin/src/translations/en/freeform.php | 1 + packages/plugin/src/translations/fr/freeform.php | 1 + packages/plugin/src/translations/it/freeform.php | 1 + packages/plugin/src/translations/nl/freeform.php | 1 + 7 files changed, 12 insertions(+), 1 deletion(-) diff --git a/packages/plugin/src/Integrations/PaymentGateways/Stripe/Fields/StripeField.php b/packages/plugin/src/Integrations/PaymentGateways/Stripe/Fields/StripeField.php index 5375f274e1..d5cad8474d 100644 --- a/packages/plugin/src/Integrations/PaymentGateways/Stripe/Fields/StripeField.php +++ b/packages/plugin/src/Integrations/PaymentGateways/Stripe/Fields/StripeField.php @@ -177,7 +177,7 @@ class StripeField extends AbstractField implements PaymentFieldInterface, SkipGi #[ValueTransformer(FieldTransformer::class)] #[Input\Field( label: 'Payment Amount Field', - instructions: 'Select a Number field which will determine the payment amount.', + instructions: 'Select a Number field which will determine the payment amount. The minimum amount is $0.50 US or equivalent in Payment Currency.', emptyOption: 'No field selected', implements: [ NumericInterface::class, diff --git a/packages/plugin/src/Integrations/PaymentGateways/Stripe/Services/StripePriceService.php b/packages/plugin/src/Integrations/PaymentGateways/Stripe/Services/StripePriceService.php index 3d74d3c834..fd62604f62 100644 --- a/packages/plugin/src/Integrations/PaymentGateways/Stripe/Services/StripePriceService.php +++ b/packages/plugin/src/Integrations/PaymentGateways/Stripe/Services/StripePriceService.php @@ -154,6 +154,12 @@ private function getDynamicAmount(Form $form, StripeField $field): float $amount = (float) $formField->getValue(); } + // Stripe expects the minimum amount of $0.50 US or equivalent in Payment Currency. + // https://docs.stripe.com/api/payment_intents/create?lang=php&api-version=2026-02-25.clover#create_payment_intent-amount + if (empty($amount)) { + return 0.5; + } + return $amount; } diff --git a/packages/plugin/src/translations/de/freeform.php b/packages/plugin/src/translations/de/freeform.php index f86b52e524..9ff509de63 100644 --- a/packages/plugin/src/translations/de/freeform.php +++ b/packages/plugin/src/translations/de/freeform.php @@ -259,6 +259,7 @@ 'Enter the amount you want to charge for this payment.' => 'Geben Sie den Betrag ein, den Sie für diese Zahlung berechnen möchten.', 'Payment Amount Field' => 'Zahlungsbetragsfeld', 'Select a Number field which will determine the payment amount.' => 'Wählen Sie ein Zahlenfeld aus, das den Zahlungsbetrag bestimmt.', + 'Select a Number field which will determine the payment amount. The minimum amount is $0.50 US or equivalent in Payment Currency.' => 'Wählen Sie ein Zahlenfeld aus, das den Zahlungsbetrag bestimmt. Der Mindestbetrag beträgt 0,50 US-Dollar oder den entsprechenden Gegenwert in Ihrer Währung.', 'Payment Currency' => 'Zahlungswährung', 'Subscription Product Name' => 'Name des Abonnementprodukts', 'Enter the name of the product you want to subscribe to. You can use the `form` and `integration` objects in twig.' => 'Geben Sie den Namen des Produkts ein, für das Sie sich anmelden möchten. Sie können die Objekte `form` und `integration` in Twig verwenden.', diff --git a/packages/plugin/src/translations/en/freeform.php b/packages/plugin/src/translations/en/freeform.php index 7a5b87967c..7906cada3c 100644 --- a/packages/plugin/src/translations/en/freeform.php +++ b/packages/plugin/src/translations/en/freeform.php @@ -259,6 +259,7 @@ 'Enter the amount you want to charge for this payment.' => 'Enter the amount you want to charge for this payment.', 'Payment Amount Field' => 'Payment Amount Field', 'Select a Number field which will determine the payment amount.' => 'Select a Number field which will determine the payment amount.', + 'Select a Number field which will determine the payment amount. The minimum amount is $0.50 US or equivalent in Payment Currency.' => 'Select a Number field which will determine the payment amount. The minimum amount is $0.50 US or equivalent in Payment Currency.', 'Payment Currency' => 'Payment Currency', 'Subscription Product Name' => 'Subscription Product Name', 'Enter the name of the product you want to subscribe to. You can use the `form` and `integration` objects in twig.' => 'Enter the name of the product you want to subscribe to. You can use the `form` and `integration` objects in twig.', diff --git a/packages/plugin/src/translations/fr/freeform.php b/packages/plugin/src/translations/fr/freeform.php index 4078b66c1f..63b621cdd5 100644 --- a/packages/plugin/src/translations/fr/freeform.php +++ b/packages/plugin/src/translations/fr/freeform.php @@ -259,6 +259,7 @@ 'Enter the amount you want to charge for this payment.' => 'Entrez le montant que vous voulez facturer pour ce paiement.', 'Payment Amount Field' => 'Champ du montant du paiement', 'Select a Number field which will determine the payment amount.' => 'Sélectionnez un champ Nombre qui déterminera le montant du paiement.', + 'Select a Number field which will determine the payment amount. The minimum amount is $0.50 US or equivalent in Payment Currency.' => 'Sélectionnez un champ Nombre qui déterminera le montant du paiement. Le montant minimum est de 0,50$ US ou l’équivalent dans la devise de paiement.', 'Payment Currency' => 'Devise du paiement', 'Subscription Product Name' => 'Nom du produit d’abonnement', 'Enter the name of the product you want to subscribe to. You can use the `form` and `integration` objects in twig.' => 'Entrez le nom du produit auquel vous voulez vous abonner. Vous pouvez utiliser les objets `form` et `integration` dans twig.', diff --git a/packages/plugin/src/translations/it/freeform.php b/packages/plugin/src/translations/it/freeform.php index da5a4910de..be697bd591 100644 --- a/packages/plugin/src/translations/it/freeform.php +++ b/packages/plugin/src/translations/it/freeform.php @@ -259,6 +259,7 @@ 'Enter the amount you want to charge for this payment.' => 'Inserisci l’importo da addebitare per questo pagamento.', 'Payment Amount Field' => 'Campo importo del pagamento', 'Select a Number field which will determine the payment amount.' => 'Seleziona un campo numerico che determinerà l’importo del pagamento.', + 'Select a Number field which will determine the payment amount. The minimum amount is $0.50 US or equivalent in Payment Currency.' => 'Seleziona un campo numerico che determinerà l’importo del pagamento. L’importo minimo è di 0,50 dollari USA o l’equivalente nella valuta di pagamento.', 'Payment Currency' => 'Valuta del pagamento', 'Subscription Product Name' => 'Nome del prodotto in abbonamento', 'Enter the name of the product you want to subscribe to. You can use the `form` and `integration` objects in twig.' => 'Inserisci il nome del prodotto a cui abbonarsi. Puoi usare gli oggetti `form` e `integration` in Twig.', diff --git a/packages/plugin/src/translations/nl/freeform.php b/packages/plugin/src/translations/nl/freeform.php index 43180623cd..2a5990b9b7 100644 --- a/packages/plugin/src/translations/nl/freeform.php +++ b/packages/plugin/src/translations/nl/freeform.php @@ -259,6 +259,7 @@ 'Enter the amount you want to charge for this payment.' => 'Vul het bedrag in dat u voor deze betaling in rekening wilt brengen.', 'Payment Amount Field' => 'Betalingsbedragveld', 'Select a Number field which will determine the payment amount.' => 'Selecteer een nummerveld dat het betalingsbedrag bepaalt.', + 'Select a Number field which will determine the payment amount. The minimum amount is $0.50 US or equivalent in Payment Currency.' => 'Selecteer een nummerveld dat het betalingsbedrag bepaalt. Het minimumbedrag is $0,50 USD of het equivalent in de betaalvaluta.', 'Payment Currency' => 'Betalingsvaluta', 'Subscription Product Name' => 'Productnaam abonnement', 'Enter the name of the product you want to subscribe to. You can use the `form` and `integration` objects in twig.' => 'Vul de naam in van het product waarop u zich wilt abonneren. U kunt de `form`- en `integration`-objecten in twig gebruiken.',