#Partner
1 messages · Page 1 of 1 (latest)
Could you share how your client secret looks like when putting it into stripe.confirmCardPayment?
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?
Can you console.log the client secret when for the payment that faced this error?
And share the client secret of that specific payment?
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
Why is there a data behind?
console.log(data, "data");
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
You mentioned that removing customer ID works?
Yes
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
That's great! Out of curiosity, what's the root cause?
What's the issue?
We need to implement one time payment + subscription
How can we do this?
Is there any guide?
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?
Yes when first subscribe 150$ payment + 15$ subscription
Next month only subscription
Are you there?
Yes, I'm here! Discord is busy now
Okay
You can add the one-time price in add_invoice_items when creating a subscription: https://stripe.com/docs/api/subscriptions/create#create_subscription-add_invoice_items
You may refer to this doc for more information: https://stripe.com/docs/billing/invoices/subscription#first-invoice-extra
Thank you let me check
No problem! Let me know if you have further question
During prices creation, you can set the billing period to monthly or yearly.
Here are the steps on you can do it: https://stripe.com/docs/products-prices/pricing-models
Thank you.