Spark not honouring the trial period for team products
I am testing a new implementation using Spark. A new user registers, setting up a team. There is a 30 day trial period. Then they subscribe to a plan, but they are billed immediately and the trial period is deleted. What am I doing wrong? Surely the subscription should commence at the end of the trial period?
The SparkServiceProvider.booted() method is:
public function booted()
{
Spark::noCardUpFront()->teamTrialDays(30);
Spark::collectBillingAddress();
Spark::freeTeamPlan()
->maxTeamMembers(1)
->features([
'First','Second','Third'
]);
Spark::teamPlan('Monthly', 'plan_GsBB7yph5yJ4BJ')
->price(18)
->features([
'First','Second','Third'
]);
...
}
In Stripe, the plan has Trial Period 30 days, Interval Monthly and Price per unit £18.00.
After registration, the team record in the Laravel database has:
SELECT id, name, current_billing_plan, card_last_four, trial_ends_at FROM vapor.teams;
id, name, current_billing_plan, card_last_four, trial_ends_at
'1', 'Test Account', NULL, NULL, '2020-04-07 17:57:42'
When the user subscribes, various HTTP calls are made to Stripe to set up the customer and payment method. The subscription is set up with POST /v1/customers/cus_GsDvWlIR77e9VM/subscriptions with the following payload:
{
"expand": {
"0": "latest_invoice.payment_intent"
},
"plan": "plan_GsBB7yph5yJ4BJ",
"quantity": "1",
"trial_end": "now",
"off_session": "true"
}
Why is Laravel sending "trial_end": "now" when the database has trial_ends_at set to 2020-04-07 17:57:42?
After the subscription, the teams record now reads:
id, name, current_billing_plan, card_last_four, trial_ends_at
'1', 'Test Account', 'plan_GsBB7yph5yJ4BJ', '4444', NULL
Please or to participate in this conversation.