We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
What do you think about adding feature for updating subscription price?
This is how it could be:
/** * Update subscription price * * @method * @param {number} subscriptionID * @param {number} price * @param {string} currency * @param {boolean} immediately * @returns {Promise} * @fulfill {object} - The result of the operation * * @example * const result = await client.updateSubscriptionPrice(123, 44, 'USD'); */ updateSubscriptionPrice (subscriptionID, price, currency, immediately = true) { return this._request('/subscription/users/update', { body: { subscription_id: subscriptionID, bill_immediately: immediately, prorate: immediately, quantity: 1, recurring_price: price, currency } }); }
The text was updated successfully, but these errors were encountered:
Please submit this code as a PR.
Sorry, something went wrong.
By the way - we can put extra options to separate object for both methods updateSubscriptionPrice and updateSubscriptionPlan Like this:
updateSubscriptionPrice
updateSubscriptionPlan
updateSubscriptionPlan (subscriptionID, planID, options = {prorate: false}) { // for backward compability: if (typeof options === "boolean") { options = {prorate: options}; } return this._request('/subscription/users/update', { body: { subscription_id: subscriptionID, plan_id: planID, ...options } }); }
and
updateSubscriptionPrice (subscriptionID, price, currency, options) { return this._request('/subscription/users/update', { body: { subscription_id: subscriptionID, recurring_price: price, currency, ...options } }); }
No branches or pull requests
What do you think about adding feature for updating subscription price?
This is how it could be:
The text was updated successfully, but these errors were encountered: