#marroco0488_api

1 messages · Page 1 of 1 (latest)

floral sonnetBOT
#

👋 Welcome to your new thread!

⏱️ We automatically close idle threads, which makes them read-only. Make sure you stick around to chat in realtime!

🔗 This thread will always be available, even after it's closed. You can find it again using Discord's search, or you can save this link: https://discord.com/channels/841573134531821608/1212437259593195563

📝 Have more to share? You can add more detail below, including code, screenshots, videos, etc.

⏲️ We'll be here soon! Typically we respond in a few minutes, but sometimes we might take a bit longer if the server is busy or if you have a particularly tricky question. Thank you for your patience!

normal kiteBOT
signal mica
cold cedar
#

mmm I see, in the documenation was like this -> const {error} = await stripe.confirmPayment({
//Elements instance that was used to create the Payment Element
elements,
confirmParams: {
return_url: "https://example.com/order/123/complete",
}
});... or im reading the wrong documentation?

signal mica
#

That's for the Payment Element, rather than the Card Element.

cold cedar
normal kiteBOT
signal mica
#

That guide walks through the complete process, but it also uses the Payment Element, below is a snippet from Step 5 showing that:

const paymentElement = elements.create('payment');
paymentElement.mount('#payment-element');```
but in your message you mentioned you're using the Card Element:
> having problems with the card element for subscription

You will either need to use the Payment Element as the guide suggests, or continue using the Card Element and use `confirmCardPayment` instead of `confirmPayment`.
cold cedar
#

I got this error -> Uncaught IntegrationError: Invalid value for confirmCardPayment: payment_method.card was payment Element, which cannot be used to create card PaymentMethods.

inland condor
#

Hello! I'm taking over and catching up...

cold cedar
#

thanks

inland condor
#

It looks like you're mixing approaches. You can use the Card Element, or you can use the Payment Element. You can't use both. Which do you want to use?

cold cedar
#

im not sure of the difference, sorry. What im trying to do is to confirm the payment... in my backend i already create the client secret with a payment intent, I send the client secret to my front where you can see the logic is creating the card, but them im stuck

inland condor
cold cedar
#

but know i reciebe this -> Uncaught (in promise) IntegrationError: stripe.confirmPayment(): expected either elements or clientSecret, but got neither.

#

that was the first error that i report in this channel

inland condor
#

Can you share the code that's throwing that error?

cold cedar
#

if I do a console.log of elements i got this -> Proxy(t) {_emit: ƒ, _once: ƒ, _removeAllListeners: ƒ, _on: ƒ, _validateUserOn: ƒ, …}
[[Handler]]
:
Object
deleteProperty
:
ƒ deleteProperty(target, key)
get
:
ƒ get3(target, key, receiver)
has
:
ƒ has(target, key)
ownKeys
:
ƒ ownKeys(target)
set
:
ƒ set3(target, key, value, receiver)
[[Prototype]]
:
Object
[[Target]]
:
t
[[IsRevoked]]
:
false

inland condor
#

Your code has element instead of elements.

cold cedar
#

I see I thought with this -> const element=this.elements;
i can just pass element but seems that needs to be elements with this specific name

#

its working now

inland condor
#

Glad to hear it's working!