@quantaroute/checkout 1.7.0 → 1.7.1
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 +15 -0
- package/dist/lib/index.d.ts +62 -1
- package/dist/lib/quantaroute-checkout.es.js +86 -77
- package/dist/lib/quantaroute-checkout.umd.js +102 -93
- package/dist/style.css +1 -1
- package/package.json +6 -6
- package/src/components/CheckoutWidget.tsx +56 -11
- package/src/components/MapPinSelector.tsx +9 -0
- package/src/components/PaymentStep.tsx +17 -1
- package/src/core/checkout-api.ts +79 -0
- package/src/core/types.ts +19 -1
- package/src/index.ts +6 -0
- package/src/styles/checkout.css +47 -28
package/CHANGELOG.md
CHANGED
|
@@ -7,6 +7,21 @@ Release dates are from git history where available; earlier versions are estimat
|
|
|
7
7
|
|
|
8
8
|
## [Unreleased]
|
|
9
9
|
|
|
10
|
+
## [1.7.1](https://github.com/quantaroute/checkout/compare/v1.7.0...v1.7.1) — 2026-07-06
|
|
11
|
+
|
|
12
|
+
### Fixed
|
|
13
|
+
|
|
14
|
+
- **Map locate button** — stays in the top-right on mobile (no overlap with attribution toggle); matches MapLibre zoom control size (29×29px) and alignment on all viewports
|
|
15
|
+
- **Map attribution** — compact attribution starts collapsed (icon only); full credits expand on click
|
|
16
|
+
|
|
17
|
+
### Added
|
|
18
|
+
|
|
19
|
+
- **Address Intelligence (opt-in)** — `enableAddressIntelligence` prop, `scoreAddressRisk()` helper, payment-step risk banner, and optional COD restriction for high-risk addresses (requires deployed `checkout-addresses` backend; defaults off)
|
|
20
|
+
|
|
21
|
+
### Changed
|
|
22
|
+
|
|
23
|
+
- `CompleteAddress` now includes saved `addressId` after `createAddress` completes
|
|
24
|
+
|
|
10
25
|
## [1.7.0](https://github.com/quantaroute/checkout/compare/v1.6.0...v1.7.0) — 2026-06-28
|
|
11
26
|
|
|
12
27
|
### Added
|
package/dist/lib/index.d.ts
CHANGED
|
@@ -24,6 +24,8 @@ export declare interface AddressComponents {
|
|
|
24
24
|
[key: string]: string | undefined;
|
|
25
25
|
}
|
|
26
26
|
|
|
27
|
+
export declare type AddressConfidenceState = 'new_source_collected' | 'buyer_reconfirmed' | 'merchant_successful' | 'courier_corrected' | 'rto_associated' | 'trusted_repeat';
|
|
28
|
+
|
|
27
29
|
export declare const AddressForm: default_2.FC<AddressFormProps>;
|
|
28
30
|
|
|
29
31
|
/** Pre-fill manual fields when verifying an imported saved address. */
|
|
@@ -65,9 +67,54 @@ export declare interface AddressFormProps {
|
|
|
65
67
|
onServiceabilityResult?: (result: ServiceabilityResult) => void;
|
|
66
68
|
}
|
|
67
69
|
|
|
70
|
+
export declare type AddressIntervention = 'none' | 'request_missing_details' | 'reconfirm_pin' | 'prepaid_nudge' | 'hide_cod' | 'manual_review' | 'delivery_instruction';
|
|
71
|
+
|
|
68
72
|
/** Label for a saved buyer address — stored in checkout-addresses API. */
|
|
69
73
|
export declare type AddressLabel = 'home' | 'work' | 'other';
|
|
70
74
|
|
|
75
|
+
export declare type AddressRiskLevel = 'low' | 'medium' | 'high';
|
|
76
|
+
|
|
77
|
+
export declare interface AddressRiskPayload {
|
|
78
|
+
address_id?: string;
|
|
79
|
+
digipin?: string;
|
|
80
|
+
lat?: number;
|
|
81
|
+
lng?: number;
|
|
82
|
+
pincode?: string;
|
|
83
|
+
state?: string;
|
|
84
|
+
district?: string;
|
|
85
|
+
locality?: string;
|
|
86
|
+
delivery_status?: string;
|
|
87
|
+
flat_number?: string;
|
|
88
|
+
floor_number?: string;
|
|
89
|
+
building_name?: string;
|
|
90
|
+
street_name?: string;
|
|
91
|
+
payment_method?: string;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
export declare interface AddressRiskScore {
|
|
95
|
+
level: AddressRiskLevel;
|
|
96
|
+
score: number;
|
|
97
|
+
reasons: string[];
|
|
98
|
+
interventions: AddressIntervention[];
|
|
99
|
+
confidence_state: AddressConfidenceState;
|
|
100
|
+
signals: AddressRiskSignals;
|
|
101
|
+
scored_at: string;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
declare interface AddressRiskSignals {
|
|
105
|
+
merchant_history_records: number;
|
|
106
|
+
buyer_successful_deliveries: number;
|
|
107
|
+
buyer_rto_orders: number;
|
|
108
|
+
pincode_successful_deliveries: number;
|
|
109
|
+
pincode_rto_orders: number;
|
|
110
|
+
digipin_cell_successful_deliveries: number;
|
|
111
|
+
digipin_cell_rto_orders: number;
|
|
112
|
+
repeat_verified_address: boolean;
|
|
113
|
+
imported_address_pending_digipin: boolean;
|
|
114
|
+
cod_requested: boolean;
|
|
115
|
+
address_edit_count: number;
|
|
116
|
+
}
|
|
117
|
+
|
|
71
118
|
export declare interface AdministrativeInfo {
|
|
72
119
|
country?: string;
|
|
73
120
|
state: string;
|
|
@@ -165,12 +212,16 @@ export declare interface CheckoutEvent {
|
|
|
165
212
|
experimentVariant?: string;
|
|
166
213
|
/** DigiPin of the confirmed location. Available after `location_confirmed` and `address_completed`. */
|
|
167
214
|
digipin?: string;
|
|
215
|
+
/** Address risk level when `address_risk_scored` fires. */
|
|
216
|
+
addressRiskLevel?: AddressRiskScore['level'];
|
|
217
|
+
/** Address risk score (0-100) when address intelligence is enabled. */
|
|
218
|
+
addressRiskScore?: number;
|
|
168
219
|
/** ISO timestamp of when the event fired. */
|
|
169
220
|
timestamp: string;
|
|
170
221
|
}
|
|
171
222
|
|
|
172
223
|
/** All step-transition event types emitted by the widget. */
|
|
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';
|
|
224
|
+
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' | 'address_risk_scored' | 'widget_reset' | 'payment_step_viewed' | 'payment_method_selected' | 'session_abandoned';
|
|
174
225
|
|
|
175
226
|
export declare type CheckoutMobilePresentation = 'auto' | 'sheet' | 'card';
|
|
176
227
|
|
|
@@ -288,6 +339,11 @@ export declare interface CheckoutWidgetProps {
|
|
|
288
339
|
* Requires `merchantId`, `supabaseFunctionBaseUrl`, and an authenticated checkout session.
|
|
289
340
|
*/
|
|
290
341
|
enableServiceabilityCheck?: boolean;
|
|
342
|
+
/**
|
|
343
|
+
* Score address-discrepancy-led RTO risk after address completion.
|
|
344
|
+
* Requires `merchantId`, `supabaseFunctionBaseUrl`, and phone/email auth or `codSessionToken`.
|
|
345
|
+
*/
|
|
346
|
+
enableAddressIntelligence?: boolean;
|
|
291
347
|
/**
|
|
292
348
|
* Opt-in fallback banner for India Post "Non Delivery" pincodes.
|
|
293
349
|
* Defaults off because courier partners may still deliver.
|
|
@@ -447,6 +503,8 @@ export declare interface CompleteAddress {
|
|
|
447
503
|
labelText?: string;
|
|
448
504
|
/** Set when the buyer re-selected an existing saved row (skip createAddress). */
|
|
449
505
|
addressId?: string;
|
|
506
|
+
/** Explainable checkout-time address discrepancy risk, when enabled. */
|
|
507
|
+
addressRisk?: AddressRiskScore;
|
|
450
508
|
}
|
|
451
509
|
|
|
452
510
|
export declare interface Coordinates {
|
|
@@ -707,6 +765,7 @@ export declare interface PaymentStepProps {
|
|
|
707
765
|
amountPaise: number;
|
|
708
766
|
enableCod?: boolean;
|
|
709
767
|
codAllowed?: boolean;
|
|
768
|
+
addressRisk?: AddressRiskScore | null;
|
|
710
769
|
theme?: 'light' | 'dark';
|
|
711
770
|
onComplete: (result: {
|
|
712
771
|
paymentMethod: string;
|
|
@@ -851,6 +910,8 @@ export declare interface SavedAddressStepProps {
|
|
|
851
910
|
onAddNew: () => void;
|
|
852
911
|
}
|
|
853
912
|
|
|
913
|
+
export declare function scoreAddressRisk(config: CheckoutApiConfig, sessionToken: string, payload: AddressRiskPayload): Promise<AddressRiskScore>;
|
|
914
|
+
|
|
854
915
|
/** Record the buyer's address choice for the current checkout session. */
|
|
855
916
|
export declare function selectAddress(config: CheckoutApiConfig, sessionToken: string, addressId: string): Promise<void>;
|
|
856
917
|
|