Using the Stripe API, Creating a new user on a paid plan with a trial period doesn't seem to work without a credit card token.
I am using the PHP SDK and doing the following:
$customer = \Stripe\Customer::create(array(
"source" => NULL,
"plan" => 'PROFESSIONAL',
"email" => $email_address,
"trial_end" => $unix_timestamp
);
Which returns the error:
Error: Invalid source object: must be a dictionary or a non-empty string.
There are two reasons I think this should work, which is why I think I am doing something wrong.
- Adding
trial_end
adds a trial to the subscription, so no payment is needed which means it doesn't need a Credit Card at that point in time. - Using the Stripe online Portal, you can create a user on a paid subscription, and also move existing users on to a paid subscription without the need for a Credit Card, when you specify a trial period. If you can do it in the portal, why can't you do it via the API?
Is there something I have missed in the Documentation to allow me to do this?