faustbrian / laravel-paddle

DEPRECATED - USE https://github.com/laravel/cashier-paddle
Mozilla Public License 2.0
10 stars 2 forks source link

Add detailed documentation and usage examples #1

Closed faustbrian closed 4 years ago

petericebear commented 4 years ago

Would be really great :-) Looking into Paddle with Laravel integration at the moment.

Can you start with documentation/examples of:

faustbrian commented 4 years ago

I'll try to take some time this weekend to get this done.

petericebear commented 4 years ago

Awesome!

faustbrian commented 4 years ago

https://github.com/kodekeep/laravel-paddle/blob/master/DOCS.md https://github.com/kodekeep/laravel-paddle/blob/master/EXAMPLE.md

The underlying client to do things like listing subscriptions would be https://github.com/kodekeep/paddle-sdk which is mentioned in the DOCS.md and should be easy enough to understand. For example Paddle::product()->plans()->all(); would achieve what you want.

Coupons aren't currently implemented in any kind of special way but you can take a look at https://paddle.com/docs/setting-up-coupons/ to see how to use them programmatically if you would want to always apply it to your checkout. If a user applies it through the Paddle Modal there is nothing special you need to do as Paddle will handle the applying of the coupon.

If you want to apply coupons at any time to an existing subscription you can use modifiers https://developer.paddle.com/api-reference/subscription-api/modifiers/createmodifier which give you the ability to modify the amount a subscription is billed for. See https://github.com/kodekeep/paddle-sdk/blob/master/src/Api/Endpoints/Subscription/Modifiers.php for the SDK implementation of that.

petericebear commented 4 years ago

Thanks for the update! I need to update my Laravel app to make use of the package, but that will turn out fine :D

faustbrian commented 4 years ago

If you run into any issues or find a missing feature just open an issue and I'll have a look if the Paddle API allows to do it.

petericebear commented 4 years ago

Thanks! I will let you know. Any issues with the SDK and Laravel wrapper for version 5 of Laravel? PHP 7.4 is on the server, But I have a project at this moment with latest 5.8.x (I know I really have to update it) but new features in a startup comes first.. :D

Are you a freelancer btw, which can take on new projects?

faustbrian commented 4 years ago

Any issues with the SDK and Laravel wrapper for version 5 of Laravel? PHP 7.4 is on the server, But I have a project at this moment with latest 5.8.x (I know I really have to update it) but new features in a startup comes first.. :D

Don't think there should be any issues besides dependency version constraints, will test that today or on Monday but I would probably recommend updating the application to Laravel 7 with https://laravelshift.com/.

Are you a freelancer btw, which can take on new projects?

You can send an e-mail to hello@basecode.sh if you have any projects for which you are looking for a contractor and I will have a look if it currently fits in timewise.

petericebear commented 4 years ago

Hi Brian,

I have 2 small questions remaining:

1) Can you share the logic what you have for that example in the webhook? That is the only missing piece I want to verify that there is a good implementation.

2) How do you handle the invoices, do you get all the transactions and filter them based on the paddle subscription id?

Greetings,

faustbrian commented 4 years ago
  1. Can you share the logic what you have for that example in the webhook?

All the subscription-related events are handled out of the box https://github.com/kodekeep/laravel-paddle/blob/master/src/Providers/PaddleServiceProvider.php#L56-L60 so I am not doing anything extra in applications where I use this package. The listeners can be seen here https://github.com/kodekeep/laravel-paddle/tree/master/src/Billing/Listeners.

I only need to make sure that the Paddle Webhook URL is configured on my account and that I configured the right credentials to grant Paddle access when a webhook is incoming.

  1. How do you handle the invoices, do you get all the transactions and filter them based on the paddle subscription id?

That's pretty much what I am doing because I can't find a better way how to list invoices with the existing API. I loop over all transactions a customer has and then filter them based on the app that the transaction is for to avoid listing transactions for a different app if you are using a single account for multiple SaaS.

petericebear commented 4 years ago

Thanks, everything works! :D whoop whoop1

faustbrian commented 4 years ago

Also looks like there is now finally a beta of the official Cashier version for Paddle over at https://laravel.com/docs/7.x/cashier-paddle.

petericebear commented 4 years ago

Yeah but I got this now working with these packages and works really good. Great work!

Groet, Peter

Op 5 jun. 2020 om 18:29 heeft Brian Faust notifications@github.com het volgende geschreven:

 Also looks like there is now finally a beta of the official Cashier version for Paddle over at https://laravel.com/docs/7.x/cashier-paddle.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub, or unsubscribe.