Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
unclebay143 opened this issue Mar 15, 2023 · 1 comment
Open

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

unclebay143 opened this issue Mar 15, 2023 · 1 comment

Comments

@unclebay143
Copy link

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
@iamraphson
Copy link
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
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants