razorpay / razorpay-node

Razorpay node.js bindings
MIT License
182 stars 111 forks source link

Subscription cancellation with options doesn't work. #325

Open rranjan14 opened 2 years ago

rranjan14 commented 2 years ago

Steps to reproduce the behavior

  1. Create a subscription.
  2. Pass { cancel_at_cycle_end: 1 } as options to the cancel function.

Expected behavior

The subscription should have been cancelled at the end of the cycle rather than getting cancelled immediately.

Actual behavior

Subscription gets cancelled immediately.

Code snippets

No response

Node version

v16.14.2

Library version

v2.8.4

Additional Information

No response

ankitdas13 commented 2 years ago

@rranjan14 Apologise for the issue you are experiencing. I just checked the cancel api and i found that the code snippet is not updated. Could you please check this code snippet and let me know?

instance.subscriptions.cancel("sub_KlLQabJyisz3mu",true)

false (default): Cancel the subscription immediately. true: Cancel the subscription at the end of the current billing cycle.

ankitdas13 commented 2 years ago

@rranjan14 could you please confirm is it worked or not ?

rranjan14 commented 2 years ago

@ankitdas13 Yes, this worked. Thankyou! :)

rranjan14 commented 1 year ago

Very strange. The problem started again.

ankitdas13 commented 1 year ago

@rranjan14 could you please update the node sdk to the latest version v2.8.6 & let me know is the issue still persist or not ?