@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
|
@@ -266,21 +266,21 @@ export const authored = {
|
|
|
266
266
|
expectedData: { defaultChannel: "email" },
|
|
267
267
|
endResult: "The order is placed after the WhatsApp code verifies. With no real Meta credentials configured this case is unreachable — answer null rather than reporting the missing option as a bug.",
|
|
268
268
|
},
|
|
269
|
-
"checklist-buying-buying-checkout-checkout-
|
|
269
|
+
"checklist-buying-buying-checkout-checkout-phonepe-charge-includes-shipping": {
|
|
270
270
|
roles: ["buyer"],
|
|
271
271
|
startPage: "/checkout",
|
|
272
272
|
steps: [
|
|
273
|
-
"Sign in as admin@letitrip.in / TempPass123
|
|
273
|
+
"Sign in as admin@letitrip.in / TempPass123!, open /admin/site, switch to the Shipping tab and confirm the 'PhonePe (online card/UPI) enabled' toggle is ON, and confirm the seller store-beyblade-arena has a configured shipping fee.",
|
|
274
274
|
"Sign in as rehan.sheikh@gmail.com / TempPass123!.",
|
|
275
275
|
"Open /products/product-beyblade-burst-valkyrie (price ₹999, store-beyblade-arena) and click 'Add to Cart'.",
|
|
276
276
|
"Complete Steps 1 and 2 of checkout.",
|
|
277
|
-
"On Step 3, select '
|
|
278
|
-
"Read the amount shown in the Order Summary before clicking the
|
|
279
|
-
"Click
|
|
277
|
+
"On Step 3, select 'Pay Online (PhonePe)'.",
|
|
278
|
+
"Read the amount shown in the Order Summary before clicking the button.",
|
|
279
|
+
"Click 'Pay Online (PhonePe)' and observe the amount displayed inside the PhonePe checkout iframe.",
|
|
280
280
|
],
|
|
281
|
-
expectedBehaviour: "The amount shown inside the
|
|
282
|
-
expectedUiState: "The
|
|
283
|
-
endResult: "After payment, the order confirmation page shows a Total that matches the
|
|
281
|
+
expectedBehaviour: "The amount shown inside the PhonePe checkout iframe must exactly match the Total shown in the Order Summary panel, including the seller's shipping fee. No discrepancy between the gateway charge and the recorded order total. This regression was originally fixed against Razorpay in 2026-08-20; PhonePe replaced Razorpay entirely and the pre-charge amount is built by the same fee-calculation code, so it is reachable through the new gateway too.",
|
|
282
|
+
expectedUiState: "The PhonePe iframe opens and shows a rupee amount that exactly matches the Total in the Order Summary (e.g. if the Order Summary shows ₹1,149.00, the PhonePe iframe shows ₹1,149.00 — not ₹999.00 or any other amount).",
|
|
283
|
+
endResult: "After payment, the order confirmation page shows a Total that matches the PhonePe iframe amount exactly.",
|
|
284
284
|
},
|
|
285
285
|
"checklist-buying-buying-checkout-emi-checkout-flow": {
|
|
286
286
|
roles: ["buyer"],
|
|
@@ -392,10 +392,10 @@ export const authored = {
|
|
|
392
392
|
"On Step 3 (Payment), read the available payment methods.",
|
|
393
393
|
"Select 'COD' (Cash on Delivery) if available and observe the UI.",
|
|
394
394
|
"Select 'UPI / Cash' (manual payment) and observe the UI.",
|
|
395
|
-
"If
|
|
395
|
+
"If 'Pay Online (PhonePe)' is listed, select it and observe the UI.",
|
|
396
396
|
],
|
|
397
397
|
inputs: { productId: "product-beyblade-burst-valkyrie" },
|
|
398
|
-
expectedBehaviour: "Each payment method option can be selected and the UI adapts accordingly — COD shows a COD confirmation, manual payment shows a how-it-works guide and consent checkbox,
|
|
398
|
+
expectedBehaviour: "Each payment method option can be selected and the UI adapts accordingly — COD shows a COD confirmation, manual payment shows a how-it-works guide and consent checkbox, PhonePe (when enabled) opens the hosted checkout iframe.",
|
|
399
399
|
expectedUiState: "Step 3 lists the available payment methods as selectable options. Selecting each one changes the lower section of the form to show method-specific instructions or controls. At least COD and UPI/Cash are shown.",
|
|
400
400
|
endResult: "Nothing persists until payment is actually submitted.",
|
|
401
401
|
},
|
|
@@ -531,20 +531,21 @@ export const authored = {
|
|
|
531
531
|
expectedUiState: "The suspension entry names an actor, a timestamp and a reason. After restoring, both transitions are listed in order.",
|
|
532
532
|
endResult: "The second store is back to its original status, with both entries recorded.",
|
|
533
533
|
},
|
|
534
|
-
"checklist-buying-offers-payout-
|
|
534
|
+
"checklist-buying-offers-payout-marked-failed-shows-in-timeline": {
|
|
535
535
|
roles: ["admin"],
|
|
536
536
|
startPage: "/admin/payouts",
|
|
537
537
|
steps: [
|
|
538
538
|
"Sign in as admin@letitrip.in / TempPass123!.",
|
|
539
|
-
"Open /admin/payouts and find a payout
|
|
540
|
-
"Open its
|
|
541
|
-
"
|
|
542
|
-
"
|
|
543
|
-
"
|
|
544
|
-
],
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
539
|
+
"Open /admin/payouts and find a pending payout.",
|
|
540
|
+
"Open it and set its status to Failed with an admin note, then save.",
|
|
541
|
+
"Reopen the payout and read its History block.",
|
|
542
|
+
"Set the same payout to Failed again with a DIFFERENT admin note, then save.",
|
|
543
|
+
"Reopen the payout and read its History block again.",
|
|
544
|
+
],
|
|
545
|
+
inputs: { firstFailureNote: "Bank rejected the transfer", secondFailureNote: "Retried with corrected IFSC, still rejected" },
|
|
546
|
+
expectedBehaviour: "Seller payouts are fully manual — there is no automated dispatch/retry job (PhonePe has no payout API, so the earlier RazorpayX auto-dispatch job that used to write razorpayPayoutId/razorpayStatus/failureCount/lastFailureReason was deleted outright when Razorpay was replaced). Each manual status change goes through the payout's status-history primitive, which appends rather than overwrites, so both Failed entries must be visible with the admin as actor.",
|
|
547
|
+
expectedUiState: "After the second save, the History block lists BOTH Failed entries in order, each with its own note ('Bank rejected the transfer' then 'Retried with corrected IFSC, still rejected') — not just the most recent one.",
|
|
548
|
+
endResult: "After reloading the payout detail page, both History entries are still present.",
|
|
548
549
|
},
|
|
549
550
|
"checklist-buying-offers-bid-timeline-explains-forfeited": {
|
|
550
551
|
roles: ["buyer"],
|
|
@@ -47,7 +47,7 @@ export const authored = {
|
|
|
47
47
|
],
|
|
48
48
|
inputs: { viewportWidth: 320 },
|
|
49
49
|
expectedBehaviour: "A label too long for one line makes its button taller rather than truncating. Height is cheap in a bottom bar; a clipped verb is not, because the buyer cannot tell what the button will do.",
|
|
50
|
-
expectedUiState: "'Pay Online (
|
|
50
|
+
expectedUiState: "'Pay Online (PhonePe)' is shown complete, wrapping onto two lines if it needs to. An ellipsis anywhere in the bar is a failure, on any payment method.",
|
|
51
51
|
endResult: "Layout-only; nothing persists. Restore the window width afterwards.",
|
|
52
52
|
},
|
|
53
53
|
};
|
|
@@ -671,7 +671,7 @@ const rawTesterChecklistItems = [
|
|
|
671
671
|
label: "The \"Send via WhatsApp instead\" option is NOT offered when the selected delivery address has no phone number on it, even with WhatsApp OTP enabled",
|
|
672
672
|
description: "Added 2026-08-21. The phone is resolved server-side from the selected address (never from anything the browser sends), so an address with no phone has nowhere to send the code. Select/create a delivery address with the phone field empty and confirm the WhatsApp option is absent rather than appearing and then failing.",
|
|
673
673
|
},
|
|
674
|
-
{ key: "payment-method-selection", label: "Choosing between COD, UPI/manual, and
|
|
674
|
+
{ key: "payment-method-selection", label: "Choosing between COD, UPI/manual, and PhonePe (when enabled) at checkout works" },
|
|
675
675
|
{ key: "payment-window-countdown", label: "Manual-payment orders show a 15-minute countdown timer on the payment page" },
|
|
676
676
|
{ key: "payment-proof-upload", label: "Uploading manual payment proof (screenshot, UTR, mark-as-paid + agreement checkboxes) works" },
|
|
677
677
|
{ key: "payment-proof-reupload", label: "Requesting a proof re-upload extends the buyer's payment window and the buyer can successfully re-submit" },
|
|
@@ -701,9 +701,9 @@ const rawTesterChecklistItems = [
|
|
|
701
701
|
href: "/checkout",
|
|
702
702
|
},
|
|
703
703
|
{
|
|
704
|
-
key: "checkout-
|
|
705
|
-
label: "When
|
|
706
|
-
description: "
|
|
704
|
+
key: "checkout-phonepe-charge-includes-shipping",
|
|
705
|
+
label: "When PhonePe online payment is enabled, the amount charged in the PhonePe checkout iframe matches the order's recorded Total exactly, including shipping fee",
|
|
706
|
+
description: "Originally fixed 2026-08-20 against Razorpay; PhonePe replaced Razorpay entirely in this same migration and the pre-charge amount is built by the identical fee-calculation code, so the same regression is reachable through the new gateway. Only testable when the \"PhonePe (online card/UPI) enabled\" toggle under Site Settings → Shipping → Payment methods is ON and the seller has a configured shipping fee. Note the amount shown inside the PhonePe iframe before paying, then compare it against the order's Total on the confirmation page — they should match exactly.",
|
|
707
707
|
href: "/checkout",
|
|
708
708
|
},
|
|
709
709
|
/*
|
|
@@ -1310,8 +1310,8 @@ const rawTesterChecklistItems = [
|
|
|
1310
1310
|
},
|
|
1311
1311
|
{
|
|
1312
1312
|
key: "platform-fee-all-methods",
|
|
1313
|
-
label: "The platform fee is charged on every payment method — COD, UPI-manual/cash and
|
|
1314
|
-
description: "It used to be added only on the
|
|
1313
|
+
label: "The platform fee is charged on every payment method — COD, UPI-manual/cash and PhonePe all include it; COD additionally shows the COD handling fee and the 10% token",
|
|
1314
|
+
description: "It used to be added only on the online-gateway path (Razorpay, since replaced by PhonePe), so COD and UPI buyers were never charged it. Compare the same cart across each available method.",
|
|
1315
1315
|
href: "/checkout",
|
|
1316
1316
|
},
|
|
1317
1317
|
{
|
|
@@ -1328,7 +1328,7 @@ const rawTesterChecklistItems = [
|
|
|
1328
1328
|
{
|
|
1329
1329
|
key: "cart-checkout-order-totals-agree",
|
|
1330
1330
|
label: "For the same cart, the expanded cart breakdown, the sum of the per-seller card fee lines, the checkout Order Summary and the created orders all show the SAME total",
|
|
1331
|
-
description: "Repeat on COD, UPI-manual and
|
|
1331
|
+
description: "Repeat on COD, UPI-manual and PhonePe. Acceptance test for the whole pricing change — if any two of those four disagree, something is reading a different source than it charges from.",
|
|
1332
1332
|
href: "/checkout",
|
|
1333
1333
|
},
|
|
1334
1334
|
{
|
|
@@ -1625,9 +1625,9 @@ const rawTesterChecklistItems = [
|
|
|
1625
1625
|
href: "/admin/stores",
|
|
1626
1626
|
},
|
|
1627
1627
|
{
|
|
1628
|
-
key: "payout-
|
|
1629
|
-
label: "
|
|
1630
|
-
description: "
|
|
1628
|
+
key: "payout-marked-failed-shows-in-timeline",
|
|
1629
|
+
label: "Manually marking a payout Failed records the change on its own status timeline, and doing it a second time does not erase the first entry",
|
|
1630
|
+
description: "Seller payouts are fully manual (there is no automated dispatch/retry job — PhonePe has no payout API, so the earlier RazorpayX auto-dispatch job and its `razorpayPayoutId`/`razorpayStatus`/`failureCount`/`lastFailureReason` fields were deleted outright rather than migrated). Mark a pending payout Failed from /admin/payouts, reopen it, and confirm the History block shows a Failed entry with the admin as actor. Mark it Failed again and confirm the FIRST entry is still listed rather than being overwritten by the second.",
|
|
1631
1631
|
href: "/admin/payouts",
|
|
1632
1632
|
},
|
|
1633
1633
|
{
|
|
@@ -4873,7 +4873,7 @@ const rawTesterChecklistItems = [
|
|
|
4873
4873
|
{
|
|
4874
4874
|
key: "coupon-admin-usage-visible",
|
|
4875
4875
|
label: "The admin coupon list shows usage counts that go up after a buyer redeems the coupon",
|
|
4876
|
-
description: "Note the current usage, have a buyer complete an order with the coupon, then refresh the admin list. Check this for BOTH a cash/UPI order and (if
|
|
4876
|
+
description: "Note the current usage, have a buyer complete an order with the coupon, then refresh the admin list. Check this for BOTH a cash/UPI order and (if PhonePe is enabled) an online-payment order — online payments previously did not record usage at all.",
|
|
4877
4877
|
},
|
|
4878
4878
|
],
|
|
4879
4879
|
},
|
|
@@ -5193,6 +5193,18 @@ const rawTesterChecklistItems = [
|
|
|
5193
5193
|
href: "/admin/site",
|
|
5194
5194
|
cases: [
|
|
5195
5195
|
{ key: "site-settings-admin", label: "Admin site settings page saves correctly", href: "/admin/site" },
|
|
5196
|
+
{
|
|
5197
|
+
key: "phonepe-credentials-persist",
|
|
5198
|
+
label: "Site Settings → Integrations saves the PhonePe Client ID, Client Secret, Client Version, Environment and both webhook credentials — and they survive a reload",
|
|
5199
|
+
description: "Open /admin/site and switch to the Integrations tab (?tab=integrations). Fill in the PhonePe Client ID, Client Secret, Client Version, Environment (sandbox/production) and Webhook Username/Password, then save and hard-reload. The Client Secret and both webhook credential fields are masked on reload (dots, not the raw value) — that is correct. Confirm by changing an unrelated field on the same tab, saving again, and verifying the masked fields still work (checkout still reaches PhonePe) rather than being silently overwritten with the mask value.",
|
|
5200
|
+
href: "/admin/site",
|
|
5201
|
+
},
|
|
5202
|
+
{
|
|
5203
|
+
key: "phonepe-enabled-toggle-persists",
|
|
5204
|
+
label: "Site Settings → Shipping: the \"PhonePe (online card/UPI) enabled\" toggle persists after save + reload, and gates the checkout payment option",
|
|
5205
|
+
description: "The toggle lives under the Shipping tab's \"Payment methods\" section (?tab=shipping), not a dedicated Payments tab. With it OFF, /checkout must not offer 'Pay Online (PhonePe)' — only manual UPI/cash and COD (whichever are separately enabled). Turn it ON, save, reload the settings page to confirm it's still ON, then open /checkout and confirm 'Pay Online (PhonePe)' now appears as a payment option.",
|
|
5206
|
+
href: "/admin/site",
|
|
5207
|
+
},
|
|
5196
5208
|
{
|
|
5197
5209
|
key: "whatsapp-credentials-persist",
|
|
5198
5210
|
label: "Site Settings → WhatsApp saves the Phone Number ID, Cloud API token, admin notify numbers, template language and all 6 template names — and they survive a reload",
|
|
@@ -6042,7 +6054,7 @@ const rawTesterChecklistItems = [
|
|
|
6042
6054
|
{
|
|
6043
6055
|
key: "no-truncation-anywhere",
|
|
6044
6056
|
label: "No CTA label is ever cut off — long ones wrap to two lines",
|
|
6045
|
-
description: "Check the payment step, whose primary reads 'Pay Online (
|
|
6057
|
+
description: "Check the payment step, whose primary reads 'Pay Online (PhonePe)'. BEFORE: a label too long for its share was clipped with an ellipsis. AFTER: the button grows taller and shows the whole label on two lines. An ellipsis anywhere in the bar is a failure.",
|
|
6046
6058
|
},
|
|
6047
6059
|
],
|
|
6048
6060
|
},
|
|
@@ -23,8 +23,8 @@ export declare const wishlistItemSchema: z.ZodObject<{
|
|
|
23
23
|
addedAt: z.ZodOptional<z.ZodString>;
|
|
24
24
|
}, "strip", z.ZodTypeAny, {
|
|
25
25
|
id: string;
|
|
26
|
-
userId: string;
|
|
27
26
|
productId: string;
|
|
27
|
+
userId: string;
|
|
28
28
|
productTitle?: string | undefined;
|
|
29
29
|
productImage?: string | undefined;
|
|
30
30
|
addedAt?: string | undefined;
|
|
@@ -34,8 +34,8 @@ export declare const wishlistItemSchema: z.ZodObject<{
|
|
|
34
34
|
productStatus?: string | undefined;
|
|
35
35
|
}, {
|
|
36
36
|
id: string;
|
|
37
|
-
userId: string;
|
|
38
37
|
productId: string;
|
|
38
|
+
userId: string;
|
|
39
39
|
productTitle?: string | undefined;
|
|
40
40
|
productImage?: string | undefined;
|
|
41
41
|
addedAt?: string | undefined;
|
package/dist/index.d.ts
CHANGED
|
@@ -169,17 +169,14 @@ export { arrayRemove } from "./contracts/index";
|
|
|
169
169
|
export { arrayUnion } from "./contracts/index";
|
|
170
170
|
export { deleteField } from "./contracts/index";
|
|
171
171
|
export { getClientAuthProvider } from "./contracts/index";
|
|
172
|
-
export { getClientPaymentGateway } from "./contracts/index";
|
|
173
172
|
export { getClientRealtimeProvider } from "./contracts/index";
|
|
174
173
|
export { getClientSessionAdapter } from "./contracts/index";
|
|
175
174
|
export { getCollectionHooks } from "./contracts/index";
|
|
176
175
|
export { getProviders } from "./contracts/index";
|
|
177
|
-
export { getRegisteredPaymentGateways } from "./contracts/index";
|
|
178
176
|
export { increment } from "./contracts/index";
|
|
179
177
|
export { mergeFilterDefinitions } from "./contracts/index";
|
|
180
178
|
export { mergeSortDefinitions } from "./contracts/index";
|
|
181
179
|
export { registerClientAuthProvider } from "./contracts/index";
|
|
182
|
-
export { registerClientPaymentGateway } from "./contracts/index";
|
|
183
180
|
export { registerClientRealtimeProvider } from "./contracts/index";
|
|
184
181
|
export { registerClientSessionAdapter } from "./contracts/index";
|
|
185
182
|
export { registerFieldOps } from "./contracts/index";
|
|
@@ -211,11 +208,9 @@ export type { FieldSentinel } from "./contracts/index";
|
|
|
211
208
|
export type { FilterDefinition } from "./contracts/index";
|
|
212
209
|
export type { FilterOption } from "./contracts/index";
|
|
213
210
|
export type { FilterType } from "./contracts/index";
|
|
214
|
-
export type { GatewayPaymentResponse } from "./contracts/index";
|
|
215
211
|
export type { IAuthProvider } from "./contracts/index";
|
|
216
212
|
export type { ICacheProvider } from "./contracts/index";
|
|
217
213
|
export type { IClientAuthProvider } from "./contracts/index";
|
|
218
|
-
export type { IClientPaymentGateway } from "./contracts/index";
|
|
219
214
|
export type { IClientRealtimeProvider } from "./contracts/index";
|
|
220
215
|
export type { IClientSessionAdapter } from "./contracts/index";
|
|
221
216
|
export type { IDbProvider } from "./contracts/index";
|
|
@@ -235,7 +230,6 @@ export type { IStyleAdapter } from "./contracts/index";
|
|
|
235
230
|
export type { IWriteRepository } from "./contracts/index";
|
|
236
231
|
export type { LayoutSlots } from "./contracts/index";
|
|
237
232
|
export type { NavItem } from "./contracts/index";
|
|
238
|
-
export type { OpenGatewayOptions } from "./contracts/index";
|
|
239
233
|
export type { PagedResult } from "./contracts/index";
|
|
240
234
|
export type { PaymentCapture } from "./contracts/index";
|
|
241
235
|
export type { PaymentOrder } from "./contracts/index";
|
|
@@ -327,7 +321,7 @@ export { handleApiError } from "./errors/index";
|
|
|
327
321
|
export { isAppError } from "./errors/index";
|
|
328
322
|
export { logError } from "./errors/index";
|
|
329
323
|
export type { ErrorCode } from "./errors/index";
|
|
330
|
-
export {
|
|
324
|
+
export { PaymentProviderUnreachableError } from "./errors/index";
|
|
331
325
|
export { mapToHttpError, HTTP_ERROR_CODES } from "./errors/index";
|
|
332
326
|
export type { MappedError, HttpErrorCode } from "./errors/index";
|
|
333
327
|
export { ERROR_DISPLAY_MAP, getErrorDisplay } from "./errors/index";
|
|
@@ -846,20 +840,10 @@ export type { ResendProviderOptions } from "./providers/email-resend/index";
|
|
|
846
840
|
export { FirebaseClientAuthProvider } from "./providers/firebase-client/index";
|
|
847
841
|
export { FirebaseClientRealtimeProvider } from "./providers/firebase-client/index";
|
|
848
842
|
export type { FirebaseClientRealtimeConfig } from "./providers/firebase-client/index";
|
|
849
|
-
export {
|
|
850
|
-
export {
|
|
851
|
-
export {
|
|
852
|
-
export {
|
|
853
|
-
export { paiseToRupees } from "./providers/payment-razorpay/index";
|
|
854
|
-
export { rupeesToPaise } from "./providers/payment-razorpay/index";
|
|
855
|
-
export { verifyPaymentSignature } from "./providers/payment-razorpay/index";
|
|
856
|
-
export { verifyPaymentSignatureWithKeys } from "./providers/payment-razorpay/index";
|
|
857
|
-
export { verifyWebhookSignature } from "./providers/payment-razorpay/index";
|
|
858
|
-
export type { RazorpayConfig } from "./providers/payment-razorpay/index";
|
|
859
|
-
export type { RazorpayOrder } from "./providers/payment-razorpay/index";
|
|
860
|
-
export type { RazorpayOrderOptions } from "./providers/payment-razorpay/index";
|
|
861
|
-
export type { RazorpayPaymentResult } from "./providers/payment-razorpay/index";
|
|
862
|
-
export type { RazorpayRefundResult } from "./providers/payment-razorpay/index";
|
|
843
|
+
export { PhonePeProvider } from "./providers/payment-phonepe/index";
|
|
844
|
+
export { paiseToRupees } from "./core/money";
|
|
845
|
+
export { rupeesToPaise } from "./core/money";
|
|
846
|
+
export type { PhonePeConfig } from "./providers/payment-phonepe/index";
|
|
863
847
|
export { ManualPaymentProvider } from "./providers/payment-manual/index";
|
|
864
848
|
export { ManualShippingProvider } from "./providers/shipping-manual/index";
|
|
865
849
|
export { STORAGE_PATHS } from "./providers/storage-firebase/client";
|
|
@@ -2168,7 +2152,6 @@ export type { RefundHistoryTableProps } from "./features/orders/index";
|
|
|
2168
2152
|
export { RefundRequestView } from "./features/orders/index";
|
|
2169
2153
|
export type { RefundRequestViewProps } from "./features/orders/index";
|
|
2170
2154
|
export type { RefundRequestSubmission } from "./features/orders/components/RefundRequestView";
|
|
2171
|
-
export { PaymentGatewayValues } from "./features/orders/index";
|
|
2172
2155
|
export { PaymentMethodValues } from "./features/orders/index";
|
|
2173
2156
|
export { OutOfStockPolicyValues } from "./features/orders/index";
|
|
2174
2157
|
export type { OutOfStockPolicy } from "./features/orders/index";
|
|
@@ -2211,7 +2194,6 @@ export type { OrderListResponse } from "./features/orders/index";
|
|
|
2211
2194
|
export type { OrderPayoutStatus } from "./features/orders/index";
|
|
2212
2195
|
export type { OrderTimeline } from "./features/orders/index";
|
|
2213
2196
|
export type { OrderUpdateInput } from "./features/orders/index";
|
|
2214
|
-
export type { PaymentGateway } from "./features/orders/index";
|
|
2215
2197
|
export type { RefundStatus } from "./features/orders/index";
|
|
2216
2198
|
export type { ShippingMethod } from "./features/orders/index";
|
|
2217
2199
|
export { cancelOrderForUser } from "./features/orders/server";
|
|
@@ -2264,10 +2246,6 @@ export { PayoutStatusValues } from "./features/payments/index";
|
|
|
2264
2246
|
export { buildPaymentColumns } from "./features/payments/index";
|
|
2265
2247
|
export { createPayoutId } from "./features/payments/index";
|
|
2266
2248
|
export { paymentAdminColumns } from "./features/payments/index";
|
|
2267
|
-
export { paymentGatewayConfigSchema } from "./features/payments/index";
|
|
2268
|
-
export { paymentGatewaySchema } from "./features/payments/index";
|
|
2269
|
-
export { paymentRecordSchema } from "./features/payments/index";
|
|
2270
|
-
export { paymentStatusSchema } from "./features/payments/index";
|
|
2271
2249
|
export { payoutQueryHelpers } from "./features/payments/index";
|
|
2272
2250
|
export { payoutStatusSchema } from "./features/payments/index";
|
|
2273
2251
|
export { usePaymentEvent } from "./features/payments/index";
|
|
@@ -3019,7 +2997,7 @@ export type { RoleGateProps, ProtectedRouteProps, AuthGuardUser, AuthRouteConfig
|
|
|
3019
2997
|
export { CartItemRow, CartDrawer, CartView, CartSummary, ShippingPicker } from "./features/cart/index";
|
|
3020
2998
|
export type { ShippingPickerProps } from "./features/cart/index";
|
|
3021
2999
|
export { CheckoutView, CheckoutAddressStep, CheckoutSuccessView } from "./features/cart/index";
|
|
3022
|
-
export { CheckoutStepper
|
|
3000
|
+
export { CheckoutStepper } from "./features/checkout/index";
|
|
3023
3001
|
export { useProfile as useCurrentProfile, useUpdateProfile as useUpdateCurrentProfile } from "./features/account/index";
|
|
3024
3002
|
export { useLogout } from "./features/auth/index";
|
|
3025
3003
|
export { Text, Label, Span } from "./ui/index";
|
package/dist/index.js
CHANGED
|
@@ -315,9 +315,6 @@ export { deleteField } from "./contracts/index";
|
|
|
315
315
|
// getClientAuthProvider - Helper for get client auth provider.
|
|
316
316
|
export { getClientAuthProvider } from "./contracts/index";
|
|
317
317
|
// [CLIENT-SSR]-Runs in both SSR and browser â€" React component or hook that does not depend on browser-only APIs.
|
|
318
|
-
// getClientPaymentGateway - Helper for get client payment gateway.
|
|
319
|
-
export { getClientPaymentGateway } from "./contracts/index";
|
|
320
|
-
// [CLIENT-SSR]-Runs in both SSR and browser â€" React component or hook that does not depend on browser-only APIs.
|
|
321
318
|
// getClientRealtimeProvider - Helper for get client realtime provider.
|
|
322
319
|
export { getClientRealtimeProvider } from "./contracts/index";
|
|
323
320
|
// [CLIENT-SSR]-Runs in both SSR and browser â€" React component or hook that does not depend on browser-only APIs.
|
|
@@ -330,9 +327,6 @@ export { getCollectionHooks } from "./contracts/index";
|
|
|
330
327
|
// getProviders - Helper for get providers.
|
|
331
328
|
export { getProviders } from "./contracts/index";
|
|
332
329
|
// [CLIENT-SSR]-Runs in both SSR and browser â€" React component or hook that does not depend on browser-only APIs.
|
|
333
|
-
// getRegisteredPaymentGateways - Helper for get registered payment gateways.
|
|
334
|
-
export { getRegisteredPaymentGateways } from "./contracts/index";
|
|
335
|
-
// [CLIENT-SSR]-Runs in both SSR and browser â€" React component or hook that does not depend on browser-only APIs.
|
|
336
330
|
// increment - Shared export for increment.
|
|
337
331
|
export { increment } from "./contracts/index";
|
|
338
332
|
// [CLIENT-SSR]-Runs in both SSR and browser â€" React component or hook that does not depend on browser-only APIs.
|
|
@@ -345,9 +339,6 @@ export { mergeSortDefinitions } from "./contracts/index";
|
|
|
345
339
|
// registerClientAuthProvider - Helper for register client auth provider.
|
|
346
340
|
export { registerClientAuthProvider } from "./contracts/index";
|
|
347
341
|
// [CLIENT-SSR]-Runs in both SSR and browser â€" React component or hook that does not depend on browser-only APIs.
|
|
348
|
-
// registerClientPaymentGateway - Helper for register client payment gateway.
|
|
349
|
-
export { registerClientPaymentGateway } from "./contracts/index";
|
|
350
|
-
// [CLIENT-SSR]-Runs in both SSR and browser â€" React component or hook that does not depend on browser-only APIs.
|
|
351
342
|
// registerClientRealtimeProvider - Helper for register client realtime provider.
|
|
352
343
|
export { registerClientRealtimeProvider } from "./contracts/index";
|
|
353
344
|
// [CLIENT-SSR]-Runs in both SSR and browser â€" React component or hook that does not depend on browser-only APIs.
|
|
@@ -558,8 +549,8 @@ export { isAppError } from "./errors/index";
|
|
|
558
549
|
// logError - Helper for log error.
|
|
559
550
|
export { logError } from "./errors/index";
|
|
560
551
|
// [UTIL]-Pure utility — no framework or runtime dependency; safe to import from any environment.
|
|
561
|
-
//
|
|
562
|
-
export {
|
|
552
|
+
// PaymentProviderUnreachableError - Thrown when the payment gateway API exhausts retries.
|
|
553
|
+
export { PaymentProviderUnreachableError } from "./errors/index";
|
|
563
554
|
// [UTIL]-Pure utility — server boundary code/HTTP mapper for any thrown value.
|
|
564
555
|
// mapToHttpError - Map any thrown value to { status, code, message, issues? }.
|
|
565
556
|
export { mapToHttpError, HTTP_ERROR_CODES } from "./errors/index";
|
|
@@ -1717,34 +1708,16 @@ export { FirebaseClientAuthProvider } from "./providers/firebase-client/index";
|
|
|
1717
1708
|
// [CLIENT-ONLY]-Cannot run in SSR mode â€" uses browser-only APIs (window, navigator, localStorage, matchMedia, DOM events) that do not exist in Node.js.
|
|
1718
1709
|
// FirebaseClientRealtimeProvider - Component for firebase client realtime provider.
|
|
1719
1710
|
export { FirebaseClientRealtimeProvider } from "./providers/firebase-client/index";
|
|
1720
|
-
// ./providers/payment-
|
|
1721
|
-
// [SERVER-ONLY]-Server-only â€" uses Node.js, Next.js server internals, or third-party server SDKs (auth, email, payment, shipping).
|
|
1722
|
-
// RazorpayProvider - Component for razorpay provider.
|
|
1723
|
-
export { RazorpayProvider } from "./providers/payment-razorpay/index";
|
|
1711
|
+
// ./providers/payment-phonepe/index
|
|
1724
1712
|
// [SERVER-ONLY]-Server-only â€" uses Node.js, Next.js server internals, or third-party server SDKs (auth, email, payment, shipping).
|
|
1725
|
-
//
|
|
1726
|
-
export {
|
|
1727
|
-
// [SERVER-ONLY]-Server-only â€" uses Node.js, Next.js server internals, or third-party server SDKs (auth, email, payment, shipping).
|
|
1728
|
-
// createRazorpayRefund - Helper for create razorpay refund.
|
|
1729
|
-
export { createRazorpayRefund } from "./providers/payment-razorpay/index";
|
|
1730
|
-
// [SERVER-ONLY]-Server-only â€" uses Node.js, Next.js server internals, or third-party server SDKs (auth, email, payment, shipping).
|
|
1731
|
-
// fetchRazorpayOrder - Shared export for fetch razorpay order.
|
|
1732
|
-
export { fetchRazorpayOrder } from "./providers/payment-razorpay/index";
|
|
1713
|
+
// PhonePeProvider - Component for phonepe provider.
|
|
1714
|
+
export { PhonePeProvider } from "./providers/payment-phonepe/index";
|
|
1733
1715
|
// [SERVER-ONLY]-Server-only â€" uses Node.js, Next.js server internals, or third-party server SDKs (auth, email, payment, shipping).
|
|
1734
1716
|
// paiseToRupees - Shared export for paise to rupees. // audit-money-units-ok: names the boundary conversion function itself
|
|
1735
|
-
export { paiseToRupees } from "./
|
|
1717
|
+
export { paiseToRupees } from "./core/money";
|
|
1736
1718
|
// [SERVER-ONLY]-Server-only â€" uses Node.js, Next.js server internals, or third-party server SDKs (auth, email, payment, shipping).
|
|
1737
1719
|
// rupeesToPaise - Shared export for rupees to paise. // audit-money-units-ok: names the boundary conversion function itself
|
|
1738
|
-
export { rupeesToPaise } from "./
|
|
1739
|
-
// [SERVER-ONLY]-Server-only â€" uses Node.js, Next.js server internals, or third-party server SDKs (auth, email, payment, shipping).
|
|
1740
|
-
// verifyPaymentSignature - Shared export for verify payment signature.
|
|
1741
|
-
export { verifyPaymentSignature } from "./providers/payment-razorpay/index";
|
|
1742
|
-
// [SERVER-ONLY]-Server-only â€" uses Node.js, Next.js server internals, or third-party server SDKs (auth, email, payment, shipping).
|
|
1743
|
-
// verifyPaymentSignatureWithKeys - Shared export for verify payment signature with keys.
|
|
1744
|
-
export { verifyPaymentSignatureWithKeys } from "./providers/payment-razorpay/index";
|
|
1745
|
-
// [SERVER-ONLY]-Server-only â€" uses Node.js, Next.js server internals, or third-party server SDKs (auth, email, payment, shipping).
|
|
1746
|
-
// verifyWebhookSignature - Shared export for verify webhook signature.
|
|
1747
|
-
export { verifyWebhookSignature } from "./providers/payment-razorpay/index";
|
|
1720
|
+
export { rupeesToPaise } from "./core/money";
|
|
1748
1721
|
// ./providers/payment-manual/index
|
|
1749
1722
|
// [SERVER-ONLY]-Server-only â€" uses Node.js, Next.js server internals, or third-party server SDKs (auth, email, payment, shipping).
|
|
1750
1723
|
// ManualPaymentProvider - the default IPaymentProvider implementation (no gateway).
|
|
@@ -3995,9 +3968,6 @@ export { OfferPhaseTimeline } from "./features/seller/components/OfferPhaseTimel
|
|
|
3995
3968
|
export { RefundHistoryTable } from "./features/orders/index";
|
|
3996
3969
|
export { RefundRequestView } from "./features/orders/index";
|
|
3997
3970
|
// [CLIENT-SSR]-Runs in both SSR and browser â€" React component or hook that does not depend on browser-only APIs.
|
|
3998
|
-
// PaymentGatewayValues - Model for payment gateway values.
|
|
3999
|
-
export { PaymentGatewayValues } from "./features/orders/index";
|
|
4000
|
-
// [CLIENT-SSR]-Runs in both SSR and browser â€" React component or hook that does not depend on browser-only APIs.
|
|
4001
3971
|
// PaymentMethodValues - Model for payment method values.
|
|
4002
3972
|
export { PaymentMethodValues } from "./features/orders/index";
|
|
4003
3973
|
// [CLIENT-SSR]-Runs in both SSR and browser â€" React component or hook that does not depend on browser-only APIs.
|
|
@@ -4139,18 +4109,6 @@ export { createPayoutId } from "./features/payments/index";
|
|
|
4139
4109
|
// paymentAdminColumns - Shared export for payment admin columns.
|
|
4140
4110
|
export { paymentAdminColumns } from "./features/payments/index";
|
|
4141
4111
|
// [CLIENT-SSR]-Runs in both SSR and browser â€" React component or hook that does not depend on browser-only APIs.
|
|
4142
|
-
// paymentGatewayConfigSchema - Model for payment gateway config schema.
|
|
4143
|
-
export { paymentGatewayConfigSchema } from "./features/payments/index";
|
|
4144
|
-
// [CLIENT-SSR]-Runs in both SSR and browser â€" React component or hook that does not depend on browser-only APIs.
|
|
4145
|
-
// paymentGatewaySchema - Model for payment gateway schema.
|
|
4146
|
-
export { paymentGatewaySchema } from "./features/payments/index";
|
|
4147
|
-
// [CLIENT-SSR]-Runs in both SSR and browser â€" React component or hook that does not depend on browser-only APIs.
|
|
4148
|
-
// paymentRecordSchema - Model for payment record schema.
|
|
4149
|
-
export { paymentRecordSchema } from "./features/payments/index";
|
|
4150
|
-
// [CLIENT-SSR]-Runs in both SSR and browser â€" React component or hook that does not depend on browser-only APIs.
|
|
4151
|
-
// paymentStatusSchema - Model for payment status schema.
|
|
4152
|
-
export { paymentStatusSchema } from "./features/payments/index";
|
|
4153
|
-
// [CLIENT-SSR]-Runs in both SSR and browser â€" React component or hook that does not depend on browser-only APIs.
|
|
4154
4112
|
// payoutQueryHelpers - Shared export for payout query helpers.
|
|
4155
4113
|
export { payoutQueryHelpers } from "./features/payments/index";
|
|
4156
4114
|
// [CLIENT-SSR]-Runs in both SSR and browser â€" React component or hook that does not depend on browser-only APIs.
|
|
@@ -5374,8 +5332,7 @@ export { RoleGate, ProtectedRoute, SocialAuthButtons, AuthStatusPanel, LoginForm
|
|
|
5374
5332
|
// Missing cart and checkout feature components
|
|
5375
5333
|
export { CartItemRow, CartDrawer, CartView, CartSummary, ShippingPicker } from "./features/cart/index";
|
|
5376
5334
|
export { CheckoutView, CheckoutAddressStep, CheckoutSuccessView } from "./features/cart/index";
|
|
5377
|
-
export { CheckoutStepper
|
|
5378
|
-
// PaymentGateway already exported from checkout types above
|
|
5335
|
+
export { CheckoutStepper } from "./features/checkout/index";
|
|
5379
5336
|
// Missing account hooks
|
|
5380
5337
|
export { useProfile as useCurrentProfile, useUpdateProfile as useUpdateCurrentProfile } from "./features/account/index";
|
|
5381
5338
|
// Missing auth hooks
|
package/dist/jobs.d.ts
CHANGED
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
* listingProcessorHandler,
|
|
21
21
|
* } from "@mohasinac/appkit/jobs";
|
|
22
22
|
*/
|
|
23
|
-
export { couponExpiryHandler, offerExpiryHandler, cartPruneHandler, notificationPruneHandler, pageViewRollupHandler, pageViewPruneHandler, dailyDataCleanupHandler, cleanupRtdbEventsHandler, auctionSettlementHandler, autoPayoutEligibilityHandler, countersReconcileHandler, onOrderCreateHandler, onOrderStatusChangeHandler, onReviewWriteHandler, promotionsHandler, mediaTmpCleanupHandler, pendingOrderTimeoutHandler, productStatsSyncHandler, positionsReconcileHandler,
|
|
23
|
+
export { couponExpiryHandler, offerExpiryHandler, cartPruneHandler, notificationPruneHandler, pageViewRollupHandler, pageViewPruneHandler, dailyDataCleanupHandler, cleanupRtdbEventsHandler, auctionSettlementHandler, autoPayoutEligibilityHandler, countersReconcileHandler, onOrderCreateHandler, onOrderStatusChangeHandler, onReviewWriteHandler, promotionsHandler, mediaTmpCleanupHandler, pendingOrderTimeoutHandler, productStatsSyncHandler, positionsReconcileHandler, weeklyPayoutEligibilityHandler, onCategoryWriteHandler, onProductWriteHandler, onStoreWriteHandler, adminAnalyticsHandler, storeAnalyticsHandler, listingProcessorHandler, supportedListingCollections, onPrizeDrawPaymentConfirmedHandler, prizeDrawSoldOutRevealHandler, prizeDrawExpiryRevealHandler, bundleStockSyncHandler, onProductStockChangeHandler, triggerEventRaffleHandler, assignSpinPrizeHandler, draftPruneHandler, onSupportTicketCreateHandler, onSupportTicketUpdateHandler, onUserBanChangeHandler, onScamReportCreateHandler, onScamReportUpdateHandler, bindSchedule, bindDocumentWritten, bindDocumentCreated, bindDocumentUpdated, bindCallable, bindHttps, bindToFirebase, } from "./_internal/server/jobs/index.js";
|
|
24
24
|
export { defineFunction, mergeFunctionRegistries, bindAllFromRegistry, APPKIT_FUNCTIONS, APPKIT_FUNCTIONS_BY_NAME, } from "./_internal/server/functions/index.js";
|
|
25
25
|
export { orderRepository, siteSettingsRepository } from "./repositories/index.js";
|
|
26
26
|
export type { OrderDocument, OrderDocumentItem } from "./features/orders/index.js";
|
package/dist/jobs.js
CHANGED
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
*/
|
|
23
23
|
export {
|
|
24
24
|
// S4–S5: Job handlers (pure, framework-agnostic)
|
|
25
|
-
couponExpiryHandler, offerExpiryHandler, cartPruneHandler, notificationPruneHandler, pageViewRollupHandler, pageViewPruneHandler, dailyDataCleanupHandler, cleanupRtdbEventsHandler, auctionSettlementHandler, autoPayoutEligibilityHandler, countersReconcileHandler, onOrderCreateHandler, onOrderStatusChangeHandler, onReviewWriteHandler, promotionsHandler, mediaTmpCleanupHandler, pendingOrderTimeoutHandler, productStatsSyncHandler, positionsReconcileHandler,
|
|
25
|
+
couponExpiryHandler, offerExpiryHandler, cartPruneHandler, notificationPruneHandler, pageViewRollupHandler, pageViewPruneHandler, dailyDataCleanupHandler, cleanupRtdbEventsHandler, auctionSettlementHandler, autoPayoutEligibilityHandler, countersReconcileHandler, onOrderCreateHandler, onOrderStatusChangeHandler, onReviewWriteHandler, promotionsHandler, mediaTmpCleanupHandler, pendingOrderTimeoutHandler, productStatsSyncHandler, positionsReconcileHandler, weeklyPayoutEligibilityHandler, onCategoryWriteHandler, onProductWriteHandler, onStoreWriteHandler, adminAnalyticsHandler, storeAnalyticsHandler, listingProcessorHandler, supportedListingCollections,
|
|
26
26
|
// SB1-L (S7-PrizeDraws) — prize-draw reveal redesigned to a fully-automatic model.
|
|
27
27
|
onPrizeDrawPaymentConfirmedHandler, prizeDrawSoldOutRevealHandler, prizeDrawExpiryRevealHandler, bundleStockSyncHandler,
|
|
28
28
|
// SB-UNI-V — Firestore onWrite trigger for product stock changes.
|
|
@@ -0,0 +1,117 @@
|
|
|
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 type { JsonValue } from "@mohasinac/appkit";
|
|
40
|
+
import { IPaymentProvider } from "../../contracts";
|
|
41
|
+
import type { PaymentOrder, PaymentCapture, Refund } from "../../contracts";
|
|
42
|
+
/**
|
|
43
|
+
* PhonePe's `metaInfo` (udf1-udf5, ≤256 chars each) is the only channel that
|
|
44
|
+
* survives from `createOrder()` through to BOTH the Order Status API AND the
|
|
45
|
+
* webhook payload. Checkout uses it to carry the buyer's checkout intent
|
|
46
|
+
* (uid / addressId / outOfStockPolicy / notes) so the webhook — which fires
|
|
47
|
+
* with no buyer session — can place the order on its own if the buyer closes
|
|
48
|
+
* the tab mid-payment. See `confirmAndPlacePhonePeOrderAction` in
|
|
49
|
+
* `_internal/server/features/checkout/actions.ts`.
|
|
50
|
+
*/
|
|
51
|
+
export interface PhonePeCheckoutIntent {
|
|
52
|
+
uid: string;
|
|
53
|
+
addressId?: string;
|
|
54
|
+
outOfStockPolicy?: string;
|
|
55
|
+
notes?: string;
|
|
56
|
+
}
|
|
57
|
+
export interface PhonePeConfig {
|
|
58
|
+
clientId: string;
|
|
59
|
+
clientSecret: string;
|
|
60
|
+
/** PhonePe's client version — a small integer, stored as a string across this codebase's credential convention. */
|
|
61
|
+
clientVersion: string;
|
|
62
|
+
environment: "sandbox" | "production";
|
|
63
|
+
/** Username/password configured in PhonePe's dashboard Webhook tab (SHA/Basic auth mode). Required for `verifyWebhook()` to do anything but return `false`. */
|
|
64
|
+
webhookUsername?: string;
|
|
65
|
+
webhookPassword?: string;
|
|
66
|
+
}
|
|
67
|
+
export declare class PhonePeProvider extends IPaymentProvider {
|
|
68
|
+
readonly name = "phonepe";
|
|
69
|
+
private readonly client;
|
|
70
|
+
private readonly webhookUsername?;
|
|
71
|
+
private readonly webhookPassword?;
|
|
72
|
+
constructor(config: PhonePeConfig);
|
|
73
|
+
/**
|
|
74
|
+
* Creates a PhonePe order and returns its hosted checkout page.
|
|
75
|
+
*
|
|
76
|
+
* `metadata.redirectUrl` is REQUIRED — PhonePe's API mandates a
|
|
77
|
+
* `merchantUrls.redirectUrl` on every order (used only as the fallback
|
|
78
|
+
* destination if the buyer's browser degrades out of IFRAME mode into a
|
|
79
|
+
* full page navigation). `metadata.uid` is REQUIRED — it (plus the
|
|
80
|
+
* optional `addressId`/`outOfStockPolicy`/`notes`) is packed into
|
|
81
|
+
* PhonePe's `metaInfo` so the webhook can reconstruct and place the order
|
|
82
|
+
* with no buyer session (see `PhonePeCheckoutIntent` above). The returned
|
|
83
|
+
* `PaymentOrder.id` is OUR generated `merchantOrderId` — the key every
|
|
84
|
+
* subsequent lookup (status, refund, webhook correlation) uses.
|
|
85
|
+
*/
|
|
86
|
+
createOrder(amount: number, currency?: string, metadata?: Record<string, JsonValue>): Promise<PaymentOrder>;
|
|
87
|
+
/**
|
|
88
|
+
* Validates a webhook request. `signature` is the raw `Authorization`
|
|
89
|
+
* header value; `payload` is the raw request body string. Requires
|
|
90
|
+
* `webhookUsername`/`webhookPassword` to be configured — returns `false`
|
|
91
|
+
* otherwise (same fail-closed shape Razorpay's provider used for a
|
|
92
|
+
* missing webhook secret).
|
|
93
|
+
*
|
|
94
|
+
* This only reports validity — it does NOT return the parsed callback
|
|
95
|
+
* body. Callers that need the parsed event (type + payload) should
|
|
96
|
+
* `JSON.parse` the raw body themselves after this returns `true`, same as
|
|
97
|
+
* the existing webhook route already does.
|
|
98
|
+
*/
|
|
99
|
+
verifyWebhook(payload: string, signature: string): boolean;
|
|
100
|
+
/** Wraps the Order Status API. `orderId` here is our `merchantOrderId`. */
|
|
101
|
+
capturePayment(orderId: string): Promise<PaymentCapture>;
|
|
102
|
+
/**
|
|
103
|
+
* Initiates a refund. `paymentId` here is actually the original
|
|
104
|
+
* `merchantOrderId` — PhonePe refunds are order-keyed
|
|
105
|
+
* (`originalMerchantOrderId`), not payment-keyed. The inherited parameter
|
|
106
|
+
* name from `IPaymentProvider` is misleading for this provider; kept only
|
|
107
|
+
* because the base contract is shared with `ManualPaymentProvider`.
|
|
108
|
+
*/
|
|
109
|
+
refund(paymentId: string, amount?: number): Promise<Refund>;
|
|
110
|
+
/**
|
|
111
|
+
* Wraps the Order Status API. `orderId` here is our `merchantOrderId`.
|
|
112
|
+
* `metadata` is the buyer's checkout intent, unpacked from PhonePe's
|
|
113
|
+
* `metaInfo` — the primary reason the checkout action calls this rather
|
|
114
|
+
* than `capturePayment()` when confirming a payment.
|
|
115
|
+
*/
|
|
116
|
+
getOrder(orderId: string): Promise<PaymentOrder>;
|
|
117
|
+
}
|