You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Android端UPI支付Intent调用始终失败,求解决方案

安卓UPI钱包充值支付失败问题求助

我们的Android应用中,用户需要通过UPI为钱包充值。已成功通过Intent唤起UPI应用,但用户输入UPI PIN后,支付失败(附失败截图)。

已采取的步骤

  • 创建自有商户账号并获取Merchant ID。
  • 尝试多种方案解决该问题。
  • 我方商户UPI ID在UPI应用内直接支付正常,但通过应用发起则失败。

使用的代码

fun buildUPIIntent(amount: String): Intent {
    val transactionId = "xxxx${System.currentTimeMillis()}"
    val businessUPI = "xxxx@xxxx"
    val merchantID = "xxxxxxx"

    val upiUri = Uri.Builder()
        .scheme("upi")
        .authority("pay")
        .appendQueryParameter("pa", businessUPI)  // Payee UPI ID
        .appendQueryParameter("pn", "xxxx")       // Payee name
        .appendQueryParameter("mc", merchantID)   // Merchant category code (optional)
        .appendQueryParameter("tr", transactionId) // Unique transaction ID
        .appendQueryParameter("tn", "Add money to your account") // Transaction note
        .appendQueryParameter("am", amount)        // Amount
        .appendQueryParameter("cu", "INR")         // Currency
        .build()

    return Intent(Intent.ACTION_VIEW).apply {
        data = upiUri
    }.let { paymentIntent ->
        Intent.createChooser(paymentIntent, "Pay using")
    }
}

补充说明

  • Android社区内众多开发者也遇到类似问题。
  • 商户UPI ID已验证,直接支付正常但通过应用发起则失败。

相关问题参考

  • Android UPI Payment Intent Always Fails
  • Adding UPI Payment to Android App
  • UPI App Deep Linking Issues

参考库示例

  • GitHub - UPI Payment URI Builder

请问有开发者遇到过该问题或找到解决方案吗?恳请提供帮助!🚀

截图

  • 支付发起界面:Payment initiated
  • 失败提示:Payment is failing
  • enter image description here

内容的提问来源于stack exchange,提问作者Chandra Sekhar Bala

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.06.14 04:35:54