fix(client): donation-error-handler (#52517)

This commit is contained in:
Niraj Nandish
2024-01-09 23:47:35 +05:30
committed by GitHub
parent 77fc74584f
commit 09e1fdad28

View File

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