@quantaroute/checkout 1.4.4 → 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 +30 -0
- package/README.md +223 -122
- package/dist/lib/index.d.ts +72 -1
- package/dist/lib/quantaroute-checkout.es.js +158 -143
- package/dist/lib/quantaroute-checkout.umd.js +160 -145
- package/dist/style.css +1 -1
- package/package.json +2 -1
- package/src/components/AddressForm.native.tsx +126 -20
- package/src/components/AddressForm.tsx +113 -23
- package/src/components/CheckoutWidget.native.tsx +8 -0
- package/src/components/CheckoutWidget.tsx +28 -4
- package/src/components/PaymentStep.tsx +11 -2
- package/src/core/checkout-api.ts +59 -2
- package/src/core/locality.ts +74 -0
- package/src/core/types.ts +47 -3
- package/src/index.ts +2 -0
- package/src/styles/checkout.css +29 -0
- package/src/styles/checkout.native.ts +25 -0
package/CHANGELOG.md
CHANGED
|
@@ -7,6 +7,36 @@ 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
|
+
|
|
29
|
+
## [1.4.5](https://github.com/quantaroute/checkout/compare/v1.4.4...v1.4.5) — 2026-06-13
|
|
30
|
+
|
|
31
|
+
### Added
|
|
32
|
+
|
|
33
|
+
- Merchant courier serviceability checks via `checkout-addresses` `serviceability_check`, signed webhook configuration on `checkout.merchants`, and `checkServiceability()` client helper
|
|
34
|
+
- `enableServiceabilityCheck`, `showIndiaPostDeliveryWarning`, and `serviceabilityBlockCheckout` widget props
|
|
35
|
+
|
|
36
|
+
### Changed
|
|
37
|
+
|
|
38
|
+
- India Post "Non Delivery" is now an opt-in informational fallback instead of the default buyer-facing warning; merchant courier serviceability takes precedence
|
|
39
|
+
|
|
10
40
|
## [1.4.4](https://github.com/quantaroute/checkout/compare/v1.4.3...v1.4.4) — 2026-06-16
|
|
11
41
|
|
|
12
42
|
### 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,85 @@ 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
|
+
|
|
395
|
+
|
|
396
|
+
---
|
|
397
|
+
|
|
398
|
+
### Merchant courier serviceability
|
|
399
|
+
|
|
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.
|
|
401
|
+
|
|
402
|
+
|
|
403
|
+
| Prop | Type | Default | Platform |
|
|
404
|
+
| ------------------------------ | --------- | ---------------- | -------- |
|
|
405
|
+
| `enableServiceabilityCheck` | `boolean` | `false` | all |
|
|
406
|
+
| `showIndiaPostDeliveryWarning` | `boolean` | `false` | all |
|
|
407
|
+
| `serviceabilityBlockCheckout` | `boolean` | merchant setting | all |
|
|
408
|
+
|
|
409
|
+
|
|
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.
|
|
411
|
+
|
|
412
|
+
```tsx
|
|
413
|
+
<CheckoutWidget
|
|
414
|
+
apiKey={process.env.NEXT_PUBLIC_QUANTAROUTE_KEY!}
|
|
415
|
+
merchantId={process.env.NEXT_PUBLIC_MERCHANT_ID!}
|
|
416
|
+
supabaseFunctionBaseUrl={process.env.NEXT_PUBLIC_SUPABASE_FUNCTION_URL!}
|
|
417
|
+
enableEmailAuth={true}
|
|
418
|
+
enableServiceabilityCheck={true}
|
|
419
|
+
onComplete={(addr) => console.log(addr)}
|
|
420
|
+
/>
|
|
421
|
+
```
|
|
422
|
+
|
|
423
|
+
Merchant configuration lives on `checkout.merchants`:
|
|
424
|
+
|
|
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
|
+
|
|
434
|
+
|
|
435
|
+
Merchant endpoint contract:
|
|
436
|
+
|
|
437
|
+
```http
|
|
438
|
+
POST /checkout/serviceability
|
|
439
|
+
Content-Type: application/json
|
|
440
|
+
X-QuantaRoute-Timestamp: 1782000000000
|
|
441
|
+
X-QuantaRoute-Signature: v1=<hmac_sha256(timestamp + "." + body)>
|
|
442
|
+
```
|
|
443
|
+
|
|
444
|
+
```json
|
|
445
|
+
{
|
|
446
|
+
"merchant_id": "merchant-uuid",
|
|
447
|
+
"pincode": "110011",
|
|
448
|
+
"lat": 28.6139,
|
|
449
|
+
"lng": 77.209,
|
|
450
|
+
"requested_at": "2026-06-21T00:00:00.000Z"
|
|
451
|
+
}
|
|
452
|
+
```
|
|
453
|
+
|
|
454
|
+
Expected response:
|
|
455
|
+
|
|
456
|
+
```json
|
|
457
|
+
{ "serviceable": true, "message": "Delivery available in 3-5 days" }
|
|
458
|
+
```
|
|
459
|
+
|
|
460
|
+
or:
|
|
461
|
+
|
|
462
|
+
```json
|
|
463
|
+
{ "serviceable": false, "message": "We do not currently ship to this pincode" }
|
|
464
|
+
```
|
|
465
|
+
|
|
466
|
+
If the merchant endpoint errors, times out, or returns an invalid response, checkout **fails open** and the buyer can continue. `showIndiaPostDeliveryWarning` is opt-in and only shows a soft informational banner: "Courier partners may still deliver to this pincode."
|
|
380
467
|
|
|
381
468
|
---
|
|
382
469
|
|
|
@@ -385,28 +472,23 @@ When `enableEmailAuth` is true the widget starts with an email-entry step. The b
|
|
|
385
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.
|
|
386
473
|
|
|
387
474
|
1. **Create a Resend account** at [resend.com](https://resend.com) — free tier covers ~3 000 emails / month.
|
|
388
|
-
|
|
389
475
|
2. **Verify your sending domain** (e.g. `checkout.yourbrand.com` or `yourbrand.com`):
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
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)
|
|
394
479
|
3. **Get an API key** — Resend → API Keys → Create. Restrict it to **Send access** only.
|
|
395
|
-
|
|
396
480
|
4. **Set secrets on the `checkout-email-otp` Edge Function:**
|
|
481
|
+
In [Supabase Dashboard](https://supabase.com/dashboard) → your project → Edge Functions → Secrets:
|
|
397
482
|
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
| `RESEND_API_KEY` | `re_...` from Resend |
|
|
403
|
-
| `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` |
|
|
404
487
|
|
|
405
488
|
5. **Deploy the Edge Function** (if not already done):
|
|
406
|
-
|
|
407
|
-
```bash
|
|
489
|
+
```bash
|
|
408
490
|
supabase functions deploy checkout-email-otp --project-ref <your-project-ref> --no-verify-jwt
|
|
409
|
-
|
|
491
|
+
```
|
|
410
492
|
|
|
411
493
|
**Required env vars (frontend):**
|
|
412
494
|
|
|
@@ -422,11 +504,13 @@ NEXT_PUBLIC_SUPABASE_FUNCTION_URL=https://<project-ref>.supabase.co/functions/v1
|
|
|
422
504
|
|
|
423
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.
|
|
424
506
|
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
|
428
|
-
| `
|
|
429
|
-
| `
|
|
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
|
+
|
|
430
514
|
|
|
431
515
|
**Example SQL:**
|
|
432
516
|
|
|
@@ -443,11 +527,13 @@ WHERE id = 'your-merchant-uuid';
|
|
|
443
527
|
|
|
444
528
|
### Branding
|
|
445
529
|
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
|
449
|
-
| `
|
|
450
|
-
| `
|
|
530
|
+
|
|
531
|
+
| Prop | Type | Default | Platform |
|
|
532
|
+
| -------------- | -------------- | --------- | -------- |
|
|
533
|
+
| `brandColor` | `string` (hex) | `#0ea5e9` | all |
|
|
534
|
+
| `logoUrl` | `string` (URL) | – | all |
|
|
535
|
+
| `headerBanner` | `ReactNode` | – | web only |
|
|
536
|
+
|
|
451
537
|
|
|
452
538
|
```tsx
|
|
453
539
|
<CheckoutWidget
|
|
@@ -461,9 +547,11 @@ WHERE id = 'your-merchant-uuid';
|
|
|
461
547
|
|
|
462
548
|
### Analytics (client-side)
|
|
463
549
|
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
|
550
|
+
|
|
551
|
+
| Prop | Type | Default | Platform |
|
|
552
|
+
| ----------------- | -------------------------------- | ------- | -------- |
|
|
553
|
+
| `onCheckoutEvent` | `(event: CheckoutEvent) => void` | – | all |
|
|
554
|
+
|
|
467
555
|
|
|
468
556
|
Called on every step transition. Use it to forward events to MoEngage, Clevertap, GTM, or your own backend — no server-side integration required.
|
|
469
557
|
|
|
@@ -493,22 +581,24 @@ Called on every step transition. Use it to forward events to MoEngage, Clevertap
|
|
|
493
581
|
|
|
494
582
|
**All event types:**
|
|
495
583
|
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
|
499
|
-
| `
|
|
500
|
-
| `
|
|
501
|
-
| `
|
|
502
|
-
| `
|
|
503
|
-
| `
|
|
504
|
-
| `
|
|
505
|
-
| `
|
|
506
|
-
| `
|
|
507
|
-
| `
|
|
508
|
-
| `
|
|
509
|
-
| `
|
|
510
|
-
| `
|
|
511
|
-
| `
|
|
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
|
+
|
|
512
602
|
|
|
513
603
|
---
|
|
514
604
|
|
|
@@ -607,7 +697,7 @@ function MyCheckout() {
|
|
|
607
697
|
|
|
608
698
|
## Supabase setup
|
|
609
699
|
|
|
610
|
-
> Only needed when using
|
|
700
|
+
> Only needed when using `**enablePhoneAuth**`. Skip this section for the basic map-only widget.
|
|
611
701
|
|
|
612
702
|
### 1 · Get your merchant credentials
|
|
613
703
|
|
|
@@ -639,19 +729,23 @@ supabase functions deploy checkout-session-expiry --project-ref <your-project-re
|
|
|
639
729
|
|
|
640
730
|
In the [Supabase Dashboard](https://supabase.com/dashboard) → your project → Edge Functions → Secrets:
|
|
641
731
|
|
|
642
|
-
|
|
732
|
+
`**checkout-email-otp` (required for email auth):**
|
|
733
|
+
|
|
643
734
|
|
|
644
|
-
| Secret
|
|
645
|
-
|
|
646
|
-
| `RESEND_API_KEY`
|
|
735
|
+
| Secret | Value |
|
|
736
|
+
| ------------------- | ------------------------------------------------------ |
|
|
737
|
+
| `RESEND_API_KEY` | `re_...` — from [resend.com](https://resend.com) |
|
|
647
738
|
| `RESEND_FROM_EMAIL` | Verified sender address, e.g. `checkout@yourbrand.com` |
|
|
648
739
|
|
|
649
|
-
**`checkout-otp` (required for phone/SMS auth — set when TRAI DLT is approved):**
|
|
650
740
|
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
|
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
|
+
|
|
655
749
|
|
|
656
750
|
### 4 · Add your domain to the allowed list
|
|
657
751
|
|
|
@@ -778,12 +872,15 @@ The offline DigiPin algorithm is the official India Post implementation:
|
|
|
778
872
|
|
|
779
873
|
## Documentation
|
|
780
874
|
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
|
784
|
-
| [
|
|
785
|
-
| [
|
|
786
|
-
| [
|
|
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
|
+
|
|
787
884
|
|
|
788
885
|
---
|
|
789
886
|
|
|
@@ -793,12 +890,14 @@ The offline DigiPin algorithm is the official India Post implementation:
|
|
|
793
890
|
|
|
794
891
|
The published tarball contains **no secrets** — only client-side widget code:
|
|
795
892
|
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
|
799
|
-
| `dist/lib
|
|
800
|
-
| `dist/
|
|
801
|
-
| `
|
|
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
|
+
|
|
802
901
|
|
|
803
902
|
- **Geocoding `apiKey`** (`dp_…`) is designed for the browser bundle — rate-limited, scoped to your merchant plan.
|
|
804
903
|
- **Admin API key** (`qca_…`) must **never** ship in frontend code. Use it server-side only (`x-api-key` on `checkout-admin`).
|
|
@@ -825,17 +924,19 @@ Use this when embedding `@quantaroute/checkout` on a **hosted QuantaRoute** stor
|
|
|
825
924
|
6. **Optional branding** — `brandColor`, `logoUrl`; per-merchant email template columns (`email_from_name`, `email_logo_url`, `email_subject_template`) in the portal.
|
|
826
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.
|
|
827
926
|
|
|
828
|
-
> **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.
|
|
829
928
|
|
|
830
929
|
### Platform responsibilities (QuantaRoute)
|
|
831
930
|
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
|
|
|
835
|
-
| `
|
|
836
|
-
| `
|
|
837
|
-
|
|
|
838
|
-
|
|
|
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
|
+
|
|
839
940
|
|
|
840
941
|
### Maintainer publish checklist
|
|
841
942
|
|
|
@@ -845,7 +946,7 @@ When publishing a new version to npm (maintainers only):
|
|
|
845
946
|
2. Run `npm run type-check && npm run build:lib && npm pack --dry-run` — confirm tarball contents.
|
|
846
947
|
3. Confirm no `.env`, `.pem`, or `supabase/` paths in the pack list.
|
|
847
948
|
4. Publish from a **clean git tag** with provenance: `npm publish --provenance --access public`.
|
|
848
|
-
5. Do **not** bump version in the same change unless releasing; current version is `1.4.
|
|
949
|
+
5. Do **not** bump version in the same change unless releasing; current version is `1.4.5`.
|
|
849
950
|
|
|
850
951
|
---
|
|
851
952
|
|
|
@@ -881,8 +982,8 @@ npx expo run:android # requires Android Studio
|
|
|
881
982
|
|
|
882
983
|
## Changelog
|
|
883
984
|
|
|
884
|
-
See [CHANGELOG.md](./CHANGELOG.md) for version history. Current release: **v1.4.
|
|
985
|
+
See [CHANGELOG.md](./CHANGELOG.md) for version history. Current release: **v1.4.5**.
|
|
885
986
|
|
|
886
987
|
---
|
|
887
988
|
|
|
888
|
-
**Made with ❤️ in India · Powered by [QuantaRoute](https://quantaroute.com)**
|
|
989
|
+
**Made with ❤️ in India · Powered by [QuantaRoute](https://quantaroute.com)**
|