gpt4 book ai didi

android - 在 Android 上从 Stripe 获取卡片 token

转载 作者:行者123 更新时间:2023-12-05 00:00:03 24 4
gpt4 key购买 nike

我正在使用 https://stripe.com/docs/mobile/android/standard 中的指令集在我的 Android/Kotlin 应用程序中,在最后的 onPaymentSessionDataChanged() 回调中,我得到一个 PaymentMethod,其 ID 以 pm_ 开头。但我想要的是一个以 card_ 开头的卡 token ID,这是我的服务器继续付款所需要的。

有没有办法将其翻译成卡片 token ,或者我应该使用不同的方法?

如果有帮助,我可以在这里放一些代码。

谢谢。

最佳答案

给你:

Token token = null;

final Card card = new Card(cardNumber, month, year, cvc);

final Stripe stripe = new Stripe(getApplicationContext());
try {

token = stripe.createTokenSynchronous(card, "YOUR-API-KEY");

} catch (StripeException stripeEx) {

errorMessage = stripeEx.getLocalizedMessage();
}

关于android - 在 Android 上从 Stripe 获取卡片 token ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/56641408/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com