@porulle/adapter-stripe 0.10.6 → 0.10.8

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 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,QAAQ,CAAC;AAC5B,OAAO,EAGL,KAAK,cAAc,EAMpB,MAAM,eAAe,CAAC;AAEvB,MAAM,WAAW,oBAAoB;IACnC,SAAS,EAAE,MAAM,CAAC;IAClB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,UAAU,CAAC,EAAE,MAAM,CAAC,gBAAgB,CAAC;CACtC;AAqBD,wBAAgB,aAAa,CAAC,OAAO,EAAE,oBAAoB,GAAG,cAAc,CA6I3E"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,QAAQ,CAAC;AAC5B,OAAO,EAGL,KAAK,cAAc,EAMpB,MAAM,eAAe,CAAC;AAEvB,MAAM,WAAW,oBAAoB;IACnC,SAAS,EAAE,MAAM,CAAC;IAClB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,UAAU,CAAC,EAAE,MAAM,CAAC,gBAAgB,CAAC;CACtC;AAqBD,wBAAgB,aAAa,CAAC,OAAO,EAAE,oBAAoB,GAAG,cAAc,CAoJ3E"}
package/dist/index.js CHANGED
@@ -136,7 +136,10 @@ export function stripePayment(options) {
136
136
  });
137
137
  }
138
138
  const body = await request.text();
139
- const event = stripe.webhooks.constructEvent(body, signature, options.webhookSecret);
139
+ // Workers expose Web Crypto through an asynchronous provider. Stripe's
140
+ // synchronous verifier throws under workerd even for a valid signature.
141
+ // The async verifier works across Workers, Node, and Bun.
142
+ const event = await stripe.webhooks.constructEventAsync(body, signature, options.webhookSecret);
140
143
  return Ok({
141
144
  id: event.id,
142
145
  type: event.type,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@porulle/adapter-stripe",
3
- "version": "0.10.6",
3
+ "version": "0.10.8",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "exports": {
@@ -12,15 +12,15 @@
12
12
  },
13
13
  "dependencies": {
14
14
  "stripe": "^18.5.0",
15
- "@porulle/core": "0.10.6"
15
+ "@porulle/core": "0.10.8"
16
16
  },
17
17
  "devDependencies": {
18
18
  "@types/node": "^24.5.2",
19
19
  "eslint": "^9.39.1",
20
20
  "typescript": "5.9.2",
21
21
  "vitest": "^3.2.4",
22
- "@porulle/eslint-config": "0.1.0",
23
- "@porulle/typescript-config": "0.1.0"
22
+ "@porulle/typescript-config": "0.1.0",
23
+ "@porulle/eslint-config": "0.1.0"
24
24
  },
25
25
  "publishConfig": {
26
26
  "access": "public"
package/src/index.ts CHANGED
@@ -161,7 +161,14 @@ export function stripePayment(options: StripeAdapterOptions): PaymentAdapter {
161
161
  }
162
162
 
163
163
  const body = await request.text();
164
- const event = stripe.webhooks.constructEvent(body, signature, options.webhookSecret);
164
+ // Workers expose Web Crypto through an asynchronous provider. Stripe's
165
+ // synchronous verifier throws under workerd even for a valid signature.
166
+ // The async verifier works across Workers, Node, and Bun.
167
+ const event = await stripe.webhooks.constructEventAsync(
168
+ body,
169
+ signature,
170
+ options.webhookSecret,
171
+ );
165
172
 
166
173
  return Ok({
167
174
  id: event.id,