我已升级到最新的stripe-android lib:compile 'com.stripe:stripe-android:1.0.3'
这只需要我向Card构造函数添加货币(“USD”):
Card stripeCard = new Card(
cardNumber, month, year, cvc, name,
line1, line2, city, state, zip, "US", "USD"
);
但这会在成功编译后在Android Studio中导致执行错误:
当我降级为:
compile 'com.stripe:stripe-android:1.0.0'
时,执行错误消失这是我的 build.gradle 的一部分:
compileSdkVersion 23
buildToolsVersion "23.0.2"
defaultConfig {
applicationId "com.website.app"
minSdkVersion 15
targetSdkVersion 23
versionCode 20
versionName "1.0"
}
有任何想法吗?
最佳答案
无法将货币作为参数传递给构造函数,但是您可以使用卡的生成器或通过显式设置属性(即
//using the Builder
Card card = new Card.Builder("4242424242424242", 9, 2018, "123").currency("usd").build();
//or set the property once you've created the card
card.setCurrency("usd")
关于android - stripe-android lib 1.0.3升级导致执行错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34844903/