Skip to content
This repository has been archived by the owner on Feb 2, 2022. It is now read-only.

Add Plan::times attribute #115

Open
manufyco opened this issue Nov 27, 2019 · 4 comments
Open

Add Plan::times attribute #115

manufyco opened this issue Nov 27, 2019 · 4 comments
Labels
enhancement New feature or request

Comments

@manufyco
Copy link

Hi all,
I'm trying to setup two types of subscriptions: 3 months and a 12 months subscription.
Both are monthly charged from the bank account. And auto-renewal for the year subscription one month before the end of the contract.

Is this possible with the current version?
Should I e.g. set the end_at column in the Subscription model at 3 months and 12 months from now at the start?

@sandervanhooft
Copy link
Collaborator

Hi,

I'm trying to understand your use case... Do you mean the subscription should stop at a preset date?

So the 3 months subscription would result in 3 monthly invoices and then be completed?

If that's the case, that's not supported. Not yet anyway. I have been thinking about adding a times attribute to the Plan, but this will not be anytime soon.

@sandervanhooft
Copy link
Collaborator

Alternatively, you could run a check that cancels "completed" subscriptions prior to processing them with cashier:run.

@manufyco
Copy link
Author

Yes correct, the subscription should stop at a certain date.
The times option should be a good fit, I already tried to add it to the cashier_plan.php like described in the mollie manual (https://docs.mollie.com/payments/recurring#payments-recurring-charging-periodically). I soon discovered that it is not supported yet.
Will this be in the next couple of months?

Can you maybe describe the alternative option in more detail?

@sandervanhooft
Copy link
Collaborator

Cashier Mollie is not using Mollie's subscription API, because it's too limited in its functionality for this.

I can't tell if/when times will be available on the Plan at this point. I'm not sure about the impact yet. Also, preparations for Spark (#119) is consuming a lot of my time.

The alternative would involve checking how many processed OrderItems exist for the Subscription before running cashier:run. Having that $count you could then do something like:

if($count >= $times) {
    $subscription->cancel();
}

@sandervanhooft sandervanhooft changed the title Year subscription with monthly billing Add Plan::times attribute Nov 28, 2019
@sandervanhooft sandervanhooft added the enhancement New feature or request label Nov 28, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants