Skip to content

Commit

Permalink
remove type check validation (#422)
Browse files Browse the repository at this point in the history
  • Loading branch information
ankitdas13 authored Oct 23, 2024
1 parent d836994 commit 51cd366
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 9 deletions.
6 changes: 0 additions & 6 deletions lib/resources/subscriptions.js
Original file line number Diff line number Diff line change
Expand Up @@ -246,12 +246,6 @@ module.exports = function subscriptionsApi (api) {
return Promise.reject(MISSING_ID_ERROR);
}

if (typeof cancelAtCycleEnd !== "boolean") {

return Promise.reject("The second parameter, Cancel at the end of cycle" +
" should be a Boolean");
}

return api.post({
url,
...(cancelAtCycleEnd && {data: {cancel_at_cycle_end: 1}})
Expand Down
6 changes: 3 additions & 3 deletions lib/types/subscriptions.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -356,11 +356,11 @@ declare function subscriptions(api: any): {
* Cancel a subscription given id and optional cancelAtCycleEnd
*
* @param subscriptionId - The unique identifier of the Subscription.
* @param cancelAtCycleEnd - `false` (default): Cancel the subscription immediately.
* @param cancelAtCycleEnd - `false` or `0` (default): Cancel the subscription immediately.
*
*/
cancel(subscriptionId: string, cancelAtCycleEnd?: boolean): Promise<Subscriptions.RazorpaySubscription>
cancel(subscriptionId: string, cancelAtCycleEnd: boolean, callback: (err: INormalizeError | null, data: Subscriptions.RazorpaySubscription) => void): void;
cancel(subscriptionId: string, cancelAtCycleEnd?: boolean | number): Promise<Subscriptions.RazorpaySubscription>
cancel(subscriptionId: string, cancelAtCycleEnd: boolean| number, callback: (err: INormalizeError | null, data: Subscriptions.RazorpaySubscription) => void): void;
/**
* Delete offer linked to a subscription
*
Expand Down

0 comments on commit 51cd366

Please sign in to comment.