next-stripe-helper
Advanced tools
Comparing version 1.2.7 to 1.2.8
@@ -11,5 +11,11 @@ import Stripe from "stripe"; | ||
* @param {string} priceId - The ID of the price (related to a product) to which the customer is subscribing. | ||
* @param {number} trial_period_days - The number of days for the trial period. | ||
* @param {Object} trial_settings - Settings related to subscription trials. This object should have an 'end_behavior' property that specifies how the subscription should behave when the trial ends, and a 'missing_payment_method' property that indicates how the subscription should change if no payment method is provided by the end of the trial. | ||
* @returns {Promise<Stripe.Subscription>} - The newly created subscription object. | ||
*/ | ||
declare function createSubscription(customerId: string, priceId: string): Promise<Stripe.Subscription>; | ||
declare function createSubscription(customerId: string, priceId: string, trial_period_days: number, trial_settings: { | ||
end_behavior: { | ||
missing_payment_method: 'cancel' | 'pause' | 'create_invoice'; | ||
}; | ||
}): Promise<Stripe.Subscription>; | ||
declare function getUserSubscriptions(customerId: string): Promise<Stripe.Response<Stripe.ApiList<Stripe.Subscription>> | null>; | ||
@@ -16,0 +22,0 @@ declare function getUserSubscription(subscriptionID: string): Promise<Stripe.Subscription>; |
@@ -10,8 +10,12 @@ "use strict"; | ||
* @param {string} priceId - The ID of the price (related to a product) to which the customer is subscribing. | ||
* @param {number} trial_period_days - The number of days for the trial period. | ||
* @param {Object} trial_settings - Settings related to subscription trials. This object should have an 'end_behavior' property that specifies how the subscription should behave when the trial ends, and a 'missing_payment_method' property that indicates how the subscription should change if no payment method is provided by the end of the trial. | ||
* @returns {Promise<Stripe.Subscription>} - The newly created subscription object. | ||
*/ | ||
async function createSubscription(customerId, priceId) { | ||
async function createSubscription(customerId, priceId, trial_period_days, trial_settings) { | ||
return await stripe_1.stripe.subscriptions.create({ | ||
customer: customerId, | ||
items: [{ price: priceId }] | ||
items: [{ price: priceId }], | ||
trial_period_days: trial_period_days, | ||
trial_settings: trial_settings | ||
}); | ||
@@ -18,0 +22,0 @@ } |
{ | ||
"name": "next-stripe-helper", | ||
"version": "1.2.07", | ||
"version": "1.2.08", | ||
"description": "Easily add Stripe boilerplate code to Nextjs, like webhook handling, and subscription updates. This package provides a thin wrapper around the Stripe API, and makes integrating Stripe and NextJS a lot faster!", | ||
@@ -5,0 +5,0 @@ "homepage": "https://github.com/i-dream-of-ai/next-stripe-helper", |
Sorry, the diff of this file is not supported yet
Manifest confusion
Supply chain riskThis package has inconsistent metadata. This could be malicious or caused by an error when publishing the package.
Found 1 instance in 1 package
Manifest confusion
Supply chain riskThis package has inconsistent metadata. This could be malicious or caused by an error when publishing the package.
Found 1 instance in 1 package
147341
1593