Comments (6)
Thanks @robindirksen1
Some good bits in here, we can work in a swappable action class (optionally override this per subscription plan) once the v1 has released.
from cashier-mollie.
cc @driesvints @bobbybouwmann as discussed at LaraconEU
from cashier-mollie.
@robindirksen1 I was going over this and I thought it makes sense that this is broken because februari can have only 28 days. It doesn't make sense that the other months don't work and that the calculations for the other months are broken, but that's a whole other story.
What happens when you always put it on the 28th when it's 29th, 30th or 31st? This should fix in general you problem and makes sense when accounting februari as well!
from cashier-mollie.
What happens when you always put it on the 28th when it's 29th, 30th or 31st? This should fix in general you problem and makes sense when accounting februari as well!
Yes that would work, but then nobody can have a subscription that runs from the last days (29,30,31) in a month. When you subscribe to something, let's says Laravel Forge, your subscription runs from the day you started and not a few days before or after that.
from cashier-mollie.
Another proposal I've:
Add a method that returns a collection Carbon instances so you can debug/show information about when the next billing day(s) for that specific subscription are.
from cashier-mollie.
I was looking into this a little more. Currently I don't see a good solution here because the new billing cycle is calculated with ->modify()
(as stated above) which basically can have any string that can be handled by the DateTime::class
e.g. ->modify('+2 day first sunday'')
. This is a bad example but could be set as interval on integrations.
My suggestion would be to allow a more specific interval but also allow the old version e.g.
// 'interval'=> '1 month' //still valid
'interval' => [
'value' => 1,
'period' => 'month', //day, month, year
// 'fixed' => true,
],
This way we could call the corresponding ->addPeriodWithoutOverflow()
method, and let Carbon handle the correct interval Date. So the next cycle would not result in a completely different month.
With the fixed
entry you can force the next billing cycle to be on the same day or the correspondig last day in the next month.
I made a draft PR for this #194
What do you guys think?
from cashier-mollie.
Related Issues (20)
- Same plan with different intervals HOT 1
- Questions HOT 3
- First 1500 customer one year €25 discount / Exclude customers from discount when they have already have one HOT 3
- Guzzle timeout when trying to create a new customer. HOT 5
- PHP8 update confilct HOT 1
- Recurrent payment HOT 17
- Testing webhooks locally HOT 3
- Question about events HOT 6
- Get checkout URL for failed order payments HOT 1
- user id rounded up HOT 1
- Question regarding API KEY HOT 1
- Not Understanding HOT 1
- See when a subscription is up for renewal HOT 1
- Event OrderInvoiceAvailable is dispatched multiple times HOT 1
- 1305 SAVEPOINT trans2 does not exist HOT 1
- Charge based on days of the month left HOT 1
- How to create different pricings for subscriptions based on user country? HOT 2
- Current subscription end date HOT 5
- Is it possible to mandate multiple subscriptions in one initial payment HOT 3
- Interval of subscription not updating
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from cashier-mollie.