#dinesh-reuse-pm

1 messages · Page 1 of 1 (latest)

cinder novaBOT
#

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.

languid shell
#

How are you integrating?

#

Is this a custom checkout flow on your site?

desert swan
languid shell
#

Ok then please provide more context for your question

#

I don't have the details necessary to help you rn

#

Subscriptions shouldn't require customer to enter details for each charge

desert swan
#

i have alrady created on subscription with card details from payment element

#

another one subscrtion create same customer i don't want collect card details, need to use already used card details(no need to show card details collect payment element UI)

languid shell
#

Yeah you can do that. Just pass the existing payment method id when creating the subscription

#

No need to collect details if you don't want to

cinder novaBOT
#

dinesh-reuse-pm

desert swan
#

but i want confirmation from customer

  1. create subscrtpion with incomplete and user confirmation i will collect payment only not card details.
#

example code

#

const options = {
clientSecret: '{{CLIENT_SECRET}}',
// Fully customizable with appearance API.
appearance: {/.../},
};

// Set up Stripe.js and Elements to use in checkout form, passing the client secret obtained in step 5
const elements = stripe.elements(options);

// Create and mount the Payment Element
const paymentElement = elements.create('payment');
paymentElement.mount('#payment-element');

#

form.addEventListener('submit', async (event) => {
event.preventDefault();

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",
}
});

if (error) {
// This point will only be reached if there is an immediate error when
// confirming the payment. Show error to your customer (for example, payment
// details incomplete)
const messageContainer = document.querySelector('#error-message');
messageContainer.textContent = error.message;
} else {
// Your customer will be redirected to your return_url. For some payment
// methods like iDEAL, your customer will be redirected to an intermediate
// site first to authorize the payment, then redirected to the return_url.
}
});

#

i don't want mount element

#

paymentElement.mount('#payment-element');

#

just confirm payment

languid shell
#

You can do that

#

If you grab client secret from the first invoice

#

As long as sub is default_incomplete behavior

#

You can just confirm with the default payment method

desert swan
#

please give example stripe code

#

for this , "You can just confirm with the default payment method"

languid shell
#

It would be in your confirm call

#

No need to render elements

desert swan
#

ok thanks!

#

i will check

#

👍

languid shell
#

No problem