#Jonah Librach

1 messages · Page 1 of 1 (latest)

primal patioBOT
oak cosmos
#

Obviously starting with stripe.Customer.retrieve(CUSTOMER_ID)

real spear
oak cosmos
#

Are there other things other than PaymentIntent? That is the most updated, correct?

#

I.e, I shouldn't be using anything else if I'm just getting started out

real spear
#

Yep that's the most updated.

oak cosmos
#

Thanks so much, that's extremely helpful

#

And the property 'amount_receive', intuitively, should be the value I'm looking for?

#

Looks like it is.

real spear
#

Yeah looks like it. I would double confirm amount_received vs amount in case you only capture a part of the PaymentIntent

#

looks like it's amount_received

oak cosmos
#

Yes. Just need to double check now, because I'm calling the paymentintent list, but it's only giving me one result.

Could be an issue with the test clock, or something else

oak cosmos
#

How long do I need to wait until the stripe clock is calibrated?

#

Because after the test runs, I can query the customer and everything looks right, but I can't get the test_clock calibration timing

#

Is the recommended approach to just continue to query the clock until its ready?

real spear
#

By calibration do you mean clock stablization?

oak cosmos
#

Sorry:

real spear
#

Like a few more secs?

oak cosmos
#

No

#

My test involves setting a test_clock a month in advance

#

And then it waits to see if my webhooks handle things properly

#

When time advances

real spear
#

okie

#

and what is the issue with that setup?

oak cosmos
#

No there's no issue, I guess I'm just trying to figure out what the best way to ensure that the clock is in "ready" state before continuing the test

#

And I suppose I just need to keep polling until it's ready

#

Unless there's another way...?

real spear
#

Ah I see, yes I also do the same thing when testing with test clock. I do a loop checking the test clock status

oak cosmos
#

It takes forever to advance!

#

It took 45s to get it to advance twice!

real spear
#

Hmm maybe just temporary? On my testing it's like 10 secs ish

oak cosmos
#

The test is extremely flakey

#

Running the same thing 3 times gets 3 different results because even when it says ready, it isn't ready

#

Is there a way to make sure that it's done sending all the messages to the webhooks?

real spear
#

Um I don't think there is a convenient way. Just like you said before do a polling on Test Clock status and wait until it's ready, then validate the webhook

oak cosmos
#

So maybe it's something I'm confused about

#

In my test, I create a subscription. It charges and everything is good.
Then, I advance the clock to after 30 days later (from July 1 to Aug 2).

This invokes the following webhooks:

test_helpers.test_clock.advancing
invoice.upcoming
invoice.created
customer.subscription.updated
test_helpers.test_clock.ready

But it's doing so without charging a second time.

#

Then, when I advance it again (to Sept 3), only then does it charge twice, where it should have charged again after the clock advanced the first time.

real spear
#

It is probably because of timezone. Subscription works by UTC

#

So what you see (July 1 to Aug2) probably is your own timezone. When it's in UTC, it might haven't been 1 month yet and it hasn't changed the billing cycle

oak cosmos
#

Okay so if I change to August 3rd it should work...? haha I'll try

#

I can't believe that's the reason LOL

#

That was the issue. Wasted 2 hours because of that.
But glad it works now