New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

next-stripe-helper

Package Overview
Dependencies
Maintainers
1
Versions
71
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

next-stripe-helper - npm Package Compare versions

Comparing version 1.2.7 to 1.2.8

8

dist/subscriptions/index.d.ts

@@ -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>;

8

dist/subscriptions/index.js

@@ -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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc