stripe / stripe-terminal-android

Stripe Terminal Android SDK
Other
79 stars 43 forks source link

Android Tap to Pay screen stuck in "Done" state #447

Open akarimcheese opened 1 month ago

akarimcheese commented 1 month ago

Summary

Using Tap to Pay with a test mode Stripe account and physical Stripe Terminal test card. The Tap to Pay target area turns green, along with the background, however the target area then reverts and the entire screen is then stuck appearing as the image attached below

Code to reproduce

Cordova plugin

     public void connectToLocalReader(String locationId, String connectedAccountId, final CallbackContext callbackContext) {
      LocalMobileConnectionConfiguration config = new LocalMobileConnectionConfiguration(locationId);
      Terminal.getInstance().connectLocalMobileReader(localMobileReader, config, new ReaderCallback() {
        @Override
        public void onSuccess(Reader r) {
          callbackContext.sendPluginResult(new PluginResult(PluginResult.Status.OK));
        }

        @Override
        public void onFailure(@NonNull TerminalException e) {
          logger.e("Error in StripeTerminal connectLocalMobileReader", e);
          callbackContext.sendPluginResult(new PluginResult(PluginResult.Status.ERROR));
        }
      });
    }

    private void collectPaymentMethod(String intentSecret, final CallbackContext callbackContext) {
      Terminal.getInstance().retrievePaymentIntent(intentSecret,
        new PaymentIntentCallback() {
          @Override
          public void onSuccess(PaymentIntent paymentIntent) {
            Cancelable cancelable = Terminal.getInstance().collectPaymentMethod(paymentIntent,
              new PaymentIntentCallback() {
                @Override
                public void onSuccess(PaymentIntent paymentIntent) {
                  callbackContext.sendPluginResult(new PluginResult(PluginResult.Status.OK, paymentIntent.getId()));
                }

                @Override
                public void onFailure(TerminalException exception) {
                  logger.e("Error in StripeTerminal collectPaymentMethod", exception);
                  callbackContext.sendPluginResult(new PluginResult(PluginResult.Status.ERROR));
                }
              },
              new CollectConfiguration.Builder().build()
            );
          }

          @Override
          public void onFailure(TerminalException exception) {
            logger.e("Error in StripeTerminal retrievePaymentIntent", exception);
            callbackContext.sendPluginResult(new PluginResult(PluginResult.Status.ERROR));
          }
        }
      );
    }

Android version

11

Impacted devices (Android devices or readers)

Galaxy A12 Tap to Pay

SDK version

3.2.1

Other information

Screenshot_20240329-144922_Found

billfinn-stripe commented 1 month ago

Hi @akarimcheese -- we are not able to reproduce this issue. Can you confirm that it reproduces every time you make a tap-to-pay payment, and can you try with the latest release (3.5.0)?

I don't think there would be any problems running using Cordova.