#paragonn - Subscriptions
1 messages ยท Page 1 of 1 (latest)
Yeah, we cover that in this doc: https://stripe.com/docs/billing/subscriptions/build-subscriptions?ui=elements#collect-payment
can you review and let me know which part of the doc isn't behaving as you expect?
ok, roger that, thanks!
ok, so my first question is this-- we are using the Subscriptions for recurring donations. Since the donor can enter any amount we don't have products and prices.
Okay so are you having the user specify the price?
correct
In that case you would need to capture that and use the price_data attribute alternatively
https://stripe.com/docs/api/subscriptions/create#create_subscription-items-price_data
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
thanks I will check it out
ok so we need support both one-time donations and recurring donations in the same checkout
it seems the guide is geared towards a subscription only checkout
Are you using Checkout? https://stripe.com/docs/payments/checkout/how-checkout-works
no stripe elements
In that case you would need to determine whether it's a one time donation or subscription in your code first
then make the appropriate API calls
can i set up a payment intent that can be used for both a one time and a subscription?
No
You would need to use a Payment Intent for a one-time donation or a Subscription for a recurring donation
ok
got it
that helps
so it looks like I need to determine whether the user is giving a one-time donation or a recurring donation before mounting the stripe elements?
Yes, so you can use the correct client_secret when creating the Element
ok
the tricky part is the donor might change their mind and go back and change it from a one-time donation to a recurring donation
I think you can replace the payment intent that the element is using in that case. Checking in to that
ok thanks
Not finding much on this unfortunately. Trying to think of what else you may be able to do here
Honestly, it might be sufficient to create a subscription either way and set cancel_at_period_end if the user wants to make it a one time thing. That way you don't have to swap payment intents or payment elments
ok roger that
Yep yep, you do have other options if you want it on the same page. Off the top of my head I am thinking you can create both, mount two payment elements, and only display the one for the one-time or recurring payments depending on what the user has selected
Or the user can choose on one page, you generate a page for a one-time or recurring payment, and they just have to go back and select the other one if they need it
ok thanks