Skip to main content

Mobile SDKs

To troubleshoot this issue, follow this step:
  • Always use the latest SDK versions. Check the Changelog for updates.
When the user is trying to install apps from sources other than the Play Store / App Store and test them in a Production environment then Cashfree mobile SDK Android, React Native, Flutter, Cordova, Ionic, Capacitor will block the transaction.This error also occurs when the application package is not whitelisted by Cashfree or when you are using an outdated SDK version. Whitelist your app package or check the whitelisting status in the Merchant Dashboard. See Whitelist Your Website or App. Upgrade your Flutter SDK to the latest stable version (for example, 2.4.0+52 or higher). Test with a build uploaded to the Google Play Store (or as a Play Store tester) so the source is recognised as trusted.To troubleshoot this issue, follow these steps:
  • Provide the package name of your internal testing application to Cashfree support so they can add it to the approved list.
  • See the guidelines for testing apps in production environments.
This issue occurs when there is an NDK version mismatch between your local setup and the SDK requirements.
To troubleshoot this issue, follow these steps:
  • Update the ndk.dir path in your local.properties file:
    ndk.dir=/path/to/ndk/<required_version>
  • Alternatively, open Android Studio > SDK Manager > SDK Tools, and install the required NDK version.
This issue occurs when Gradle cannot find the required Cashfree dependencies.
To troubleshoot this issue, follow these steps:
  • Add the following repositories inside android/build.gradle under allprojects > repositories:
    google()
    mavenCentral()
    maven { url "https://jitpack.io" }
To initialise a payment, follow these steps:
  • Use the method:
    CashfreePGSDK.doPayment(orderId, setEnvironment, setPaymentSessionId);
  • Ensure the following:
    • orderId and paymentSessionId are securely generated from your backend.
    • setEnvironment is either SANDBOX or PRODUCTION.
    • You specify the platform (for example, UPI, card, or netbanking).
This issue occurs in the sandbox (test) environment. Real UPI apps don’t launch because transactions are simulated.
To test UPI behaviour, follow these steps:
  • Use the Cashfree UPI simulator with sandbox credentials.
  • For end-to-end testing, use production mode with small payment amounts.
No. UPI Intent works only on supported mobile devices and mobile applications, because it opens an installed UPI app.On desktop websites, present UPI QR. Do not offer UPI Intent or UPI Collect on desktop, except where NPCI still allows Collect. See UPI Collect Flow Deprecation for QR setup, iOS support, and exemption details.
The payment_session_id_invalid error means the payment session ID is missing or does not exist. Common causes include:
  1. Modified session ID: Don’t trim the payment_session_id or add extra characters to it. Pass it exactly as received from the Create Order API response.
  2. Environment mismatch: Ensure the payment_session_id generated in one environment is not used in another. A Sandbox session ID cannot be used with the Production checkout environment.
To resolve this error:
  1. Pass the payment_session_id exactly as received from the Create Order API.
  2. Create the order in the same environment that the app uses.
  3. Initialise CFSession with CFEnvironment.PRODUCTION for production orders, or CFEnvironment.SANDBOX for sandbox orders.
  4. Verify that your API credentials, endpoint, and checkout environment are all consistent.
See React Native Integration for the session setup.
To troubleshoot this issue, follow these steps:
  • Run:
    flutter clean
    flutter pub get
  • If issues persist, delete the following directories:
    .gradle/
    .idea/
To integrate the native UPI Intent flow on Android:
  1. Create a Cashfree order from your server to obtain a payment_session_id and order_id.
  2. Initialise the Cashfree Mobile SDK in your app.
  3. Create a CFSession using the payment session ID and order ID.
  4. Configure CFUPIIntentCheckoutPayment.
  5. Call doPayment() to launch the native UPI Intent flow.
  6. Handle the SDK callback and verify the final payment status from your backend.
See Android Integration for full setup details.
No. Cashfree does not currently offer a UPI plugin or SDK for React Native that keeps the customer fully inside your app. The customer must still complete the payment through an external UPI application, such as Google Pay or PhonePe.

Server-Side SDKs

If you use the Cashfree Node.js SDK (cashfree-pg), pass the environment as the CFEnvironment.PRODUCTION enum in the configuration constructor. Do not pass a plain string. A string value can cause the SDK to default to the sandbox host, which returns a 401 authentication error when you use live API keys.
Sample integration kits