#snackdex

1 messages · Page 1 of 1 (latest)

hollow sequoiaBOT
tight karma
#

hi! in iOS, or Android, or React Native?

coral zealot
#

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.

tight karma
#

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

coral zealot
#

ah ok

#

i should be able to use the one that gets created right?
i believe the payment intent is needed to open the payment sheet 👀
so on success i can just use that?