#vis - React Native

1 messages · Page 1 of 1 (latest)

pure badge
#

Can you send me the example you are basing this on?

serene wren
#

@stripe/stripe-react-native

#

Sure just a sec

pure badge
#

Thank you, checking that out

serene wren
#

Ok

pure badge
#

Still trying to figure this out, I am not familiar enough with RN and will reach out to a colleague. When specifically do you get that error from the card form? Do you make a certain call?

serene wren
#

const handlePayPress = async () => {
// 1. fetch Intent Client Secret from backend
const clientSecret = await fetchPaymentIntentClientSecret();

// 2. Gather customer billing information (ex. email)
const billingDetails: PaymentMethodCreateParams.BillingDetails = {
  email: 'email@stripe.com',
  phone: '+48888000888',
  addressCity: 'Houston',
  addressCountry: 'US',
  addressLine1: '1459  Circle Drive',
  addressLine2: 'Texas',
  addressPostalCode: '77063',
}; // mocked data for tests

// 3. Confirm payment with card details
// The rest will be done automatically using webhooks
const { error, paymentIntent } = await confirmPayment(clientSecret, {
  type: 'Card',
  billingDetails,
  setupFutureUsage: saveCard ? 'OffSession' : undefined,
});

if (error) {
  Alert.alert(`Error code: ${error.code}`, error.message);
  console.log('Payment confirmation error', error.message);
} else if (paymentIntent) {
  Alert.alert(
    'Success',
    `The payment was confirmed successfully! currency: ${paymentIntent.currency}`
  );
  console.log('Success from promise', paymentIntent);
}

};

#

On this call

#

This is there in that example

pure badge
#

Gotcha. And this would be on step 2 correct?

serene wren
#

Yup

#

Any idea?

pure badge
#

Not at the moment, still looking. Thank you for clarifying

serene wren
#

Ok

#

Could u pls share to your colleague who has exp in react native if not figured out?

pure badge
#

Yes, just about to reach out.

serene wren
#

Thank you

#

Let me try all these ways

pure badge
#

My colleagues have said it will be best for us to look at this through a ticket. I see you opened one for us, we will grab it and look further through there