next-stripe-helper
Advanced tools
Comparing version
@@ -1,2 +0,3 @@ | ||
declare const createPortalLink: (customer: string, returnUrl: string) => Promise<string>; | ||
import Stripe from 'stripe'; | ||
declare const createPortalLink: (object: Stripe.BillingPortal.SessionCreateParams) => Promise<string>; | ||
export { createPortalLink }; |
@@ -5,8 +5,5 @@ "use strict"; | ||
const stripe_1 = require("../utils/stripe"); | ||
const createPortalLink = async (customer, returnUrl) => { | ||
const createPortalLink = async (object) => { | ||
try { | ||
const { url } = await stripe_1.stripe.billingPortal.sessions.create({ | ||
customer: customer, | ||
return_url: returnUrl, | ||
}); | ||
const { url } = await stripe_1.stripe.billingPortal.sessions.create(object); | ||
return url; | ||
@@ -13,0 +10,0 @@ } |
{ | ||
"name": "next-stripe-helper", | ||
"version": "1.1.13", | ||
"version": "1.1.14", | ||
"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 @@ "main": "dist/index.js", |
import Stripe from 'stripe'; | ||
import { handleStripeError, stripe } from '../utils/stripe'; | ||
const createPortalLink = async (customer: string , returnUrl: string) => { | ||
const createPortalLink = async (object: Stripe.BillingPortal.SessionCreateParams) => { | ||
try { | ||
const { url } = await stripe.billingPortal.sessions.create({ | ||
customer: customer, | ||
return_url: returnUrl, | ||
}); | ||
const { url } = await stripe.billingPortal.sessions.create(object); | ||
return url; | ||
@@ -11,0 +8,0 @@ } catch (error) { |
Sorry, the diff of this file is not supported yet
87278
-0.18%1252
-0.4%