#incaelum

1 messages ยท Page 1 of 1 (latest)

steel tokenBOT
#

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.

minor sparrow
#

Hi, let me help you with this.

#

What "second fetch" exactly?

scenic beacon
#

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

minor sparrow
#

Could you please share your code?

scenic beacon
#

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

minor sparrow
#

So, initPaymentSheet is not called?

scenic beacon
#

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

minor sparrow
#

Can you add logs around the call to see what's happening?

scenic beacon
#

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'

#

but becos i need to check if the product is still avaliable afer user inputs credit card info i need customFlow true

minor sparrow
scenic beacon
#

ok let me use your code

#

done

#

buttons keep loading forever

#

it is happening in android emulator and in my phone too

minor sparrow
#

Could you please share a screen recording?

scenic beacon
#

what you mean?

minor sparrow
#

I just want to understand what behavior you're observing.

scenic beacon
#

a screenshot of my app you mean?

minor sparrow
#

Yes

scenic beacon
#

this is with my old implementation works fine:

steel tokenBOT
scenic beacon
#

and this is with your code:

drifting bramble
#

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?

scenic beacon
#

well let me explain

#

i made a markeplace app, users can offer their products customers can buy them

#

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

#

and i have no error outputs in my console

drifting bramble
#

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.

scenic beacon
#

ok let me some time to understad what is happening ill be back to you

scenic beacon
#

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

#

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.price
100*10/100), # app collect
transfer_data={
'destination': owner.profile.vendor_stripe_id,# target destination
},

  )

the point is how to save paymentmethod

drifting bramble
scenic beacon
#

it is handeled by my backend?