acceptStripeWebhook method
Future<DVDisputeResult>
acceptStripeWebhook(
- DVStripeBillingProvider stripe, {
- required String payload,
- required String signatureHeader,
Verifies a Stripe webhook and applies it when it is a dispute event.
Throws DVBillingError for a signature that is missing, wrong or stale, having changed nothing; the route answers that with a client error.
Implementation
Future<DVDisputeResult> acceptStripeWebhook(
DVStripeBillingProvider stripe, {
required String payload,
required String signatureHeader,
}) async {
final Map<String, Object?> event =
stripe.verifyEvent(payload, signatureHeader);
final DVDisputeEvent? dispute = DVStripeDisputeEvents.parse(event);
if (dispute == null) return const DVDisputeResult();
return accept(dispute);
}