@flopay/node 1.14.4 → 1.14.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
declare const STRIPE_API_VERSION = "2026-04-22.dahlia";
|
|
1
|
+
import type { CheckoutSession, CheckoutSessionResult, CreateCustomerParams, CreateSessionParams, Customer, LineItem, UpdateCustomerParams, WebhookEvent } from '@flopay/shared';
|
|
2
|
+
export declare const STRIPE_API_VERSION = "2026-04-22.dahlia";
|
|
4
3
|
/** Options for the FloPay Node SDK constructor. */
|
|
5
|
-
interface FloPayNodeOptions {
|
|
4
|
+
export interface FloPayNodeOptions {
|
|
6
5
|
apiVersion?: string;
|
|
7
6
|
/** Stripe secret key, required when using Stripe-specific operations. */
|
|
8
7
|
stripeSecretKey?: string;
|
|
@@ -38,7 +37,7 @@ interface FloPayNodeOptions {
|
|
|
38
37
|
* });
|
|
39
38
|
* ```
|
|
40
39
|
*/
|
|
41
|
-
declare class FloPay {
|
|
40
|
+
export declare class FloPay {
|
|
42
41
|
private readonly stripe;
|
|
43
42
|
readonly checkout: {
|
|
44
43
|
sessions: {
|
|
@@ -78,5 +77,3 @@ declare class FloPay {
|
|
|
78
77
|
private retrieveCustomer;
|
|
79
78
|
private updateCustomer;
|
|
80
79
|
}
|
|
81
|
-
|
|
82
|
-
export { FloPay, type FloPayNodeOptions, STRIPE_API_VERSION };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,82 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
declare const STRIPE_API_VERSION = "2026-04-22.dahlia";
|
|
4
|
-
/** Options for the FloPay Node SDK constructor. */
|
|
5
|
-
interface FloPayNodeOptions {
|
|
6
|
-
apiVersion?: string;
|
|
7
|
-
/** Stripe secret key, required when using Stripe-specific operations. */
|
|
8
|
-
stripeSecretKey?: string;
|
|
9
|
-
}
|
|
10
|
-
/**
|
|
11
|
-
* Server-side FloPay SDK.
|
|
12
|
-
*
|
|
13
|
-
* Supports two modes of operation:
|
|
14
|
-
*
|
|
15
|
-
* 1. **Billing API mode** — Creates checkout sessions via the FloPay/ClickTech
|
|
16
|
-
* billing API (`POST /v1/checkouts/sessions`). This mirrors the
|
|
17
|
-
* `createCheckoutSession` function from `clicktech-core-ui`.
|
|
18
|
-
*
|
|
19
|
-
* 2. **Stripe direct mode** — When a `stripeSecretKey` is provided, also
|
|
20
|
-
* exposes direct Stripe operations (customers, webhooks).
|
|
21
|
-
*
|
|
22
|
-
* @example
|
|
23
|
-
* ```ts
|
|
24
|
-
* import { FloPay } from '@flopay/node';
|
|
25
|
-
*
|
|
26
|
-
* const flopay = new FloPay('sk_test_...');
|
|
27
|
-
*
|
|
28
|
-
* // Create session via billing API
|
|
29
|
-
* const result = await flopay.checkout.sessions.create({
|
|
30
|
-
* billingApiUrl: 'https://billing.example.com',
|
|
31
|
-
* checkoutBaseUrl: 'https://checkout.example.com',
|
|
32
|
-
* clientId: 'client_123',
|
|
33
|
-
* currency: 'USD',
|
|
34
|
-
* items: [{ code: 'prod_abc' }],
|
|
35
|
-
* account: { userId: 'user_1', email: 'user@example.com' },
|
|
36
|
-
* successUrl: '/success',
|
|
37
|
-
* cancelUrl: '/cancel',
|
|
38
|
-
* });
|
|
39
|
-
* ```
|
|
40
|
-
*/
|
|
41
|
-
declare class FloPay {
|
|
42
|
-
private readonly stripe;
|
|
43
|
-
readonly checkout: {
|
|
44
|
-
sessions: {
|
|
45
|
-
/** Create a checkout session via the billing API. */
|
|
46
|
-
create: (params: CreateSessionParams) => Promise<CheckoutSessionResult>;
|
|
47
|
-
/** Retrieve a checkout session from Stripe. */
|
|
48
|
-
retrieve: (id: string) => Promise<CheckoutSession>;
|
|
49
|
-
/** Expire a checkout session on Stripe. */
|
|
50
|
-
expire: (id: string) => Promise<CheckoutSession>;
|
|
51
|
-
/** List line items for a Stripe checkout session. */
|
|
52
|
-
listLineItems: (id: string) => Promise<LineItem[]>;
|
|
53
|
-
};
|
|
54
|
-
};
|
|
55
|
-
readonly webhooks: {
|
|
56
|
-
constructEvent: (payload: string | Buffer, signature: string, secret: string) => WebhookEvent;
|
|
57
|
-
};
|
|
58
|
-
readonly customers: {
|
|
59
|
-
create: (params: CreateCustomerParams) => Promise<Customer>;
|
|
60
|
-
retrieve: (id: string) => Promise<Customer>;
|
|
61
|
-
update: (id: string, params: UpdateCustomerParams) => Promise<Customer>;
|
|
62
|
-
};
|
|
63
|
-
constructor(secretKey: string, options?: FloPayNodeOptions);
|
|
64
|
-
/**
|
|
65
|
-
* Create a checkout session via the billing API.
|
|
66
|
-
*
|
|
67
|
-
* Mirrors `createCheckoutSession` from `clicktech-core-ui/modules`.
|
|
68
|
-
* Posts to `{billingApiUrl}/v1/checkouts/sessions` and returns
|
|
69
|
-
* the session UUID for redirect.
|
|
70
|
-
*/
|
|
71
|
-
private createSession;
|
|
72
|
-
private normalizeStripeSession;
|
|
73
|
-
private retrieveSession;
|
|
74
|
-
private expireSession;
|
|
75
|
-
private listLineItems;
|
|
76
|
-
private constructWebhookEvent;
|
|
77
|
-
private createCustomer;
|
|
78
|
-
private retrieveCustomer;
|
|
79
|
-
private updateCustomer;
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
export { FloPay, type FloPayNodeOptions, STRIPE_API_VERSION };
|
|
1
|
+
export type { FloPayNodeOptions } from './flopay-node.js';
|
|
2
|
+
export { FloPay, STRIPE_API_VERSION } from './flopay-node.js';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@flopay/node",
|
|
3
|
-
"version": "1.14.
|
|
3
|
+
"version": "1.14.6",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"sideEffects": false,
|
|
6
6
|
"publishConfig": {
|
|
@@ -26,16 +26,16 @@
|
|
|
26
26
|
"dist"
|
|
27
27
|
],
|
|
28
28
|
"dependencies": {
|
|
29
|
-
"@flopay/shared": "1.14.
|
|
29
|
+
"@flopay/shared": "1.14.6",
|
|
30
30
|
"stripe": "^22.6.2"
|
|
31
31
|
},
|
|
32
32
|
"devDependencies": {
|
|
33
33
|
"tsup": "^8.3.0",
|
|
34
|
-
"typescript": "^
|
|
34
|
+
"typescript": "^7.0.2",
|
|
35
35
|
"vitest": "4.1.12"
|
|
36
36
|
},
|
|
37
37
|
"scripts": {
|
|
38
|
-
"build": "tsup",
|
|
38
|
+
"build": "tsup && tsc -p tsconfig.build.json",
|
|
39
39
|
"dev": "tsup --watch",
|
|
40
40
|
"typecheck": "tsc --noEmit",
|
|
41
41
|
"test": "vitest run",
|