Flutter - SCA - Not working with Visa cards on Android

Hi,

I am having an issue with the Flutter `square_in_app_payments` package.

I have recently upgraded to Flutter 3.35.4 and have upgraded the square_in_app_payments to 1.7.11.

I have implemented the `startCardEntryFlowWithBuyerVerification` flow in my app. When I try to verify a Visa debit card on Android I am getting the following error:

“unexpected_buyer_verification_failure“

Please note that I have also tested by creating a release build and uploading to the Play Store so my app has the same bundleId and SHA256 keys as I have set up in the Square console.

On iOS it seems to be working fine and when I verify a Mastercard it also works.

Here are my Android dependencies:

dependencies {
    implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
    implementation 'androidx.browser:browser:1.3.0'

    implementation 'com.google.android.gms:play-services-wallet:19.1.0'

    def sqipVersion = '1.6.7'
    implementation "com.squareup.sdk.in-app-payments:card-entry:$sqipVersion"
    implementation "com.squareup.sdk.in-app-payments:google-pay:$sqipVersion"
    implementation "com.squareup.sdk.in-app-payments:buyer-verification:$sqipVersion"
}

Any help would be appreciated!

:waving_hand: I’m Square Dev AI, here to help answer your question!
Based on the information you’ve provided, the following documentation will help answer your question:

Additional Documentation

Build on Android
Flutter Plugin
Flutter Plugin: In-App Payments SDK

If this documentation helped you find a solution, please check the box indicating that this reply solves the problem.
Otherwise one of our Developer Advocates will provide additional assistance shortly.

Are other cards working as expected? :slight_smile:

Yes I am able to verify Mastercards just fine. It seems to only happen with Visa cards

I have done some more testing and when I run my app in release mode I am seeing this error in the console when I run the `InAppPayments.startCardEntryFlowWithBuyerVerification` function:

onBuyerVerificationFailure: SdkRuntimeException - No configuration was found for DS ID [A000000003]. Please provide configuration for this DS. Error code: [1032]

Do you know what this error means?

When you updated did you also update all the dependencies? :slight_smile:

Yes I did, here are my version numbers:

Flutter: 3.35.4

square_in_app_payments: 1.7.11

Kotlin version: 2.1.0

And here are my dependencies in my android/app/build.gradle file:

dependencies {
    implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
    implementation 'androidx.browser:browser:1.3.0'

    implementation 'com.google.android.gms:play-services-wallet:19.1.0'

    def sqipVersion = '1.6.7'
    implementation "com.squareup.sdk.in-app-payments:card-entry:$sqipVersion"
    implementation "com.squareup.sdk.in-app-payments:google-pay:$sqipVersion"
    implementation "com.squareup.sdk.in-app-payments:buyer-verification:$sqipVersion"
}

As far as I know the latest square dependency version is 1.6.7. Is this correct?

This error is only occuring for me when I am testing on a production Square account by the way. Is there any additional setup I need to do in the Square Console to ensure that my Square app can verify cards?

What Android version are you targeting? :slight_smile:

I am building on Android targeting these SDK versions:

minSdkVersion 28
targetSdkVersion 36
compileSdkVersion 36
Java 21

The SDK doesn’t currently support targeting 36. Currently is supports targeting 31. If you change the version to 31 does it work as expected? :slight_smile:

I cannot downgrade to target sdk 31 at the moment because I have recently upgrade to Flutter 3.35.4.

I am waiting on a fix mentioned in this github issue at the moment: Android - Square / 3DS Package does not support 16KB page size · Issue #271 · square/in-app-payments-flutter-plugin · GitHub

I am hoping that once this github issue is resolved it will also resolve my issue.

The team just launched 1.6.8 of In-App Payments SDK that supports targeting API 35. :slight_smile:

Hi, I just want to report that after updating the square_in_app_payments package to 1.7.12 this issue has been fixed for me!

I also bumped the Play Service wallet dependency in my app/build.gradle to:

implementation ‘com.google.android.gms:play-services-wallet:19.5.0’

Thanks for your help!

Are you receiving any client side errors with verifyBuyer? :slight_smile:

No, I am no longer getting these errors :smiley: