@aixyz/stripe 0.28.0 → 0.29.0
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.
- package/README.md +1 -1
- package/index.ts +4 -5
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -137,7 +137,7 @@ const server = new AixyzApp();
|
|
|
137
137
|
await server.withPlugin(new IndexPagePlugin());
|
|
138
138
|
|
|
139
139
|
// A2A: agent discovery + JSON-RPC endpoint
|
|
140
|
-
await server.withPlugin(new A2APlugin(agent));
|
|
140
|
+
await server.withPlugin(new A2APlugin([{ exports: agent }]));
|
|
141
141
|
|
|
142
142
|
// MCP: expose tools to MCP clients
|
|
143
143
|
await server.withPlugin(
|
package/index.ts
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import Stripe from "stripe";
|
|
2
|
-
import { BasePlugin } from "aixyz/app/plugin";
|
|
3
|
-
import type { AixyzApp } from "aixyz/app";
|
|
2
|
+
import { BasePlugin, type RegisterContext } from "aixyz/app/plugin";
|
|
4
3
|
|
|
5
4
|
let stripe: Stripe | null = null;
|
|
6
5
|
|
|
@@ -94,7 +93,7 @@ async function validateAndConsumePaymentIntent(
|
|
|
94
93
|
export class experimental_StripePaymentIntentPlugin extends BasePlugin {
|
|
95
94
|
readonly name = "stripe-payment-intent";
|
|
96
95
|
|
|
97
|
-
register(
|
|
96
|
+
register(ctx: RegisterContext): void {
|
|
98
97
|
const secretKey = process.env.STRIPE_SECRET_KEY;
|
|
99
98
|
const priceInCents = Number(process.env.STRIPE_PRICE_CENTS) || 100;
|
|
100
99
|
|
|
@@ -106,7 +105,7 @@ export class experimental_StripePaymentIntentPlugin extends BasePlugin {
|
|
|
106
105
|
initializeStripe(secretKey);
|
|
107
106
|
|
|
108
107
|
// Endpoint to create payment intents
|
|
109
|
-
|
|
108
|
+
ctx.route("POST", "/stripe/create-payment-intent", async () => {
|
|
110
109
|
try {
|
|
111
110
|
const result = await createPaymentIntent({ priceInCents });
|
|
112
111
|
return Response.json(result);
|
|
@@ -118,7 +117,7 @@ export class experimental_StripePaymentIntentPlugin extends BasePlugin {
|
|
|
118
117
|
});
|
|
119
118
|
|
|
120
119
|
// Stripe payment validation middleware
|
|
121
|
-
|
|
120
|
+
ctx.use(async (request: Request, next: () => Promise<Response>) => {
|
|
122
121
|
if (!stripe) return next();
|
|
123
122
|
|
|
124
123
|
const stripePaymentIntentId = request.headers.get("x-stripe-payment-intent-id");
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aixyz/stripe",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.29.0",
|
|
4
4
|
"description": "Payment-native SDK for AI Agent",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"ai",
|
|
@@ -25,11 +25,11 @@
|
|
|
25
25
|
},
|
|
26
26
|
"devDependencies": {
|
|
27
27
|
"@types/express": "^5",
|
|
28
|
-
"aixyz": "0.
|
|
28
|
+
"aixyz": "0.29.0",
|
|
29
29
|
"typescript": "^5.9.3"
|
|
30
30
|
},
|
|
31
31
|
"peerDependencies": {
|
|
32
|
-
"aixyz": "0.
|
|
32
|
+
"aixyz": "0.29.0",
|
|
33
33
|
"stripe": "^20"
|
|
34
34
|
}
|
|
35
35
|
}
|