Skip to content
This repository has been archived by the owner on May 26, 2023. It is now read-only.

Handle renewal, schedule and payment #112

Merged
merged 24 commits into from
Jan 23, 2022
Merged

Handle renewal, schedule and payment #112

merged 24 commits into from
Jan 23, 2022

Conversation

bpuig
Copy link
Owner

@bpuig bpuig commented Jan 16, 2022

Status

READY

Migrations

YES

Description

New services and jobs to process pending renewals and also schedules.

Todos

  • Tests
  • Documentation

Deploy Notes

Publish dev migrations.

Impacted Areas in Application

List general components of the application that this PR will affect:

  • Plan Subscriptions Schedule
  • Plan Subscriptions

@bpuig bpuig added the work in progress This work is in progress. label Jan 16, 2022
@bpuig bpuig added this to the v6.0.0 milestone Jan 16, 2022
@boryn
Copy link
Contributor

boryn commented Jan 19, 2022

Hi @bpuig!

I can see lots of new things coming in the v6 :)

What payment provider do you work with that you need to manually, periodically trigger the payment? I used to work with payment providers where we process the first payment with the option of recurring payments, and later it's them who trigger a webhook at our system, and we know whether the consecutive payments were successful or not and change the plan subscription accordingly.

PS. If you could remember about #80 and #90

@bpuig
Copy link
Owner Author

bpuig commented Jan 19, 2022

I can see lots of new things coming in the v6 :)

Yeah 😎

What payment provider do you work with that you need to manually, periodically trigger the payment?

Honestly, I can't think of any. I noticed that while I was doing it. I have a local bank provider that kinda looks like that. But I'll leave that as a base to start working on your own payment methods. It will be good for Free (for example you can set there to send an email to the client or something).

I used to work with payment providers where we process the first payment with the option of recurring payments, and later it's them who trigger a webhook at our system, and we know whether the consecutive payments were successful or not and change the plan subscription accordingly.

Yes, I think that is the way Stripe works. This can easily be achieved using null as payment_method. Subscription will become passive in means of what renews it.

PS. If you could remember about #80 and #90

I will, but I can only do things on weekends 😛

@boryn
Copy link
Contributor

boryn commented Jan 19, 2022

And the "free" plan will be then automatically renewed? You remember, we were talking about this as for me, the "free" should be just free and maintenance-free ;) Or we still need to run the scheduler to renew the free plan?

@bpuig
Copy link
Owner Author

bpuig commented Jan 20, 2022

And the "free" plan will be then automatically renewed?

"Automatically", yes. Just run the payment collector schedule and it will be renewed. The default service for "free" does nothing but renew.

You remember, we were talking about this as for me, the "free" should be just free and maintenance-free ;) Or we still need to run the scheduler to renew the free plan?

You need to run it because, one way or another, usage has to be reset. So the universal solution is a payment service that does nothing but renew.

Also note, this branch has many bugs now. Be careful.

@bpuig bpuig self-assigned this Jan 23, 2022
@bpuig bpuig linked an issue Jan 23, 2022 that may be closed by this pull request
@bpuig bpuig merged commit 865b583 into main Jan 23, 2022
@bpuig bpuig deleted the feature_handle_renewal branch January 23, 2022 14:13
@bpuig bpuig removed the work in progress This work is in progress. label Jan 23, 2022
@bpuig
Copy link
Owner Author

bpuig commented Jan 23, 2022

I¡m stupid and did not squash commits 🤦‍♂️

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

Renewal handling
2 participants