stripe-android icon indicating copy to clipboard operation
stripe-android copied to clipboard

[BUG] `Stripe.handleNextActionForPayment()` does not use `PaymentAuthConfig`

Open romainpiel opened this issue 2 years ago • 2 comments

Summary

I am setting a custom config for the 3DS screen just before I create my Stripe object:

        PaymentAuthConfig.init(
            PaymentAuthConfig.Builder()
                .set3ds2Config(
                    PaymentAuthConfig.Stripe3ds2Config.Builder()
                        .setTimeout(5)
                        .setUiCustomization(
                            PaymentAuthConfig.Stripe3ds2UiCustomization.Builder()
                                .setAccentColor("#FF6900")
                                .setToolbarCustomization(
                                    PaymentAuthConfig.Stripe3ds2ToolbarCustomization.Builder()
                                        .setBackgroundColor("#FFFFFF")
                                        .setStatusBarColor("#FFFFFF")
                                        .setTextColor("#000000")
                                        .build()
                                )
                                .build()
                        )
                        .build()
                )
                .build()
        )

However when I call Stripe.handleNextActionForPayment() and get redirected to a 3DS screen (in my case represented by a PaymentAuthWebViewActivity), the settings I set are not picked up. Debugging PaymentAuthWebViewActivity and its view model, I notice that we use the args passed to the view model: https://github.com/stripe/stripe-android/blob/0daa971e23330066ad710cdfef68aa4be34efe0c/payments-core/src/main/java/com/stripe/android/view/PaymentAuthWebViewActivityViewModel.kt#L23

The instantiation: https://github.com/stripe/stripe-android/blob/0daa971e23330066ad710cdfef68aa4be34efe0c/payments-core/src/main/java/com/stripe/android/payments/core/authentication/WebIntentAuthenticator.kt#L102-L130

Doesn't pass any of my customisation. Is that expected?

Android version

Android 12

Impacted devices

Pixel 3a (emulator)

Installation method

gradle

Dependency Versions

kotlin: 1.6.21 stripe-android: 20.5.0 Android Gradle Plugin: 7.1.2 Gradle: 7.4

SDK classes

PaymentAuthWebViewActivity and view model WebIntentAuthenticator

romainpiel avatar Jun 16 '22 13:06 romainpiel

Hi @romainpiel, thanks for filing the issue! Those customization parameters are applied to the 3DS2 native version. If your authentication flow is using PaymentAuthWebViewActivity that means you're going through a web version of 3DS. In that case we load a URL provided by the issuer, so not all of those customization parameters can be used. Our backend decides whether to use the native or web version. That said, the web version should still reflect the customization parameters where possible, like on the status bar and toolbar, and from my tests it looks like they're not being set. We'll look into fixing this.

brnunes-stripe avatar Jun 22 '22 20:06 brnunes-stripe

Hi @romainpiel just wanted to give you an update on this issue. We still aren't sure when we will be able to add this feature, but it is on the roadmap!

jameswoo-stripe avatar Nov 15 '22 12:11 jameswoo-stripe