Skip to content
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

Stripe integration #38

Open
wants to merge 13 commits into
base: main
Choose a base branch
from
Open

Conversation

magarrent
Copy link
Contributor

Hey there!

I'm testing the new Stripe integration that I've built. It works fine but test some of you and see if I missed something.
Hope this will help a lot of people!

This PR does not replace paddle integration, I designed it for work with both integrations, just choose what you want.

composer.json Outdated Show resolved Hide resolved
phpunit.xml Outdated Show resolved Hide resolved
<div onclick="switchPlans('{{ $plan->plan_id }}', '{{ $plan->name }}')" class="inline-flex items-center justify-center w-full px-4 py-4 text-base font-semibold text-white transition duration-150 ease-in-out @if($plan->default){{ ' bg-gradient-to-r from-wave-600 to-indigo-500 hover:from-wave-500 hover:to-indigo-400' }}@else{{ 'bg-gray-800 hover:bg-gray-700 active:bg-gray-900 focus:border-gray-900 focus:shadow-outline-gray' }}@endif border border-transparent cursor-pointer focus:outline-none disabled:opacity-25">
Switch Plans
</div>
@if (env('CASHIER_VENDOR') == 'stripe')
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Using env directly in your project is discouraged. Wave has a config you can add to.

A new stripe key for Stripe specific configurations would be better to add if you need to access Stripe specific enviroment variables.

A billing.vendor config option could use the env('CASHIER_VENDOR') so it'll be easy to check which vendor is installed by using config('billing.vendor').

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, it's a good option. I choose .env because there are all the config there in just one place, but we can move it

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also, I've built it in that way because it won't take effect with any current Wave config. So there is no conflict if you don't have any of the new Stripe .env vars

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, Laravel applications have a lot of config files. Mainly because it's the suggested approch for retrieving enviroment variables to only use env in config files, and most Laravel projects follow this standard.

Most of the time you won't have to even reach into config files, you simply add the config options you want in your enviroment files. That's probably one of the reason for this two-step approach.

If you have a config that points to the enviroment variables you can update the config with new options as much as you want without conflicting with already set options.

For application specific configurations I usually create a new config file matching the project name, that keeps things nice and separated IMHO.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So there is no conflict if you don't have any of the new Stripe .env vars

The second parameter to the env function is for default values, e.g. env('CASHIER_VENDOR', 'paddle') would return paddle if CASHIER_VENDOR was blank or isn't set.

@tnylea
Copy link
Contributor

tnylea commented Dec 14, 2021

I like this a lot, thanks @magarrent, if we merge this in, can we get some help supporting this as well 😄

Just want to make sure because one of the main reasons we excluded (stripe) was that it caused more tickets than it was worth. As you'll notice the Paddle integration is custom (not using cashier) and super duper simple. (You are a subscriber or not)

Stripe brings in a ton of options (which is great and bad at the same time). Products, Tiered Pricing, etc... Let me know your thoughts and if you are willing to help out.

Appreciate it!

magarrent and others added 2 commits December 15, 2021 09:31
Co-authored-by: Kim Hallberg <hallberg.kim@gmail.com>
Co-authored-by: Kim Hallberg <hallberg.kim@gmail.com>
@magarrent
Copy link
Contributor Author

I like this a lot, thanks @magarrent, if we merge this in, can we get some help supporting this as well 😄

Just want to make sure because one of the main reasons we excluded (stripe) was that it caused more tickets than it was worth. As you'll notice the Paddle integration is custom (not using cashier) and super duper simple. (You are a subscriber or not)

Stripe brings in a ton of options (which is great and bad at the same time). Products, Tiered Pricing, etc... Let me know your thoughts and if you are willing to help out.

Appreciate it!

Hi @tnylea thanks, mate!

The idea is that you can choose between Stripe or Paddle when you install Wave.

This PR uses Stripe checkout for the initial payment, and then you can manage your subscription via Billing Portal. So for now it's really "simple". It's just a "starter kit", like Wave.

I had a lot of problems with Paddle verifications, and they have a poor API and almost no existing 3rd part integrations.

Also offering both options, Wave will reach a lot of more people that prefer Stripe than Paddle.

It's a first PR, so maybe it's not perfect hahaha, but I'm using it right now and testing in ActionForms.io, and looks good.

@thinkverse
Copy link
Contributor

Also offering both options, Wave will reach a lot of more people that prefer Stripe than Paddle.

I don't think @tnylea is asking what the potential benefits of supporting both Paddle and Stripe are. I think he's more concerned about the technical debt that would come from supporting both vendors, hence the question.

if we merge this in, can we get some help supporting this as well.

wave/src/User.php Outdated Show resolved Hide resolved
@javaskript
Copy link

Also offering both options, Wave will reach a lot of more people that prefer Stripe than Paddle.

I don't think @tnylea is asking what the potential benefits of supporting both Paddle and Stripe are. I think he's more concerned about the technical debt that would come from supporting both vendors, hence the question.

if we merge this in, can we get some help supporting this as well.

As @magarrent mentioned, this is quite a simple integration using Stripe's billing portal. As long as tiered pricing, etc. is avoided, I don't see this functionality causing many issues or a need for excess support, aside from future API alterations on Stripe's end. Stripe is much more prevalent than Paddle, so this payment integration would definitely open the door to many more users of the Wave boilerplate and, personally, would be a very welcome addition.

@tnylea
Copy link
Contributor

tnylea commented Jan 2, 2022

@magarrent Looks great! I just tested that everything works good with this PR, can you fix that Merge conflict in the partials/subscriptions.blade.php and then I'll do one more test and then get it merged in and tag a new version.

You'll see that I've also updated the billing.md file to include a little more info about Stripe. I would like to eventually get some more documentation about integrating it with stripe in the future. Screenshots of the dashboard and a complete walk-through of how you set it up using Stripe.

🤣 this has kind of come full circle. Wave v1 only supported Stripe and I removed it to clean up some code and included Paddle. But I think @magarrent you are right that Stripe seems to be more preferred over Paddle so hopefully this will open it up to a lot more people using it 👍

Great job on the PR, sorry it took awhile to get merged in, I wanted to test that everything was working correctly before committing to this.

I have some cool ideas for new features in V3, will probably schedule something for around middle of this year 🕺

@obaviet
Copy link

obaviet commented Mar 27, 2022

@magarrent Trông thật tuyệt vời! Tôi vừa thử nghiệm rằng mọi thứ đều hoạt động tốt với PR này, bạn có thể khắc phục xung đột Merge đó trong và sau đó tôi sẽ làm thêm một thử nghiệm nữa và sau đó hợp nhất nó và gắn thẻ một phiên bản mới.partials/subscriptions.blade.php

Bạn sẽ thấy rằng tôi cũng đã cập nhật tệp để bao gồm thêm một chút thông tin về Stripe. Cuối cùng tôi muốn có thêm một số tài liệu về việc tích hợp nó với sọc trong tương lai. Ảnh chụp màn hình của bảng điều khiển và hướng dẫn đầy đủ về cách bạn thiết lập nó bằng Sọc.billing.md

🤣 Điều này có loại đến vòng tròn đầy đủ. Wave v1 chỉ hỗ trợ Stripe và tôi đã loại bỏ nó để dọn dẹp một số mã và bao gồm Paddle. Nhưng tôi nghĩ @magarrent bạn nói đúng rằng Stripe dường như được ưa thích hơn Paddle vì vậy hy vọng điều này sẽ mở ra cho nhiều người sử dụng nó hơn. 👍

Công việc tuyệt vời về PR, xin lỗi phải mất một thời gian để được sáp nhập, tôi muốn kiểm tra xem mọi thứ đã hoạt động chính xác trước khi cam kết điều này.

Tôi có một số ý tưởng thú vị cho các tính năng mới trong V3, có thể sẽ lên lịch một cái gì đó cho khoảng giữa năm nay 🕺

I didn't see the stripe integration documentation. Is it still working?

titonova added a commit to titonova/wave that referenced this pull request May 13, 2022
Based on this pull request(thedevdojo#38), I think Devdojo team decided to add Stripe support (which I'm so happy about), but I cant see  some of the commit's made by `https://github.com/magarrent/wave`, in Wave.
It seems like Stripe has only been partially supported in Wave. Is that the case? If so, is there any upcoming plans to complete it?
@asheroto
Copy link

Hoping for this too!

@MrGKanev
Copy link

Someone mentioned in Discord, that because of the Paddle integration, they will migrate to Cashier (Laravel's package).

@KeithPrinkey-ops
Copy link

KeithPrinkey-ops commented Feb 28, 2024 via email

@KeithPrinkey-ops
Copy link

I assume this was never merged nor were the conflicts fixed?

@KeithPrinkey-ops
Copy link

But then again, wave was given up on in favor of something else. It seems this happens a lot at DevDojo where they release something with just one or two versions and they have moved on to something else.

It's like they can never make up their mind lol. Originally it was only PHP products being released. Now? Now it is almost exclusively JS or some sort of JS framework.

@KeithPrinkey-ops
Copy link

👍

@bobbyiliev
Copy link
Collaborator

We do plan to work on Wave v3.

Also, why this has not been merged, here are some thoughts from Taylor Otwell himself regarding Cashier:

https://youtu.be/QlEHZmvHcOs?si=W1u0VGXmbPCCLV1w

We might reconsider using Cashier in v3 though.

@MrGKanev
Copy link

We do plan to work on Wave v3.

Also, why this has not been merged, here are some thoughts from Taylor Otwell himself regarding Cashier:

https://youtu.be/QlEHZmvHcOs?si=W1u0VGXmbPCCLV1w

We might reconsider using Cashier in v3 though.

Is there a public plan/roadmap or simular regarding Wave v3?

@bobbyiliev
Copy link
Collaborator

We do plan to work on Wave v3.
Also, why this has not been merged, here are some thoughts from Taylor Otwell himself regarding Cashier:

https://youtu.be/QlEHZmvHcOs?si=W1u0VGXmbPCCLV1w

We might reconsider using Cashier in v3 though.

Is there a public plan/roadmap or simular regarding Wave v3?

We just started a discussion about v3 here:

#112

feel free to make any suggestions!

@KeithPrinkey-ops
Copy link

We do plan to work on Wave v3.

Also, why this has not been merged, here are some thoughts from Taylor Otwell himself regarding Cashier:

https://youtu.be/QlEHZmvHcOs?si=W1u0VGXmbPCCLV1w

We might reconsider using Cashier in v3 though.

Bobby, that was not meant as a shot at y'all. I remember us having a conversation and being told it was being replaced with Foundation? I think even Tony chimed in regarding Wave. Did y'all change your minds?

Will the new wave have an upgrade path from v2? I assume yes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
10 participants