@deepintel-ltd/farmpro-contracts 1.5.17 → 1.5.19
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/dist/routes/payments.routes.d.ts +4 -4
- package/dist/routes/payments.routes.js +8 -8
- package/dist/routes/subscriptions.routes.d.ts +288 -56
- package/dist/routes/subscriptions.routes.d.ts.map +1 -1
- package/dist/routes/subscriptions.routes.js +25 -2
- package/dist/schemas/payments.schemas.d.ts +65 -48
- package/dist/schemas/payments.schemas.d.ts.map +1 -1
- package/dist/schemas/payments.schemas.js +18 -15
- package/dist/schemas/subscriptions.schemas.d.ts +32 -32
- package/dist/schemas/subscriptions.schemas.d.ts.map +1 -1
- package/dist/schemas/subscriptions.schemas.js +0 -1
- package/package.json +1 -1
|
@@ -811,7 +811,7 @@ export declare const paymentsRouter: {
|
|
|
811
811
|
farmId: string;
|
|
812
812
|
}>;
|
|
813
813
|
summary: "Initialize payment";
|
|
814
|
-
description: "Create a payment intent and get
|
|
814
|
+
description: "Create a payment intent and get payment gateway link";
|
|
815
815
|
method: "POST";
|
|
816
816
|
body: z.ZodObject<{
|
|
817
817
|
data: z.ZodObject<{
|
|
@@ -1269,7 +1269,7 @@ export declare const paymentsRouter: {
|
|
|
1269
1269
|
farmId: string;
|
|
1270
1270
|
}>;
|
|
1271
1271
|
summary: "Verify payment";
|
|
1272
|
-
description: "Verify payment status with
|
|
1272
|
+
description: "Verify payment status with payment gateway";
|
|
1273
1273
|
method: "POST";
|
|
1274
1274
|
body: z.ZodObject<{}, "strip", z.ZodTypeAny, {}, {}>;
|
|
1275
1275
|
path: "/farms/:farmId/payments/:id/verify";
|
|
@@ -1732,8 +1732,8 @@ export declare const paymentsRouter: {
|
|
|
1732
1732
|
};
|
|
1733
1733
|
};
|
|
1734
1734
|
webhook: {
|
|
1735
|
-
summary: "
|
|
1736
|
-
description: "Webhook endpoint for
|
|
1735
|
+
summary: "Payment webhook";
|
|
1736
|
+
description: "Webhook endpoint for payment gateway callbacks";
|
|
1737
1737
|
method: "POST";
|
|
1738
1738
|
body: z.ZodAny;
|
|
1739
1739
|
path: "/payments/webhook";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { initContract } from '@ts-rest/core';
|
|
2
2
|
import { z } from 'zod';
|
|
3
|
-
import { paymentResponseSchema, paymentListResponseSchema,
|
|
3
|
+
import { paymentResponseSchema, paymentListResponseSchema, initPaymentSchema, initPaymentResponseSchema, } from '../schemas/payments.schemas';
|
|
4
4
|
import { jsonApiErrorResponseSchema, jsonApiSuccessResponseSchema, jsonApiPaginationQuerySchema, jsonApiSortQuerySchema, jsonApiIncludeQuerySchema, jsonApiFilterQuerySchema } from '../schemas/common.schemas';
|
|
5
5
|
const c = initContract();
|
|
6
6
|
export const paymentsRouter = c.router({
|
|
@@ -47,16 +47,16 @@ export const paymentsRouter = c.router({
|
|
|
47
47
|
method: 'POST',
|
|
48
48
|
path: '/farms/:farmId/payments/initialize',
|
|
49
49
|
pathParams: z.object({ farmId: z.string().uuid() }),
|
|
50
|
-
body: z.object({ data:
|
|
50
|
+
body: z.object({ data: initPaymentSchema }),
|
|
51
51
|
responses: {
|
|
52
|
-
201:
|
|
52
|
+
201: initPaymentResponseSchema,
|
|
53
53
|
400: jsonApiErrorResponseSchema,
|
|
54
54
|
404: jsonApiErrorResponseSchema,
|
|
55
55
|
401: jsonApiErrorResponseSchema,
|
|
56
56
|
422: jsonApiErrorResponseSchema,
|
|
57
57
|
},
|
|
58
58
|
summary: 'Initialize payment',
|
|
59
|
-
description: 'Create a payment intent and get
|
|
59
|
+
description: 'Create a payment intent and get payment gateway link',
|
|
60
60
|
},
|
|
61
61
|
// Verify payment
|
|
62
62
|
verifyPayment: {
|
|
@@ -74,18 +74,18 @@ export const paymentsRouter = c.router({
|
|
|
74
74
|
400: jsonApiErrorResponseSchema,
|
|
75
75
|
},
|
|
76
76
|
summary: 'Verify payment',
|
|
77
|
-
description: 'Verify payment status with
|
|
77
|
+
description: 'Verify payment status with payment gateway',
|
|
78
78
|
},
|
|
79
79
|
// Webhook endpoint (public, no auth required)
|
|
80
80
|
webhook: {
|
|
81
81
|
method: 'POST',
|
|
82
82
|
path: '/payments/webhook',
|
|
83
|
-
body: z.any(), //
|
|
83
|
+
body: z.any(), // Payment gateway webhook payload
|
|
84
84
|
responses: {
|
|
85
85
|
200: jsonApiSuccessResponseSchema,
|
|
86
86
|
400: jsonApiErrorResponseSchema,
|
|
87
87
|
},
|
|
88
|
-
summary: '
|
|
89
|
-
description: 'Webhook endpoint for
|
|
88
|
+
summary: 'Payment webhook',
|
|
89
|
+
description: 'Webhook endpoint for payment gateway callbacks',
|
|
90
90
|
},
|
|
91
91
|
});
|