@quantaroute/checkout 1.4.5 → 1.5.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/CHANGELOG.md +19 -0
- package/README.md +165 -132
- package/dist/lib/index.d.ts +17 -1
- package/dist/lib/quantaroute-checkout.es.js +102 -92
- package/dist/lib/quantaroute-checkout.umd.js +119 -109
- package/package.json +2 -1
- package/src/components/AddressForm.native.tsx +11 -10
- package/src/components/AddressForm.tsx +12 -14
- package/src/components/CheckoutWidget.tsx +20 -4
- package/src/components/PaymentStep.tsx +11 -2
- package/src/core/checkout-api.ts +6 -2
- package/src/core/locality.ts +74 -0
- package/src/core/types.ts +19 -2
package/CHANGELOG.md
CHANGED
|
@@ -7,6 +7,25 @@ Release dates are from git history where available; earlier versions are estimat
|
|
|
7
7
|
|
|
8
8
|
## [Unreleased]
|
|
9
9
|
|
|
10
|
+
## [1.5.0](https://github.com/quantaroute/checkout/compare/v1.4.5...v1.5.0) — 2026-06-21
|
|
11
|
+
|
|
12
|
+
### Added
|
|
13
|
+
|
|
14
|
+
- **Razorpay payment step** — `PaymentStep` after address completion when `enablePayment` and `paymentAmountPaise` are set
|
|
15
|
+
- `verifyPayment()` client helper; verify response includes `razorpay_order_id` and `razorpay_payment_id`
|
|
16
|
+
- `orderConfirmationUrl` prop — optional post-payment redirect with `{{sessionId}}` placeholder
|
|
17
|
+
- Extended `onPaymentComplete` callback — `sessionId`, `razorpayOrderId`, and `razorpayPaymentId` on prepaid success
|
|
18
|
+
- Payment auth guard — `enablePayment` requires phone/email OTP auth (or `codSessionToken`) before the payment step
|
|
19
|
+
- **`checkout-payment`** verify action returns Razorpay order and payment IDs; fires `session.completed` webhook
|
|
20
|
+
- **`checkout-admin`** — `get_payment_config` and `set_payment_config` actions for merchant Razorpay credentials (`x-api-key`)
|
|
21
|
+
- `payment_orders` Razorpay order ID index migration (`20260621120000_payment_orders_rzp_index.sql`)
|
|
22
|
+
- Demo app payment flow with Razorpay test-mode banner and order-complete result panel
|
|
23
|
+
|
|
24
|
+
### Documentation
|
|
25
|
+
|
|
26
|
+
- `docs/merchant-onboarding.md` — merchant onboarding from test keys through production go-live
|
|
27
|
+
- `docs/razorpay-e2e-setup.md` — end-to-end Razorpay test setup (Admin API, Edge Functions, demo checklist)
|
|
28
|
+
|
|
10
29
|
## [1.4.5](https://github.com/quantaroute/checkout/compare/v1.4.4...v1.4.5) — 2026-06-13
|
|
11
30
|
|
|
12
31
|
### Added
|
package/README.md
CHANGED
|
@@ -4,10 +4,10 @@
|
|
|
4
4
|
> Two-step: Map pin → Auto-filled form.
|
|
5
5
|
> One package. Three platforms: **React web · iOS · Android.**
|
|
6
6
|
|
|
7
|
-
[
|
|
8
|
-
[
|
|
9
|
-
[
|
|
10
|
-
[
|
|
7
|
+
[Made in India](https://quantaroute.com)
|
|
8
|
+
[DigiPin](https://www.indiapost.gov.in)
|
|
9
|
+
[Map](https://carto.com)
|
|
10
|
+
[License](./LICENSE)
|
|
11
11
|
|
|
12
12
|
---
|
|
13
13
|
|
|
@@ -43,11 +43,13 @@ Step 1 – Map Pin Step 2 – Auto-fill + Details
|
|
|
43
43
|
|
|
44
44
|
## Platform support
|
|
45
45
|
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
|
49
|
-
|
|
|
50
|
-
|
|
|
46
|
+
|
|
47
|
+
| Platform | Bundler | Map engine | Install |
|
|
48
|
+
| ----------------------------- | -------------- | --------------------------------- | ---------------------------- |
|
|
49
|
+
| React / Next.js / Vite / Nuxt | Webpack / Vite | MapLibre GL JS | `maplibre-gl` |
|
|
50
|
+
| iOS (Expo / React Native) | Metro | expo-osm-sdk (MapLibre GL Native) | `expo-osm-sdk expo-location` |
|
|
51
|
+
| Android (Expo / React Native) | Metro | expo-osm-sdk (MapLibre GL Native) | `expo-osm-sdk expo-location` |
|
|
52
|
+
|
|
51
53
|
|
|
52
54
|
> **Same import on all platforms.**
|
|
53
55
|
> Metro automatically resolves `.native.tsx` files on mobile; Vite/Webpack use the web `.tsx` files.
|
|
@@ -127,6 +129,7 @@ export default function CheckoutPage() {
|
|
|
127
129
|
```
|
|
128
130
|
|
|
129
131
|
CSS in `app/layout.tsx`:
|
|
132
|
+
|
|
130
133
|
```tsx
|
|
131
134
|
import 'maplibre-gl/dist/maplibre-gl.css';
|
|
132
135
|
import '@quantaroute/checkout/style.css';
|
|
@@ -236,11 +239,13 @@ npm install @quantaroute/checkout expo-osm-sdk expo-location
|
|
|
236
239
|
|
|
237
240
|
This single plugin automatically configures:
|
|
238
241
|
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
|
242
|
+
|
|
243
|
+
| What | iOS | Android |
|
|
244
|
+
| ------------------- | ------------------------------------- | ---------------------- |
|
|
245
|
+
| MapLibre native SDK | `expo-osm-sdk/plugin` | `expo-osm-sdk/plugin` |
|
|
242
246
|
| Location permission | `NSLocationWhenInUseUsageDescription` | `ACCESS_FINE_LOCATION` |
|
|
243
|
-
| Internet permission | –
|
|
247
|
+
| Internet permission | – | `INTERNET` |
|
|
248
|
+
|
|
244
249
|
|
|
245
250
|
### 3 · Rebuild your dev client
|
|
246
251
|
|
|
@@ -288,26 +293,30 @@ npx expo run:android
|
|
|
288
293
|
|
|
289
294
|
### Core props
|
|
290
295
|
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
|
294
|
-
| `
|
|
295
|
-
| `
|
|
296
|
-
| `
|
|
297
|
-
| `
|
|
298
|
-
| `
|
|
299
|
-
| `
|
|
300
|
-
| `
|
|
301
|
-
| `
|
|
302
|
-
| `
|
|
303
|
-
| `
|
|
304
|
-
| `
|
|
296
|
+
|
|
297
|
+
| Prop | Type | Default | Platform |
|
|
298
|
+
| ------------------ | -------------------------------------- | ----------------------------- | -------- |
|
|
299
|
+
| `apiKey` | `string` | **required** | all |
|
|
300
|
+
| `onComplete` | `(addr: CompleteAddress) => void` | **required** | all |
|
|
301
|
+
| `apiBaseUrl` | `string` | `https://api.quantaroute.com` | all |
|
|
302
|
+
| `onError` | `(err: Error) => void` | – | all |
|
|
303
|
+
| `defaultLat` | `number` | India center | all |
|
|
304
|
+
| `defaultLng` | `number` | India center | all |
|
|
305
|
+
| `theme` | `'light' | 'dark'` | `'light'` | all |
|
|
306
|
+
| `mapHeight` | `string | number` | `'380px'` / `380` | all |
|
|
307
|
+
| `title` | `string` | `'Add Delivery Address'` | all |
|
|
308
|
+
| `className` | `string` | – | web only |
|
|
309
|
+
| `style` | `CSSProperties | StyleProp<ViewStyle>` | – | all |
|
|
310
|
+
| `indiaBoundaryUrl` | `string` | – | web only |
|
|
311
|
+
|
|
305
312
|
|
|
306
313
|
### Search bar
|
|
307
314
|
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
|
315
|
+
|
|
316
|
+
| Prop | Type | Default | Platform |
|
|
317
|
+
| -------------- | --------- | ------- | -------- |
|
|
318
|
+
| `enableSearch` | `boolean` | `true` | all |
|
|
319
|
+
|
|
311
320
|
|
|
312
321
|
When `enableSearch` is true, a unified search bar appears above the map. It handles two modes automatically:
|
|
313
322
|
|
|
@@ -318,11 +327,13 @@ As India Post promotes DigiPin nationally, buyers can paste their 10-character c
|
|
|
318
327
|
|
|
319
328
|
### Phone OTP + saved addresses (D2C checkout)
|
|
320
329
|
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
|
324
|
-
| `
|
|
325
|
-
| `
|
|
330
|
+
|
|
331
|
+
| Prop | Type | Default | Platform |
|
|
332
|
+
| ------------------------- | --------- | ------- | -------- |
|
|
333
|
+
| `enablePhoneAuth` | `boolean` | `false` | all |
|
|
334
|
+
| `merchantId` | `string` | – | all |
|
|
335
|
+
| `supabaseFunctionBaseUrl` | `string` | – | all |
|
|
336
|
+
|
|
326
337
|
|
|
327
338
|
When `enablePhoneAuth` is true the widget starts with a phone-entry step. Returning buyers can pick a previously saved address from any brand in the network instead of dropping the pin again.
|
|
328
339
|
|
|
@@ -346,11 +357,13 @@ On the address details step, buyers choose a **Home / Work / Other** label befor
|
|
|
346
357
|
|
|
347
358
|
### Email OTP auth (`enableEmailAuth`)
|
|
348
359
|
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
|
352
|
-
| `
|
|
353
|
-
| `
|
|
360
|
+
|
|
361
|
+
| Prop | Type | Default | Platform |
|
|
362
|
+
| ------------------------- | --------- | ------- | -------- |
|
|
363
|
+
| `enableEmailAuth` | `boolean` | `false` | all |
|
|
364
|
+
| `merchantId` | `string` | – | all |
|
|
365
|
+
| `supabaseFunctionBaseUrl` | `string` | – | all |
|
|
366
|
+
|
|
354
367
|
|
|
355
368
|
When `enableEmailAuth` is true the widget starts with an email-entry step. The buyer receives a 6-digit OTP via **Resend**. On success a checkout session is created and saved addresses are shown if available.
|
|
356
369
|
|
|
@@ -372,11 +385,13 @@ When `enableEmailAuth` is true the widget starts with an email-entry step. The b
|
|
|
372
385
|
|
|
373
386
|
**Client-side events emitted during email auth:**
|
|
374
387
|
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
|
378
|
-
| `
|
|
379
|
-
| `
|
|
388
|
+
|
|
389
|
+
| Event type | When |
|
|
390
|
+
| ------------------- | ----------------------------- |
|
|
391
|
+
| `email_step_viewed` | Email input screen rendered |
|
|
392
|
+
| `email_otp_sent` | OTP dispatched via Resend |
|
|
393
|
+
| `email_verified` | OTP correct → session created |
|
|
394
|
+
|
|
380
395
|
|
|
381
396
|
---
|
|
382
397
|
|
|
@@ -384,11 +399,13 @@ When `enableEmailAuth` is true the widget starts with an email-entry step. The b
|
|
|
384
399
|
|
|
385
400
|
QuantaRoute still validates that a pincode exists in the India Post database, but India Post "Non Delivery" is treated as **reference data**, not the final merchant delivery decision. Most D2C stores ship through Shiprocket, Delhivery, ClickPost, or direct courier contracts, so the buyer-facing serviceability check should come from the merchant.
|
|
386
401
|
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
|
390
|
-
| `
|
|
391
|
-
| `
|
|
402
|
+
|
|
403
|
+
| Prop | Type | Default | Platform |
|
|
404
|
+
| ------------------------------ | --------- | ---------------- | -------- |
|
|
405
|
+
| `enableServiceabilityCheck` | `boolean` | `false` | all |
|
|
406
|
+
| `showIndiaPostDeliveryWarning` | `boolean` | `false` | all |
|
|
407
|
+
| `serviceabilityBlockCheckout` | `boolean` | merchant setting | all |
|
|
408
|
+
|
|
392
409
|
|
|
393
410
|
When `enableServiceabilityCheck` is true and the buyer has a checkout session, the widget calls `checkout-addresses` with `action: "serviceability_check"`. The Edge Function calls the merchant's configured courier endpoint server-side and fails open if that endpoint is unavailable.
|
|
394
411
|
|
|
@@ -405,13 +422,15 @@ When `enableServiceabilityCheck` is true and the buyer has a checkout session, t
|
|
|
405
422
|
|
|
406
423
|
Merchant configuration lives on `checkout.merchants`:
|
|
407
424
|
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
|
411
|
-
| `
|
|
412
|
-
| `
|
|
413
|
-
| `
|
|
414
|
-
| `
|
|
425
|
+
|
|
426
|
+
| Column | Meaning |
|
|
427
|
+
| ---------------------------------- | ------------------------------------------------- |
|
|
428
|
+
| `serviceability_enabled` | Enables the merchant courier check |
|
|
429
|
+
| `serviceability_webhook_url` | Merchant endpoint called by QuantaRoute |
|
|
430
|
+
| `serviceability_webhook_secret` | Shared HMAC secret for outbound calls |
|
|
431
|
+
| `serviceability_block_checkout` | If true, `serviceable: false` blocks address save |
|
|
432
|
+
| `show_india_post_delivery_warning` | Optional soft India Post info banner fallback |
|
|
433
|
+
|
|
415
434
|
|
|
416
435
|
Merchant endpoint contract:
|
|
417
436
|
|
|
@@ -453,28 +472,23 @@ If the merchant endpoint errors, times out, or returns an invalid response, chec
|
|
|
453
472
|
> **Hosted merchants (recommended):** If you onboarded at [developers.quantaroute.com](https://developers.quantaroute.com), QuantaRoute already runs Resend on shared infrastructure. Skip steps 1–5 below — just set `enableEmailAuth={true}` and register your domain in the portal. The steps below apply only when **self-hosting** the `checkout-email-otp` Edge Function in your own Supabase project.
|
|
454
473
|
|
|
455
474
|
1. **Create a Resend account** at [resend.com](https://resend.com) — free tier covers ~3 000 emails / month.
|
|
456
|
-
|
|
457
475
|
2. **Verify your sending domain** (e.g. `checkout.yourbrand.com` or `yourbrand.com`):
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
476
|
+
- Go to **Resend → Domains → Add domain**
|
|
477
|
+
- Add the DNS records shown (SPF, DKIM, DMARC) to your DNS provider
|
|
478
|
+
- Wait for "Verified" status (usually under 5 minutes with Cloudflare; up to 48 h with others)
|
|
462
479
|
3. **Get an API key** — Resend → API Keys → Create. Restrict it to **Send access** only.
|
|
463
|
-
|
|
464
480
|
4. **Set secrets on the `checkout-email-otp` Edge Function:**
|
|
481
|
+
In [Supabase Dashboard](https://supabase.com/dashboard) → your project → Edge Functions → Secrets:
|
|
465
482
|
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
| `RESEND_API_KEY` | `re_...` from Resend |
|
|
471
|
-
| `RESEND_FROM_EMAIL` | A verified sender address, e.g. `checkout@yourbrand.com` |
|
|
483
|
+
| Secret | Value |
|
|
484
|
+
| ------------------- | -------------------------------------------------------- |
|
|
485
|
+
| `RESEND_API_KEY` | `re_...` from Resend |
|
|
486
|
+
| `RESEND_FROM_EMAIL` | A verified sender address, e.g. `checkout@yourbrand.com` |
|
|
472
487
|
|
|
473
488
|
5. **Deploy the Edge Function** (if not already done):
|
|
474
|
-
|
|
475
|
-
```bash
|
|
489
|
+
```bash
|
|
476
490
|
supabase functions deploy checkout-email-otp --project-ref <your-project-ref> --no-verify-jwt
|
|
477
|
-
|
|
491
|
+
```
|
|
478
492
|
|
|
479
493
|
**Required env vars (frontend):**
|
|
480
494
|
|
|
@@ -490,11 +504,13 @@ NEXT_PUBLIC_SUPABASE_FUNCTION_URL=https://<project-ref>.supabase.co/functions/v1
|
|
|
490
504
|
|
|
491
505
|
Set these columns directly on your `checkout.merchants` row (SQL or Supabase Table Editor). All are optional — omitting any falls back to the QuantaRoute default.
|
|
492
506
|
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
|
496
|
-
| `
|
|
497
|
-
| `
|
|
507
|
+
|
|
508
|
+
| Column | Type | Default | Effect |
|
|
509
|
+
| ------------------------ | ------ | ---------------------------------------- | --------------------------------------------------------------------------------------------- |
|
|
510
|
+
| `email_from_name` | `text` | `"{brand} Checkout"` | "From" display name in the inbox, e.g. `"Fabindia"` |
|
|
511
|
+
| `email_logo_url` | `text` | *(text brand name)* | HTTPS URL of your logo (PNG/SVG, 180 × 48 px recommended) shown at the top of every OTP email |
|
|
512
|
+
| `email_subject_template` | `text` | `"{code} is your {brand} checkout code"` | Subject line; supports `{code}` and `{brand}` placeholders |
|
|
513
|
+
|
|
498
514
|
|
|
499
515
|
**Example SQL:**
|
|
500
516
|
|
|
@@ -511,11 +527,13 @@ WHERE id = 'your-merchant-uuid';
|
|
|
511
527
|
|
|
512
528
|
### Branding
|
|
513
529
|
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
|
517
|
-
| `
|
|
518
|
-
| `
|
|
530
|
+
|
|
531
|
+
| Prop | Type | Default | Platform |
|
|
532
|
+
| -------------- | -------------- | --------- | -------- |
|
|
533
|
+
| `brandColor` | `string` (hex) | `#0ea5e9` | all |
|
|
534
|
+
| `logoUrl` | `string` (URL) | – | all |
|
|
535
|
+
| `headerBanner` | `ReactNode` | – | web only |
|
|
536
|
+
|
|
519
537
|
|
|
520
538
|
```tsx
|
|
521
539
|
<CheckoutWidget
|
|
@@ -529,9 +547,11 @@ WHERE id = 'your-merchant-uuid';
|
|
|
529
547
|
|
|
530
548
|
### Analytics (client-side)
|
|
531
549
|
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
|
550
|
+
|
|
551
|
+
| Prop | Type | Default | Platform |
|
|
552
|
+
| ----------------- | -------------------------------- | ------- | -------- |
|
|
553
|
+
| `onCheckoutEvent` | `(event: CheckoutEvent) => void` | – | all |
|
|
554
|
+
|
|
535
555
|
|
|
536
556
|
Called on every step transition. Use it to forward events to MoEngage, Clevertap, GTM, or your own backend — no server-side integration required.
|
|
537
557
|
|
|
@@ -561,22 +581,24 @@ Called on every step transition. Use it to forward events to MoEngage, Clevertap
|
|
|
561
581
|
|
|
562
582
|
**All event types:**
|
|
563
583
|
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
|
567
|
-
| `
|
|
568
|
-
| `
|
|
569
|
-
| `
|
|
570
|
-
| `
|
|
571
|
-
| `
|
|
572
|
-
| `
|
|
573
|
-
| `
|
|
574
|
-
| `
|
|
575
|
-
| `
|
|
576
|
-
| `
|
|
577
|
-
| `
|
|
578
|
-
| `
|
|
579
|
-
| `
|
|
584
|
+
|
|
585
|
+
| Event | When fired | Auth channel |
|
|
586
|
+
| ------------------------ | --------------------------------------- | ------------ |
|
|
587
|
+
| `phone_step_viewed` | Phone entry screen rendered | Phone |
|
|
588
|
+
| `otp_sent` | OTP dispatched via MSG91 | Phone |
|
|
589
|
+
| `phone_verified` | SMS OTP correct; session created | Phone |
|
|
590
|
+
| `email_step_viewed` | Email input screen rendered | Email |
|
|
591
|
+
| `email_otp_sent` | OTP dispatched via Resend | Email |
|
|
592
|
+
| `email_verified` | Email OTP correct; session created | Email |
|
|
593
|
+
| `auth_skipped` | Buyer tapped "Skip" | Both |
|
|
594
|
+
| `saved_addresses_viewed` | Saved address list rendered | – |
|
|
595
|
+
| `saved_address_selected` | Buyer chose a saved address (skips map) | – |
|
|
596
|
+
| `map_step_viewed` | Map pin step rendered | – |
|
|
597
|
+
| `location_confirmed` | Buyer tapped "Confirm location" | – |
|
|
598
|
+
| `form_step_viewed` | Address detail form rendered | – |
|
|
599
|
+
| `address_completed` | Full address submitted | – |
|
|
600
|
+
| `widget_reset` | Buyer tapped "Change address" | – |
|
|
601
|
+
|
|
580
602
|
|
|
581
603
|
---
|
|
582
604
|
|
|
@@ -675,7 +697,7 @@ function MyCheckout() {
|
|
|
675
697
|
|
|
676
698
|
## Supabase setup
|
|
677
699
|
|
|
678
|
-
> Only needed when using
|
|
700
|
+
> Only needed when using `**enablePhoneAuth**`. Skip this section for the basic map-only widget.
|
|
679
701
|
|
|
680
702
|
### 1 · Get your merchant credentials
|
|
681
703
|
|
|
@@ -707,19 +729,23 @@ supabase functions deploy checkout-session-expiry --project-ref <your-project-re
|
|
|
707
729
|
|
|
708
730
|
In the [Supabase Dashboard](https://supabase.com/dashboard) → your project → Edge Functions → Secrets:
|
|
709
731
|
|
|
710
|
-
|
|
732
|
+
`**checkout-email-otp` (required for email auth):**
|
|
711
733
|
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
|
734
|
+
|
|
735
|
+
| Secret | Value |
|
|
736
|
+
| ------------------- | ------------------------------------------------------ |
|
|
737
|
+
| `RESEND_API_KEY` | `re_...` — from [resend.com](https://resend.com) |
|
|
715
738
|
| `RESEND_FROM_EMAIL` | Verified sender address, e.g. `checkout@yourbrand.com` |
|
|
716
739
|
|
|
717
|
-
**`checkout-otp` (required for phone/SMS auth — set when TRAI DLT is approved):**
|
|
718
740
|
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
|
741
|
+
`**checkout-otp` (required for phone/SMS auth — set when TRAI DLT is approved):**
|
|
742
|
+
|
|
743
|
+
|
|
744
|
+
| Secret | Value |
|
|
745
|
+
| ------------------- | ----------------------------------------------------------------------------------------------------------------------- |
|
|
746
|
+
| `MSG91_AUTHKEY` | Your MSG91 AuthKey ([setup guide](./docs/MSG91_INDIA_OTP_SETUP.md)) — must match the Edge Function env var name exactly |
|
|
747
|
+
| `MSG91_TEMPLATE_ID` | Your approved DLT OTP template ID |
|
|
748
|
+
|
|
723
749
|
|
|
724
750
|
### 4 · Add your domain to the allowed list
|
|
725
751
|
|
|
@@ -846,12 +872,15 @@ The offline DigiPin algorithm is the official India Post implementation:
|
|
|
846
872
|
|
|
847
873
|
## Documentation
|
|
848
874
|
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
|
|
|
852
|
-
| [
|
|
853
|
-
| [
|
|
854
|
-
| [
|
|
875
|
+
|
|
876
|
+
| Doc | Description |
|
|
877
|
+
| -------------------------------------------------- | ------------------------------------------- |
|
|
878
|
+
| [Changelog](./CHANGELOG.md) | Version history and release notes |
|
|
879
|
+
| [Checkout roadmap](./docs/CHECKOUT_ROADMAP.md) | Feature phases and implementation status |
|
|
880
|
+
| [Merchant onboarding](./docs/merchant-onboarding.md) | Razorpay + widget setup (test → prod) |
|
|
881
|
+
| [Razorpay E2E setup](./docs/razorpay-e2e-setup.md) | Test-mode verification checklist |
|
|
882
|
+
| [MSG91 OTP setup](./docs/MSG91_INDIA_OTP_SETUP.md) | India SMS / DLT configuration for phone OTP | |
|
|
883
|
+
|
|
855
884
|
|
|
856
885
|
---
|
|
857
886
|
|
|
@@ -861,12 +890,14 @@ The offline DigiPin algorithm is the official India Post implementation:
|
|
|
861
890
|
|
|
862
891
|
The published tarball contains **no secrets** — only client-side widget code:
|
|
863
892
|
|
|
864
|
-
|
|
865
|
-
|
|
866
|
-
|
|
|
867
|
-
| `dist/lib
|
|
868
|
-
| `dist/
|
|
869
|
-
| `
|
|
893
|
+
|
|
894
|
+
| Included | Excluded |
|
|
895
|
+
| ------------------------------------------ | ----------------------------------------- |
|
|
896
|
+
| `dist/lib/*.js` (Terser-minified ES + UMD) | `supabase/`, Edge Functions, migrations |
|
|
897
|
+
| `dist/lib/index.d.ts` | `demo/`, `docs/`, `openapi.yaml`, `.env*` |
|
|
898
|
+
| `dist/style.css` | `vite.config.ts`, dev tooling |
|
|
899
|
+
| `src/` (required for React Native / Metro) | `node_modules/` |
|
|
900
|
+
|
|
870
901
|
|
|
871
902
|
- **Geocoding `apiKey`** (`dp_…`) is designed for the browser bundle — rate-limited, scoped to your merchant plan.
|
|
872
903
|
- **Admin API key** (`qca_…`) must **never** ship in frontend code. Use it server-side only (`x-api-key` on `checkout-admin`).
|
|
@@ -893,17 +924,19 @@ Use this when embedding `@quantaroute/checkout` on a **hosted QuantaRoute** stor
|
|
|
893
924
|
6. **Optional branding** — `brandColor`, `logoUrl`; per-merchant email template columns (`email_from_name`, `email_logo_url`, `email_subject_template`) in the portal.
|
|
894
925
|
7. **Handle completion** — implement `onComplete` to pass the `CompleteAddress` to your cart / payment gateway. Built-in payment (`enablePayment`) and COD (`enableCod`) are separate opt-in props.
|
|
895
926
|
|
|
896
|
-
> **Resend is platform-managed for hosted merchants.**
|
|
927
|
+
> **Resend is platform-managed for hosted merchants.** QuantaRouHMACte operates the shared `checkout-email-otp` Edge Function and Resend sender (`RESEND_API_KEY`, `RESEND_FROM_EMAIL`). Merchants do **not** need their own Resend account for the hosted MVP. See [Setting up Resend](#setting-up-resend-required-for-enableemailauth) only if you self-host the Edge Functions.
|
|
897
928
|
|
|
898
929
|
### Platform responsibilities (QuantaRoute)
|
|
899
930
|
|
|
900
|
-
|
|
901
|
-
|
|
902
|
-
|
|
|
903
|
-
| `
|
|
904
|
-
| `
|
|
905
|
-
|
|
|
906
|
-
|
|
|
931
|
+
|
|
932
|
+
| Item | Owner |
|
|
933
|
+
| -------------------------------------------------------------------------------------------------------------- | ----------------------------------- |
|
|
934
|
+
| Deploy & operate `checkout-email-otp`, `checkout-addresses`, `checkout-session-expiry` | QuantaRoute |
|
|
935
|
+
| `RESEND_API_KEY`, `RESEND_FROM_EMAIL`, Supabase service role | QuantaRoute (Edge Function secrets) |
|
|
936
|
+
| `checkout.merchants` provisioning, `allowed_domains`, email template columns | QuantaRoute portal + DB |
|
|
937
|
+
| Buyer OTP consistent reuse (10 logins per code), fresh-code limit (3 / 24h), verify lockout (5 fails → 15 min) | Edge Function |
|
|
938
|
+
| Geocoding API key issuance & plan rate limits | QuantaRoute |
|
|
939
|
+
|
|
907
940
|
|
|
908
941
|
### Maintainer publish checklist
|
|
909
942
|
|
|
@@ -953,4 +986,4 @@ See [CHANGELOG.md](./CHANGELOG.md) for version history. Current release: **v1.4.
|
|
|
953
986
|
|
|
954
987
|
---
|
|
955
988
|
|
|
956
|
-
**Made with ❤️ in India · Powered by [QuantaRoute](https://quantaroute.com)**
|
|
989
|
+
**Made with ❤️ in India · Powered by [QuantaRoute](https://quantaroute.com)**
|
package/dist/lib/index.d.ts
CHANGED
|
@@ -318,7 +318,16 @@ export declare interface CheckoutWidgetProps {
|
|
|
318
318
|
onPaymentComplete?: (result: {
|
|
319
319
|
paymentMethod: string;
|
|
320
320
|
sessionId?: string;
|
|
321
|
+
razorpayOrderId?: string;
|
|
322
|
+
razorpayPaymentId?: string;
|
|
321
323
|
}) => void;
|
|
324
|
+
/**
|
|
325
|
+
* URL to redirect the buyer to after successful payment.
|
|
326
|
+
* Use `{{sessionId}}` as a placeholder — the widget replaces it before redirecting.
|
|
327
|
+
* Example: "https://yourstore.com/order/confirm?sid={{sessionId}}"
|
|
328
|
+
* When omitted, no redirect occurs and the host app handles navigation via onPaymentComplete.
|
|
329
|
+
*/
|
|
330
|
+
orderConfirmationUrl?: string;
|
|
322
331
|
/**
|
|
323
332
|
* Show prepaid conversion nudge when COD is eligible (merchant `prepaid_nudge_copy` or prop override).
|
|
324
333
|
*/
|
|
@@ -669,9 +678,14 @@ export declare interface PaymentStepProps {
|
|
|
669
678
|
enableCod?: boolean;
|
|
670
679
|
codAllowed?: boolean;
|
|
671
680
|
theme?: 'light' | 'dark';
|
|
672
|
-
onComplete: (
|
|
681
|
+
onComplete: (result: {
|
|
682
|
+
paymentMethod: string;
|
|
683
|
+
razorpayOrderId?: string;
|
|
684
|
+
razorpayPaymentId?: string;
|
|
685
|
+
}) => void;
|
|
673
686
|
onBack?: () => void;
|
|
674
687
|
onEvent?: (type: CheckoutEventType, paymentMethod?: string) => void;
|
|
688
|
+
orderConfirmationUrl?: string;
|
|
675
689
|
}
|
|
676
690
|
|
|
677
691
|
export declare const PhoneStep: default_2.FC<PhoneStepProps>;
|
|
@@ -917,6 +931,8 @@ export declare function verifyPayment(config: CheckoutApiConfig, sessionToken: s
|
|
|
917
931
|
payment_method?: string;
|
|
918
932
|
}): Promise<{
|
|
919
933
|
payment_method: string;
|
|
934
|
+
razorpay_order_id: string;
|
|
935
|
+
razorpay_payment_id: string;
|
|
920
936
|
}>;
|
|
921
937
|
|
|
922
938
|
export { }
|