#snackdex
1 messages · Page 1 of 1 (latest)
hi! in iOS, or Android, or React Native?
react native
if it helps, for context i'm trying to see if i can get the last 4 on the card that was used and the card type.
you can't, that would need a backend call
the response from the SDK call contains the PaymentIntent object and you can read some fields on it but for example pi.paymentMethod will just be the pm_xxx object ID and not the full object
const openPaymentSheet = async () => {
const {error, paymentOption} = await presentPaymentSheet();
if (error) {
console.log(error);
Alert.alert(`Error code: ${error.code}`, error.message);
} else {
console.log(paymentOption);
Alert.alert('Success', 'Your order is confirmed!');
let pi = await retrievePaymentIntent(paymentIntent); // retrieve the payment intent
console.log(pi);
}
};
ah actually you don't get the PaymentIntent, here I'm just reading it from my state variable and refreshing it after success