Skip to content

The invoice.update event isn't getting called in webhook #80

Open

Description

@unclebay143

Hi team,

For some unknown reason, the invoice.update event isn't getting called in our webhook when a subscription is renewed by Paystack.

Here's the switch case that covered the event. Are we probably doing something wrong? Other events work as expected.

case 'invoice.update':
  if (data.status === 'success' && data.paid) {
    await Subscription.findOneAndUpdate(
      { userId },
      {
        $set: {
          startDate: data.period_start,
          endDate: data.period_end,
          customerCode: data.customer.customer_code,
          subCode: data.subscription.subscription_code,
          amount: data.amount,
          currency: data.currency,
        },
      },
    )
  }
  break
  • Using Next.js

Activity

  1. iamraphson commented on Apr 2, 2023

    @iamraphson
    Owner

    is this related to webhook or react lib?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions