#incaelum
1 messages ยท Page 1 of 1 (latest)
Hello! We'll be with you shortly. Below are links to other discussions we've had with you in the past week in case you want to review that information. If your question is related to one of these previous discussions, please provide a comprehensive summary of the current state and what you need help with now. We help many users simultaneously, so a summary allows us to resolve your issue as soon as possible.
- incaelum-reactnative-deferredintent, 14 hours ago, 70 messages
- incaelum-typo-docs, 21 hours ago, 10 messages
- incaelum, 1 day ago, 15 messages
hi
as u see this code has to fetch to my backend firts to retrieve customer id and second to get client_secret , but buttons keeps in loading state true for ever, and i can only see a call into my backend, the call to retrieve customer
also in my expo console no output of any error
Could you please share your code?
sure
i modified to use jsx instead of tsx from original
the only thing i see in my expo server console is console.log("customer", customer);
customer cus_PDy17FgkKvSuyo
hint:
when i follow this instructions in this doc it works perfect:
https://stripe.com/docs/connect/collect-then-transfer-guide
So, initPaymentSheet is not called?
i think it is called but somewhere is crashing with no output error
i just copied your code but i changed your endpoint to mines
Can you add logs around the call to see what's happening?
ok i added at start:
const initialisePaymentSheet = async () => {
console.log("start");
setLoading(true);
and in the end :
if (!error) {
console.log("paymentsheet enabled");
setPaymentSheetEnabled(true);
} else {
Alert.alert(Error code: ${error.code}, error.message);
}
if (paymentOption) {
console.log("payment options");
setPaymentMethodOption(paymentOption);
}
} catch (error) {
console.log("error", error);
} finally {
console.log("finally");
setLoading(false);
}
expo console only shows 'start'
is is strange cuz if i follow this other doc it works fine:
https://stripe.com/docs/connect/collect-then-transfer-guide
but becos i need to check if the product is still avaliable afer user inputs credit card info i need customFlow true
Have you looked at this example? https://github.com/stripe/stripe-react-native/blob/master/example/src/screens/PaymentsUICustomScreen.tsx
ok let me use your code
done
buttons keep loading forever
it is happening in android emulator and in my phone too
Could you please share a screen recording?
what you mean?
I just want to understand what behavior you're observing.
a screenshot of my app you mean?
Yes
this is with my old implementation works fine:
and this is with your code:
Hi there ๐ jumping in as my teammate needs to step away soon. Let me start by saying I'm not too familiar with React Native, but I'm happy to try to help dig into this. The screenshots help me understand what is happening, but doesn't give me much insight into why.
With the additional logging you've added, have you been able to figure out exactly which line in your app is causing the hang?
well let me explain
i made a markeplace app, users can offer their products customers can buy them
i followed this instructions in the first place:
https://stripe.com/docs/connect/collect-then-transfer-guide
i works perfectly fine users can pay for products
the problem here is i need to check if product is still avaliable in DB after user inputs all card numbers
so i can not use that impolementation
so i choose to go for customflow:true implementation
following this doc:
https://stripe.com/docs/payments/accept-a-payment-deferred?platform=react-native&type=setup&integration=paymentsheet-flowcontroller
and now your teammate give to me this code:
https://github.com/stripe/stripe-react-native/blob/master/example/src/screens/PaymentsUICustomScreen.tsx
and when i initialisePaymentSheet it hangs forever in loading = true
and i have no error outputs in my console
Alright, so it's initialisePaymentSheet that is hanging. It's really hard to get any sense of what could possibly be going wrong without an error.
ok let me some time to understad what is happening ill be back to you
ok!!!
i think it is working
changed my backend to properly returns the stuff your code needs and it is working!!
but one thing , i dont know how to save the credit card for future purchasing
this code is now working:
and i have this on my backend:
paymentIntent = stripe.PaymentIntent.create(
amount=int(offer.price100),
currency='eur',
customer=customer,
# In the latest version of the API, specifying the automatic_payment_methods parameter is optional because Stripe enables its functionality by default.
automatic_payment_methods={
'enabled': True,
},
application_fee_amount=int(offer.price100*10/100), # app collect
transfer_data={
'destination': owner.profile.vendor_stripe_id,# target destination
},
)
the point is how to save paymentmethod
I believe the key thing to change there, is that when you're creating the Payment Intent you'll want to set setup_future_usage to align with how you intend to use the Payment Method in the future:
https://stripe.com/docs/api/payment_intents/create#create_payment_intent-setup_future_usage
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
it is handeled by my backend?