stripe/stripe-python

PaymentIntents does not use TestClock date for timestamps

BerglundDaniel opened this issue · 1 comments

Describe the bug

When testing subscriptions with a TestClock the payment intents that are generated by the subscription have the incorrect timestamp for created. The payment intent has the timestamp from what the time is now instead of what time the TestClock has.

To Reproduce

Setup a subscription etc with a test clock set to some other date that now
Advance the clock so that the subscription is paid
List all payment intents for the customer
Look at the created field for the payment intent, the created timestamp is the current time. Instead of the test clocks time as expected.

Expected behavior

The payment intent for the subscription has the timestamps from the test clock

Code snippets

No response

OS

Ubuntu

Language version

Python 3.10

Library version

7.9.0

API version

2022-11-15

Additional context

No response

@BerglundDaniel Github issues are limited to bugs or feature requests with the stripe-python SDK itself. Your question is more an integration support question about the behaviour of TestClocks and better directed to our support team for 1:1 help. You can contact them here: https://support.stripe.com/contact

To unblock you though I can confirm that this is expected behaviour today. The TestClocks feature was built specifically for Subscriptions to easily test their behaviour over time which can only be done with time traveling. The TestClock's current time is only applied to the Subscription's related objects like Invoices but it doesn't propagate down to the PaymentIntent/Charge/BalanceTransaction objects that it might create. It's definitely something we hope to improve in the future but we haven't planned the work for now.