#Ender1776 [syndicate]

1 messages ยท Page 1 of 1 (latest)

hazy ivyBOT
vagrant valve
#

Hello ๐Ÿ‘‹
For it to fail silently is definitely weird.
What guide are you following for the integration?

lime stag
#

https://stripe.com/docs/payments/accept-a-payment?platform=react-native&ui=custom

main app.js
<StripeProvider
publishableKey="pk_test_..."
urlScheme="oururl" // required for 3D Secure and bank redirects
merchantIdentifier="merchant.com.ourcompany" // required for Apple Pay
>

gradle:
implementation(project(':stripe_stripe-react-native')) { exclude module: 'appcompat' }

server response for payment intent:
{"customer": "cus_****", "ephemeralKey": "ek_test_", "paymentIntent": "pi_", "publishableKey": "pk_test_*****"}

RN screen component (fails with and without customFlow):
const { error, paymentOption } = await initPaymentSheet({
merchantDisplayName: 'Sippd',
customerId: customer,
customerEphemeralKeySecret: ephemeralKey,
paymentIntentClientSecret: paymentIntent,
allowsDelayedPaymentMethods: false,
defaultBillingDetails: {
name: 'Test User'
},
googlePay: {
merchantCountryCode: 'US',
testEnv: true // use test environment
},
customFlow: true
});

#

that said, is there a way to do this custom, without the payment sheet, and just use our own page to trigger apple/google pay, and display the card field and our own input for address, etc, and submit through the RN SDK, all the online docs use the default stripe payment sheet

vagrant valve
#

have you tried printing

customer, ephemeralKey, paymentIntent
variables before passing into initPaymentSheet ?

#

also what happens when you print error variable?

lime stag
#

yes, i posted it above, but just removed all the extra characters, but I get back values just fine, and they are the values being passed.
server response for payment intent:
{"customer": "cus", "ephemeralKey": "ektest*", "paymentIntent": "pi_", "publishableKey": "pktest"}

#

I don't get an error. I do have a log stmt after initPaymentSheet, but it crashes on initPaymentSheet, so it never gets there

#

and yeah, I've seen the docs for setting up apple and google pay, but thats not really what I'm asking, the docs for RN all assume you are going to use the presentPaymentSheet option, but we'd rather use our own UI for collecting information

verbal spoke
#

๐Ÿ‘‹ If you wrap your call to initPaymentSheet in a try...catch block are you able to catch the exception?

lime stag
#

nope, the app is setup with a Sentry error boundary, so it should be catching that stuff, but wrapped a try catch around it just incase to check this and still no error, just crashes to android home

verbal spoke
#

It's really strange that there's no error or detail of any kind. I'm not that familiar with Android; is there some kind of system log you can check for clues?

#

Is this on an actual device or an emulator?

lime stag
#

emulator, still in early dev on this feature

verbal spoke
#

Maybe try spinning up a brand new emulator and see if the results are different? No error of any kind usually means something pretty low-level is not working correctly.

lime stag
#

if I was going the custom route, would I still need initPaymentSheet, or is there a way to do this without, and just using confirmPayment at the end, with my payment intent

verbal spoke
#

What version of our React Native SDK are you using?

lime stag
#

"@stripe/stripe-react-native": "^0.21.0",

verbal spoke
#

Ah, okay, that's pretty recent, so unlikely to be the issue.

#

However, one other thing to check for the PaymentSheet: what payment_method_types are you setting on the Payment Intent?

lime stag
#

const paymentIntent = await stripe.paymentIntents.create({
amount: amount,
currency: 'usd',
customer: customer.id,
automatic_payment_methods: {
enabled: true,
},
}

#

thanks for the tip on 22.0

verbal spoke
#

Can you try without automatic_payment_methods and see if it makes any difference?

#

I'm wondering if it might be getting tripped up because you have a payment method enabled which isn't compatible with React Native.

lime stag
#

nope, same result, will try v22 with cardfield instead of using payment sheet

verbal spoke
#

Okay. Just out of curiosity, does it crash the same way on iOS?