#cooldude400_best-practices
1 messages ¡ Page 1 of 1 (latest)
đ Welcome to your new thread!
â˛ď¸ We'll be here soon! Typically we respond in a few minutes, but sometimes we might take a bit longer if the server is busy or if you have a particularly tricky question.
âąď¸ We close idle threads, which makes them read-only. Once a thread is closed it won't be reopened, but you can always start a new thread if you have another question.
đ This thread will always be available, even after it's closed. You can find it again using Discord's search, or you can save this link: https://discord.com/channels/841573134531821608/1305693132314116117
đ Have more to share? Add more details, code, screenshots, videos, etc. below.
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.
- cooldude400_best-practices, 6 days ago, 22 messages
i'm also wondering what the best way to pull "active subscriptions" for a given customer_id is, as https://docs.stripe.com/api/subscriptions/list will pull incomplete and active, and if there are many old incomplete ones, then I can't necesarilly see the active one as the limit is 100 objects?
Hello! Have a look here for a way to collect payment details before creating a Payment Intent on iOS: https://docs.stripe.com/payments/accept-a-payment-deferred?platform=ios
You can specify you only want Subscriptions with a status of active when listing Subscriptions: https://docs.stripe.com/api/subscriptions/list#list_subscriptions-status
I saw this, but it requires the person to agree to an $X payment prior to selecting their donations level, which I want to avoid
You should also use auto-pagination to get the full list: https://docs.stripe.com/api/pagination/auto
ah, the docs dont actually list "active" as an option, thank you
The status of the subscriptions to retrieve. Passing in a value of canceled will return all canceled subscriptions, including those belonging to deleted customers. Pass ended to find subscriptions that are canceled and subscriptions that are expired due to incomplete payment. Passing in a value of all will return subscriptions of all statuses. If no value is supplied, all subscriptions that have not been canceled are returned.
Sorry, not sure I understand what you mean. Can you provide more details about the exact flow you want to build?
Yes, the flow is:
- User selects one of 5 options for a monthly donation level
- A payment sheet button is shown for that dollar amount
My issue is 1) I need to unrender and re-render the payment sheet button each time - is this avoidable?
and 2) I'm currently creating a new paymentintent every time the user changes their selection, which seems wrong. I think I should be creating a monthly incomplete subscription, and then when the user selects a donation level, sending an invoice for that subscription that contians a) the selected amount and b) the preprty that payment of that invoice begisn the subscription for that price
so I think what I want is:
- Create an incomplete subscription for that user
- When the user selects a donation level, create an invoice with that price
- When the user pays the invoice, begin the recurring donatiino at that price
For #1, it sounds like that would be avoidable, yeah. Typically in such a flow they would make their selection, then press a button of some kind which would trigger the Payment Sheet for the selected amount.
I see, that makes sense
For #2, you don't need to create a Payment Intent every time the Payment Sheet is shown. The docs I linked to above explain how to do that.
Also, you should only create a Subscription later in the process.
After you get Payment Method details.
If you follow the guide I linked above, you basically create the Subscription in step 5. That will create an Invoice, and that Invoice will create a Payment Intent, and that Payment Intent's client secret is what you would return.
got it, i'll try that, Thank you!