webhook static method

CoffrifyWebhook webhook({
  1. String? id,
  2. String? name,
  3. String? url,
  4. List<String>? events,
  5. bool isActive = true,
})

Build a CoffrifyWebhook with overridable fields.

Implementation

static CoffrifyWebhook webhook({
  String? id,
  String? name,
  String? url,
  List<String>? events,
  bool isActive = true,
}) {
  final n = ++_seq;
  return CoffrifyWebhook(
    id: id ?? 'wh_test_${_pad(n)}',
    name: name ?? 'Fixture webhook $n',
    url: url ?? 'https://example.com/hook',
    events: events ?? const ['transfer.created'],
    isActive: isActive,
    signingVersion: 'v1',
    retryPolicy:
        const WebhookRetryPolicy(maxAttempts: 12, backoffBaseSeconds: 30),
    successCount: 0,
    failureCount: 0,
    createdAt: DateTime(2026, 5, 1, 12),
  );
}