stripity-stripe icon indicating copy to clipboard operation
stripity-stripe copied to clipboard

Compilation fails if `plug` isn't a dependency

Open lleger opened this issue 2 years ago • 6 comments

If you don't have plug as a dependency, stripity_stripe will fail to compile because of Stripe.WebhookPlug.

This sort of precludes Elixir apps that need to connect with Stripe but don't serve HTTP requests (e.g. CLIs, backend server apps, etc). It's an easy fix to add plug but that's a large dependency that's unnecessary in the context of those apps.

A fix here would be to make the compilation of Stripe.WebhookPlug conditional on the presence of plug, which seems appropriate. That module is opt-in if you need it (and it's great, I've used it in other apps) but unnecessary to the larger context of Stripe API integration.

lleger avatar Dec 13 '21 16:12 lleger

I created #701 to fix this

MikaAK avatar Jan 11 '22 02:01 MikaAK

@snewcomer is there something I can do to get this merged in quicker?

MikaAK avatar Jan 23 '22 21:01 MikaAK

@MikaAK Ya I was wondering why the tests weren't running. Mind rebasing with latest?

snewcomer avatar Jan 26 '22 16:01 snewcomer

@snewcomer done!

MikaAK avatar Feb 01 '22 23:02 MikaAK

@snewcomer is there anything else?

MikaAK avatar Feb 10 '22 22:02 MikaAK

I just ran into this as well. I'm using stripity_stripe in a CLI app that doesn't have Plug installed.

@MikaAK your PR is still failing, and it does look like it's related to the PR. Compile warnings are treated as errors and you get a warning: https://github.com/beam-community/stripity_stripe/runs/5148451957?check_suite_focus=true

FreedomBen avatar May 08 '22 02:05 FreedomBen

Got tripped up by this trying to use in a non-Phoenix app. #701 is closed but this issue is still open; any plans to resolve?

ehogberg-papa avatar May 06 '23 03:05 ehogberg-papa

https://github.com/beam-community/stripity-stripe/pull/798/files @ehogberg-papa give a code review, this should fix the issue, please confirm.

yordis avatar May 06 '23 22:05 yordis