#Himanshu Mukhedkar-

1 messages ยท Page 1 of 1 (latest)

vague totem
#

๐Ÿ‘‹ happy to help

#

could you please describe what the issue is? the screenshot is not very helpful yet

humble holly
#

Geeting this error on Console IntegrationError: Invalid value for confirmCardPayment: payment_method.card should be an object or element. You specified: null.

#

We are getting correct value in elements initially, but later on it is getting Null after clicking Paynow Button

#

If you want I will share a public URL to reproduce issue at your end @vague totem

vague totem
#

yes that would be helpful thanks

humble holly
tawny hinge
#

๐Ÿ‘‹ Did you try what I suggested yesterday?

humble holly
#

Will raise a Ticket for Stripe Support shortly, Meanwhile can you pls let me know about a possible solution for the same.

tawny hinge
humble holly
#

You mean to say do like this:
confirmCardPayment(clientSecret, {
payment_method: {
card: CardElement,
},

tawny hinge
humble holly
#

Okay I'll try this locally.
Do i only need to do this in my code:
stripe .confirmPayment(clientSecret, { payment_method: { card: cardElement`,
},
})
.then((res) => {
console.log(res , "res");
if (
res &&
res.paymentIntent &&
res.paymentIntent.status &&
res.paymentIntent.status === "succeeded"
) {
getConfrimationDetails();
setIsLoading(false);
}
if (res && res.error) {
setIsLoading(false);

        addToast(res.error.message, {
          appearance: "error",
          autoDismiss: true,
        });
      }`

and Rest of the code is good.

#

and FYI I'm using this version:

"@stripe/react-stripe-js": "^1.6.0",
"@stripe/stripe-js": "^1.21.1",

Do i need to update this as well

tawny hinge
#

Shouldn't be necessary

humble holly
#

Okay I'll try with replacing stripe.confirmCardPayment with stripe.confirmPayment

tawny hinge
#

No, you can't use confirmPayment with the CardElement

#

(sorry missed that)

humble holly
#

So what should I do now? I need to solve this issue quickly. #dev-help

tawny hinge
#

You should charge the card parameter to cardElement

#

I pasted the code for you yesterday

#

Otherwise if that doesn't help, you'll need to write in so we can spend time take a deeper look

humble holly
#

But we are not getting element object here,

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

Do you think will that work.
card: cardElement

Anyways I'm getting error while using this cardElement is not defined, because we are using CardElement.
<CardElement id="payment-element" options={{ hidePostalCode: true }} />

tawny hinge
#

What's the error?

humble holly
#

cardElement was not defined

tawny hinge
#

Can I ask you write in to support like I did yesterday? If you can provide us with as much context and code as possible, we can work to resolve the issue for you

humble holly
#

Sure We have talked with the support person, and they said We mail you and get back to you.
If you want I will share the public URL of Staging Env to debug at your end.

keen lintel
#

your ticket is on my team's queue right now

#

someone will look and get back when we can

humble holly
#

Basically
const elements = useElements();
This element is getting null after initially render that's causing the problem.