@quantaroute/checkout 1.3.2 → 1.4.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.
@@ -1,4 +1,5 @@
1
1
  import { default as default_2 } from 'react';
2
+ import { ReactNode } from 'react';
2
3
 
3
4
  /**
4
5
  * Address components from Nominatim/OpenStreetMap (via reverse geocoding).
@@ -43,9 +44,6 @@ export declare interface AdministrativeInfo {
43
44
  pincode: string;
44
45
  delivery: string;
45
46
  district: string;
46
- mean_population_density?: number;
47
- min_population_density?: number;
48
- max_population_density?: number;
49
47
  }
50
48
 
51
49
  declare type AnyStyle = any;
@@ -89,15 +87,70 @@ export declare interface AutocompleteSuggestion {
89
87
  };
90
88
  }
91
89
 
90
+ /** Read UTM params from the current page URL (web). Returns {} on native or SSR. */
91
+ export declare function captureUtmFromUrl(href?: string): UtmParams;
92
+
93
+ /**
94
+ * Check COD availability for a delivery pincode (Edge: `cod_eligibility`).
95
+ * Respects `checkout.merchants.enable_cod` (C4), `cod_blocked_pincodes` / `cod_max_cart_value_paise` (D1/D2).
96
+ * Pass `cartTotalPaise` in paise (e.g. ₹499 → 49900) to enforce the cart cap when set.
97
+ */
98
+ export declare function checkCodEligibility(config: CheckoutApiConfig, sessionToken: string, pincode: string, cartTotalPaise?: number): Promise<CodEligibilityResult>;
99
+
100
+ export declare interface CheckoutApiConfig {
101
+ /** Supabase Edge Function base URL, e.g. https://<project>.supabase.co/functions/v1 */
102
+ functionBaseUrl: string;
103
+ /** UUID of the merchant from checkout.merchants */
104
+ merchantId: string;
105
+ }
106
+
107
+ /**
108
+ * Payload delivered to `onCheckoutEvent` on every step transition.
109
+ * Forward this to MoEngage, Clevertap, GTM, or your own analytics.
110
+ */
111
+ export declare interface CheckoutEvent {
112
+ /** The event that just occurred. */
113
+ type: CheckoutEventType;
114
+ /** The step the widget moved INTO. */
115
+ step: string;
116
+ /** Buyer's phone number (E.164) or email. Available after OTP sent. */
117
+ mobile?: string;
118
+ /** Internal buyer UUID. Available after auth verification. */
119
+ buyerId?: string;
120
+ /** Checkout session UUID. Available after auth verification. */
121
+ sessionId?: string;
122
+ /** Auth channel used in this session. */
123
+ authChannel?: 'phone' | 'email' | 'none';
124
+ /** Device class: mobile | tablet | desktop */
125
+ deviceType?: 'mobile' | 'tablet' | 'desktop';
126
+ /** Platform: web | ios | android */
127
+ platform?: 'web' | 'ios' | 'android';
128
+ /** Truncated user agent (web). */
129
+ userAgent?: string;
130
+ /** Payment method when selected: cod | prepaid | upi | card | … */
131
+ paymentMethod?: string;
132
+ /** A/B experiment variant label from `variant` prop. */
133
+ experimentVariant?: string;
134
+ /** DigiPin of the confirmed location. Available after `location_confirmed` and `address_completed`. */
135
+ digipin?: string;
136
+ /** ISO timestamp of when the event fired. */
137
+ timestamp: string;
138
+ }
139
+
140
+ /** All step-transition event types emitted by the widget. */
141
+ 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';
142
+
143
+ declare type CheckoutPlatform = 'web' | 'ios' | 'android';
144
+
92
145
  /**
93
146
  * QuantaRoute Checkout Widget
94
147
  *
95
- * A two-step, mobile-first address collection component:
96
- * Step 1 – Map: user pins their exact location (DigiPin shown offline, real-time)
97
- * Step 2 – Form: auto-filled address + manual flat/building details
148
+ * Default (enablePhoneAuth = false):
149
+ * map → form → done
98
150
  *
99
- * Works in React, Next.js, Nuxt (via nuxt-module), Vite, etc.
100
- * Embed as a script tag (vanilla JS) via the UMD build.
151
+ * With phone auth (enablePhoneAuth = true):
152
+ * phone → otp → saved → map → form → done
153
+ * (buyer can skip phone auth to go straight to map)
101
154
  */
102
155
  declare const CheckoutWidget: default_2.FC<CheckoutWidgetProps>;
103
156
  export { CheckoutWidget }
@@ -143,6 +196,126 @@ export declare interface CheckoutWidgetProps {
143
196
  * and the map instantly flies to their ~4m × 4m location — zero API cost.
144
197
  */
145
198
  enableSearch?: boolean;
199
+ /**
200
+ * Enable phone OTP authentication for saved addresses (default: false).
201
+ * When true, the widget starts with a phone entry step so returning buyers
202
+ * can access their previously saved addresses — reducing re-entry friction.
203
+ * Requires merchantId and supabaseFunctionBaseUrl to be set.
204
+ * Takes precedence over enableEmailAuth if both are set.
205
+ */
206
+ enablePhoneAuth?: boolean;
207
+ /**
208
+ * Enable email OTP authentication via Resend (default: false).
209
+ * When true (and enablePhoneAuth is false), the widget starts with an email
210
+ * entry step. Requires merchantId and supabaseFunctionBaseUrl to be set.
211
+ * Needs RESEND_API_KEY + RESEND_FROM_EMAIL on the checkout-email-otp Edge Function.
212
+ */
213
+ enableEmailAuth?: boolean;
214
+ /**
215
+ * UUID of your merchant record in checkout.merchants.
216
+ * Required when enablePhoneAuth or enableEmailAuth is true.
217
+ */
218
+ merchantId?: string;
219
+ /**
220
+ * Base URL of your Supabase Edge Functions deployment.
221
+ * Example: "https://ikfiewesidedxozotmrl.supabase.co/functions/v1"
222
+ * Required when enablePhoneAuth or enableEmailAuth is true.
223
+ */
224
+ supabaseFunctionBaseUrl?: string;
225
+ /**
226
+ * When true, shows a Cash on Delivery availability strip on the success screen
227
+ * (calls `cod_eligibility`). Requires `merchantId`, `supabaseFunctionBaseUrl`, and a
228
+ * session token from phone auth or `codSessionToken`. On the server, set
229
+ * `checkout.merchants.enable_cod` and optional D1/D2 columns.
230
+ */
231
+ enableCod?: boolean;
232
+ /**
233
+ * Cart total in paise for the COD cart cap (D2). Omit if the cart total is unknown.
234
+ */
235
+ codCartTotalPaise?: number;
236
+ /**
237
+ * Session token for the COD check when your app manages auth outside the widget’s phone flow.
238
+ */
239
+ codSessionToken?: string;
240
+ /**
241
+ * Brand accent colour (hex, e.g. `#7c3aed`). On web, sets `--qr-primary` on the root; on native, passed to the map pin and header accents.
242
+ */
243
+ brandColor?: string;
244
+ /**
245
+ * Merchant logo URL shown in the widget header (replaces default map icon when set).
246
+ */
247
+ logoUrl?: string;
248
+ /**
249
+ * Optional slot below the header row for trust badges, free-shipping strip, or any custom JSX.
250
+ */
251
+ headerBanner?: ReactNode;
252
+ /**
253
+ * Client-side analytics hook. Called on every step transition so you can
254
+ * forward events to MoEngage, Clevertap, GTM, or your own backend.
255
+ *
256
+ * @example
257
+ * onCheckoutEvent={(event) => {
258
+ * Moengage.track_event(event.type, { step: event.step, buyerId: event.buyerId });
259
+ * }}
260
+ */
261
+ onCheckoutEvent?: (event: CheckoutEvent) => void;
262
+ /**
263
+ * A/B experiment variant label — included on every `onCheckoutEvent` payload
264
+ * and stored on the checkout session for funnel breakdowns.
265
+ */
266
+ variant?: string;
267
+ /**
268
+ * UTM params captured from the page URL at widget mount (web).
269
+ * Stored on the session when the buyer verifies OTP.
270
+ */
271
+ utmParams?: UtmParams;
272
+ /**
273
+ * Enable Razorpay payment step after address completion (requires merchant Razorpay keys).
274
+ */
275
+ enablePayment?: boolean;
276
+ /** Cart total in paise for Razorpay order creation. Required when enablePayment is true. */
277
+ paymentAmountPaise?: number;
278
+ /** Called when payment completes (prepaid or COD). */
279
+ onPaymentComplete?: (result: {
280
+ paymentMethod: string;
281
+ sessionId?: string;
282
+ }) => void;
283
+ /**
284
+ * Show prepaid conversion nudge when COD is eligible (merchant `prepaid_nudge_copy` or prop override).
285
+ */
286
+ enablePrepaidNudge?: boolean;
287
+ /** Override merchant prepaid nudge copy. */
288
+ prepaidNudgeCopy?: string;
289
+ /** Override merchant prepaid nudge CTA URL. */
290
+ prepaidNudgeCtaUrl?: string;
291
+ }
292
+
293
+ /**
294
+ * Shows COD availability after checkout using `cod_eligibility` (merchant `enable_cod` + D1/D2).
295
+ */
296
+ export declare const CodAvailabilityBanner: default_2.FC<CodAvailabilityBannerProps>;
297
+
298
+ declare interface CodAvailabilityBannerProps {
299
+ checkoutConfig: CheckoutApiConfig;
300
+ sessionToken: string;
301
+ pincode: string;
302
+ cartTotalPaise?: number;
303
+ theme?: 'light' | 'dark';
304
+ /** Called when COD eligibility is resolved (for prepaid nudge gating). */
305
+ onCodAllowedChange?: (allowed: boolean) => void;
306
+ }
307
+
308
+ export declare interface CodEligibilityResult {
309
+ /** Whether COD is allowed for this pincode for the session merchant. */
310
+ cod_allowed: boolean;
311
+ /** Normalized 6-digit pincode when valid; otherwise the trimmed input. */
312
+ pincode: string;
313
+ /** Present when COD is not allowed or the pincode could not be normalized. */
314
+ reason?: 'cod_disabled' | 'pincode_blocked' | 'invalid_pincode' | 'cart_value_exceeded';
315
+ /** Merchant COD cart cap in paise; null when unlimited. */
316
+ cod_max_cart_value_paise?: number | null;
317
+ /** Echo of `cartTotalPaise` when sent. */
318
+ cart_total_paise?: number;
146
319
  }
147
320
 
148
321
  export declare interface CompleteAddress {
@@ -183,6 +356,36 @@ export declare interface Coordinates {
183
356
  lng: number;
184
357
  }
185
358
 
359
+ /** Save a new address for the authenticated buyer. */
360
+ export declare function createAddress(config: CheckoutApiConfig, sessionToken: string, address: SavedAddressPayload): Promise<SavedAddress>;
361
+
362
+ export declare function createPaymentOrder(config: CheckoutApiConfig, sessionToken: string, amountPaise: number): Promise<CreatePaymentOrderResult>;
363
+
364
+ export declare interface CreatePaymentOrderResult {
365
+ razorpay_order_id: string;
366
+ razorpay_key_id: string;
367
+ amount_paise: number;
368
+ currency: string;
369
+ }
370
+
371
+ /** Soft-delete a saved address. */
372
+ export declare function deleteAddress(config: CheckoutApiConfig, sessionToken: string, addressId: string): Promise<void>;
373
+
374
+ /** Detect coarse device class from viewport / user agent (web only). */
375
+ export declare function detectDeviceType(userAgent?: string): DeviceType;
376
+
377
+ /** Web checkout platform; native widgets pass platform explicitly. */
378
+ export declare function detectPlatform(): CheckoutPlatform;
379
+
380
+ declare interface DeviceContext {
381
+ deviceType: DeviceType;
382
+ platform: CheckoutPlatform;
383
+ userAgent?: string;
384
+ }
385
+
386
+ /** Device / platform metadata attached to checkout analytics events. */
387
+ declare type DeviceType = 'mobile' | 'tablet' | 'desktop';
388
+
186
389
  /** Geographic bounds for India */
187
390
  export declare const DIGIPIN_BOUNDS: {
188
391
  minLat: number;
@@ -196,6 +399,50 @@ declare interface DigiPinCoordinates {
196
399
  longitude: string;
197
400
  }
198
401
 
402
+ export declare const EmailOtpStep: default_2.FC<EmailOtpStepProps>;
403
+
404
+ export declare interface EmailOtpStepProps {
405
+ email: string;
406
+ /** When true, no new email was sent — shopper should use their existing code. */
407
+ codeReused?: boolean;
408
+ onVerified: (sessionToken: string, buyerId: string, sessionId?: string) => void;
409
+ onBack: () => void;
410
+ functionBaseUrl: string;
411
+ merchantId: string;
412
+ sessionContext?: SessionContextPayload;
413
+ }
414
+
415
+ export declare const EmailStep: default_2.FC<EmailStepProps>;
416
+
417
+ export declare interface EmailStepProps {
418
+ /** Called with the normalised (lowercased) email once OTP is ready (sent or reused). */
419
+ onOtpSent: (email: string, info?: {
420
+ reused?: boolean;
421
+ }) => void;
422
+ onSkip: () => void;
423
+ functionBaseUrl: string;
424
+ merchantId: string;
425
+ }
426
+
427
+ /** Fetch merchant prepaid nudge copy via Admin API (optional; use props to avoid). */
428
+ export declare function fetchPrepaidNudgeConfig(functionBaseUrl: string, adminApiKey: string): Promise<PrepaidNudgeConfig | null>;
429
+
430
+ /** Fetch UTM-matched offer banner for the current session. */
431
+ export declare function fetchSessionOffer(config: CheckoutApiConfig, sessionToken: string): Promise<SessionOffer | null>;
432
+
433
+ export declare interface FunnelEventPayload {
434
+ event_type: string;
435
+ step?: string;
436
+ session_token?: string;
437
+ buyer_id?: string;
438
+ auth_channel?: string;
439
+ device_type?: string;
440
+ platform?: string;
441
+ user_agent?: string;
442
+ payment_method?: string;
443
+ experiment_variant?: string;
444
+ }
445
+
199
446
  /**
200
447
  * Convert lat/lng coordinates to a DigiPin code.
201
448
  * @throws if coordinates are outside India's bounds
@@ -208,6 +455,12 @@ export declare function getDigiPin(lat: number, lon: number): string;
208
455
  */
209
456
  export declare function getLatLngFromDigiPin(digiPin: string): DigiPinCoordinates;
210
457
 
458
+ /** Build device context for web embeds. */
459
+ export declare function getWebDeviceContext(): DeviceContext;
460
+
461
+ /** True when at least one UTM field is set. */
462
+ export declare function hasUtmParams(utm: UtmParams): boolean;
463
+
211
464
  /**
212
465
  * Validate a DigiPin string (format + character check).
213
466
  */
@@ -218,6 +471,9 @@ export declare function isValidDigiPin(digiPin: string): boolean;
218
471
  */
219
472
  export declare function isWithinIndia(lat: number, lon: number): boolean;
220
473
 
474
+ /** Fetch all saved addresses for the authenticated buyer. */
475
+ export declare function listAddresses(config: CheckoutApiConfig, sessionToken: string): Promise<SavedAddress[]>;
476
+
221
477
  export declare interface LocationAlternative {
222
478
  pincode: string;
223
479
  name: string;
@@ -246,6 +502,9 @@ export declare interface LocationLookupResponse {
246
502
  message?: string;
247
503
  }
248
504
 
505
+ /** Log a checkout funnel event to the server (fire-and-forget). */
506
+ export declare function logFunnelEvent(config: CheckoutApiConfig, payload: FunnelEventPayload, sessionToken?: string): Promise<void>;
507
+
249
508
  /**
250
509
  * Returns true if the trimmed input looks like a complete DigiPin code.
251
510
  * Used to skip the API call and resolve offline instead.
@@ -287,8 +546,107 @@ export declare interface MapPinSelectorProps {
287
546
  apiKey?: string;
288
547
  /** API base URL for autocomplete. Defaults to https://api.quantaroute.com */
289
548
  apiBaseUrl?: string;
549
+ /**
550
+ * Brand accent colour (hex, e.g. `#7c3aed`). Sets map pin, buttons, focus rings via `--qr-primary` on web.
551
+ */
552
+ brandColor?: string;
290
553
  }
291
554
 
555
+ /**
556
+ * Notify the server that the buyer has confirmed their delivery address.
557
+ * Triggers `session.address_completed` webhook on the merchant's configured URL.
558
+ * Call this once `onComplete` fires in the widget (or from your own checkout page).
559
+ */
560
+ export declare function notifyAddressCompleted(config: CheckoutApiConfig, sessionToken: string, address: {
561
+ pincode: string;
562
+ digipin: string;
563
+ state: string;
564
+ district: string;
565
+ locality: string;
566
+ }): Promise<void>;
567
+
568
+ /** Signal explicit session abandonment (page exit). */
569
+ export declare function notifySessionAbandoned(config: CheckoutApiConfig, sessionToken: string, lastStep: string): Promise<void>;
570
+
571
+ export declare const OtpStep: default_2.FC<OtpStepProps>;
572
+
573
+ export declare interface OtpStepProps {
574
+ mobile: string;
575
+ onVerified: (sessionToken: string, buyerId: string, sessionId?: string) => void;
576
+ onBack: () => void;
577
+ functionBaseUrl: string;
578
+ merchantId: string;
579
+ sessionContext?: SessionContextPayload;
580
+ }
581
+
582
+ export declare const PaymentStep: default_2.FC<PaymentStepProps>;
583
+
584
+ export declare interface PaymentStepProps {
585
+ checkoutConfig: CheckoutApiConfig;
586
+ sessionToken: string;
587
+ sessionId?: string;
588
+ amountPaise: number;
589
+ enableCod?: boolean;
590
+ codAllowed?: boolean;
591
+ theme?: 'light' | 'dark';
592
+ onComplete: (paymentMethod: string) => void;
593
+ onBack?: () => void;
594
+ onEvent?: (type: CheckoutEventType, paymentMethod?: string) => void;
595
+ }
596
+
597
+ export declare const PhoneStep: default_2.FC<PhoneStepProps>;
598
+
599
+ export declare interface PhoneStepProps {
600
+ onOtpSent: (mobile: string) => void;
601
+ onSkip: () => void;
602
+ functionBaseUrl: string;
603
+ merchantId: string;
604
+ }
605
+
606
+ /**
607
+ * Whether this pincode has at least one post office with India Post "Delivery" status
608
+ * (vs "Non Delivery" only — e.g. remote or PO-box-only areas).
609
+ */
610
+ export declare function pincodeHasDeliveryOffice(offices: PincodeOffice[]): boolean;
611
+
612
+ /** One office row from /v1/pincode/validate/:pincode */
613
+ export declare interface PincodeOffice {
614
+ office_name: string;
615
+ delivery: string | null;
616
+ district: string | null;
617
+ state: string | null;
618
+ circle: string | null;
619
+ region: string | null;
620
+ division: string | null;
621
+ }
622
+
623
+ export declare interface PincodeValidateData {
624
+ isValid: boolean;
625
+ pincode: string;
626
+ count: number;
627
+ offices: PincodeOffice[];
628
+ }
629
+
630
+ /**
631
+ * C5 prepaid nudge — shown when COD is eligible to encourage prepaid checkout.
632
+ */
633
+ export declare const PrepaidNudge: default_2.FC<PrepaidNudgeProps>;
634
+
635
+ export declare interface PrepaidNudgeConfig {
636
+ prepaid_nudge_copy: string | null;
637
+ prepaid_nudge_cta_url: string | null;
638
+ }
639
+
640
+ export declare interface PrepaidNudgeProps {
641
+ copy: string;
642
+ ctaUrl?: string;
643
+ theme?: 'light' | 'dark';
644
+ }
645
+
646
+ export declare function recordCodPayment(config: CheckoutApiConfig, sessionToken: string): Promise<{
647
+ payment_method: string;
648
+ }>;
649
+
292
650
  /**
293
651
  * Call QuantaRoute's Reverse Geocoding API.
294
652
  * Converts DigiPin → address components from Nominatim/OpenStreetMap.
@@ -315,6 +673,88 @@ export declare interface ReverseGeocodeResponse {
315
673
  message?: string;
316
674
  }
317
675
 
676
+ export declare interface SavedAddress {
677
+ id: string;
678
+ digipin: string;
679
+ lat: number;
680
+ lng: number;
681
+ state: string;
682
+ district: string;
683
+ locality: string;
684
+ pincode: string;
685
+ delivery_status: string;
686
+ flat_number: string;
687
+ floor_number: string;
688
+ building_name: string;
689
+ street_name: string;
690
+ label: string;
691
+ is_default: boolean;
692
+ created_at: string;
693
+ updated_at: string;
694
+ /** Brand name of the merchant where this address was first saved. Null if unknown. */
695
+ saved_at_brand: string | null;
696
+ }
697
+
698
+ export declare interface SavedAddressPayload {
699
+ digipin: string;
700
+ lat: number;
701
+ lng: number;
702
+ state?: string;
703
+ district?: string;
704
+ locality?: string;
705
+ pincode?: string;
706
+ delivery_status?: string;
707
+ flat_number?: string;
708
+ floor_number?: string;
709
+ building_name?: string;
710
+ street_name?: string;
711
+ full_address_json?: Record<string, unknown>;
712
+ label?: string;
713
+ is_default?: boolean;
714
+ }
715
+
716
+ export declare const SavedAddressStep: default_2.FC<SavedAddressStepProps>;
717
+
718
+ export declare interface SavedAddressStepProps {
719
+ sessionToken: string;
720
+ functionBaseUrl: string;
721
+ merchantId: string;
722
+ onSelectAddress: (address: SavedAddress) => void;
723
+ onAddNew: () => void;
724
+ }
725
+
726
+ /** Send a 6-digit OTP to the given email via Resend (Edge: `checkout-email-otp`). */
727
+ export declare function sendEmailOtp(config: CheckoutApiConfig, email: string): Promise<SendEmailOtpResult>;
728
+
729
+ /** Result from send email OTP — includes whether an existing code was reused (no new email). */
730
+ export declare interface SendEmailOtpResult {
731
+ reused: boolean;
732
+ }
733
+
734
+ /** Send OTP to the given mobile number. Throws on failure. */
735
+ export declare function sendOtp(config: CheckoutApiConfig, mobile: string): Promise<void>;
736
+
737
+ /** Device + UTM context sent with OTP verify to enrich checkout sessions. */
738
+ export declare interface SessionContextPayload {
739
+ utm_source?: string;
740
+ utm_medium?: string;
741
+ utm_campaign?: string;
742
+ device_type?: string;
743
+ platform?: string;
744
+ user_agent?: string;
745
+ experiment_variant?: string;
746
+ }
747
+
748
+ export declare interface SessionOffer {
749
+ offer_id: string;
750
+ name: string;
751
+ banner_copy: string;
752
+ banner_cta_url: string | null;
753
+ }
754
+
755
+ /** Set an address as the default. */
756
+ export declare function setDefaultAddress(config: CheckoutApiConfig, sessionToken: string, addressId: string): Promise<void>;
757
+
318
758
  /**
319
759
  * Compute a DigiPin code from lat/lng entirely offline (no API call).
320
760
  * Returns null if coordinates are outside India's bounds.
@@ -335,4 +775,46 @@ export declare function useGeolocation(): {
335
775
  error: string | null;
336
776
  };
337
777
 
778
+ /** UTM parameters captured from the storefront URL at checkout start. */
779
+ export declare interface UtmParams {
780
+ utm_source?: string;
781
+ utm_medium?: string;
782
+ utm_campaign?: string;
783
+ }
784
+
785
+ /**
786
+ * Validate a 6-digit Indian pincode against QuantaRoute's postal database.
787
+ * Rejects fake codes (e.g. 123456) that are not in India Post records.
788
+ */
789
+ export declare function validatePincode(pincode: string, apiKey: string, baseUrl?: string): Promise<PincodeValidateData>;
790
+
791
+ /** Verify a 6-digit email OTP. Returns a session token on success. */
792
+ export declare function verifyEmailOtp(config: CheckoutApiConfig, email: string, code: string, context?: SessionContextPayload): Promise<VerifyEmailOtpResult>;
793
+
794
+ export declare interface VerifyEmailOtpResult {
795
+ session_token: string;
796
+ session_id: string;
797
+ expires_at: string;
798
+ buyer_id: string;
799
+ }
800
+
801
+ /** Verify OTP and return a session token. Throws on invalid OTP. */
802
+ export declare function verifyOtp(config: CheckoutApiConfig, mobile: string, otp: string, context?: SessionContextPayload): Promise<VerifyOtpResult>;
803
+
804
+ export declare interface VerifyOtpResult {
805
+ session_token: string;
806
+ session_id: string;
807
+ expires_at: string;
808
+ buyer_id: string;
809
+ }
810
+
811
+ export declare function verifyPayment(config: CheckoutApiConfig, sessionToken: string, params: {
812
+ razorpay_order_id: string;
813
+ razorpay_payment_id: string;
814
+ razorpay_signature: string;
815
+ payment_method?: string;
816
+ }): Promise<{
817
+ payment_method: string;
818
+ }>;
819
+
338
820
  export { }