Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot create subscription without payment source, even with free trial period #106

Open
GaryReckard opened this issue Mar 2, 2020 · 3 comments

Comments

@GaryReckard
Copy link

GaryReckard commented Mar 2, 2020

I am trying to create a subscription for a user when they register. However, I am getting an error saying that a payment source is necessary.

In the Stripe docs (https://stripe.com/docs/billing/subscriptions/trials) it says:

When creating a subscription with a trial period, no payment method is required for the customer. An immediate invoice is still created, but for $0.

However, in the Commerce docs (https://docs.craftcms.com/commerce/v3/subscription-templates.html#subscribing) it says:

Subscribing a user to a plan requires the user to have a stored payment source. If a user doesn’t have one, you can add it by displaying the payment form.

In this repo, here is where it is checking for payment methods:

if (\count($paymentMethods->data) === 0) {
throw new PaymentSourceException(Craft::t('commerce-stripe', 'No payment sources are saved to use for subscriptions.'));
}

Perhaps it should only check for payment methods after checking if the subscription plan has a trial period, or if trial_end or trial_period_days has a truthy value?

This StackOverflow answer suggests the same: https://stackoverflow.com/a/41999174/2441459

@cherrykoda
Copy link

cherrykoda commented May 10, 2024

Im running into this now and have no idea how to work around it >_<

I have a $0 stripe subscription that doesn't need a payment source, its for the client to track free tier usage against paid tier usage in stripe.

@lukeholder
Copy link
Member

We can look into this. Does stripe allow zero value subscriptions without a card in their checkout /billing portal?

@cherrykoda
Copy link

cherrykoda commented May 10, 2024

@lukeholder yup!

image

image

We even ended up with two people subscribed through Craft Commerce because they swapped from another plan that already had a payment method on file. We found out about the issue in a live setting and I've spent about 36 hours straight re-coding everything. We didn't catch it in QA because the test accounts went through just fine.

This is re: Trials Payments (they aren't meant to have to take payment methods) for the fella above me:

https://docs.stripe.com/billing/subscriptions/trials#:~:text=When%20creating%20a%20subscription%20with,still%20created%2C%20but%20for%20%240.

https://docs.stripe.com/payments/checkout/free-trials

And this is my situation:

https://docs.stripe.com/billing/subscriptions/overview#non-payment

For the record, I'm fine with still collecting payment information and tried it that way but the plugin was rejecting the submissions with a "Please check your billing information" error. The issue wasn;t the card or bank and was replicate with Stripe test cards in a testing env too.

Edit: for clarification my expectation would be that you can signup for any Stripe subscription that's been successfully made in Stripe so long as you still provide the payment info collection.

For the other person in the thread their expectation I believe is that trials do not require payment method, and work with Stripe's built in Trials and Trials end behaviour methods

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants