#gopi_67606

1 messages · Page 1 of 1 (latest)

river stoneBOT
#

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.

ebon sequoia
#

stripe.confirmCardPayment(clientSecret, {
payment_method: {
card: elements.getElement(CardElement)
}
});

#

This is not working for me in the front end

#

why?

finite plume
#

How can I help?

ebon sequoia
#

I am not getting any response after hitting that function

finite plume
#

What do you mean by 'not working'? Are there any errors? What happens when that code is called?

ebon sequoia
#

No error & no result are getting

#

I am trying to create the suvscription .

finite plume
#

I suspect there will be errors in your browser console if you're hitting the confirmCardPayment function but nothing is happening. Can you share the code that calls that function?

ebon sequoia
#

For that I am creating the customer & after that I am creating the subscription & after that I am creating the payment Method uding payment Intent Id in the subscription

#

But my subscription is in incomplete

#

const { paymentIntent, error } = await stripe.confirmCardPayment(response.data.subscription.latest_invoice.payment_intent.client_secret, {
payment_method: {
card: CardElement,
billing_details: {
name: response.data.subscription.customer_name,
},
},
})

#

const { paymentIntent, error } = await stripe.confirmCardPayment(clientSecret, {
payment_method: {
card: CardElement,
billing_details: {
name: response.data.subscription.customer_name,
},
},
})

finite plume
#

I meant the code which calls that function. It's normally triggered by an event like a button click

ebon sequoia
#

sub_1OAWPPD6fLV2vwHg0GvzUiQQ IS this subscription will get success after some time?

ebon sequoia
#

Hlo there?

finite plume
#

I am here yes, please be patient

finite plume
ebon sequoia
#

const { paymentIntent, error } = await stripe.confirmCardPayment(response.data.subscription.latest_invoice.payment_intent.client_secret, {
payment_method: {
card: CardElement,
billing_details: {
name: response.data.subscription.customer_name,
},
},
})

#

The above one is the code

finite plume
#

You need to add some logging to your code to understand why it isn't being triggered. Without an error I can't really help you

ebon sequoia
#

That function is triggering but no result

#

confirmCardPayment this function is there in stripe?

finite plume
#

What do you mean 'no result'? Can you share the ID of the Subscription or Payment Intent?

ebon sequoia
#

pi_3OATxSD6fLV2vwHg12Kp7RYJ

#

Payment Intent

finite plume
ebon sequoia
#

Can I know why the subscription sub_1OAWixD6fLV2vwHg0drOpLy2 is incomplete?

finite plume
ebon sequoia
#

const subscription = await stripe.subscriptions.create({
customer: customer.id,
items: [{
price: planId == 3 ? environment.priceId : environment.pId, // Replace with your product's price ID
}],
payment_behavior: 'default_incomplete',
payment_settings: { save_default_payment_method: 'on_subscription' },
expand: ['latest_invoice.payment_intent'],
});

finite plume
ebon sequoia
#

I am creating subscription like above one is that correct?

finite plume
#

Looks fine to me, that's not the issue here. The issue is in your front-end code where you're receiving the client_secret from your backend and passing it to confirmCardPayment. Can you share your full code where your front-end calls your backend to initialise the Subscription creation?

ebon sequoia
finite plume
#

Ok, and what's the confirmCardPayment code look like?

ebon sequoia
#

const { paymentIntent, error } = await stripe.confirmCardPayment({clientSecret}, {
payment_method: {
card: CardElement,
billing_details: {
name: response.data.subscription.customer_name,
},
},
})

#

This is how it looks like

#

pi_3OAWzaD6fLV2vwHg0tRxmAAa This is the payment Intent Id for the above error

finite plume
#

Ok, and what is your CardElement variable?

ebon sequoia
#

One minute

#

"card": {
"installments": null,
"mandate_options": null,
"network": null,
"request_three_d_secure": "automatic"
},

#

Can I use this as Card element?

finite plume
#

How are you creating that CardElement variable?