@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
|
@@ -0,0 +1,221 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @mohasinac/payment-phonepe — PhonePe Standard Checkout v2 IPaymentProvider implementation
|
|
3
|
+
*
|
|
4
|
+
* Implements the @mohasinac/contracts IPaymentProvider interface using the
|
|
5
|
+
* official `phonepe-pg-sdk-node` package. Accepts credentials via
|
|
6
|
+
* constructor — no Firestore or DB dependency (mirrors `payment-manual`'s
|
|
7
|
+
* shape, not the old `payment-razorpay` three-layer file: every caller goes
|
|
8
|
+
* through `getProviders().payment`, there is no separate "deprecated
|
|
9
|
+
* standalone helper" bypass layer here).
|
|
10
|
+
*
|
|
11
|
+
* PhonePe's flow differs from a client-side-modal gateway in two structural
|
|
12
|
+
* ways every caller of this provider must account for:
|
|
13
|
+
*
|
|
14
|
+
* 1. `createOrder()` returns a `checkoutUrl` (PhonePe's `redirectUrl`) —
|
|
15
|
+
* the browser opens/embeds this page. There is no publishable key to
|
|
16
|
+
* hand the client and no client-side signature to verify afterward.
|
|
17
|
+
* 2. The definitive payment result is never returned to the browser. The
|
|
18
|
+
* caller must poll `getOrder()`/`capturePayment()` (both wrap PhonePe's
|
|
19
|
+
* Order Status API) or rely on the webhook (`verifyWebhook`) as the
|
|
20
|
+
* source of truth.
|
|
21
|
+
*
|
|
22
|
+
* @example
|
|
23
|
+
* ```ts
|
|
24
|
+
* import { PhonePeProvider } from "@mohasinac/payment-phonepe";
|
|
25
|
+
* import { registerProviders } from "../../contracts";
|
|
26
|
+
*
|
|
27
|
+
* registerProviders({
|
|
28
|
+
* payment: new PhonePeProvider({
|
|
29
|
+
* clientId: process.env.PHONEPE_CLIENT_ID!,
|
|
30
|
+
* clientSecret: process.env.PHONEPE_CLIENT_SECRET!,
|
|
31
|
+
* clientVersion: process.env.PHONEPE_CLIENT_VERSION ?? "1",
|
|
32
|
+
* environment: (process.env.PHONEPE_ENVIRONMENT as "sandbox" | "production") ?? "sandbox",
|
|
33
|
+
* webhookUsername: process.env.PHONEPE_WEBHOOK_USERNAME,
|
|
34
|
+
* webhookPassword: process.env.PHONEPE_WEBHOOK_PASSWORD,
|
|
35
|
+
* }),
|
|
36
|
+
* });
|
|
37
|
+
* ```
|
|
38
|
+
*/
|
|
39
|
+
import { randomBytes } from "crypto";
|
|
40
|
+
import { StandardCheckoutClient, StandardCheckoutPayRequest, RefundRequest, MetaInfo, Env, } from "phonepe-pg-sdk-node";
|
|
41
|
+
import { IPaymentProvider } from "../../contracts";
|
|
42
|
+
import { getDefaultCurrency } from "../../core/baseline-resolver";
|
|
43
|
+
import { normalizeError } from "../../errors/normalize";
|
|
44
|
+
function packMetaInfo(intent) {
|
|
45
|
+
return MetaInfo.builder()
|
|
46
|
+
.udf1(intent.uid)
|
|
47
|
+
.udf2(intent.addressId ?? "")
|
|
48
|
+
.udf3(intent.outOfStockPolicy ?? "")
|
|
49
|
+
.udf4((intent.notes ?? "").slice(0, 256))
|
|
50
|
+
.udf5("")
|
|
51
|
+
.build();
|
|
52
|
+
}
|
|
53
|
+
function unpackMetaInfo(meta) {
|
|
54
|
+
if (!meta?.udf1)
|
|
55
|
+
return undefined;
|
|
56
|
+
return {
|
|
57
|
+
uid: meta.udf1,
|
|
58
|
+
addressId: meta.udf2 || undefined,
|
|
59
|
+
outOfStockPolicy: meta.udf3 || undefined,
|
|
60
|
+
notes: meta.udf4 || undefined,
|
|
61
|
+
};
|
|
62
|
+
}
|
|
63
|
+
/** merchantOrderId / merchantRefundId — ≤63 chars, `_`/`-` only (PhonePe constraint). */
|
|
64
|
+
function generateId(prefix) {
|
|
65
|
+
return `${prefix}_${randomBytes(12).toString("hex")}`;
|
|
66
|
+
}
|
|
67
|
+
function mapOrderState(state) {
|
|
68
|
+
switch (state) {
|
|
69
|
+
case "COMPLETED":
|
|
70
|
+
return "paid";
|
|
71
|
+
case "FAILED":
|
|
72
|
+
return "failed";
|
|
73
|
+
case "PENDING":
|
|
74
|
+
return "attempted";
|
|
75
|
+
default:
|
|
76
|
+
return "created";
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
// --- IPaymentProvider implementation ------------------------------------------
|
|
80
|
+
export class PhonePeProvider extends IPaymentProvider {
|
|
81
|
+
constructor(config) {
|
|
82
|
+
super();
|
|
83
|
+
this.name = "phonepe";
|
|
84
|
+
const env = config.environment === "production" ? Env.PRODUCTION : Env.SANDBOX;
|
|
85
|
+
this.client = StandardCheckoutClient.getInstance(config.clientId, config.clientSecret, Number.parseInt(config.clientVersion, 10) || 1, env);
|
|
86
|
+
this.webhookUsername = config.webhookUsername;
|
|
87
|
+
this.webhookPassword = config.webhookPassword;
|
|
88
|
+
}
|
|
89
|
+
/**
|
|
90
|
+
* Creates a PhonePe order and returns its hosted checkout page.
|
|
91
|
+
*
|
|
92
|
+
* `metadata.redirectUrl` is REQUIRED — PhonePe's API mandates a
|
|
93
|
+
* `merchantUrls.redirectUrl` on every order (used only as the fallback
|
|
94
|
+
* destination if the buyer's browser degrades out of IFRAME mode into a
|
|
95
|
+
* full page navigation). `metadata.uid` is REQUIRED — it (plus the
|
|
96
|
+
* optional `addressId`/`outOfStockPolicy`/`notes`) is packed into
|
|
97
|
+
* PhonePe's `metaInfo` so the webhook can reconstruct and place the order
|
|
98
|
+
* with no buyer session (see `PhonePeCheckoutIntent` above). The returned
|
|
99
|
+
* `PaymentOrder.id` is OUR generated `merchantOrderId` — the key every
|
|
100
|
+
* subsequent lookup (status, refund, webhook correlation) uses.
|
|
101
|
+
*/
|
|
102
|
+
async createOrder(amount, currency, metadata) {
|
|
103
|
+
const redirectUrl = metadata?.redirectUrl;
|
|
104
|
+
if (typeof redirectUrl !== "string" || !redirectUrl) {
|
|
105
|
+
throw new Error("PhonePeProvider.createOrder requires metadata.redirectUrl");
|
|
106
|
+
}
|
|
107
|
+
const uid = metadata?.uid;
|
|
108
|
+
if (typeof uid !== "string" || !uid) {
|
|
109
|
+
throw new Error("PhonePeProvider.createOrder requires metadata.uid");
|
|
110
|
+
}
|
|
111
|
+
const merchantOrderId = generateId("ord");
|
|
112
|
+
const metaInfo = packMetaInfo({
|
|
113
|
+
uid,
|
|
114
|
+
addressId: typeof metadata?.addressId === "string" ? metadata.addressId : undefined,
|
|
115
|
+
outOfStockPolicy: typeof metadata?.outOfStockPolicy === "string" ? metadata.outOfStockPolicy : undefined,
|
|
116
|
+
notes: typeof metadata?.notes === "string" ? metadata.notes : undefined,
|
|
117
|
+
});
|
|
118
|
+
const payRequest = StandardCheckoutPayRequest.builder()
|
|
119
|
+
.merchantOrderId(merchantOrderId)
|
|
120
|
+
.amount(amount)
|
|
121
|
+
.redirectUrl(redirectUrl)
|
|
122
|
+
.metaInfo(metaInfo)
|
|
123
|
+
.build();
|
|
124
|
+
const response = await this.client.pay(payRequest);
|
|
125
|
+
return {
|
|
126
|
+
id: merchantOrderId,
|
|
127
|
+
amount,
|
|
128
|
+
currency: currency ?? getDefaultCurrency(),
|
|
129
|
+
status: "created",
|
|
130
|
+
metadata,
|
|
131
|
+
createdAt: new Date().toISOString(),
|
|
132
|
+
gatewayOrderId: response.orderId,
|
|
133
|
+
checkoutUrl: response.redirectUrl,
|
|
134
|
+
expiresAt: new Date(response.expireAt).toISOString(),
|
|
135
|
+
};
|
|
136
|
+
}
|
|
137
|
+
/**
|
|
138
|
+
* Validates a webhook request. `signature` is the raw `Authorization`
|
|
139
|
+
* header value; `payload` is the raw request body string. Requires
|
|
140
|
+
* `webhookUsername`/`webhookPassword` to be configured — returns `false`
|
|
141
|
+
* otherwise (same fail-closed shape Razorpay's provider used for a
|
|
142
|
+
* missing webhook secret).
|
|
143
|
+
*
|
|
144
|
+
* This only reports validity — it does NOT return the parsed callback
|
|
145
|
+
* body. Callers that need the parsed event (type + payload) should
|
|
146
|
+
* `JSON.parse` the raw body themselves after this returns `true`, same as
|
|
147
|
+
* the existing webhook route already does.
|
|
148
|
+
*/
|
|
149
|
+
verifyWebhook(payload, signature) {
|
|
150
|
+
if (!this.webhookUsername || !this.webhookPassword)
|
|
151
|
+
return false;
|
|
152
|
+
try {
|
|
153
|
+
this.client.validateCallback(this.webhookUsername, this.webhookPassword, signature, payload);
|
|
154
|
+
return true;
|
|
155
|
+
}
|
|
156
|
+
catch (err) {
|
|
157
|
+
void normalizeError(err);
|
|
158
|
+
return false;
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
/** Wraps the Order Status API. `orderId` here is our `merchantOrderId`. */
|
|
162
|
+
async capturePayment(orderId) {
|
|
163
|
+
const status = await this.client.getOrderStatus(orderId, true);
|
|
164
|
+
return {
|
|
165
|
+
id: orderId,
|
|
166
|
+
orderId: status.orderId,
|
|
167
|
+
amount: status.amount,
|
|
168
|
+
currency: getDefaultCurrency(),
|
|
169
|
+
status: status.state === "COMPLETED" ? "captured" : "failed",
|
|
170
|
+
capturedAt: new Date().toISOString(),
|
|
171
|
+
transactionId: status.paymentDetails?.[0]?.transactionId,
|
|
172
|
+
};
|
|
173
|
+
}
|
|
174
|
+
/**
|
|
175
|
+
* Initiates a refund. `paymentId` here is actually the original
|
|
176
|
+
* `merchantOrderId` — PhonePe refunds are order-keyed
|
|
177
|
+
* (`originalMerchantOrderId`), not payment-keyed. The inherited parameter
|
|
178
|
+
* name from `IPaymentProvider` is misleading for this provider; kept only
|
|
179
|
+
* because the base contract is shared with `ManualPaymentProvider`.
|
|
180
|
+
*/
|
|
181
|
+
async refund(paymentId, amount) {
|
|
182
|
+
if (amount === undefined) {
|
|
183
|
+
throw new Error("PhonePeProvider.refund requires an explicit amount (paise) — PhonePe has no whole-order refund shorthand");
|
|
184
|
+
}
|
|
185
|
+
const merchantRefundId = generateId("rfnd");
|
|
186
|
+
const refundRequest = RefundRequest.builder()
|
|
187
|
+
.merchantRefundId(merchantRefundId)
|
|
188
|
+
.originalMerchantOrderId(paymentId)
|
|
189
|
+
.amount(amount)
|
|
190
|
+
.build();
|
|
191
|
+
const result = await this.client.refund(refundRequest);
|
|
192
|
+
return {
|
|
193
|
+
id: result.refundId,
|
|
194
|
+
paymentId,
|
|
195
|
+
amount: result.amount,
|
|
196
|
+
currency: getDefaultCurrency(),
|
|
197
|
+
status: result.state === "COMPLETED" ? "processed" : result.state === "FAILED" ? "failed" : "pending",
|
|
198
|
+
createdAt: new Date().toISOString(),
|
|
199
|
+
};
|
|
200
|
+
}
|
|
201
|
+
/**
|
|
202
|
+
* Wraps the Order Status API. `orderId` here is our `merchantOrderId`.
|
|
203
|
+
* `metadata` is the buyer's checkout intent, unpacked from PhonePe's
|
|
204
|
+
* `metaInfo` — the primary reason the checkout action calls this rather
|
|
205
|
+
* than `capturePayment()` when confirming a payment.
|
|
206
|
+
*/
|
|
207
|
+
async getOrder(orderId) {
|
|
208
|
+
const status = await this.client.getOrderStatus(orderId, true);
|
|
209
|
+
const intent = unpackMetaInfo(status.metaInfo);
|
|
210
|
+
return {
|
|
211
|
+
id: orderId,
|
|
212
|
+
amount: status.amount,
|
|
213
|
+
currency: getDefaultCurrency(),
|
|
214
|
+
status: mapOrderState(status.state),
|
|
215
|
+
createdAt: new Date().toISOString(),
|
|
216
|
+
gatewayOrderId: status.orderId,
|
|
217
|
+
transactionId: status.paymentDetails?.[0]?.transactionId,
|
|
218
|
+
metadata: intent,
|
|
219
|
+
};
|
|
220
|
+
}
|
|
221
|
+
}
|
package/dist/providers.d.ts
CHANGED
|
@@ -17,8 +17,9 @@ export type { DocumentSnapshot } from "firebase-admin/firestore";
|
|
|
17
17
|
export { firebaseStorageProvider } from "./providers/storage-firebase/index";
|
|
18
18
|
export { createResendProvider } from "./providers/email-resend/index";
|
|
19
19
|
export type { ResendProviderOptions } from "./providers/email-resend/index";
|
|
20
|
-
export {
|
|
21
|
-
export type {
|
|
20
|
+
export { PhonePeProvider } from "./providers/payment-phonepe/index";
|
|
21
|
+
export type { PhonePeConfig } from "./providers/payment-phonepe/index";
|
|
22
|
+
export { rupeesToPaise, paiseToRupees } from "./core/money";
|
|
22
23
|
export { ManualPaymentProvider } from "./providers/payment-manual/index";
|
|
23
24
|
export { ManualShippingProvider } from "./providers/shipping-manual/index";
|
|
24
25
|
export { tailwindAdapter } from "./style/tailwind/index";
|
package/dist/providers.js
CHANGED
|
@@ -20,8 +20,9 @@ export { firebaseDbProvider, getAdminApp, getAdminAuth, getAdminDb, getAdminStor
|
|
|
20
20
|
export { firebaseStorageProvider } from "./providers/storage-firebase/index";
|
|
21
21
|
// Email (Resend)
|
|
22
22
|
export { createResendProvider } from "./providers/email-resend/index";
|
|
23
|
-
// Payment (
|
|
24
|
-
export {
|
|
23
|
+
// Payment (PhonePe) — disabled by default; siteSettings.payment.phonepeEnabled turns it on
|
|
24
|
+
export { PhonePeProvider } from "./providers/payment-phonepe/index";
|
|
25
|
+
export { rupeesToPaise, paiseToRupees } from "./core/money";
|
|
25
26
|
// Payment (manual) — the default provider
|
|
26
27
|
export { ManualPaymentProvider } from "./providers/payment-manual/index";
|
|
27
28
|
// Shipping (manual) — the default (and only) provider
|