#laulhus
1 messages · Page 1 of 1 (latest)
Hi, let me help you with this.
Hi, thank you!
Could you please share relevant code snippets for both cases?
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]);```
Are you sure the await collectSetupIntentPaymentMethod() doesn't throw an error?
Are you getting the paymentIntent variable?
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
Yeah, that's a limitation right now.
Is there a way to save cards for future use with tap to pay on Android different than this?
or some kind of workaround?
I don't think there is at the moment.
Okay thank you so much for your help!
Happy to help.
Have a good one
You too.