private void handlePostAuthReturn() {
        final Uri intentUri = getIntent().getData();
        if (intentUri != null) {
            if ("stripe".equals(intentUri.getScheme()) &&
                    "payment-auth-return".equals(intentUri.getHost())) {
                final String paymentIntentClientSecret =
                        intentUri.getQueryParameter("payment_intent_client_secret");
                if (paymentIntentClientSecret != null) {
                    final Stripe stripe = new Stripe(getApplicationContext(),
                            PaymentConfiguration.getInstance().getPublishableKey());
                    final PaymentIntentParams paymentIntentParams = PaymentIntentParams
                            .createRetrievePaymentIntentParams(paymentIntentClientSecret);
                    mCompositeDisposable.add(Observable
                            .fromCallable(() ->
                                    stripe.retrievePaymentIntentSynchronous(paymentIntentParams,
                                            PaymentConfiguration.getInstance().getPublishableKey()))
                            .subscribeOn(Schedulers.io())
                            .observeOn(AndroidSchedulers.mainThread())
                            .subscribe((paymentIntent -> {
                                if (paymentIntent != null) {
                                    handleRetrievedPaymentIntent(paymentIntent);
                                }
                            }))
                    );
                }
            }
        }
    }
private void handlePostAuthReturn ( ) { final Uri intentUri = getIntent ( ) . getData ( ) ; if ( intentUri != null ) { if ( "stripe" . equals ( intentUri . getScheme ( ) ) && "payment-auth-return" . equals ( intentUri . getHost ( ) ) ) { final String paymentIntentClientSecret = intentUri . getQueryParameter ( "payment_intent_client_secret" ) ; if ( paymentIntentClientSecret != null ) { final Stripe stripe = new Stripe ( getApplicationContext ( ) , PaymentConfiguration . getInstance ( ) . getPublishableKey ( ) ) ; final PaymentIntentParams paymentIntentParams = PaymentIntentParams . createRetrievePaymentIntentParams ( paymentIntentClientSecret ) ; mCompositeDisposable . add ( Observable . fromCallable ( ( ) -> stripe . retrievePaymentIntentSynchronous ( paymentIntentParams , PaymentConfiguration . getInstance ( ) . getPublishableKey ( ) ) ) . subscribeOn ( Schedulers . io ( ) ) . observeOn ( AndroidSchedulers . mainThread ( ) ) . subscribe ( ( paymentIntent -> { if ( paymentIntent != null ) { handleRetrievedPaymentIntent ( paymentIntent ) ; } } ) ) ) ; } } } }
If the intent URI matches the post auth deep-link URI, the user attempted to authenticate
payment and was returned to the app. Retrieve the PaymentIntent and inform the user about
the state of their payment.