Flutter SCA Not Working

I’ve just added the in-app-payments-sdk to my flutter app and although the UI is working, only the startCardEntryFlow methods work. I get the generic error ‘something went wrong’ when I try to perform any buyer verification steps. I have used the code in the examples from github but this still doesn’t work.

We’re going to providing this within the UK and EU so SCA is cricital.

    var money = Money((b) => b
      ..amount = 100
      ..currencyCode = 'USD');

    var contact = Contact((b) => b
      ..givenName = "John"
      ..familyName = "Doe"
      ..addressLines =
          new BuiltList<String>(["London Eye", "Riverside Walk"]).toBuilder()
      ..city = "London"
      ..countryCode = "GB"
      ..email = "[email protected]"
      ..phone = "8001234567"
      ..postalCode = "SE1 7");

    await InAppPayments.startCardEntryFlowWithBuyerVerification(
        onBuyerVerificationSuccess: _onBuyerVerificationSuccess,
        onBuyerVerificationFailure: _onBuyerVerificationFailure,
        onCardEntryCancel: _onCancelCardEntryFlow,
        buyerAction: "Store",
        money: money,
        squareLocationId: squareLocationId,
        contact: contact,
        collectPostalCode: true);

This is the code used from the example. I don’t actually want to take a payment, so I’d initially tried setting the money amounnt to 0. I thought this may have been causing the issue but it doesn’t seem to matter what I put in here.

If someone could help me out here I’d be very appreciative!

Thanks,
Peter

Are there an additional error messages from your server logs? :slightly_smiling_face:

Turns out I’m an idiot. The location ID isn’t just a country code or arbirtrary value, it’s a value provided in the sandbox/production environments… This was what was going wrong. I put the correct one in and it works as expected! RTFM.

Thanks Bryan, have a good weekend!

Glad you figured it out. This literally made my day "RTFM "! Love the honesty! Happens to me all the time as well. :joy: