#laulhus

1 messages · Page 1 of 1 (latest)

verbal sandBOT
rapid pollen
#

Hi, let me help you with this.

rocky plaza
#

Hi, thank you!

rapid pollen
#

Could you please share relevant code snippets for both cases?

rocky plaza
#

sure, just a second

#

I call this function from a button:

    const {error, setupIntent} = await createSetupIntent({
      customerId: 'cus_P6pu3iQFMVqQPa',
    });

    if (error) {
      Alert.alert(error.code, error.message);
    }
    if (setupIntent) {
      setSetupIntent(setupIntent);
    }
  };```

And then this useEffect fires up:
```useEffect(() => {
    const startCollectPaymentMethod = async () => {
      if (setupIntent) {
        const {setupIntent: paymentIntent, error} =
          await collectSetupIntentPaymentMethod({
            setupIntentId: setupIntent?.id,
            customerConsentCollected: true,
          });
        if (error) {
          Alert.alert('Error', error.message);
        }
        Alert.alert('Method', paymentIntent?.status);
      }
    };
    startCollectPaymentMethod();
  }, [collectSetupIntentPaymentMethod, confirmSetupIntent, setupIntent]);```
rapid pollen
#

Are you sure the await collectSetupIntentPaymentMethod() doesn't throw an error?

#

Are you getting the paymentIntent variable?

rocky plaza
#

let me double check again

#

okay, seems one Alert was covering another one, I just go an error message with Setup intents are not available with Tap to Pay on Android

#

my bad

rapid pollen
#

Yeah, that's a limitation right now.

rocky plaza
#

Is there a way to save cards for future use with tap to pay on Android different than this?

#

or some kind of workaround?

rapid pollen
#

I don't think there is at the moment.

rocky plaza
#

Okay thank you so much for your help!

rapid pollen
#

Happy to help.

rocky plaza
#

Have a good one

rapid pollen
#

You too.