-
-
Notifications
You must be signed in to change notification settings - Fork 316
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
Added support for Paddle Billing #838
Conversation
Dang! I will try and find some time this week to review.
Let's do this in a second PR (before release). Consolidating dependencies would be nice and I'm sure that users on Paddle Classic will likely want to upgrade so they would only need the single dependency in the new version. |
It's not complete yet, just thought I'd create a PR of what I've done so far 😅
Sounds good 👍 |
@deanpcmad It's great that you already started a PR. I too looked into Paddle Billing recently. For one, I already documented the new webhook verification so you can reuse it for the PR: https://nts.strzibny.name/verify-paddle-billing-webhooks-rails/ I have one question. Should we design the pause & cancellations changes as they are in Paddle Billing? In Paddle, subscriptions are active even on a grace period which looks like Pay now follows as well. Hovewer it seems to me that Pay still marks subscriptions as "paused" or "cancelled" even if the change is only scheduled. What would be the right way for this PR to work? I would maybe prefer to have this same as Paddle since it's less mental overhead. On the other hand I understand the value of doing it similarly as for other providers. @excid3 can you provide any insight on the design here? (I might just misunderstand it.) |
@strzibny thanks for the link! I'm not sure how the paused and cancelled subscriptions would work tbh. I see that they created a "scheduled change" with the |
Yep, exactly as you said, they should be modeled with scheduled changes I believe. But previously Pay would immediately marked a scheduled subscription to be paused or cancelled. I would like to avoid that and match the status in Paddle, whatever it is. |
Not sure why the tests are failing at the mo |
I received an email about a comment on this but I can't see it now 🧐 |
Whoopsie. I did not mean to merge that lol. 🙃 |
I did get tests passing again though. What other features are unfinished? |
haha, I did wonder that. I'm pretty sure all the subscription stuff is working. Need to work out how Pay will show paused/cancelled subscriptions as Paddle use "scheduled changes". e.g. If I set a subscription to cancel, the status will still be active but there will be a The documentation also need updating. You may notice that I've removed the |
Also need to work on tests for Paddle |
I see that PaddlePay is still referenced in the new Paddle code, so we should update all those references as well. All we need for the scheduled changes is to use those in the |
@deanpcmad I see the |
Sounds good, so still set the status and date fields as required? I believe I already have that set when running And yes, that can be removed as I found that it's much easier and cleaner to set the Customer ID when setting up the Paddle subscription button. I can help work through the docs, as there's a few changes on their new Paddle.js |
Yeah, status should always be set to what Paddle has defined. I'll go ahead and remove that. 👍 Docs + tests are going to be the biggest things to complete I think. |
I think that |
After upgrading Jumpstart Pro... I'm starting to think it's better if we use I will probably rename it today or tomorrow unless you beat me to it @deanpcmad. |
Yeah that makes sense tbh. Some tests need to be written for it too |
I'll start a PR for it today. |
This PR adds support for Paddle Billing, the new service/APIs available from Paddle. More Info
paddle
topaddle_classic
Paddle Billing now supports multiple subscriptions for a customer, similar to Stripe, so I've copied some code from Stripe and modified as required.
This uses my Paddle Gem which supports both the new Billing but also the Classic APIs. The existing Paddle Classic code is untouched, but could be changed to use my library.
Fixes #837