#twirtle2_best-practices

1 messages ยท Page 1 of 1 (latest)

grim gyroBOT
#

๐Ÿ‘‹ 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/1361459419971453111

๐Ÿ“ Have more to share? Add more details, code, screenshots, videos, etc. below.

undone trail
#

Hi there

vale raft
#

Hi to set the context I'm working on a website and call centre integration with stripe taking donations (one off an recurring) using the salesforce connector so please keep in mind that I'm limited to an older API functionality set.

When it comes to subscriptions we have a couple of common intervals, 4 weekly and monthly on the 15th. 4 weekly works perfectly fine as the billing anchor set to now presents no issues with but when it comes to monthly it gets a bit finnicky.

Currently this is what I've got configured:

Website flow

  1. Create Customer
  2. Create Subscription
  3. Get Latest Invoice and corresponding Payment Intent
  4. Present payment intent in payment element and confirmPayment

At the moment I don't have the billing anchor set on creation as I want to take payment immediately so after the subscription is paid for there's a subsequent call to update the subscription with a trial_end (according to the docs) of the calculated next donation date (some business logic applied here). This works perfectly and does exactly how I want it to perform, except the subscription gets flagged as a trial, which doesn't really bother me operationally.

I just wanted to sense check a few things
I was thinking about how to pause someone's donation, and there's pause_collection that can be used. In the docs it's not clear if the billing anchor gets reset as well? If so would I be better off resetting the billing anchor using a pause instead of trial? Or would I use trial to put a subscription on pause?

from the docs it reads Use the Subscription ID to update pause_collection[behavior] to void and pause_collection[resumes_at] to the date you want to start collecting payments again. which sounds like it's a reset of the billing anchor when it resumes?

undone trail
#

We're not Connector experts here so bear with me

vale raft
#

hey that's fine, i was just setting the context that I'm not using the latest APIs

#

this is more about how best to set billing anchor and pausing

undone trail
#

I'm not sure if pausing a Subscription is necessarily what you want to do here

#

Pausing a Subscription (using pause_collection) will still create Invoices as the billing cycles move forward. Depending on the scenario, the Subscription's status may also remain in the active state

vale raft
#

even if you mark the behaviour as void/

#

I guess what I want to understand is when pausing, does the billing anchor get reset to when it resumes?

undone trail
#

Even if you void the latest Invoice, the Subscription could still remain active if the latest Invoice that was not voided was paid

#

Taking a step back, can you share more details about what you're trying to solve for exactly?

vale raft
#

so say you sign up on 5 April for a monthly donation. I want to take payment instantly as you sign up, and then set your subscription with the billing anchor on the 15th so you're due on 15 May

#

trial_end right now works perfectly, after the payment is taken I update the subscription with the trial end of 15 May with proration = none, and it comes back on 15 May and instantly charges now with the billing anchor of 15 monthly

#

I'm trying to understand whether pausing can achieve the same thing as I think about how I go about pausing someones donations for 2 months as an example

undone trail
#

No, you won't be able to achieve the same thing by pausing a Subscription since pause_behavior isn't the same as changing a Subscription's status to paused

#

Using a trial period is the recommended approach here

vale raft
#

so to confirm

if the billing anchor is set to 15 monthly, and I pause_collection setting it to resume on 1 June, the next invoice due will be 15 June?

grim gyroBOT
ancient steppe
#

hello! taking over for roadrunner - catching up on the thread now

#

if i understand your question i think that's correct, but it's been a while since i've experimented with pausing

#

have you used test clocks before for testing out scenarios like this?

vale raft
#

yea I have, but wanted to ask before I dive into modifying records and testing

#

thought it would be a clear cut answer haha. So i guess I'm using trial end correctly to reset billing anchor and pause doesn't reset the billing anchor.

so I guess the question is, is there any downside to using trial end as a way to pause?

#

to me it seems simpler to use trial end so you're sure of billing anchor (i guess it's possible the donor could want a pause in donations and also change their billing cycle at the same time)

ancient steppe
#

sorry for the slow response - been running some experiments of my own to remind me how a few of these things work

#

but yes, i agree that trial_end is the simpler way to go here

vale raft
#

yea no worries i'm playing around with it as well

vale raft
#

I'm not hugely bothered by the trial flag in the stripe dashboard since it won't be surfaced to the end user

ancient steppe
#

not off the top of my head! like roadrunner mentioned, trial periods are usually what we recommend for things like this. i think like you said earlier one of the primary difference is that the trial period approach handles the billing cycle anchor for you

vale raft
#

ok perfect thank you! appreciate both of you

ancient steppe
#

yep! good luck ๐Ÿ™‚