Error code: unexpected when saving card

I’m using the latest flutter sdk 1.7.10 and have been able to successfully load the credit card entry form using

await InAppPayments.startCardEntryFlow( // ✅ Dismiss the keyboard before opening Square’s UI
  collectPostalCode:
      true, // ✅ Collect postal code for better fraud prevention
  onCardNonceRequestSuccess: _onCardEntryCardNonceRequestSuccess,
  onCardEntryCancel: _onCancelCardEntryFlow,
);

However when I click Save and error returns

“Something went wrong. Please contact the developer of this application and provide them with this error code: unexpected”

I have setup the proper application ID using my sandbox and also the location ID provided. I sent a debug trace and there is nothing I could see since it is using an embedded framework.

There seems to be several people over a few years complaining about this issue and often without a reply.

This happens with a valid credit card every single time. All certificates have been loaded and this happens with or without loading Apple Pay and without buyer verification. Is this a known issue or what can I do to fix? I have already browsed all recommendations and am about to move onto a competitor platform because this seems to be very brittle.

Downgrading or upgrading has made no difference. This occurs on real devices both through xcode debugger and on testflight.

There are no API logs in the dashboard as I’m trying to get the nonce directly. When I log before the call it works but I never get a log on success. When I cancel the form I do receive a log. So this is an internal bug with the creditcard entry form that I am unable to resolve.

:wave: 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

In-App Payments SDK Quickstart
Download, Configure, and Run the Client Sample
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.

What’s your application ID and could you further explain what you mean by:

When I log before the call it works but I never get a log on success. When I cancel the form I do receive a log.

:slight_smile:

app id: sandbox-sq0idb-ldcfRSAhmhXw5moGi9XM_g

I have print or console logs during all steps of the code. So I can confirm the widget is triggering and the cancel is triggering properly by seeing logs however nothing is triggered after onCardNonceRequestSuccess

Is the card input screen being shown to the customer?

Yes here is a picture

Then nothing happens when you use our test value 4111 1111 1111 1111? :slight_smile: