(ctx context.Context, event *stripego.Event)
| 80 | } |
| 81 | |
| 82 | func (h *WebhookHandler) processEvent(ctx context.Context, event *stripego.Event) error { |
| 83 | switch event.Type { |
| 84 | case |
| 85 | "customer.subscription.created", |
| 86 | "customer.subscription.updated", |
| 87 | "customer.subscription.deleted", |
| 88 | "customer.subscription.paused", |
| 89 | "customer.subscription.resumed": |
| 90 | return h.handleSubscriptionStatusChange(ctx, event) |
| 91 | case "invoice.paid": |
| 92 | return h.handleInvoicePaid(ctx, event) |
| 93 | default: |
| 94 | return nil |
| 95 | } |
| 96 | } |
| 97 | |
| 98 | func (h *WebhookHandler) handleSubscriptionStatusChange(ctx context.Context, event *stripego.Event) error { |
| 99 | var sub stripego.Subscription |
no test coverage detected