#Partner

1 messages · Page 1 of 1 (latest)

frosty wyvernBOT
night bison
#

Could you share how your client secret looks like when putting it into stripe.confirmCardPayment?

rancid goblet
#

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

#

If just create payment without creating customer it worked well.

#

I created customer and added customer id

#

then this happened

#

Can you help me?

night bison
#

Can you console.log the client secret when for the payment that faced this error?

#

And share the client secret of that specific payment?

rancid goblet
#

Okay give me a few mins

night bison
#

Can you print client secret right before calling stripe.confirmCardPayment to check what the value of client secret is?

#

From the error message, it's likely that your client secret is in the wrong format

#

Printing the client secret will be helpful to identify what you actually set in the request

rancid goblet
#

This is client secret

#

from backend

night bison
#

Why is there a data behind?

rancid goblet
#

console.log(data, "data");

night bison
#

I see! Is there a white space behind the client secret?

#

The client secret looks fine, but i suspect there might be additional character after the secret

rancid goblet
#

this is payload

#

in console

#

there is no white space

#

this is backend

night bison
#

You mentioned that removing customer ID works?

rancid goblet
#

Yes

night bison
#

If you copy and paste the payment intent client secret with customer and set it directly in confirmCardPayment (instead of using the client secret from backend), does it work? For example,

const payload = await stripe.confirmCardPayment('pi_xxx_secret_xxx', {
            payment_method: {
            card: elements.getElement(CardElement),
            },
        });
#

I tested my own confirmCardPayment using a client secret with customer, it works fine

rancid goblet
#

Let me try

#

Yes I thin it works.

#

I found problem.

#

It works now

night bison
#

That's great! Out of curiosity, what's the root cause?

rancid goblet
#

It's async issue

#

I have one more question.

#

one time payment

night bison
#

What's the issue?

rancid goblet
#

We need to implement one time payment + subscription

#

How can we do this?

#

Is there any guide?

night bison
#

Do you mean you want to have one time price in the subscription, i.e. only charge the one-time when the customer subscribes at the very beginning?

rancid goblet
#

Yes when first subscribe 150$ payment + 15$ subscription

#

Next month only subscription

#

Are you there?

night bison
#

Yes, I'm here! Discord is busy now

rancid goblet
#

Okay

night bison
rancid goblet
#

Thank you let me check

night bison
#

No problem! Let me know if you have further question

rancid goblet
#

Okay BTW one more question: 🙂

#

How to set monthly and yearly?

night bison
rancid goblet
#

Thank you.