@solvapay/server 1.0.8-preview.7 → 1.0.8-preview.9

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.
Files changed (141) hide show
  1. package/dist/edge.d.ts +24 -1
  2. package/dist/edge.js +72 -0
  3. package/dist/index.cjs +12 -293
  4. package/dist/index.d.cts +3 -35
  5. package/dist/index.d.ts +3 -35
  6. package/dist/index.js +12 -289
  7. package/package.json +8 -8
  8. package/dist/chunk-R5U7XKVJ.js +0 -16
  9. package/dist/dist-EPVKJAIP.js +0 -94
  10. package/dist/dist-JBJ4HMP7.js +0 -94
  11. package/dist/esm-5GYCIXIY.js +0 -3475
  12. package/dist/esm-UW7WCMEK.js +0 -3475
  13. package/dist/src/adapters/base.d.ts +0 -57
  14. package/dist/src/adapters/base.d.ts.map +0 -1
  15. package/dist/src/adapters/base.js +0 -73
  16. package/dist/src/adapters/base.js.map +0 -1
  17. package/dist/src/adapters/http.d.ts +0 -25
  18. package/dist/src/adapters/http.d.ts.map +0 -1
  19. package/dist/src/adapters/http.js +0 -99
  20. package/dist/src/adapters/http.js.map +0 -1
  21. package/dist/src/adapters/index.d.ts +0 -11
  22. package/dist/src/adapters/index.d.ts.map +0 -1
  23. package/dist/src/adapters/index.js +0 -10
  24. package/dist/src/adapters/index.js.map +0 -1
  25. package/dist/src/adapters/mcp.d.ts +0 -24
  26. package/dist/src/adapters/mcp.d.ts.map +0 -1
  27. package/dist/src/adapters/mcp.js +0 -75
  28. package/dist/src/adapters/mcp.js.map +0 -1
  29. package/dist/src/adapters/next.d.ts +0 -24
  30. package/dist/src/adapters/next.d.ts.map +0 -1
  31. package/dist/src/adapters/next.js +0 -109
  32. package/dist/src/adapters/next.js.map +0 -1
  33. package/dist/src/client.d.ts +0 -58
  34. package/dist/src/client.d.ts.map +0 -1
  35. package/dist/src/client.js +0 -495
  36. package/dist/src/client.js.map +0 -1
  37. package/dist/src/edge.d.ts +0 -22
  38. package/dist/src/edge.d.ts.map +0 -1
  39. package/dist/src/edge.js +0 -91
  40. package/dist/src/edge.js.map +0 -1
  41. package/dist/src/factory.d.ts +0 -605
  42. package/dist/src/factory.d.ts.map +0 -1
  43. package/dist/src/factory.js +0 -215
  44. package/dist/src/factory.js.map +0 -1
  45. package/dist/src/helpers/auth.d.ts +0 -47
  46. package/dist/src/helpers/auth.d.ts.map +0 -1
  47. package/dist/src/helpers/auth.js +0 -73
  48. package/dist/src/helpers/auth.js.map +0 -1
  49. package/dist/src/helpers/checkout.d.ts +0 -45
  50. package/dist/src/helpers/checkout.d.ts.map +0 -1
  51. package/dist/src/helpers/checkout.js +0 -89
  52. package/dist/src/helpers/checkout.js.map +0 -1
  53. package/dist/src/helpers/customer.d.ts +0 -51
  54. package/dist/src/helpers/customer.d.ts.map +0 -1
  55. package/dist/src/helpers/customer.js +0 -77
  56. package/dist/src/helpers/customer.js.map +0 -1
  57. package/dist/src/helpers/error.d.ts +0 -15
  58. package/dist/src/helpers/error.d.ts.map +0 -1
  59. package/dist/src/helpers/error.js +0 -35
  60. package/dist/src/helpers/error.js.map +0 -1
  61. package/dist/src/helpers/index.d.ts +0 -17
  62. package/dist/src/helpers/index.d.ts.map +0 -1
  63. package/dist/src/helpers/index.js +0 -23
  64. package/dist/src/helpers/index.js.map +0 -1
  65. package/dist/src/helpers/payment.d.ts +0 -107
  66. package/dist/src/helpers/payment.d.ts.map +0 -1
  67. package/dist/src/helpers/payment.js +0 -150
  68. package/dist/src/helpers/payment.js.map +0 -1
  69. package/dist/src/helpers/plans.d.ts +0 -19
  70. package/dist/src/helpers/plans.d.ts.map +0 -1
  71. package/dist/src/helpers/plans.js +0 -53
  72. package/dist/src/helpers/plans.js.map +0 -1
  73. package/dist/src/helpers/renewal.d.ts +0 -23
  74. package/dist/src/helpers/renewal.d.ts.map +0 -1
  75. package/dist/src/helpers/renewal.js +0 -90
  76. package/dist/src/helpers/renewal.js.map +0 -1
  77. package/dist/src/helpers/subscription.d.ts +0 -23
  78. package/dist/src/helpers/subscription.d.ts.map +0 -1
  79. package/dist/src/helpers/subscription.js +0 -101
  80. package/dist/src/helpers/subscription.js.map +0 -1
  81. package/dist/src/helpers/types.d.ts +0 -22
  82. package/dist/src/helpers/types.d.ts.map +0 -1
  83. package/dist/src/helpers/types.js +0 -7
  84. package/dist/src/helpers/types.js.map +0 -1
  85. package/dist/src/index.d.ts +0 -73
  86. package/dist/src/index.d.ts.map +0 -1
  87. package/dist/src/index.js +0 -106
  88. package/dist/src/index.js.map +0 -1
  89. package/dist/src/mcp/auth-bridge.d.ts +0 -9
  90. package/dist/src/mcp/auth-bridge.d.ts.map +0 -1
  91. package/dist/src/mcp/auth-bridge.js +0 -46
  92. package/dist/src/mcp/auth-bridge.js.map +0 -1
  93. package/dist/src/mcp/oauth-bridge.d.ts +0 -48
  94. package/dist/src/mcp/oauth-bridge.d.ts.map +0 -1
  95. package/dist/src/mcp/oauth-bridge.js +0 -110
  96. package/dist/src/mcp/oauth-bridge.js.map +0 -1
  97. package/dist/src/mcp-auth.d.ts +0 -17
  98. package/dist/src/mcp-auth.d.ts.map +0 -1
  99. package/dist/src/mcp-auth.js +0 -57
  100. package/dist/src/mcp-auth.js.map +0 -1
  101. package/dist/src/paywall.d.ts +0 -119
  102. package/dist/src/paywall.d.ts.map +0 -1
  103. package/dist/src/paywall.js +0 -700
  104. package/dist/src/paywall.js.map +0 -1
  105. package/dist/src/register-virtual-tools-mcp.d.ts +0 -23
  106. package/dist/src/register-virtual-tools-mcp.d.ts.map +0 -1
  107. package/dist/src/register-virtual-tools-mcp.js +0 -86
  108. package/dist/src/register-virtual-tools-mcp.js.map +0 -1
  109. package/dist/src/types/client.d.ts +0 -216
  110. package/dist/src/types/client.d.ts.map +0 -1
  111. package/dist/src/types/client.js +0 -7
  112. package/dist/src/types/client.js.map +0 -1
  113. package/dist/src/types/generated.d.ts +0 -2834
  114. package/dist/src/types/generated.d.ts.map +0 -1
  115. package/dist/src/types/generated.js +0 -6
  116. package/dist/src/types/generated.js.map +0 -1
  117. package/dist/src/types/index.d.ts +0 -13
  118. package/dist/src/types/index.d.ts.map +0 -1
  119. package/dist/src/types/index.js +0 -8
  120. package/dist/src/types/index.js.map +0 -1
  121. package/dist/src/types/options.d.ts +0 -126
  122. package/dist/src/types/options.d.ts.map +0 -1
  123. package/dist/src/types/options.js +0 -8
  124. package/dist/src/types/options.js.map +0 -1
  125. package/dist/src/types/paywall.d.ts +0 -64
  126. package/dist/src/types/paywall.d.ts.map +0 -1
  127. package/dist/src/types/paywall.js +0 -7
  128. package/dist/src/types/paywall.js.map +0 -1
  129. package/dist/src/types/webhook.d.ts +0 -50
  130. package/dist/src/types/webhook.d.ts.map +0 -1
  131. package/dist/src/types/webhook.js +0 -2
  132. package/dist/src/types/webhook.js.map +0 -1
  133. package/dist/src/utils.d.ts +0 -110
  134. package/dist/src/utils.d.ts.map +0 -1
  135. package/dist/src/utils.js +0 -217
  136. package/dist/src/utils.js.map +0 -1
  137. package/dist/src/virtual-tools.d.ts +0 -44
  138. package/dist/src/virtual-tools.d.ts.map +0 -1
  139. package/dist/src/virtual-tools.js +0 -140
  140. package/dist/src/virtual-tools.js.map +0 -1
  141. package/dist/tsconfig.tsbuildinfo +0 -1
@@ -1,35 +0,0 @@
1
- /**
2
- * Error Handling Helper
3
- *
4
- * Generic error handling utilities for route helpers
5
- */
6
- import { SolvaPayError } from '@solvapay/core';
7
- /**
8
- * Check if a result is an error result
9
- */
10
- export function isErrorResult(result) {
11
- return typeof result === 'object' && result !== null && 'error' in result && 'status' in result;
12
- }
13
- /**
14
- * Handle route errors and convert to ErrorResult
15
- */
16
- export function handleRouteError(error, operationName, defaultMessage) {
17
- console.error(`[${operationName}] Error:`, error);
18
- // Handle SolvaPay configuration errors
19
- if (error instanceof SolvaPayError) {
20
- const errorMessage = error.message;
21
- return {
22
- error: errorMessage,
23
- status: 500,
24
- details: errorMessage,
25
- };
26
- }
27
- const errorMessage = error instanceof Error ? error.message : 'Unknown error';
28
- const message = defaultMessage || `${operationName} failed`;
29
- return {
30
- error: message,
31
- status: 500,
32
- details: errorMessage,
33
- };
34
- }
35
- //# sourceMappingURL=error.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"error.js","sourceRoot":"","sources":["../../../src/helpers/error.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAA;AAG9C;;GAEG;AACH,MAAM,UAAU,aAAa,CAAC,MAAe;IAC3C,OAAO,OAAO,MAAM,KAAK,QAAQ,IAAI,MAAM,KAAK,IAAI,IAAI,OAAO,IAAI,MAAM,IAAI,QAAQ,IAAI,MAAM,CAAA;AACjG,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,gBAAgB,CAC9B,KAAc,EACd,aAAqB,EACrB,cAAuB;IAEvB,OAAO,CAAC,KAAK,CAAC,IAAI,aAAa,UAAU,EAAE,KAAK,CAAC,CAAA;IAEjD,uCAAuC;IACvC,IAAI,KAAK,YAAY,aAAa,EAAE,CAAC;QACnC,MAAM,YAAY,GAAG,KAAK,CAAC,OAAO,CAAA;QAClC,OAAO;YACL,KAAK,EAAE,YAAY;YACnB,MAAM,EAAE,GAAG;YACX,OAAO,EAAE,YAAY;SACtB,CAAA;IACH,CAAC;IAED,MAAM,YAAY,GAAG,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,eAAe,CAAA;IAC7E,MAAM,OAAO,GAAG,cAAc,IAAI,GAAG,aAAa,SAAS,CAAA;IAE3D,OAAO;QACL,KAAK,EAAE,OAAO;QACd,MAAM,EAAE,GAAG;QACX,OAAO,EAAE,YAAY;KACtB,CAAA;AACH,CAAC"}
@@ -1,17 +0,0 @@
1
- /**
2
- * Route Helpers (Core)
3
- *
4
- * Generic route helpers that work with standard Web API Request.
5
- * These can be used by Express, Fastify, Next.js, Edge Functions, etc.
6
- *
7
- * Framework-specific wrappers (e.g., Next.js) should be in their respective packages.
8
- */
9
- export type { ErrorResult, AuthenticatedUser } from './types';
10
- export { isErrorResult, handleRouteError } from './error';
11
- export { getAuthenticatedUserCore } from './auth';
12
- export { syncCustomerCore } from './customer';
13
- export { createPaymentIntentCore, processPaymentIntentCore } from './payment';
14
- export { createCheckoutSessionCore, createCustomerSessionCore } from './checkout';
15
- export { cancelPurchaseCore } from './renewal';
16
- export { listPlansCore } from './plans';
17
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/helpers/index.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAGH,YAAY,EAAE,WAAW,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAA;AAG7D,OAAO,EAAE,aAAa,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAA;AAGzD,OAAO,EAAE,wBAAwB,EAAE,MAAM,QAAQ,CAAA;AAGjD,OAAO,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAA;AAG7C,OAAO,EAAE,uBAAuB,EAAE,wBAAwB,EAAE,MAAM,WAAW,CAAA;AAG7E,OAAO,EAAE,yBAAyB,EAAE,yBAAyB,EAAE,MAAM,YAAY,CAAA;AAGjF,OAAO,EAAE,kBAAkB,EAAE,MAAM,WAAW,CAAA;AAG9C,OAAO,EAAE,aAAa,EAAE,MAAM,SAAS,CAAA"}
@@ -1,23 +0,0 @@
1
- /**
2
- * Route Helpers (Core)
3
- *
4
- * Generic route helpers that work with standard Web API Request.
5
- * These can be used by Express, Fastify, Next.js, Edge Functions, etc.
6
- *
7
- * Framework-specific wrappers (e.g., Next.js) should be in their respective packages.
8
- */
9
- // Export error handling
10
- export { isErrorResult, handleRouteError } from './error';
11
- // Export auth helpers
12
- export { getAuthenticatedUserCore } from './auth';
13
- // Export customer helpers
14
- export { syncCustomerCore } from './customer';
15
- // Export payment helpers
16
- export { createPaymentIntentCore, processPaymentIntentCore } from './payment';
17
- // Export checkout helpers
18
- export { createCheckoutSessionCore, createCustomerSessionCore } from './checkout';
19
- // Export purchase cancellation helpers
20
- export { cancelPurchaseCore } from './renewal';
21
- // Export plans helpers
22
- export { listPlansCore } from './plans';
23
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/helpers/index.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAKH,wBAAwB;AACxB,OAAO,EAAE,aAAa,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAA;AAEzD,sBAAsB;AACtB,OAAO,EAAE,wBAAwB,EAAE,MAAM,QAAQ,CAAA;AAEjD,0BAA0B;AAC1B,OAAO,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAA;AAE7C,yBAAyB;AACzB,OAAO,EAAE,uBAAuB,EAAE,wBAAwB,EAAE,MAAM,WAAW,CAAA;AAE7E,0BAA0B;AAC1B,OAAO,EAAE,yBAAyB,EAAE,yBAAyB,EAAE,MAAM,YAAY,CAAA;AAEjF,uCAAuC;AACvC,OAAO,EAAE,kBAAkB,EAAE,MAAM,WAAW,CAAA;AAE9C,uBAAuB;AACvB,OAAO,EAAE,aAAa,EAAE,MAAM,SAAS,CAAA"}
@@ -1,107 +0,0 @@
1
- /**
2
- * Payment Helpers (Core)
3
- *
4
- * Generic helpers for payment operations.
5
- * Works with standard Web API Request (works everywhere).
6
- */
7
- import type { SolvaPay } from '../factory';
8
- import type { ErrorResult } from './types';
9
- /**
10
- * Create a Stripe payment intent for a customer to purchase a plan.
11
- *
12
- * This is a framework-agnostic helper that:
13
- * 1. Extracts authenticated user from the request
14
- * 2. Syncs customer with SolvaPay backend
15
- * 3. Creates a payment intent for the specified plan
16
- *
17
- * The payment intent can then be confirmed on the client side using Stripe.js.
18
- * After confirmation, use `processPaymentIntentCore()` to complete the purchase.
19
- *
20
- * @param request - Standard Web API Request object
21
- * @param body - Payment intent parameters
22
- * @param body.planRef - Plan reference to purchase (required)
23
- * @param body.productRef - Product reference (required)
24
- * @param options - Configuration options
25
- * @param options.solvaPay - Optional SolvaPay instance (creates new one if not provided)
26
- * @param options.includeEmail - Whether to include email in customer data (default: true)
27
- * @param options.includeName - Whether to include name in customer data (default: true)
28
- * @returns Payment intent response with client secret and customer reference, or error result
29
- *
30
- * @example
31
- * ```typescript
32
- * // In an API route handler
33
- * export async function POST(request: Request) {
34
- * const body = await request.json();
35
- * const result = await createPaymentIntentCore(request, body);
36
- *
37
- * if (isErrorResult(result)) {
38
- * return Response.json(result, { status: result.status });
39
- * }
40
- *
41
- * return Response.json(result);
42
- * }
43
- * ```
44
- *
45
- * @see {@link processPaymentIntentCore} for processing confirmed payments
46
- * @see {@link ErrorResult} for error handling
47
- * @since 1.0.0
48
- */
49
- export declare function createPaymentIntentCore(request: Request, body: {
50
- planRef: string;
51
- productRef: string;
52
- }, options?: {
53
- solvaPay?: SolvaPay;
54
- includeEmail?: boolean;
55
- includeName?: boolean;
56
- }): Promise<{
57
- id: string;
58
- clientSecret: string;
59
- publishableKey: string;
60
- accountId?: string;
61
- customerRef: string;
62
- } | ErrorResult>;
63
- /**
64
- * Process a payment intent after client-side Stripe confirmation.
65
- *
66
- * This helper processes a payment intent that has been confirmed on the client
67
- * side using Stripe.js. It creates the purchase immediately,
68
- * eliminating webhook delay.
69
- *
70
- * Call this after the client has confirmed the payment intent with Stripe.js.
71
- *
72
- * @param request - Standard Web API Request object
73
- * @param body - Payment processing parameters
74
- * @param body.paymentIntentId - Stripe payment intent ID from client confirmation (required)
75
- * @param body.productRef - Product reference (required)
76
- * @param body.planRef - Optional plan reference (if not in payment intent)
77
- * @param options - Configuration options
78
- * @param options.solvaPay - Optional SolvaPay instance (creates new one if not provided)
79
- * @returns Process payment result with purchase details, or error result
80
- *
81
- * @example
82
- * ```typescript
83
- * // In an API route handler
84
- * export async function POST(request: Request) {
85
- * const body = await request.json();
86
- * const result = await processPaymentIntentCore(request, body);
87
- *
88
- * if (isErrorResult(result)) {
89
- * return Response.json(result, { status: result.status });
90
- * }
91
- *
92
- * return Response.json(result);
93
- * }
94
- * ```
95
- *
96
- * @see {@link createPaymentIntentCore} for creating payment intents
97
- * @see {@link ErrorResult} for error handling
98
- * @since 1.0.0
99
- */
100
- export declare function processPaymentIntentCore(request: Request, body: {
101
- paymentIntentId: string;
102
- productRef: string;
103
- planRef?: string;
104
- }, options?: {
105
- solvaPay?: SolvaPay;
106
- }): Promise<import('../types/client').ProcessPaymentResult | ErrorResult>;
107
- //# sourceMappingURL=payment.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"payment.d.ts","sourceRoot":"","sources":["../../../src/helpers/payment.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAA;AAC1C,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,SAAS,CAAA;AAK1C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAuCG;AACH,wBAAsB,uBAAuB,CAC3C,OAAO,EAAE,OAAO,EAChB,IAAI,EAAE;IACJ,OAAO,EAAE,MAAM,CAAA;IACf,UAAU,EAAE,MAAM,CAAA;CACnB,EACD,OAAO,GAAE;IACP,QAAQ,CAAC,EAAE,QAAQ,CAAA;IACnB,YAAY,CAAC,EAAE,OAAO,CAAA;IACtB,WAAW,CAAC,EAAE,OAAO,CAAA;CACjB,GACL,OAAO,CACN;IACE,EAAE,EAAE,MAAM,CAAA;IACV,YAAY,EAAE,MAAM,CAAA;IACpB,cAAc,EAAE,MAAM,CAAA;IACtB,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,WAAW,EAAE,MAAM,CAAA;CACpB,GACD,WAAW,CACd,CAuCA;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoCG;AACH,wBAAsB,wBAAwB,CAC5C,OAAO,EAAE,OAAO,EAChB,IAAI,EAAE;IACJ,eAAe,EAAE,MAAM,CAAA;IACvB,UAAU,EAAE,MAAM,CAAA;IAClB,OAAO,CAAC,EAAE,MAAM,CAAA;CACjB,EACD,OAAO,GAAE;IACP,QAAQ,CAAC,EAAE,QAAQ,CAAA;CACf,GACL,OAAO,CAAC,OAAO,iBAAiB,EAAE,oBAAoB,GAAG,WAAW,CAAC,CAgCvE"}
@@ -1,150 +0,0 @@
1
- /**
2
- * Payment Helpers (Core)
3
- *
4
- * Generic helpers for payment operations.
5
- * Works with standard Web API Request (works everywhere).
6
- */
7
- import { createSolvaPay } from '../factory';
8
- import { handleRouteError, isErrorResult } from './error';
9
- import { syncCustomerCore } from './customer';
10
- /**
11
- * Create a Stripe payment intent for a customer to purchase a plan.
12
- *
13
- * This is a framework-agnostic helper that:
14
- * 1. Extracts authenticated user from the request
15
- * 2. Syncs customer with SolvaPay backend
16
- * 3. Creates a payment intent for the specified plan
17
- *
18
- * The payment intent can then be confirmed on the client side using Stripe.js.
19
- * After confirmation, use `processPaymentIntentCore()` to complete the purchase.
20
- *
21
- * @param request - Standard Web API Request object
22
- * @param body - Payment intent parameters
23
- * @param body.planRef - Plan reference to purchase (required)
24
- * @param body.productRef - Product reference (required)
25
- * @param options - Configuration options
26
- * @param options.solvaPay - Optional SolvaPay instance (creates new one if not provided)
27
- * @param options.includeEmail - Whether to include email in customer data (default: true)
28
- * @param options.includeName - Whether to include name in customer data (default: true)
29
- * @returns Payment intent response with client secret and customer reference, or error result
30
- *
31
- * @example
32
- * ```typescript
33
- * // In an API route handler
34
- * export async function POST(request: Request) {
35
- * const body = await request.json();
36
- * const result = await createPaymentIntentCore(request, body);
37
- *
38
- * if (isErrorResult(result)) {
39
- * return Response.json(result, { status: result.status });
40
- * }
41
- *
42
- * return Response.json(result);
43
- * }
44
- * ```
45
- *
46
- * @see {@link processPaymentIntentCore} for processing confirmed payments
47
- * @see {@link ErrorResult} for error handling
48
- * @since 1.0.0
49
- */
50
- export async function createPaymentIntentCore(request, body, options = {}) {
51
- try {
52
- if (!body.planRef || !body.productRef) {
53
- return {
54
- error: 'Missing required parameters: planRef and productRef are required',
55
- status: 400,
56
- };
57
- }
58
- const customerResult = await syncCustomerCore(request, {
59
- solvaPay: options.solvaPay,
60
- includeEmail: options.includeEmail,
61
- includeName: options.includeName,
62
- });
63
- if (isErrorResult(customerResult)) {
64
- return customerResult;
65
- }
66
- const customerRef = customerResult;
67
- const solvaPay = options.solvaPay || createSolvaPay();
68
- const paymentIntent = await solvaPay.createPaymentIntent({
69
- productRef: body.productRef,
70
- planRef: body.planRef,
71
- customerRef,
72
- });
73
- return {
74
- id: paymentIntent.id,
75
- clientSecret: paymentIntent.clientSecret,
76
- publishableKey: paymentIntent.publishableKey,
77
- accountId: paymentIntent.accountId,
78
- customerRef,
79
- };
80
- }
81
- catch (error) {
82
- return handleRouteError(error, 'Create payment intent', 'Payment intent creation failed');
83
- }
84
- }
85
- /**
86
- * Process a payment intent after client-side Stripe confirmation.
87
- *
88
- * This helper processes a payment intent that has been confirmed on the client
89
- * side using Stripe.js. It creates the purchase immediately,
90
- * eliminating webhook delay.
91
- *
92
- * Call this after the client has confirmed the payment intent with Stripe.js.
93
- *
94
- * @param request - Standard Web API Request object
95
- * @param body - Payment processing parameters
96
- * @param body.paymentIntentId - Stripe payment intent ID from client confirmation (required)
97
- * @param body.productRef - Product reference (required)
98
- * @param body.planRef - Optional plan reference (if not in payment intent)
99
- * @param options - Configuration options
100
- * @param options.solvaPay - Optional SolvaPay instance (creates new one if not provided)
101
- * @returns Process payment result with purchase details, or error result
102
- *
103
- * @example
104
- * ```typescript
105
- * // In an API route handler
106
- * export async function POST(request: Request) {
107
- * const body = await request.json();
108
- * const result = await processPaymentIntentCore(request, body);
109
- *
110
- * if (isErrorResult(result)) {
111
- * return Response.json(result, { status: result.status });
112
- * }
113
- *
114
- * return Response.json(result);
115
- * }
116
- * ```
117
- *
118
- * @see {@link createPaymentIntentCore} for creating payment intents
119
- * @see {@link ErrorResult} for error handling
120
- * @since 1.0.0
121
- */
122
- export async function processPaymentIntentCore(request, body, options = {}) {
123
- try {
124
- if (!body.paymentIntentId || !body.productRef) {
125
- return {
126
- error: 'paymentIntentId and productRef are required',
127
- status: 400,
128
- };
129
- }
130
- const customerResult = await syncCustomerCore(request, {
131
- solvaPay: options.solvaPay,
132
- });
133
- if (isErrorResult(customerResult)) {
134
- return customerResult;
135
- }
136
- const customerRef = customerResult;
137
- const solvaPay = options.solvaPay || createSolvaPay();
138
- const result = await solvaPay.processPaymentIntent({
139
- paymentIntentId: body.paymentIntentId,
140
- productRef: body.productRef,
141
- customerRef,
142
- planRef: body.planRef,
143
- });
144
- return result;
145
- }
146
- catch (error) {
147
- return handleRouteError(error, 'Process payment intent', 'Payment processing failed');
148
- }
149
- }
150
- //# sourceMappingURL=payment.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"payment.js","sourceRoot":"","sources":["../../../src/helpers/payment.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAIH,OAAO,EAAE,cAAc,EAAE,MAAM,YAAY,CAAA;AAC3C,OAAO,EAAE,gBAAgB,EAAE,aAAa,EAAE,MAAM,SAAS,CAAA;AACzD,OAAO,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAA;AAE7C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAuCG;AACH,MAAM,CAAC,KAAK,UAAU,uBAAuB,CAC3C,OAAgB,EAChB,IAGC,EACD,UAII,EAAE;IAWN,IAAI,CAAC;QACH,IAAI,CAAC,IAAI,CAAC,OAAO,IAAI,CAAC,IAAI,CAAC,UAAU,EAAE,CAAC;YACtC,OAAO;gBACL,KAAK,EAAE,kEAAkE;gBACzE,MAAM,EAAE,GAAG;aACZ,CAAA;QACH,CAAC;QAED,MAAM,cAAc,GAAG,MAAM,gBAAgB,CAAC,OAAO,EAAE;YACrD,QAAQ,EAAE,OAAO,CAAC,QAAQ;YAC1B,YAAY,EAAE,OAAO,CAAC,YAAY;YAClC,WAAW,EAAE,OAAO,CAAC,WAAW;SACjC,CAAC,CAAA;QAEF,IAAI,aAAa,CAAC,cAAc,CAAC,EAAE,CAAC;YAClC,OAAO,cAAc,CAAA;QACvB,CAAC;QAED,MAAM,WAAW,GAAG,cAAc,CAAA;QAElC,MAAM,QAAQ,GAAG,OAAO,CAAC,QAAQ,IAAI,cAAc,EAAE,CAAA;QAErD,MAAM,aAAa,GAAG,MAAM,QAAQ,CAAC,mBAAmB,CAAC;YACvD,UAAU,EAAE,IAAI,CAAC,UAAU;YAC3B,OAAO,EAAE,IAAI,CAAC,OAAO;YACrB,WAAW;SACZ,CAAC,CAAA;QAEF,OAAO;YACL,EAAE,EAAE,aAAa,CAAC,EAAE;YACpB,YAAY,EAAE,aAAa,CAAC,YAAY;YACxC,cAAc,EAAE,aAAa,CAAC,cAAc;YAC5C,SAAS,EAAE,aAAa,CAAC,SAAS;YAClC,WAAW;SACZ,CAAA;IACH,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,OAAO,gBAAgB,CAAC,KAAK,EAAE,uBAAuB,EAAE,gCAAgC,CAAC,CAAA;IAC3F,CAAC;AACH,CAAC;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoCG;AACH,MAAM,CAAC,KAAK,UAAU,wBAAwB,CAC5C,OAAgB,EAChB,IAIC,EACD,UAEI,EAAE;IAEN,IAAI,CAAC;QACH,IAAI,CAAC,IAAI,CAAC,eAAe,IAAI,CAAC,IAAI,CAAC,UAAU,EAAE,CAAC;YAC9C,OAAO;gBACL,KAAK,EAAE,6CAA6C;gBACpD,MAAM,EAAE,GAAG;aACZ,CAAA;QACH,CAAC;QAED,MAAM,cAAc,GAAG,MAAM,gBAAgB,CAAC,OAAO,EAAE;YACrD,QAAQ,EAAE,OAAO,CAAC,QAAQ;SAC3B,CAAC,CAAA;QAEF,IAAI,aAAa,CAAC,cAAc,CAAC,EAAE,CAAC;YAClC,OAAO,cAAc,CAAA;QACvB,CAAC;QAED,MAAM,WAAW,GAAG,cAAc,CAAA;QAElC,MAAM,QAAQ,GAAG,OAAO,CAAC,QAAQ,IAAI,cAAc,EAAE,CAAA;QAErD,MAAM,MAAM,GAAG,MAAM,QAAQ,CAAC,oBAAoB,CAAC;YACjD,eAAe,EAAE,IAAI,CAAC,eAAe;YACrC,UAAU,EAAE,IAAI,CAAC,UAAU;YAC3B,WAAW;YACX,OAAO,EAAE,IAAI,CAAC,OAAO;SACtB,CAAC,CAAA;QAEF,OAAO,MAAM,CAAA;IACf,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,OAAO,gBAAgB,CAAC,KAAK,EAAE,wBAAwB,EAAE,2BAA2B,CAAC,CAAA;IACvF,CAAC;AACH,CAAC"}
@@ -1,19 +0,0 @@
1
- /**
2
- * Plans Helper (Core)
3
- *
4
- * Generic helper for listing plans.
5
- * Works with standard Web API Request (works everywhere).
6
- * This is a public route - no authentication required.
7
- */
8
- import type { ErrorResult } from './types';
9
- import type { components } from '../types/generated';
10
- type Plan = components['schemas']['Plan'];
11
- /**
12
- * List plans - core implementation
13
- */
14
- export declare function listPlansCore(request: Request): Promise<{
15
- plans: Plan[];
16
- productRef: string;
17
- } | ErrorResult>;
18
- export {};
19
- //# sourceMappingURL=plans.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"plans.d.ts","sourceRoot":"","sources":["../../../src/helpers/plans.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,SAAS,CAAA;AAC1C,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAA;AAKpD,KAAK,IAAI,GAAG,UAAU,CAAC,SAAS,CAAC,CAAC,MAAM,CAAC,CAAA;AAEzC;;GAEG;AACH,wBAAsB,aAAa,CAAC,OAAO,EAAE,OAAO,GAAG,OAAO,CAC1D;IACE,KAAK,EAAE,IAAI,EAAE,CAAA;IACb,UAAU,EAAE,MAAM,CAAA;CACnB,GACD,WAAW,CACd,CA4CA"}
@@ -1,53 +0,0 @@
1
- /**
2
- * Plans Helper (Core)
3
- *
4
- * Generic helper for listing plans.
5
- * Works with standard Web API Request (works everywhere).
6
- * This is a public route - no authentication required.
7
- */
8
- import { createSolvaPayClient } from '../client';
9
- import { handleRouteError } from './error';
10
- import { getSolvaPayConfig } from '@solvapay/core';
11
- /**
12
- * List plans - core implementation
13
- */
14
- export async function listPlansCore(request) {
15
- try {
16
- const url = new URL(request.url);
17
- const productRef = url.searchParams.get('productRef');
18
- if (!productRef) {
19
- return {
20
- error: 'Missing required parameter: productRef',
21
- status: 400,
22
- };
23
- }
24
- const config = getSolvaPayConfig();
25
- const solvapaySecretKey = config.apiKey;
26
- const solvapayApiBaseUrl = config.apiBaseUrl;
27
- if (!solvapaySecretKey) {
28
- return {
29
- error: 'Server configuration error: SolvaPay secret key not configured',
30
- status: 500,
31
- };
32
- }
33
- const apiClient = createSolvaPayClient({
34
- apiKey: solvapaySecretKey,
35
- apiBaseUrl: solvapayApiBaseUrl,
36
- });
37
- if (!apiClient.listPlans) {
38
- return {
39
- error: 'List plans method not available',
40
- status: 500,
41
- };
42
- }
43
- const plans = await apiClient.listPlans(productRef);
44
- return {
45
- plans: plans || [],
46
- productRef,
47
- };
48
- }
49
- catch (error) {
50
- return handleRouteError(error, 'List plans', 'Failed to fetch plans');
51
- }
52
- }
53
- //# sourceMappingURL=plans.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"plans.js","sourceRoot":"","sources":["../../../src/helpers/plans.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAIH,OAAO,EAAE,oBAAoB,EAAE,MAAM,WAAW,CAAA;AAChD,OAAO,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAA;AAC1C,OAAO,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAA;AAIlD;;GAEG;AACH,MAAM,CAAC,KAAK,UAAU,aAAa,CAAC,OAAgB;IAOlD,IAAI,CAAC;QACH,MAAM,GAAG,GAAG,IAAI,GAAG,CAAC,OAAO,CAAC,GAAG,CAAC,CAAA;QAChC,MAAM,UAAU,GAAG,GAAG,CAAC,YAAY,CAAC,GAAG,CAAC,YAAY,CAAC,CAAA;QAErD,IAAI,CAAC,UAAU,EAAE,CAAC;YAChB,OAAO;gBACL,KAAK,EAAE,wCAAwC;gBAC/C,MAAM,EAAE,GAAG;aACZ,CAAA;QACH,CAAC;QAED,MAAM,MAAM,GAAG,iBAAiB,EAAE,CAAA;QAClC,MAAM,iBAAiB,GAAG,MAAM,CAAC,MAAM,CAAA;QACvC,MAAM,kBAAkB,GAAG,MAAM,CAAC,UAAU,CAAA;QAE5C,IAAI,CAAC,iBAAiB,EAAE,CAAC;YACvB,OAAO;gBACL,KAAK,EAAE,gEAAgE;gBACvE,MAAM,EAAE,GAAG;aACZ,CAAA;QACH,CAAC;QAED,MAAM,SAAS,GAAG,oBAAoB,CAAC;YACrC,MAAM,EAAE,iBAAiB;YACzB,UAAU,EAAE,kBAAkB;SAC/B,CAAC,CAAA;QAEF,IAAI,CAAC,SAAS,CAAC,SAAS,EAAE,CAAC;YACzB,OAAO;gBACL,KAAK,EAAE,iCAAiC;gBACxC,MAAM,EAAE,GAAG;aACZ,CAAA;QACH,CAAC;QAED,MAAM,KAAK,GAAG,MAAM,SAAS,CAAC,SAAS,CAAC,UAAU,CAAC,CAAA;QAEnD,OAAO;YACL,KAAK,EAAE,KAAK,IAAI,EAAE;YAClB,UAAU;SACX,CAAA;IACH,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,OAAO,gBAAgB,CAAC,KAAK,EAAE,YAAY,EAAE,uBAAuB,CAAC,CAAA;IACvE,CAAC;AACH,CAAC"}
@@ -1,23 +0,0 @@
1
- /**
2
- * Purchase Cancellation Helpers (Core)
3
- *
4
- * Generic helpers for purchase cancellation operations.
5
- * Works with standard Web API Request (works everywhere).
6
- */
7
- import type { SolvaPay } from '../factory';
8
- import type { ErrorResult } from './types';
9
- /**
10
- * Cancel purchase - core implementation
11
- *
12
- * @param request - Standard Web API Request
13
- * @param body - Cancellation parameters
14
- * @param options - Configuration options
15
- * @returns Cancelled purchase response or error result
16
- */
17
- export declare function cancelPurchaseCore(request: Request, body: {
18
- purchaseRef: string;
19
- reason?: string;
20
- }, options?: {
21
- solvaPay?: SolvaPay;
22
- }): Promise<Record<string, unknown> | ErrorResult>;
23
- //# sourceMappingURL=renewal.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"renewal.d.ts","sourceRoot":"","sources":["../../../src/helpers/renewal.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAA;AAC1C,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,SAAS,CAAA;AAK1C;;;;;;;GAOG;AACH,wBAAsB,kBAAkB,CACtC,OAAO,EAAE,OAAO,EAChB,IAAI,EAAE;IACJ,WAAW,EAAE,MAAM,CAAA;IACnB,MAAM,CAAC,EAAE,MAAM,CAAA;CAChB,EACD,OAAO,GAAE;IACP,QAAQ,CAAC,EAAE,QAAQ,CAAA;CACf,GACL,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,WAAW,CAAC,CAuFhD"}
@@ -1,90 +0,0 @@
1
- /**
2
- * Purchase Cancellation Helpers (Core)
3
- *
4
- * Generic helpers for purchase cancellation operations.
5
- * Works with standard Web API Request (works everywhere).
6
- */
7
- import { createSolvaPay } from '../factory';
8
- import { SolvaPayError } from '@solvapay/core';
9
- import { handleRouteError } from './error';
10
- /**
11
- * Cancel purchase - core implementation
12
- *
13
- * @param request - Standard Web API Request
14
- * @param body - Cancellation parameters
15
- * @param options - Configuration options
16
- * @returns Cancelled purchase response or error result
17
- */
18
- export async function cancelPurchaseCore(request, body, options = {}) {
19
- try {
20
- if (!body.purchaseRef) {
21
- return {
22
- error: 'Missing required parameter: purchaseRef is required',
23
- status: 400,
24
- };
25
- }
26
- const solvaPay = options.solvaPay || createSolvaPay();
27
- if (!solvaPay.apiClient.cancelPurchase) {
28
- return {
29
- error: 'Cancel purchase method not available on SDK client',
30
- status: 500,
31
- };
32
- }
33
- let cancelledPurchase = await solvaPay.apiClient.cancelPurchase({
34
- purchaseRef: body.purchaseRef,
35
- reason: body.reason,
36
- });
37
- if (!cancelledPurchase || typeof cancelledPurchase !== 'object') {
38
- return {
39
- error: 'Invalid response from cancel purchase endpoint',
40
- status: 500,
41
- };
42
- }
43
- const responseObj = cancelledPurchase;
44
- if (responseObj.purchase && typeof responseObj.purchase === 'object') {
45
- cancelledPurchase = responseObj.purchase;
46
- }
47
- if (!cancelledPurchase.reference) {
48
- return {
49
- error: 'Cancel purchase response missing required fields',
50
- status: 500,
51
- };
52
- }
53
- const isCancelled = cancelledPurchase.status === 'cancelled' || cancelledPurchase.cancelledAt;
54
- if (!isCancelled) {
55
- return {
56
- error: `Purchase cancellation failed: backend returned status '${cancelledPurchase.status}' without cancelledAt timestamp`,
57
- status: 500,
58
- };
59
- }
60
- await new Promise(resolve => setTimeout(resolve, 500));
61
- return cancelledPurchase;
62
- }
63
- catch (error) {
64
- if (error instanceof SolvaPayError) {
65
- const errorMessage = error.message;
66
- if (errorMessage.includes('not found')) {
67
- return {
68
- error: 'Purchase not found',
69
- status: 404,
70
- details: errorMessage,
71
- };
72
- }
73
- if (errorMessage.includes('cannot be cancelled') ||
74
- errorMessage.includes('does not belong to provider')) {
75
- return {
76
- error: 'Purchase cannot be cancelled or does not belong to provider',
77
- status: 400,
78
- details: errorMessage,
79
- };
80
- }
81
- return {
82
- error: errorMessage,
83
- status: 500,
84
- details: errorMessage,
85
- };
86
- }
87
- return handleRouteError(error, 'Cancel purchase', 'Failed to cancel purchase');
88
- }
89
- }
90
- //# sourceMappingURL=renewal.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"renewal.js","sourceRoot":"","sources":["../../../src/helpers/renewal.ts"],"names":[],"mappings":"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"}
@@ -1,23 +0,0 @@
1
- /**
2
- * Subscription Helpers (Core)
3
- *
4
- * Generic helpers for subscription operations.
5
- * Works with standard Web API Request (works everywhere).
6
- */
7
- import type { SolvaPay } from '../factory';
8
- import type { ErrorResult } from './types';
9
- /**
10
- * Cancel subscription - core implementation
11
- *
12
- * @param request - Standard Web API Request
13
- * @param body - Cancellation parameters
14
- * @param options - Configuration options
15
- * @returns Cancelled subscription response or error result
16
- */
17
- export declare function cancelSubscriptionCore(request: Request, body: {
18
- subscriptionRef: string;
19
- reason?: string;
20
- }, options?: {
21
- solvaPay?: SolvaPay;
22
- }): Promise<any | ErrorResult>;
23
- //# sourceMappingURL=subscription.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"subscription.d.ts","sourceRoot":"","sources":["../../../src/helpers/subscription.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAA;AAC1C,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,SAAS,CAAA;AAK1C;;;;;;;GAOG;AACH,wBAAsB,sBAAsB,CAC1C,OAAO,EAAE,OAAO,EAChB,IAAI,EAAE;IACJ,eAAe,EAAE,MAAM,CAAA;IACvB,MAAM,CAAC,EAAE,MAAM,CAAA;CAChB,EACD,OAAO,GAAE;IACP,QAAQ,CAAC,EAAE,QAAQ,CAAA;CACf,GACL,OAAO,CAAC,GAAG,GAAG,WAAW,CAAC,CAkG5B"}