Back to snapcart-api report
ReliabilityMedium
Missing Error Handling
src/services/payment.ts:73
Before
1export async function capture(orderId: string) {2 const intent = await paymentGateway.authorize(orderId);3 const charge = await paymentGateway.capture(intent.id); // may throw4 return { ok: true, charge };5}After
1export async function capture(orderId: string) {2 try {3 const intent = await paymentGateway.authorize(orderId);4 const charge = await paymentGateway.capture(intent.id);5 return { ok: true, charge };6 } catch (err) {7 await markChargeFailed(orderId, err);8 return { ok: false };9 }10}- Uploaddone
- Analyzedone
- Finddone
- Explainactive
- Fixupcoming
- Testupcoming
- Verifyupcoming