Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

Scotalia's avatar

Cashier / Stripe Issue with trialDay() and empty trial period (zero days)

I am getting an error when trying to run TEST payments using Cashier with Stripe when i create new subscriptions with ZERO (0) trial days:

trialDays(0) or trialDays()

$newMember = $user->newSubscription('eurotripr', $stripePlanId)->trialDays(0)->create($stripeToken, [
                'email' => $request['membership-email'],
            ]);

Results in this error:

Stripe\Exception\InvalidRequestException
Invalid timestamp: must be an integer Unix timestamp in the future.

If I omit the trialDays() method altogether, i get an error that there is no Payment Method attached. This seemingly is because the Stripe Token is not being set on newSubcription() when trialDays() is omitted.

If i add days (trialDays(7) for example) the stripe payment hits stripe as an incomplete payment ending trial period. So theoretically it works if there is a trial period and the number of days is greater than 0.

I have looked for solutions here, Laravel.com, on StackOverflow, and other sites but all i'm finding states how to use 'trialDays()' instead of WHY it may not be working with 0 or NULL values.

Any ideas as to why I continue to get this error?

0 likes
1 reply
Scotalia's avatar
Scotalia
OP
Best Answer
Level 7

I am so dumb: My VirtualBox server time was not in sync with my host machine and was 4 days behind. So it looked like the values i was using were in the past 1, 2, and 3 days.

Note to self: it's always the simplest things I forget to test/check that take the longest to debug and cause the most stress.

Please or to participate in this conversation.