@mohasinac/appkit 4.41.17 → 4.42.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/dist/_internal/client/features/maintenance/views/MaintenanceDashboardView.js +1 -1
- package/dist/_internal/server/features/checkout/actions.d.ts +16 -14
- package/dist/_internal/server/features/checkout/actions.js +145 -97
- package/dist/_internal/server/features/checkout/bundle-expansion.d.ts +1 -1
- package/dist/_internal/server/features/checkout/index.d.ts +1 -1
- package/dist/_internal/server/features/checkout/index.js +1 -1
- package/dist/_internal/server/features/checkout/locked-lines.js +1 -1
- package/dist/_internal/server/features/checkout/source-context.js +2 -2
- package/dist/_internal/server/features/maintenance/analyze.js +1 -1
- package/dist/_internal/server/features/refunds/actions.d.ts +4 -4
- package/dist/_internal/server/features/refunds/actions.js +9 -8
- package/dist/_internal/server/functions/scheduled.d.ts +1 -2
- package/dist/_internal/server/functions/scheduled.js +1 -9
- package/dist/_internal/server/jobs/core/index.d.ts +0 -1
- package/dist/_internal/server/jobs/core/index.js +0 -1
- package/dist/_internal/server/jobs/handlers/index.d.ts +0 -1
- package/dist/_internal/server/jobs/handlers/index.js +0 -1
- package/dist/_internal/shared/actions/action-registry.js +2 -2
- package/dist/_internal/shared/checkout/order-math.d.ts +1 -1
- package/dist/_internal/shared/checkout/order-math.js +1 -1
- package/dist/_internal/shared/checkout/rules/prize-draw.rule.js +2 -2
- package/dist/_internal/shared/features/blog/schema.d.ts +4 -4
- package/dist/_internal/shared/features/cart/schema.d.ts +6 -6
- package/dist/_internal/shared/features/orders/refund-copy.d.ts +1 -1
- package/dist/_internal/shared/features/orders/refund-copy.js +1 -1
- package/dist/_internal/shared/features/orders/schema.d.ts +5 -5
- package/dist/_internal/shared/features/orders/schema.js +1 -1
- package/dist/_internal/shared/features/products/schema.d.ts +2 -2
- package/dist/_internal/shared/features/promotions/schema.d.ts +4 -4
- package/dist/_internal/shared/features/reviews/schema.d.ts +1 -1
- package/dist/client.d.ts +1 -1
- package/dist/client.js +1 -1
- package/dist/configs/next.js +2 -2
- package/dist/constants/field-names.d.ts +1 -1
- package/dist/constants/field-names.js +1 -1
- package/dist/contracts/index.d.ts +0 -2
- package/dist/contracts/index.js +0 -1
- package/dist/contracts/payment.d.ts +13 -2
- package/dist/contracts/payment.js +2 -2
- package/dist/core/integration-keys.d.ts +7 -3
- package/dist/core/integration-keys.js +13 -7
- package/dist/core/money.d.ts +11 -0
- package/dist/core/money.js +15 -0
- package/dist/errors/index.d.ts +1 -1
- package/dist/errors/index.js +1 -1
- package/dist/errors/messages.d.ts +1 -0
- package/dist/errors/messages.js +1 -0
- package/dist/errors/{razorpay-unreachable.d.ts → payment-provider-unreachable.d.ts} +1 -1
- package/dist/errors/{razorpay-unreachable.js → payment-provider-unreachable.js} +1 -1
- package/dist/features/addresses/schemas/address-form.d.ts +20 -20
- package/dist/features/addresses/schemas/index.d.ts +2 -2
- package/dist/features/admin/components/AdminSiteSettingsView.js +32 -16
- package/dist/features/admin/constants/site-settings-tabs.d.ts +1 -1
- package/dist/features/admin/schemas/admin-ops-forms.d.ts +10 -10
- package/dist/features/admin/schemas/admin-user-form.d.ts +2 -2
- package/dist/features/admin/schemas/firestore.d.ts +17 -8
- package/dist/features/admin/schemas/firestore.js +1 -1
- package/dist/features/admin/schemas/nav-item-form.d.ts +2 -2
- package/dist/features/auctions/schemas/index.d.ts +2 -2
- package/dist/features/auth/schemas/index.d.ts +2 -2
- package/dist/features/before-after/schemas/index.d.ts +2 -2
- package/dist/features/blog/actions/blog-actions.d.ts +4 -4
- package/dist/features/blog/schemas/blog-form.d.ts +2 -2
- package/dist/features/blog/schemas/index.d.ts +4 -4
- package/dist/features/cart/schemas/index.d.ts +3 -3
- package/dist/features/catalogue/schemas/validation.d.ts +4 -4
- package/dist/features/categories/schemas/index.d.ts +2 -2
- package/dist/features/checkout/index.d.ts +0 -4
- package/dist/features/checkout/index.js +0 -3
- package/dist/features/checkout/types/index.d.ts +0 -25
- package/dist/features/checkout/types/index.js +1 -2
- package/dist/features/collections/schemas/index.d.ts +2 -2
- package/dist/features/consultation/schemas/index.d.ts +4 -4
- package/dist/features/corporate/schemas/index.d.ts +2 -2
- package/dist/features/events/schemas/index.d.ts +4 -4
- package/dist/features/grouped/schemas/index.d.ts +2 -2
- package/dist/features/homepage/schemas/index.d.ts +2 -2
- package/dist/features/lottery/schemas/zod.d.ts +4 -4
- package/dist/features/loyalty/schemas/index.d.ts +6 -6
- package/dist/features/orders/components/OrderPaymentSummary.d.ts +1 -1
- package/dist/features/orders/components/OrderPaymentSummary.js +5 -5
- package/dist/features/orders/components/RefundHistoryTable.js +1 -1
- package/dist/features/orders/repository/orders.repository.d.ts +10 -1
- package/dist/features/orders/repository/orders.repository.js +17 -1
- package/dist/features/orders/schemas/firestore.d.ts +11 -12
- package/dist/features/orders/schemas/firestore.js +0 -1
- package/dist/features/orders/schemas/index.d.ts +48 -48
- package/dist/features/orders/schemas/index.js +1 -1
- package/dist/features/orders/types/index.d.ts +1 -3
- package/dist/features/orders/types/index.js +1 -2
- package/dist/features/payments/manifest.js +1 -1
- package/dist/features/payments/repository/payout.repository.d.ts +1 -4
- package/dist/features/payments/repository/payout.repository.js +0 -29
- package/dist/features/payments/schemas/firestore.d.ts +8 -15
- package/dist/features/payments/schemas/firestore.js +7 -5
- package/dist/features/payments/schemas/index.d.ts +52 -125
- package/dist/features/payments/schemas/index.js +0 -58
- package/dist/features/payments/types/index.d.ts +2 -4
- package/dist/features/payments/types/index.js +1 -2
- package/dist/features/products/schemas/index.d.ts +14 -14
- package/dist/features/products/schemas/product-features.validators.d.ts +10 -10
- package/dist/features/promotions/schemas/index.d.ts +20 -20
- package/dist/features/reviews/schemas/index.d.ts +8 -8
- package/dist/features/scams/schemas/index.d.ts +10 -10
- package/dist/features/search/action-index/settings-entries.js +4 -4
- package/dist/features/seller/schemas/index.d.ts +12 -12
- package/dist/features/seller/schemas/order-forms.d.ts +4 -4
- package/dist/features/shipments/schemas/validation.d.ts +28 -28
- package/dist/features/store-extensions/schemas/payout-method-form.d.ts +50 -50
- package/dist/features/store-extensions/schemas/report-create-form.d.ts +2 -2
- package/dist/features/store-extensions/schemas/shipping-config-form.d.ts +10 -10
- package/dist/features/support/schemas/index.d.ts +14 -14
- package/dist/features/tester/actions/checklist-item-actions.d.ts +4 -4
- package/dist/features/tester/schemas/checklist-item-form.d.ts +2 -2
- package/dist/features/tester/seed-data/_money-flows.js +145 -0
- package/dist/features/tester/seed-data/authored/admin__site-system.js +38 -0
- package/dist/features/tester/seed-data/authored/buying__buying-checkout.js +10 -10
- package/dist/features/tester/seed-data/authored/buying__offers.js +11 -10
- package/dist/features/tester/seed-data/authored/cta-layout__checkout-bottom-bar.js +1 -1
- package/dist/features/tester/seed-data/tester-checklist-seed-data.js +24 -12
- package/dist/features/wishlist/schemas/index.d.ts +2 -2
- package/dist/index.d.ts +6 -28
- package/dist/index.js +8 -51
- package/dist/jobs.d.ts +1 -1
- package/dist/jobs.js +1 -1
- package/dist/providers/payment-phonepe/index.d.ts +117 -0
- package/dist/providers/payment-phonepe/index.js +221 -0
- package/dist/providers.d.ts +3 -2
- package/dist/providers.js +3 -2
- package/dist/schemas/registry.d.ts +163 -2623
- package/dist/schemas/registry.js +1 -6
- package/dist/seed/faq-seed-data.js +5 -5
- package/dist/seed/payouts-seed-data.js +3 -3
- package/dist/seed/site-settings-seed-data.js +7 -4
- package/dist/server-entry.d.ts +1 -2
- package/dist/server-entry.js +1 -3
- package/dist/server.d.ts +3 -9
- package/dist/server.js +5 -23
- package/dist/validation/schemas.d.ts +2 -2
- package/package.json +5 -4
- package/dist/_internal/server/features/payments/actions.d.ts +0 -30
- package/dist/_internal/server/features/payments/actions.js +0 -45
- package/dist/_internal/server/features/payments/data.d.ts +0 -13
- package/dist/_internal/server/features/payments/data.js +0 -20
- package/dist/_internal/server/features/payments/index.d.ts +0 -3
- package/dist/_internal/server/features/payments/index.js +0 -3
- package/dist/_internal/server/jobs/core/payoutBatch.d.ts +0 -2
- package/dist/_internal/server/jobs/core/payoutBatch.js +0 -120
- package/dist/_internal/server/jobs/handlers/payoutBatch.d.ts +0 -2
- package/dist/_internal/server/jobs/handlers/payoutBatch.js +0 -2
- package/dist/_internal/shared/features/payments/config.d.ts +0 -3
- package/dist/_internal/shared/features/payments/config.js +0 -3
- package/dist/contracts/client-payment-gateway.d.ts +0 -64
- package/dist/contracts/client-payment-gateway.js +0 -25
- package/dist/features/checkout/hooks/useCheckout.d.ts +0 -9
- package/dist/features/checkout/hooks/useCheckout.js +0 -24
- package/dist/features/checkout/hooks/useCheckoutApi.d.ts +0 -72
- package/dist/features/checkout/hooks/useCheckoutApi.js +0 -47
- package/dist/features/checkout/hooks/usePaymentCheckout.d.ts +0 -77
- package/dist/features/checkout/hooks/usePaymentCheckout.js +0 -192
- package/dist/providers/payment-razorpay/index.d.ts +0 -115
- package/dist/providers/payment-razorpay/index.js +0 -208
- package/dist/schemas/webhooks/razorpay.d.ts +0 -2634
- package/dist/schemas/webhooks/razorpay.js +0 -104
|
@@ -1,104 +0,0 @@
|
|
|
1
|
-
// [SCHEMA] Razorpay webhook envelopes (W7).
|
|
2
|
-
//
|
|
3
|
-
// Razorpay dispatches webhook POSTs with shape `{ event, payload, ... }`
|
|
4
|
-
// where `event` is a discriminator like "payment.captured" /
|
|
5
|
-
// "payment.failed" / "refund.processed" / "order.paid" and `payload`
|
|
6
|
-
// carries the corresponding entity nested under `payment`, `refund`, or
|
|
7
|
-
// `order`.
|
|
8
|
-
//
|
|
9
|
-
// Consumed by src/app/api/payment/webhook/route.ts (W7 — wire the route
|
|
10
|
-
// to call razorpayWebhookEnvelopeSchema.parse(JSON.parse(rawBody))).
|
|
11
|
-
import { z } from "zod";
|
|
12
|
-
// ---------------------------------------------------------------------------
|
|
13
|
-
// Common entity shapes.
|
|
14
|
-
// ---------------------------------------------------------------------------
|
|
15
|
-
export const razorpayPaymentEntitySchema = z.object({
|
|
16
|
-
id: z.string(),
|
|
17
|
-
entity: z.literal("payment").optional(),
|
|
18
|
-
amount: z.number().int(),
|
|
19
|
-
currency: z.string(),
|
|
20
|
-
status: z.string(),
|
|
21
|
-
order_id: z.string().optional(),
|
|
22
|
-
invoice_id: z.string().nullable().optional(),
|
|
23
|
-
international: z.boolean().optional(),
|
|
24
|
-
method: z.string().optional(),
|
|
25
|
-
amount_refunded: z.number().int().optional(),
|
|
26
|
-
refund_status: z.string().nullable().optional(),
|
|
27
|
-
captured: z.boolean().optional(),
|
|
28
|
-
description: z.string().nullable().optional(),
|
|
29
|
-
card_id: z.string().nullable().optional(),
|
|
30
|
-
bank: z.string().nullable().optional(),
|
|
31
|
-
wallet: z.string().nullable().optional(),
|
|
32
|
-
vpa: z.string().nullable().optional(),
|
|
33
|
-
email: z.string().optional(),
|
|
34
|
-
contact: z.string().optional(),
|
|
35
|
-
notes: z.record(z.string(), z.string()).optional(),
|
|
36
|
-
fee: z.number().int().optional(),
|
|
37
|
-
tax: z.number().int().optional(),
|
|
38
|
-
error_code: z.string().nullable().optional(),
|
|
39
|
-
error_description: z.string().nullable().optional(),
|
|
40
|
-
error_source: z.string().nullable().optional(),
|
|
41
|
-
error_step: z.string().nullable().optional(),
|
|
42
|
-
error_reason: z.string().nullable().optional(),
|
|
43
|
-
acquirer_data: z.record(z.string(), z.union([z.string(), z.number(), z.null()])).optional(),
|
|
44
|
-
created_at: z.number().int().optional(),
|
|
45
|
-
});
|
|
46
|
-
export const razorpayRefundEntitySchema = z.object({
|
|
47
|
-
id: z.string(),
|
|
48
|
-
entity: z.literal("refund").optional(),
|
|
49
|
-
amount: z.number().int(),
|
|
50
|
-
currency: z.string(),
|
|
51
|
-
payment_id: z.string(),
|
|
52
|
-
notes: z.record(z.string(), z.string()).optional(),
|
|
53
|
-
receipt: z.string().nullable().optional(),
|
|
54
|
-
acquirer_data: z.record(z.string(), z.union([z.string(), z.number(), z.null()])).optional(),
|
|
55
|
-
created_at: z.number().int().optional(),
|
|
56
|
-
batch_id: z.string().nullable().optional(),
|
|
57
|
-
status: z.string(),
|
|
58
|
-
speed_processed: z.string().optional(),
|
|
59
|
-
speed_requested: z.string().optional(),
|
|
60
|
-
});
|
|
61
|
-
export const razorpayOrderEntitySchema = z.object({
|
|
62
|
-
id: z.string(),
|
|
63
|
-
entity: z.literal("order").optional(),
|
|
64
|
-
amount: z.number().int(),
|
|
65
|
-
amount_paid: z.number().int().optional(),
|
|
66
|
-
amount_due: z.number().int().optional(),
|
|
67
|
-
currency: z.string(),
|
|
68
|
-
receipt: z.string().nullable().optional(),
|
|
69
|
-
status: z.string(),
|
|
70
|
-
attempts: z.number().int().optional(),
|
|
71
|
-
notes: z.record(z.string(), z.string()).optional(),
|
|
72
|
-
created_at: z.number().int().optional(),
|
|
73
|
-
});
|
|
74
|
-
// ---------------------------------------------------------------------------
|
|
75
|
-
// Per-event payload buckets.
|
|
76
|
-
// ---------------------------------------------------------------------------
|
|
77
|
-
const paymentCapturedPayload = z.object({ payment: z.object({ entity: razorpayPaymentEntitySchema }) });
|
|
78
|
-
const paymentFailedPayload = z.object({ payment: z.object({ entity: razorpayPaymentEntitySchema }) });
|
|
79
|
-
const refundProcessedPayload = z.object({
|
|
80
|
-
refund: z.object({ entity: razorpayRefundEntitySchema }),
|
|
81
|
-
payment: z.object({ entity: razorpayPaymentEntitySchema }).optional(),
|
|
82
|
-
});
|
|
83
|
-
const refundFailedPayload = z.object({ refund: z.object({ entity: razorpayRefundEntitySchema }) });
|
|
84
|
-
const orderPaidPayload = z.object({
|
|
85
|
-
order: z.object({ entity: razorpayOrderEntitySchema }),
|
|
86
|
-
payment: z.object({ entity: razorpayPaymentEntitySchema }).optional(),
|
|
87
|
-
});
|
|
88
|
-
// ---------------------------------------------------------------------------
|
|
89
|
-
// Envelope: discriminated union keyed on `event`.
|
|
90
|
-
// ---------------------------------------------------------------------------
|
|
91
|
-
const envelopeBase = {
|
|
92
|
-
account_id: z.string().optional(),
|
|
93
|
-
contains: z.array(z.string()).optional(),
|
|
94
|
-
created_at: z.number().int().optional(),
|
|
95
|
-
};
|
|
96
|
-
export const razorpayWebhookEnvelopeSchema = z.discriminatedUnion("event", [
|
|
97
|
-
z.object({ event: z.literal("payment.captured"), payload: paymentCapturedPayload, ...envelopeBase }),
|
|
98
|
-
z.object({ event: z.literal("payment.failed"), payload: paymentFailedPayload, ...envelopeBase }),
|
|
99
|
-
z.object({ event: z.literal("payment.authorized"), payload: paymentCapturedPayload, ...envelopeBase }),
|
|
100
|
-
z.object({ event: z.literal("refund.processed"), payload: refundProcessedPayload, ...envelopeBase }),
|
|
101
|
-
z.object({ event: z.literal("refund.failed"), payload: refundFailedPayload, ...envelopeBase }),
|
|
102
|
-
z.object({ event: z.literal("refund.created"), payload: refundProcessedPayload, ...envelopeBase }),
|
|
103
|
-
z.object({ event: z.literal("order.paid"), payload: orderPaidPayload, ...envelopeBase }),
|
|
104
|
-
]);
|