next-stripe-helper
Advanced tools
Comparing version 1.2.2 to 1.2.3
@@ -53,2 +53,10 @@ import { Stripe } from 'stripe'; | ||
/** | ||
* Retrieves a Stripe Connect account. | ||
* | ||
* @param {string} accountId - The ID of the connected account. | ||
* @returns {Promise<Stripe.Account>} - A promise that resolves to the retrieved account. | ||
* @throws {Error} - If there's an error during the request. | ||
*/ | ||
declare const retrieveAccount: (accountId: string) => Promise<Stripe.Account>; | ||
/** | ||
* Creates a Connect Express login link for a connected account. | ||
@@ -62,2 +70,2 @@ * | ||
declare const createConnectExpressLoginLink: (accountId: string) => Promise<string>; | ||
export { createConnectedAccount, createPayout, startOAuthFlow, handleOAuthCallback, createAccountLink, createConnectExpressLoginLink }; | ||
export { createConnectedAccount, createPayout, startOAuthFlow, handleOAuthCallback, createAccountLink, retrieveAccount, createConnectExpressLoginLink }; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.createConnectExpressLoginLink = exports.createAccountLink = exports.handleOAuthCallback = exports.startOAuthFlow = exports.createPayout = exports.createConnectedAccount = void 0; | ||
exports.createConnectExpressLoginLink = exports.retrieveAccount = exports.createAccountLink = exports.handleOAuthCallback = exports.startOAuthFlow = exports.createPayout = exports.createConnectedAccount = void 0; | ||
const stripe_1 = require("../utils/stripe"); | ||
@@ -124,2 +124,19 @@ /** | ||
/** | ||
* Retrieves a Stripe Connect account. | ||
* | ||
* @param {string} accountId - The ID of the connected account. | ||
* @returns {Promise<Stripe.Account>} - A promise that resolves to the retrieved account. | ||
* @throws {Error} - If there's an error during the request. | ||
*/ | ||
const retrieveAccount = async (accountId) => { | ||
try { | ||
const account = await stripe_1.stripe.accounts.retrieve(accountId); | ||
return account; | ||
} | ||
catch (error) { | ||
(0, stripe_1.handleStripeError)(error); | ||
} | ||
}; | ||
exports.retrieveAccount = retrieveAccount; | ||
/** | ||
* Creates a Connect Express login link for a connected account. | ||
@@ -126,0 +143,0 @@ * |
{ | ||
"name": "next-stripe-helper", | ||
"version": "1.2.02", | ||
"version": "1.2.03", | ||
"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", |
@@ -353,2 +353,21 @@ # next-stripe-helper | ||
### Retrieve Connect Account | ||
Retrieves a Stripe Connect account. | ||
```javascript | ||
const account = await retrieveAccount( | ||
'acct_123456789' | ||
); | ||
``` | ||
Parameters: | ||
- `accountId` (required): The ID of the connected account. | ||
Returns: | ||
- An object representing the retrieved Stripe Connect account. | ||
### Create Connect Express Login Link | ||
@@ -355,0 +374,0 @@ |
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
125696
1404
1140