Fix potential NullPointerException in StripeManager#createPaymentIntent

This commit is contained in:
Chris Eager authored and GitHub committed 2025-08-11 18:26:21 -04:00
1 parent 127bd56f73
commit ad84cd848a
1 file changed
+1 -1
@@ -229,7 +229,7 @@ public class StripeManager implements CustomerAwareSubscriptionPaymentProcessor
try {
return stripeClient.paymentIntents().create(builder.build(), commonOptions());
} catch (StripeException e) {
final String errorCode = e.getCode().toLowerCase(Locale.ROOT);
final String errorCode = StringUtils.lowerCase(e.getCode(), Locale.ROOT);
switch (errorCode) {
case "amount_too_small","amount_too_large" ->
throw ExceptionUtils.wrap(new SubscriptionException.InvalidAmount(errorCode));