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

[Bug]: Missing Invoice Webhooks in Paddle Node.js SDK #80

Closed
Mcoder995 opened this issue Nov 26, 2024 · 2 comments
Closed

[Bug]: Missing Invoice Webhooks in Paddle Node.js SDK #80

Mcoder995 opened this issue Nov 26, 2024 · 2 comments
Assignees

Comments

@Mcoder995
Copy link

What happened?

The Paddle Node.js SDK does not support any webhooks starting with "invoice" (e.g., invoice.issued, invoice.paid,
invoice.overdue, invoice.canceled). These events are essential for handling invoicing workflows but are completely missing from the SDK, making it difficult to process such events natively.

Steps to reproduce

Attempt to configure a webhook in the Paddle Node.js SDK for invoice_payment_succeeded or any other invoice_* event.
Observe that there are no methods or event handlers for these webhooks in the SDK.
Review the SDK documentation and confirm that no reference exists for invoice-related webhooks.

Steps to reproduce

  1. Attempt to configure a webhook in the Paddle Node.js SDK for invoice_payment_succeeded or any other invoice_* event.
  2. Observe that there are no methods or event handlers for these webhooks in the SDK.
  3. Review the SDK documentation and confirm that no reference exists for invoice-related webhooks.

What did you expect to happen?

The SDK should provide support for all Paddle webhooks, including those related to invoices, to ensure full compatibility with Paddle's webhook offerings.

Logs

N/A — this issue is based on missing functionality in the SDK, not runtime errors.
@danbillson danbillson self-assigned this Nov 26, 2024
@danbillson
Copy link
Contributor

Hi @Mcoder995, thanks for raising this, we'll look into this and provide an update soon

@danbillson
Copy link
Contributor

danbillson commented Dec 2, 2024

Hi @Mcoder995, we have added implicit support for these events in 2.1.3 (see #85)

The SDK does not directly support the invoice events i.e. provide the invoice type enum or types but will now still give you the data from the event instead of returning null

An example of this implementation would be for matching on the event type you can manually add in the invoice event types which will be passed through.

    switch (event?.eventType) {
      case EventName.SubscriptionCreated:
           // handle subscribtion created event

      // @ts-ignore
      case "invoice.paid":
          // handle invoice paid event as a generic event

Note that the event?.data will use camel case for object keys to match the rest of the node-sdk instead of snake case from the raw object.

Please feel free to reach out if you need anything else

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