Fix potential NullPointerException in StripeManager#createPaymentIntent

This commit is contained in:
Chris Eager
2025-08-11 17:26:21 -05:00
committed by GitHub
parent 127bd56f73
commit ad84cd848a

View File

@@ -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));