#dinesh-reuse-pm
1 messages · Page 1 of 1 (latest)
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.
- dineshkumar6419, 45 minutes ago, 23 messages
no, i created subscription https://stripe.com/docs/billing/subscriptions/build-subscriptions?ui=elements#create-pricing-model
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
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)
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
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
dinesh-reuse-pm
but i want confirmation from customer
- 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
await stripe.confirmPayment({
//Elements instance that was used to create the Payment Element
elements,
confirmParams: {
return_url: "https://example.com/order/123/complete",
}
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
please give example stripe code
for this , "You can just confirm with the default payment method"
No problem