@quantaroute/checkout 1.5.0 → 1.7.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 +35 -0
- package/README.md +39 -7
- package/dist/lib/index.d.ts +59 -4
- package/dist/lib/quantaroute-checkout.es.js +200 -190
- package/dist/lib/quantaroute-checkout.umd.js +136 -126
- package/dist/style.css +1 -1
- package/package.json +1 -1
- package/src/components/AddressForm.tsx +31 -7
- package/src/components/CheckoutWidget.tsx +265 -55
- package/src/components/PaymentStep.tsx +15 -5
- package/src/components/SavedAddressStep.tsx +8 -4
- package/src/core/checkout-api.ts +58 -3
- package/src/core/types.ts +31 -0
- package/src/index.ts +6 -0
- package/src/styles/checkout.css +574 -0
package/CHANGELOG.md
CHANGED
|
@@ -7,6 +7,41 @@ Release dates are from git history where available; earlier versions are estimat
|
|
|
7
7
|
|
|
8
8
|
## [Unreleased]
|
|
9
9
|
|
|
10
|
+
## [1.7.0](https://github.com/quantaroute/checkout/compare/v1.6.0...v1.7.0) — 2026-06-28
|
|
11
|
+
|
|
12
|
+
### Added
|
|
13
|
+
|
|
14
|
+
- **Mobile-first checkout presentation** — new `mobilePresentation` prop (`auto`, `sheet`, `card`) for storefront modals and drawers
|
|
15
|
+
- **Mobile labeled stepper** — compact Mobile/Address/Pay progress on small screens while preserving desktop dot progress
|
|
16
|
+
- **`mobileStepLabels`** prop for merchant-specific step label copy
|
|
17
|
+
|
|
18
|
+
### Changed
|
|
19
|
+
|
|
20
|
+
- Improved mobile shell styling: sticky branded header, safe-area-aware actions, larger touch targets, softer saved-address cards, compact lazy verification banner, and mobile payment option rows
|
|
21
|
+
- Demo app includes a mobile preview frame to inspect the sheet treatment
|
|
22
|
+
- README documents the host-app boundary: cart state, order summary, coupons, platform APIs, and checkout interception stay outside the npm package
|
|
23
|
+
|
|
24
|
+
## [1.6.0](https://github.com/quantaroute/checkout/compare/v1.5.0...v1.6.0) — 2026-06-23
|
|
25
|
+
|
|
26
|
+
### Added
|
|
27
|
+
|
|
28
|
+
- **Lazy DigiPin verification** — imported saved addresses without a DigiPin trigger a `verify-address` step (map pin + prepopulated form) before payment or `onComplete`
|
|
29
|
+
- **`selectAddress()` and `verifyDigipin()`** client helpers; `SavedAddress.digipin` is nullable for pending imports
|
|
30
|
+
- **`AddressFormInitialValues`** — prepopulate manual fields when verifying an imported address
|
|
31
|
+
- **`verify_address_step_viewed`** checkout analytics event
|
|
32
|
+
- **`checkout-addresses`** — `select_address` and `verify_digipin` actions; session `selected_address_id` + `address_verified` order lock
|
|
33
|
+
- **`checkout-payment`** — blocks `create_order`, `verify`, and `record_cod` until the selected address has a confirmed DigiPin
|
|
34
|
+
- **`checkout-admin`** — `import_customers` bulk import API and `import_status`; `create_linked_account` returns 501 (Mode C stub)
|
|
35
|
+
- **Identity linking (H8)** — merge email/phone import profiles on OTP verify via `_shared/identity.ts`
|
|
36
|
+
- Migration `20260623120000_customer_import_and_digipin_verify.sql` — import batches, nullable digipin, `payment_mode` on merchants
|
|
37
|
+
|
|
38
|
+
### Documentation
|
|
39
|
+
|
|
40
|
+
- `docs/byo-payment-gateway.md` — Mode A (PayU/Cashfree/Paytm) integration guide
|
|
41
|
+
- `docs/customer-migration-playbook.md` — merchant-facing import + lazy verify story
|
|
42
|
+
- `docs/hosted-payments-roadmap.md` — Mode C QuantaRoute Payments roadmap
|
|
43
|
+
- `docs/portal-payment-wizard-spec.md` and `docs/portal-migration-wizard-spec.md` — developer portal UI specs
|
|
44
|
+
|
|
10
45
|
## [1.5.0](https://github.com/quantaroute/checkout/compare/v1.4.5...v1.5.0) — 2026-06-21
|
|
11
46
|
|
|
12
47
|
### Added
|
package/README.md
CHANGED
|
@@ -533,6 +533,8 @@ WHERE id = 'your-merchant-uuid';
|
|
|
533
533
|
| `brandColor` | `string` (hex) | `#0ea5e9` | all |
|
|
534
534
|
| `logoUrl` | `string` (URL) | – | all |
|
|
535
535
|
| `headerBanner` | `ReactNode` | – | web only |
|
|
536
|
+
| `mobilePresentation` | `'auto' \| 'sheet' \| 'card'` | `'auto'` | web |
|
|
537
|
+
| `mobileStepLabels` | `{ auth?: string; address?: string; payment?: string }` | Mobile/Address/Pay | web |
|
|
536
538
|
|
|
537
539
|
|
|
538
540
|
```tsx
|
|
@@ -541,10 +543,35 @@ WHERE id = 'your-merchant-uuid';
|
|
|
541
543
|
brandColor="#7c3aed"
|
|
542
544
|
logoUrl="https://yourbrand.com/logo.png"
|
|
543
545
|
headerBanner={<p>🚚 Free shipping on orders over ₹499</p>}
|
|
546
|
+
mobilePresentation="sheet"
|
|
547
|
+
mobileStepLabels={{ auth: 'Mobile', address: 'Address', payment: 'Pay' }}
|
|
544
548
|
onComplete={...}
|
|
545
549
|
/>
|
|
546
550
|
```
|
|
547
551
|
|
|
552
|
+
### Mobile-first storefront shells
|
|
553
|
+
|
|
554
|
+
Use `mobilePresentation="sheet"` when the widget is mounted inside a mobile drawer or storefront modal. It keeps the package focused on auth, saved addresses, DigiPin verification, and optional payment while your host app owns cart-specific UI.
|
|
555
|
+
|
|
556
|
+
```tsx
|
|
557
|
+
<CheckoutWidget
|
|
558
|
+
apiKey={geocodingKey}
|
|
559
|
+
merchantId={merchantId}
|
|
560
|
+
supabaseFunctionBaseUrl={functionsUrl}
|
|
561
|
+
enablePhoneAuth
|
|
562
|
+
enablePayment={merchantPaymentMode === 'byo_razorpay'}
|
|
563
|
+
paymentAmountPaise={cartTotalPaiseAfterDiscounts}
|
|
564
|
+
codCartTotalPaise={cartTotalPaiseAfterDiscounts}
|
|
565
|
+
mobilePresentation="sheet"
|
|
566
|
+
mobileStepLabels={{ auth: 'Mobile', address: 'Address', payment: 'Pay' }}
|
|
567
|
+
onCheckoutEvent={(event) => syncHostShellStep(event.step)}
|
|
568
|
+
onComplete={(address) => saveDeliveryAddress(address)}
|
|
569
|
+
onPaymentComplete={(result) => completeOrder(result)}
|
|
570
|
+
/>
|
|
571
|
+
```
|
|
572
|
+
|
|
573
|
+
The host app should keep order summary, product lines, coupons, cart state, platform APIs, and checkout-button interception outside this package. Pass only the final totals and callbacks into the widget.
|
|
574
|
+
|
|
548
575
|
### Analytics (client-side)
|
|
549
576
|
|
|
550
577
|
|
|
@@ -873,13 +900,18 @@ The offline DigiPin algorithm is the official India Post implementation:
|
|
|
873
900
|
## Documentation
|
|
874
901
|
|
|
875
902
|
|
|
876
|
-
| Doc
|
|
877
|
-
|
|
|
878
|
-
| [Changelog](./CHANGELOG.md)
|
|
879
|
-
| [Checkout roadmap](./docs/CHECKOUT_ROADMAP.md)
|
|
880
|
-
| [Merchant onboarding](./docs/merchant-onboarding.md)
|
|
881
|
-
| [
|
|
882
|
-
| [
|
|
903
|
+
| Doc | Description |
|
|
904
|
+
| ---------------------------------------------------------- | ------------------------------------------------ |
|
|
905
|
+
| [Changelog](./CHANGELOG.md) | Version history and release notes |
|
|
906
|
+
| [Checkout roadmap](./docs/CHECKOUT_ROADMAP.md) | Feature phases and implementation status |
|
|
907
|
+
| [Merchant onboarding](./docs/merchant-onboarding.md) | Payment modes A/B/C, Razorpay setup (Mode B) |
|
|
908
|
+
| [BYO payment gateway](./docs/byo-payment-gateway.md) | Mode A — PayU/Cashfree/Paytm/Shopify integration |
|
|
909
|
+
| [Hosted payments roadmap](./docs/hosted-payments-roadmap.md) | Mode C — QuantaRoute Payments (coming soon) |
|
|
910
|
+
| [Razorpay E2E setup](./docs/razorpay-e2e-setup.md) | Test-mode verification checklist (Mode B) |
|
|
911
|
+
| [Customer migration playbook](./docs/customer-migration-playbook.md) | Merchant-facing import + lazy DigiPin story |
|
|
912
|
+
| [Portal payment wizard spec](./docs/portal-payment-wizard-spec.md) | Developer portal — `/checkout/payments` spec |
|
|
913
|
+
| [Portal migration wizard spec](./docs/portal-migration-wizard-spec.md) | Developer portal — `/checkout/migrate` spec |
|
|
914
|
+
| [MSG91 OTP setup](./docs/MSG91_INDIA_OTP_SETUP.md) | India SMS / DLT configuration for phone OTP |
|
|
883
915
|
|
|
884
916
|
|
|
885
917
|
---
|
package/dist/lib/index.d.ts
CHANGED
|
@@ -26,6 +26,17 @@ export declare interface AddressComponents {
|
|
|
26
26
|
|
|
27
27
|
export declare const AddressForm: default_2.FC<AddressFormProps>;
|
|
28
28
|
|
|
29
|
+
/** Pre-fill manual fields when verifying an imported saved address. */
|
|
30
|
+
export declare interface AddressFormInitialValues {
|
|
31
|
+
flatNumber?: string;
|
|
32
|
+
floorNumber?: string;
|
|
33
|
+
buildingName?: string;
|
|
34
|
+
streetName?: string;
|
|
35
|
+
locality?: string;
|
|
36
|
+
label?: AddressLabel;
|
|
37
|
+
labelText?: string;
|
|
38
|
+
}
|
|
39
|
+
|
|
29
40
|
export declare interface AddressFormProps {
|
|
30
41
|
digipin: string;
|
|
31
42
|
lat: number;
|
|
@@ -36,6 +47,10 @@ export declare interface AddressFormProps {
|
|
|
36
47
|
onBack: () => void;
|
|
37
48
|
onError?: (error: Error) => void;
|
|
38
49
|
theme?: 'light' | 'dark';
|
|
50
|
+
/** Pre-populate manual fields from a saved address row (lazy DigiPin verify). */
|
|
51
|
+
initialValues?: AddressFormInitialValues;
|
|
52
|
+
/** Override primary submit button label (default: "Save Address"). */
|
|
53
|
+
submitLabel?: string;
|
|
39
54
|
/** Checkout API config for merchant serviceability checks. */
|
|
40
55
|
checkoutConfig?: CheckoutApiConfig;
|
|
41
56
|
/** Buyer session token used by checkout-addresses serviceability_check. */
|
|
@@ -155,7 +170,15 @@ export declare interface CheckoutEvent {
|
|
|
155
170
|
}
|
|
156
171
|
|
|
157
172
|
/** All step-transition event types emitted by the widget. */
|
|
158
|
-
export declare type CheckoutEventType = 'phone_step_viewed' | 'otp_sent' | 'phone_verified' | 'email_step_viewed' | 'email_otp_sent' | 'email_verified' | 'auth_skipped' | 'saved_addresses_viewed' | 'saved_address_selected' | 'map_step_viewed' | 'location_confirmed' | 'form_step_viewed' | 'address_completed' | 'widget_reset' | 'payment_step_viewed' | 'payment_method_selected' | 'session_abandoned';
|
|
173
|
+
export declare type CheckoutEventType = 'phone_step_viewed' | 'otp_sent' | 'phone_verified' | 'email_step_viewed' | 'email_otp_sent' | 'email_verified' | 'auth_skipped' | 'saved_addresses_viewed' | 'saved_address_selected' | 'verify_address_step_viewed' | 'map_step_viewed' | 'location_confirmed' | 'form_step_viewed' | 'address_completed' | 'widget_reset' | 'payment_step_viewed' | 'payment_method_selected' | 'session_abandoned';
|
|
174
|
+
|
|
175
|
+
export declare type CheckoutMobilePresentation = 'auto' | 'sheet' | 'card';
|
|
176
|
+
|
|
177
|
+
export declare interface CheckoutMobileStepLabels {
|
|
178
|
+
auth?: string;
|
|
179
|
+
address?: string;
|
|
180
|
+
payment?: string;
|
|
181
|
+
}
|
|
159
182
|
|
|
160
183
|
declare type CheckoutPlatform = 'web' | 'ios' | 'android';
|
|
161
184
|
|
|
@@ -206,6 +229,13 @@ export declare interface CheckoutWidgetProps {
|
|
|
206
229
|
mapHeight?: string | number;
|
|
207
230
|
/** Widget header title. Defaults to 'Add Delivery Address'. */
|
|
208
231
|
title?: string;
|
|
232
|
+
/**
|
|
233
|
+
* Mobile visual treatment. `auto` applies the improved mobile layout below 480px,
|
|
234
|
+
* `sheet` is for storefront drawers/modals, and `card` preserves the compact card feel.
|
|
235
|
+
*/
|
|
236
|
+
mobilePresentation?: CheckoutMobilePresentation;
|
|
237
|
+
/** Override the compact mobile step labels (e.g. Mobile / Address / Pay). */
|
|
238
|
+
mobileStepLabels?: CheckoutMobileStepLabels;
|
|
209
239
|
/**
|
|
210
240
|
* URL to an India boundary GeoJSON file (FeatureCollection).
|
|
211
241
|
* When provided, a thin grey outline is drawn on the map for legal compliance.
|
|
@@ -769,9 +799,10 @@ export declare interface ReverseGeocodeResponse {
|
|
|
769
799
|
|
|
770
800
|
export declare interface SavedAddress {
|
|
771
801
|
id: string;
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
802
|
+
/** Null for imported addresses pending lazy map verification. */
|
|
803
|
+
digipin: string | null;
|
|
804
|
+
lat: number | null;
|
|
805
|
+
lng: number | null;
|
|
775
806
|
state: string;
|
|
776
807
|
district: string;
|
|
777
808
|
locality: string;
|
|
@@ -820,6 +851,9 @@ export declare interface SavedAddressStepProps {
|
|
|
820
851
|
onAddNew: () => void;
|
|
821
852
|
}
|
|
822
853
|
|
|
854
|
+
/** Record the buyer's address choice for the current checkout session. */
|
|
855
|
+
export declare function selectAddress(config: CheckoutApiConfig, sessionToken: string, addressId: string): Promise<void>;
|
|
856
|
+
|
|
823
857
|
/** Send a 6-digit OTP to the given email via Resend (Edge: `checkout-email-otp`). */
|
|
824
858
|
export declare function sendEmailOtp(config: CheckoutApiConfig, email: string): Promise<SendEmailOtpResult>;
|
|
825
859
|
|
|
@@ -904,6 +938,27 @@ export declare interface UtmParams {
|
|
|
904
938
|
*/
|
|
905
939
|
export declare function validatePincode(pincode: string, apiKey: string, baseUrl?: string): Promise<PincodeValidateData>;
|
|
906
940
|
|
|
941
|
+
/**
|
|
942
|
+
* Confirm map pin + form for an imported address missing DigiPin.
|
|
943
|
+
* Updates buyer_addresses and marks the session address as verified.
|
|
944
|
+
*/
|
|
945
|
+
export declare function verifyDigipin(config: CheckoutApiConfig, sessionToken: string, addressId: string, payload: VerifyDigipinPayload): Promise<SavedAddress>;
|
|
946
|
+
|
|
947
|
+
export declare interface VerifyDigipinPayload {
|
|
948
|
+
digipin: string;
|
|
949
|
+
lat: number;
|
|
950
|
+
lng: number;
|
|
951
|
+
state?: string;
|
|
952
|
+
district?: string;
|
|
953
|
+
locality?: string;
|
|
954
|
+
pincode?: string;
|
|
955
|
+
delivery_status?: string;
|
|
956
|
+
flat_number?: string;
|
|
957
|
+
floor_number?: string;
|
|
958
|
+
building_name?: string;
|
|
959
|
+
street_name?: string;
|
|
960
|
+
}
|
|
961
|
+
|
|
907
962
|
/** Verify a 6-digit email OTP. Returns a session token on success. */
|
|
908
963
|
export declare function verifyEmailOtp(config: CheckoutApiConfig, email: string, code: string, context?: SessionContextPayload): Promise<VerifyEmailOtpResult>;
|
|
909
964
|
|