@stacksjs/commerce 0.75.79 → 0.75.80

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.
@@ -66,6 +66,7 @@ export {
66
66
  handlePaymentFailed,
67
67
  handlePaymentSucceeded,
68
68
  handleRefundSucceeded,
69
+ receivePaymentWebhook,
69
70
  } from './webhook';
70
71
  // Server-side cart-to-order total recompute (stacksjs/stacks#1879 Co-13).
71
72
  // Apps pre-flight the cart through this before placeOrder to detect
@@ -1,4 +1,4 @@
1
- import type { PaymentEvent } from '@stacksjs/payments';
1
+ import type { PaymentDriver, PaymentEvent } from '@stacksjs/payments';
2
2
  /**
3
3
  * A payment succeeded. Marks the linked payment row and order row in a single
4
4
  * transaction. Idempotent via `recordEventOrSkip`.
@@ -27,6 +27,21 @@ declare function handleRefundSucceeded(event: PaymentEvent): Promise<void>;
27
27
  * commerce acted on it; events it has no use for are left alone.
28
28
  */
29
29
  export declare function handleCommercePaymentEvent(event: PaymentEvent): Promise<boolean>;
30
+ /**
31
+ * A provider's webhook delivery, start to finish: verified by the payment
32
+ * driver, applied to orders, answered the way the provider expects. This is
33
+ * what the framework mounts at `POST /webhooks/payments`.
34
+ *
35
+ * - No webhook secret configured: 401 `missing-config`, so nothing
36
+ * unauthenticated is ever applied.
37
+ * - A signature that does not verify: 400 `invalid-signature`.
38
+ * - Anything failing while applying an event throws, which answers 500 and
39
+ * makes the provider retry. The event's dedup row rolled back with it, so
40
+ * the retry is applied, not skipped.
41
+ *
42
+ * `driver` defaults to the configured one; tests pass their own.
43
+ */
44
+ export declare function receivePaymentWebhook(request: Request, driver?: PaymentDriver): Promise<Response>;
30
45
  // Export the individual handlers for direct testing.
31
46
  export {
32
47
  handlePaymentFailed,
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@stacksjs/commerce",
3
3
  "type": "module",
4
- "version": "0.75.79",
4
+ "version": "0.75.80",
5
5
  "description": "Stacks commerce utilities.",
6
6
  "author": "Chris Breuer",
7
7
  "contributors": [
@@ -57,17 +57,17 @@
57
57
  "prepublishOnly": "bun run build"
58
58
  },
59
59
  "dependencies": {
60
- "@stacksjs/cache": "0.75.79",
61
- "@stacksjs/config": "0.75.79",
62
- "@stacksjs/database": "0.75.79",
63
- "@stacksjs/env": "0.75.79",
64
- "@stacksjs/error-handling": "0.75.79",
65
- "@stacksjs/events": "0.75.79",
66
- "@stacksjs/logging": "0.75.79",
67
- "@stacksjs/orm": "0.75.79",
68
- "@stacksjs/payments": "0.75.79",
69
- "@stacksjs/realtime": "0.75.79",
70
- "@stacksjs/strings": "0.75.79",
60
+ "@stacksjs/cache": "0.75.80",
61
+ "@stacksjs/config": "0.75.80",
62
+ "@stacksjs/database": "0.75.80",
63
+ "@stacksjs/env": "0.75.80",
64
+ "@stacksjs/error-handling": "0.75.80",
65
+ "@stacksjs/events": "0.75.80",
66
+ "@stacksjs/logging": "0.75.80",
67
+ "@stacksjs/orm": "0.75.80",
68
+ "@stacksjs/payments": "0.75.80",
69
+ "@stacksjs/realtime": "0.75.80",
70
+ "@stacksjs/strings": "0.75.80",
71
71
  "ts-spreadsheets": "^0.2.0"
72
72
  },
73
73
  "devDependencies": {