razorpay / razorpay/razorpay-node

cancel_at_cycle_end: true ignored — subscription cancel is not working

Open
#452 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
JavaScript
Stars
243
Forks
129
PR merge metrics
No merged PRs in 30d

Description

Steps to reproduce the behavior

When calling:

razorpay.subscriptions.cancel(subId, { cancel_at_cycle_end: true });

The subscription is not canceled at the end of the billing cycle. The API response shows:

"has_scheduled_changes": false,
"change_scheduled_at": null

even though the cancel_at_cycle_end parameter was provided.

Impact:

This makes it impossible to show a "cancels at end of period" message in the UI or honor user intent, forcing developers to implement unreliable workarounds.

Expected behavior

According to the official docs, passing cancel_at_cycle_end: true should:

Schedule cancellation at the end of the current cycle

Return:

"has_scheduled_changes": true,
"change_scheduled_at": "cycle_end",
"current_end": [timestamp]
Impact:

This makes it impossible to show a "cancels at end of period" message in the UI or honor user intent, forcing developers to implement unreliable workarounds.

Actual behavior

When calling:

razorpay.subscriptions.cancel(subId, { cancel_at_cycle_end: true });

The subscription is not canceled at the end of the billing cycle. The API response shows:

"has_scheduled_changes": false,
"change_scheduled_at": null

even though the cancel_at_cycle_end parameter was provided.

Impact:

This makes it impossible to show a "cancels at end of period" message in the UI or honor user intent, forcing developers to implement unreliable workarounds.

Code snippets

Node version

v23.11.0

Library version

^2.9.6

Additional Information
Impact:

This makes it impossible to show a "cancels at end of period" message in the UI or honor user intent, forcing developers to implement unreliable workarounds.

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.

Research direction

Start at the subscriptions.cancel(subId, { cancel_at_cycle_end: true }) entry point and reproduce the request using Node v23.11.0 with library version ^2.9.6. Verify whether the parameter is sent and whether the response reports has_scheduled_changes: true, change_scheduled_at: "cycle_end", and current_end; done means cancellation is scheduled at cycle end and the documented response is returned.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, node.js
Domain
api, backend, payments
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.