stripe / stripe-android

Stripe Android SDK
https://stripe.com/docs/mobile/android
MIT License
1.28k stars 644 forks source link

[BUG] UnionPay fail #4509

Closed 22106331 closed 2 years ago

22106331 commented 2 years ago

Summary

I paid with UnionPay card, the payment was successful, but the sdk callback gave the wrong result.

Code to reproduce

paymentLauncher = PaymentLauncher.Companion.create( activity, paymentConfiguration.publishableKey, paymentConfiguration.stripeAccountId, ::onPaymentResult ) private fun onPaymentResult(paymentResult: PaymentResult) { when (paymentResult) { is PaymentResult.Completed -> { delegate?.stopLoading() delegate?.paymentDidSuccess(com.fysl.user.entity.PaymentMethod.Card.value) } is PaymentResult.Canceled -> { delegate?.stopLoading() delegate?.paymentDidFail(AnyReadableException("payment canceled")) LogUtils.d(tag, "onPaymentResult result:Canceled") } is PaymentResult.Failed -> { delegate?.stopLoading() delegate?.paymentDidFail(paymentResult.throwable) LogUtils.d(tag, "onPaymentResult result:fail:${paymentResult.throwable.message}") // See here: https://stripe.com/docs/api/payment_intents/object#payment_intent_object-last_payment_error-message } } }

Android version

all

Impacted devices

all

Installation method

Through a gradle dependency

Dependency Versions

18.2.0

kotlin: ext.kotlin_version = '1.4.21' stripe-android: 18.2.0 Android Gradle Plugin: com.android.tools.build:gradle:4.1.2 Gradle: 6.5

SDK classes

Video

https://user-images.githubusercontent.com/6029511/149611693-28eba9fe-7348-45b5-82e9-be75297a02b4.mp4

strip_error

Other information

brnunes-stripe commented 2 years ago

Hi @22106331, thanks for raising the issue! Can you consistently reproduce this? Does it happen in test or live mode? Can you provide the stack trace for the exception? It'll help us understand where the exception is coming from.

22106331 commented 2 years ago

Hi @22106331, thanks for raising the issue! Can you consistently reproduce this? Does it happen in test or live mode? Can you provide the stack trace for the exception? It'll help us understand where the exception is coming from.

It happened in live mode. I use under api can solve the problem.

val confirmParams = ConfirmPaymentIntentParams.createWithPaymentMethodId(paymentMethodId, clientSecret) stripe.confirmPayment(activity, confirmParams) stripe.onPaymentResult(requestCode, data, object : ApiResultCallback {})

skyler-stripe commented 2 years ago

hey there @22106331

Do you have any more details on the APIException you're getting? You're saying using the Stripe.kt methods work for you but payment launcher does not?

skyler-stripe commented 2 years ago

Hey there. If this continues to be an issue for you feel free to reopen and we can continue our investigation.