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

[CEPF-1767]: Remove type check validation #422

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading