mirror of
https://github.com/freeCodeCamp/freeCodeCamp.git
synced 2026-01-07 09:03:27 -05:00
fix(client): donation-error-handler (#52517)
This commit is contained in:
@@ -72,7 +72,11 @@ export function* postChargeSaga({
|
||||
}
|
||||
|
||||
if (paymentProvider === PaymentProvider.Stripe) {
|
||||
yield call(postChargeStripe, payload);
|
||||
const response = yield call(postChargeStripe, payload);
|
||||
const error = response?.data?.error;
|
||||
if (error) {
|
||||
throw error;
|
||||
}
|
||||
} else if (paymentProvider === PaymentProvider.StripeCard) {
|
||||
const optimizedPayload = { paymentMethodId, amount, duration };
|
||||
const response = yield call(postChargeStripeCard, optimizedPayload);
|
||||
|
||||
Reference in New Issue
Block a user