#ReneDenmark-payment-element
1 messages · Page 1 of 1 (latest)
Hi there, I'd suggest to start from here https://stripe.com/docs/payments/accept-a-payment?platform=web&ui=elements
Thanks. Failed to mention I am doing the subcription payment.
Which I already have made and want to upgrade to Payment Elements. But the migration guide is also not giving me much help.
"Just" need the example at https://github.com/stripe-samples/subscription-use-cases to have a version with the new Payment Element.
I see, or do you want to use the Checkout page? it's much easier to integration and it works well with subscription.
No, I have to use a custom flow.
I have everything working, but problems changing to Payment Element. A working example would me a lot to do the upgrade. Thats all 🙂
Some of the JS is new and not everything is shown on the tutorial. On this one: https://stripe.com/docs/billing/subscriptions/build-subscription?ui=elements
No problem, let me help you with that.
So basically that's what you need to do
- Create a customer
- Create a subscription for the customer
- Pass the subscription's
latest_invoice.payment_intent.client_secretto the payment element to render - enter the payment details and call
stripe.confirmPaymentto confirm the payment - The subscription will be active if the payment is successful.
Yeah. I almost have all that. But fx the examples says the JS is the following: fetch('/create-subscription', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
},
body: JSON.stringify({
priceId: priceId,
customerId: customerId,
}),
})
But there has to more JS. Using the return, setting the parameters and such. This is were I have to do som e guessing and so on.
Just want a complete example to work from. If there is any.
Your code looks good to me, is there a particular problem that you have encountered?
No, not yet. Just trying to avoid all the guessing. But let me work on it and get back if I have problems. Just wanted a working example (.Net) to work with.
I'd suggest to play with the APIs first, and you are welcome to come back anytime if you hit any problems
Ok. Thanks.