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

Android端Stripe测试模式Google支付报错:未识别应用及支付无效

Fixing "Unrecognised App" & "Transaction Declined: Invalid Payment" with Stripe Google Pay Test Mode on Android

Hey there! I’ve run into this exact issue before when setting up Google Pay with Stripe in test mode—let’s walk through the most common fixes to get you up and running.

1. Double-Check Your Test Environment Configuration

First off, make sure you’re not mixing up production and test resources:

  • Use Stripe’s test publishable key: Replace any production pk_live_ keys with your pk_test_ key in your app’s Stripe initialization. You can find this in your Stripe Dashboard under API Keys.
  • Explicitly set test mode for Google Pay: When building your Google Pay parameters, force the test environment so Google knows it’s a sandbox transaction. For example, in Kotlin:
    val googlePayParams = GooglePayPaymentMethodCreateParams.Builder()
        .setAmount(500) // $5.00 in cents
        .setCurrencyCode("USD")
        .setEnvironment(GooglePayPaymentMethodCreateParams.Environment.TEST)
        .build()
    

2. Verify App Signature Fingerprint in Stripe Dashboard

The "unrecognised app" error almost always ties to a mismatch between your app’s debug signature and what’s registered in Stripe:

  • Get your debug SHA-1/SHA-256 fingerprint: Run this command in your terminal (uses the default Android debug keystore):
    keytool -list -v -keystore ~/.android/debug.keystore -alias androiddebugkey -storepass android -keypass android
    
  • Update Stripe’s Google Pay settings: Go to your Stripe Dashboard → Payment Methods → Google Pay. Under "Android apps", add your app’s package name and the fingerprint you just generated. Make sure this matches exactly—even a single character off will cause the error.

3. Ensure You’re Using Valid Test Payment Methods

Even in test mode, Google Pay won’t accept real cards. Instead:

  • When the Google Pay sheet pops up, select the Test Card option (it should appear automatically in test mode if your config is correct).
  • If you don’t see it, make sure your device’s Google Pay app is signed into a test account, or reset the Google Pay app’s cache to refresh the test options.

4. Update Your Stripe Android SDK

Outdated SDK versions can cause compatibility issues with Google Pay’s latest API. Head to your app-level build.gradle and make sure you’re using the latest stable Stripe SDK version:

dependencies {
    implementation 'com.stripe:stripe-android:20.12.0'
}

Quick Troubleshooting Checklist

  • Restart your Android device after updating Stripe settings—sometimes Google Pay caches old app signatures.
  • Make sure your app’s package name in Stripe matches exactly what’s in your AndroidManifest.xml.
  • Test on a physical device if possible—emulators can sometimes have Google Pay compatibility quirks.

Once you’ve worked through these steps, your test Google Pay transactions should go through without the "unrecognised app" or "invalid payment" errors.

内容的提问来源于stack exchange,提问作者Lahari Areti

相关产品推荐
方舟 Agent Plan

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

最近更新时间:2026.05.15 08:00:29