razorpay / razorpay/razorpay-node

Not receiving webhook response when cancelling at period end.

Open
#337 2 comments 0 reactions 1 assignee View on GitHub

@ankitdas13 is already working on this.

Since Apr 24, 2023.

awaiting response
Dominant language
JavaScript
Stars
243
Forks
128
PR merge metrics
No merged PRs in 30d

Description

Hey guys,

When I cancel a subscription at period end, I don't get back any webhook response. Nothing on the dashboard changes either, except a green notification bar pops up and says the subscription will be cancelled at period end, but aside from that no changes. Invoices still show that the next invoice will be billed.

I am getting webhook responses successfully for everything else.

If this doesn't work, I would have to let my customers cancel their subscription immediately, and manually continue their access to premium content till period ends on my side, and this would be very cumbersome.

How can I allow them to cancel their subscription when period ends and why am I not getting a webhook response when I do this?

Also, the code doesn't work:

  await razorpay.subscriptions.cancel(sub_id, {
    cancel_at_cycle_end: 1
  })

I get the following error: Error: The second parameter, Cancel at the end of cycle should be a Boolean. If I change it to true or false I still get that error.

Allowing users to cancel a subscription at period end is pretty basic functionality. If this way doesn't work, please recommend how I can allow users to cancel their subscription at period end.

Also, I would recommend adding functionality similar to Stripe, where they send cancel_at_period_end (which is a bool) with their webhook responses to easily implement this functionality.

Thanks

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.