Quick Start
Platform Examples
Checkout Customization
Mobile Recipes
start(...)
call के पीछे wrap करता है और abandoned-session recovery built in होती है। Manual WebView का उपयोग केवल
तभी करें जब इनमें से कोई भी आपके stack के लिए उपयुक्त न हो।आवश्यकताएँ
अपने mobile app में Dodo Payments को integrate करने से पहले सुनिश्चित करें कि आपके पास ये हैं:- Dodo Payments Account: API access वाला active merchant account
- API Credentials: आपके dashboard से API key और webhook secret key
- Mobile App Project: Android, iOS, React Native या Flutter application
- Backend Server: checkout session creation को securely handle करने के लिए
Integration Workflow
Mobile integration एक secure 4-step process का पालन करता है, जिसमें आपका backend API calls handle करता है और आपका mobile app user experience manage करता है।status user को क्या दिखाना है, इसका केवल UI hint है। Access हमेशा अपने backend पर payment.succeeded / subscription.active webhook से grant करें — केवल mobile result के आधार पर कभी नहीं।Backend: Create Checkout Session
Checkout Session API Docs
Mobile: Get Checkout URL
- iOS (Swift)
- Android (Kotlin)
- React Native (JavaScript)
- Flutter (Dart)
Mobile: Open Checkout in Browser
Pick your mobile SDK
Backend: Handle Payment Completion
अपना SDK चुनें
हर mobile SDK एक ही contract expose करता है: एकstart(...) call Dodo के
hosted checkout को platform के native browser surface में खोलता है और एक typed
CheckoutResult लौटाता है, जिसका status succeeded,
failed, cancelled,
pending या expired होता है। इनमें से कोई भी API key store नहीं करता या Dodo
Payments API को call नहीं करता, और सभी चार abandoned-session recovery support करते हैं।
Android
com.dodopayments.api:checkout-android एक Chrome Custom Tab खोलता है। इसके लिए minSdk 23 आवश्यक है।iOS
dodopayments-mobile-sdk-ios, SFSafariViewController खोलता है। इसके लिए iOS 16+ आवश्यक है।React Native
@dodopayments/react-native-checkout, दोनों native cores पर एक Turbo Module। इसके लिए React Native 0.76+ आवश्यक है।Flutter
dodopayments_checkout, दोनों native cores पर एक Pigeon channel। इसके लिए Flutter 3.44+ आवश्यक है।Callback URL Scheme register करना
सभी चार SDK आपके चुने हुए custom URL scheme के माध्यम से control वापस आपके app को देते हैं, उदाहरण के लिएmyapp://checkout/return। इसे प्रत्येक
platform पर एक बार register करें:
- Android
- iOS
- Expo
checkout_url को platform के system
browser (Android Custom Tabs / iOS SFSafariViewController) में खोलें और
navigation को अपने return_url पर intercept करें, फिर status और payment_id query
parameters पढ़ें। ऊपर दिए गए SDK आपके लिए यही काम करते हैं।Appearance Customization
हर SDKstart(...) / CheckoutParams पर एक optional customization parameter स्वीकार करता है, जो native browser surface के appearance और behavior - toolbar, buttons और presentation - को control करता है। यह checkout page की अपनी theme से अलग है, जिसे आप checkout session पर customization.theme_config के माध्यम से server-side configure करते हैं।
Options को platform के अनुसार group किया गया है, क्योंकि Android का Custom Tab और iOS का SFSafariViewController अलग-अलग native controls expose करते हैं। सभी fields optional हैं; customization को पूरी तरह omit करने पर प्रत्येक platform का default appearance उपयोग होता है।
Android - Custom Tab
Android - Custom Tab
default system का “X” icon दिखाता है; back इसके बजाय back arrow draw करता है।iOS - SFSafariViewController
iOS - SFSafariViewController
pageSheet swipe-to-dismiss वाले card के रूप में प्रस्तुत होता है; fullScreen पूरी screen को cover करता है।presentationStyle fullScreen हो - pageSheet इस setting की परवाह किए बिना bars को pinned रखता है।- React Native
- Flutter
- Android (Kotlin)
- iOS (Swift)
Checkout Page Customization
ऊपर का Appearance Customization section native browser surface - toolbar, buttons और color scheme - को control करता है। checkout page स्वयं - कौन से fields दिखाई दें, theme और कौन से payment methods दिखें - checkout session बनाते समय server-side configure किया जाता है। इन parameters का mobile conversion पर सबसे अधिक प्रभाव पड़ता है। नीचे दिए गए parameters checkout session request में तीन अलग-अलग स्थानों पर होते हैं - Where it goes column बताता है कि प्रत्येक parameter किस object में होना चाहिए। इसे गलत रखना सबसे सामान्य गलती है: गलत object में रखा गया parameter silently ignore हो जाता है।
show_order_details: false moves the contact and payment fields above the fold, instead of behind the order summary.
minimal_address: true set करें:

minimal_address: true reduces the billing address to a single postcode field.
theme: "system" set करें:

With theme: system, the checkout follows the device's light or dark appearance automatically.
Full checkout session parameter reference
Mobile-Optimized Recipes
नीचे दिया गया प्रत्येक recipe एक complete checkout session request body है। अपने scenario से मेल खाने वाला recipe copy करें, उसमें अपना product ID डालें और उसे अपने backend के session-creation endpoint पर pass करें।Minimal Mobile Checkout - fastest path to payment
Minimal Mobile Checkout - fastest path to payment
- Node.js SDK
- Python SDK
One-Click Returning Customer - saved card, instant confirmation
One-Click Returning Customer - saved card, instant confirmation
confirm: true combine करें।- Node.js SDK
- Python SDK
status केवल UI hint है। अपने backend पर payment.succeeded webhook सुनकर access की पुष्टि करें।Subscription with Free Trial - trial before first charge
Subscription with Free Trial - trial before first charge
- Node.js SDK
- Python SDK
subscription.active webhook प्राप्त हो, तब feature access grant करें - mobile SDK के return पर नहीं। पूरे webhook flow के लिए Subscription Integration Guide देखें।On-Demand Mandate - save a card for future variable charges
On-Demand Mandate - save a card for future variable charges
- Node.js SDK
- Python SDK
Mobile से Subscription Flows
Subscriptions उसी checkout session flow के माध्यम से बनाई जाती हैं जिसका उपयोग one-time payments के लिए होता है - mobile SDK hosted checkout खोलता है, customer subscribe करता है और आपका app deep-link return handle करता है। इसके बाद subscription lifecycle पूरी तरह backend पर manage किया जाता है।Regular Recurring Subscriptions
Fixed-interval billing (monthly, annual) के लिए subscription product और deep-linkreturn_url के साथ checkout session बनाएँ। Subscription confirm होने पर आपका backend subscription.active प्राप्त करता है।
On-Demand Subscriptions
On-demand subscriptions customer के payment method को एक बार authorize करके बाद में variable amounts charge करने देती हैं - wallet top-ups, pay-as-you-go और उन सभी scenarios के लिए आदर्श जहाँ charge amount पहले से ज्ञात नहीं होता। Complete request body के लिए ऊपर दिया गया On-Demand Mandate recipe देखें। मुख्य mobile considerations:show_on_demand_tag: falseset करें ताकि checkout page पर “subscription” या “on-demand” language दिखाई न दे। Card-tokenization use cases में customers subscription terminology की अपेक्षा नहीं करते।- Mandate authorize होने के बाद आपका backend
subscription.activeप्राप्त करता है।subscription_idstore करें - सभी future charges के लिए इसका उपयोग होगा।
Subscription with Free Trial
पहले billing cycle से पहले trial offer करने के लिए checkout session मेंsubscription_data.trial_period_days pass करें। Customer trial signup के दौरान अपने payment method को authorize करता है; trial समाप्त होने पर पहला charge automatically होता है। Complete request body के लिए ऊपर दिया गया Subscription with Free Trial recipe देखें।
Upgrades और Downgrades
Plan changes आपके backend पर API के माध्यम से किए जाते हैं, किसी नए checkout session के माध्यम से नहीं। Dodo Payments proration automatically calculate करता है। Customers को self-service option देने के लिए Customer Portal embed करें या उसका link दें।Subscription Integration Guide
On-Demand Subscriptions
Upgrade / Downgrade
Customer Portal
Checkout Drop-Offs कम करना
Mobile checkouts में web की तुलना में abandonment अधिक होता है - छोटी screens, अधिक distractions और लंबे forms सभी इसमें योगदान देते हैं। सबसे तेज improvements checkout session configuration से ही मिलते हैं।Form को Optimize करें
Customer Data Pre-Fill करें
Customer को जो field type नहीं करनी पड़ती, वह checkout abandon न करने का एक कारण है:- New customers - अपनी auth session से
customer.emailऔरcustomer.nameset करें। - Returning customers - सभी stored details automatically pre-fill करने के लिए
customer.customer_idset करें। - Currency -
billing_currencyऔरbilling_address.countryको हमेशा साथ pass करें।
Recovery Tools
Abandoned Cart Recovery
Payment Retries
Subscription Dunning
Recovery Overview
Best Practices
- Security: अपने app में API key कभी ship न करें। Checkout sessions अपने backend पर बनाएँ और केवल resulting
checkout_urlclient को pass करें। - Authority:
CheckoutResult.statusको UI hint मानें। Access केवल backend द्वारा payment confirm करने के बाद grant करें। - User Experience: Backend द्वारा session create किए जाने तक loading state दिखाएँ और
cancelledको error के बजाय normal outcome के रूप में handle करें। - Testing: Test mode और test cards का उपयोग करें और real device तथा simulator दोनों पर return-URL round trip verify करें।
- Conversion: Best mobile checkout completion rates के लिए
show_order_details: falseऔरminimal_address: trueset करें। Payment methods को above the fold ले जाना और form fields कम करना, आपके द्वारा किए जा सकने वाले दो सबसे प्रभावी बदलाव हैं। - Currency:
billing_currencyऔरbilling_address.countryदोनों को हमेशा explicitly pass करें - इनमें से कोई missing होने पर adaptive currency customer के IP address के आधार पर billing currency बदल सकती है। - On-demand billing: Card tokenization के लिए on-demand subscriptions का उपयोग करते समय
show_on_demand_tag: falseset करें। Wallet top-up flow का उपयोग करने वाले customers “subscription” language देखने की अपेक्षा नहीं करते। - Recovery: Checkout पूरा न करने वाले customers को automatically re-engage करने के लिए अपने Dodo Payments dashboard में abandoned cart recovery enable करें।
Troubleshooting
सामान्य समस्याएँ
- Callback कभी नहीं आता:
returnUrlमें scheme आपके registered scheme से match होना चाहिए। Android पर यहdodoCallbackSchememanifest placeholder है; iOS और React Native पर यहInfo.plistURL type है। - Checkout आपके app के बजाय browser पर लौटता है (iOS): आपने incoming URL forward नहीं किया है।
.onOpenURL,scene(_:openURLContexts:)या React NativeLinkinglistener सेDodoCheckout.handleOpenURL(url)call करें। - Android पर
PLATFORM_ERROR: अधिकतर मामलों में यह scheme mismatch होता है। यह तब भी दिखाई दे सकता है जब आपकाMainActivityandroid:taskAffinity=""set करता है (stockflutter createdefault), जिससे कुछ OEM builds in-flight checkout खो सकते हैं। ALREADY_IN_PROGRESS: एक checkout अभी भी open है। दूसरा शुरू करने से पहले पिछले checkout का await या dismiss करें।- Unresolved placeholder के कारण build fail होता है: आपने Android SDK add किया, लेकिन
manifestPlaceholders["dodoCallbackScheme"]set नहीं किया। - Payment सफल हुआ लेकिन access grant नहीं हुआ: यदि आप mobile result पर निर्भर हैं तो यह expected है। इसके बजाय
payment.succeeded/subscription.activewebhook से access grant करें। - Mobile पर Apple Pay / Google Pay दिखाई नहीं देते: Checkout embedded WebView (
WKWebView/ AndroidWebView) में load हो रहा है, जो wallets को suppress करता है और 3-D Secure को तोड़ सकता है। इसके बजाय SDK से या system browser (Custom Tabs /SFSafariViewController) में खोलें।
अतिरिक्त Resources
- Payment Integration Guide
- Webhook Documentation
- Testing Process
- Technical FAQs
- Checkout Session Customization
- On-Demand Subscriptions
- Subscription Upgrade/Downgrade
- Abandoned Cart Recovery
- Customer Portal
