#paragonn - Subscriptions

1 messages ยท Page 1 of 1 (latest)

honest ferry
#

HI ๐Ÿ‘‹

brittle plaza
#

Hi Snufkin!

#

Does my question above make sense?

honest ferry
#

can you review and let me know which part of the doc isn't behaving as you expect?

brittle plaza
#

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.

honest ferry
#

Okay so are you having the user specify the price?

brittle plaza
#

correct

honest ferry
brittle plaza
#

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

honest ferry
brittle plaza
#

no stripe elements

honest ferry
#

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

brittle plaza
#

can i set up a payment intent that can be used for both a one time and a subscription?

honest ferry
#

No

#

You would need to use a Payment Intent for a one-time donation or a Subscription for a recurring donation

brittle plaza
#

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?

honest ferry
#

Yes, so you can use the correct client_secret when creating the Element

brittle plaza
#

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

fleet swift
#

I think you can replace the payment intent that the element is using in that case. Checking in to that

brittle plaza
#

ok thanks

fleet swift
#

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

brittle plaza
#

ok roger that

fleet swift
#

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

brittle plaza
#

ok thanks