#ankit-react

1 messages · Page 1 of 1 (latest)

analog drift
#

Hi there, how can I help?

#

Is there an error message that I can take a look?

olive elm
#

My application is in the react js and node js

#

while i am creating a react build and test strip its working fine

#

but if i will create a react build with the node js it not working on the server

#

But its working on local system

analog drift
#

Can you tell me exactly what's not working?

olive elm
#

so do i need to add any setting on server level

#

my concern is that, stripe is not working with the node build on the server, while it is working fine in my local system.

#

i have used the cardNumberElement, CardExpiryElement, CardCvcElement seperately, i am getting an object response from the CardNumberElement in my local system. but problem is about to the server. i am getting null reposne on the remote server. is there anything wrong on the server?

#

OR is there am i missing on the server?

analog drift
#

Do you have a public URL to access the server?

olive elm
#

Yes

analog drift
#

OK, can you send me the URL and tell me how to reproduce the problem

olive elm
#

click on the cart icon top right and click on the proceed to checkout

#

continue the steps until PAYMENT step

#

there is one radio button for the Pay by card(stripe)

analog drift
#

OK, I pressed Place order and nothing happened

olive elm
#

enter the test card details
41111 1111 1111 1111
12/24
123

olive elm
analog drift
#

Yes I have console opened.

olive elm
#

i have console with the key "cardElement-2"

#

click on the place order button and check the console

analog drift
#

cardElement-2 null

olive elm
analog drift
#

Can you check if this <CardNumberElement> is wrapped inside an <Elements> ?

olive elm
#

And in local system i ma getting this :

olive elm
#

Do i need to add any setting on server side ?

#

Also i have tried with only react build and also its working

analog drift
#

Why are you calling stripe.createPaymentMethod in useEffect?

olive elm
#

But while i am creating build with node its not working

analog drift
#

shouldn't you call it in handleSumbit?

olive elm
analog drift
#

I don't really understand they purpose of calling stripe.createPaymentMethod in useEffect() block. There's no way you can create a payment method here because the customer hasn't even enter the card details.

olive elm
#

But this method is working on the local system.

#

My only concern is its not working on the server end.

analog drift
#

To my best knowledge there's no way to create a card payment method without card details.

olive elm
#

We are passing card details in create payment method

analog drift
#

How do you pass? can you share the code?

olive elm
analog drift
#

How do you pass the card number?

olive elm
#

we are passing the card number element

analog drift
#

You need card number, expiry date and cvc in order to create a card payment method object.

#

we are passing the card number element -> But the card number element doesn't allow you to pre-populate the card number.

#

Perhaps you can share with me the PaymentMethod ID that you created from the local system?

olive elm
#

ID : stripe_payment

#

Can we connect over the call ?

#

So i can explain you in details if possible

desert canopy
#

Hi! I'm taking over Jack Tan.

olive elm
#

Hello Soma.

desert canopy
#

ID : stripe_payment
the payment method ID should look like this: pm_xxx
Can we connect over the call ?
Sorry but we only do written chat here on Discord

olive elm
#

pm_xxx, this is what we are getting from the createPaymentMethod response

desert canopy
#

Can you copy paste the exact ID you are getting?

olive elm
#

pm_1L51jVAflprgPQpUNYpFhCPA

desert canopy
#

Yes, can you copy paste that ID in the screenshot?

olive elm
#

pm_1L51jVAflprgPQpUNYpFhCPA

desert canopy
#

Thanks! It looks like this card was created successfully.

#

Can you clarify exactly what is your issue?

olive elm
#

soma Its working exactly what i need in local system

#

But while i am moving same on server its not working

#

So do i need to add any thing for server to work in server as well ?

desert canopy
#

Got it! I would recommend to ask that question to Stripe support directly, they will have more time to investigate this. Make sure to include all relevance information, like code snippet, PaymentIntent ID, etc.
https://support.stripe.com/?contact=true