Open dthul opened 2 years ago
Thanks for the report. I'll have a look and see if we can either a) rework the deps or b) at least document this requirement.
We are planning on addressing this issue with 0.15 where we will split out the codegen into crates. This will make the dependencies much more explicit. Stay tuned.
Hi @arlyon I am experiencing similar issue as @dthul .
And also trying to undestand which feature I have to enable to make use stripe::TerminalLocation;
to compile, it complains
6 | use stripe::TerminalLocation;
| ^^^^^^^^^^^^^^^^^^^^^^^^ no `TerminalLocation` in the root
I have noticed that this code is generated https://github.com/arlyon/async-stripe/blob/ca5269ebcf9cbd7005f3fecedc63cc31718680a6/src/resources/generated/terminal_location.rs
Tried to add "terminal" or "terminal-location" features, but none of them worked:
the package `my_example` depends on `async-stripe`, with features: `terminal-location` but `async-stripe` does not have these features.
Hi
The terminal APIs are currently not exported (and untested). I will write a PR to add them and you can provide feedback. Everything should 'just work' after that.
See here for a list of unexported APIs (updated weekly with): https://github.com/arlyon/async-stripe/pull/216
I am adding terminal support in this PR: https://github.com/arlyon/async-stripe/pull/221
The pr is merged let me know if there are any issues with the terminal API.
When I updated to v0.15 I ran into a new but similar compile issue. The Cargo.toml line I used:
async-stripe = { version = "0.15", default-features = false, features = ["runtime-tokio-hyper-rustls", "billing", "webhook-events", "checkout"] }
which leads to this error:
Checking async-stripe v0.15.0
error[E0412]: cannot find type `AccountCapabilities` in this scope
--> /home/dthul/.cargo/registry/src/github.com-1ecc6299db9ec823/async-stripe-0.15.0/src/resources/webhook_events.rs:444:25
|
444 | AccountCapabilities(AccountCapabilities),
| ^^^^^^^^^^^^^^^^^^^ not found in this scope
|
help: there is an enum variant `crate::EventObject::AccountCapabilities`; try using the variant's enum
|
444 | AccountCapabilities(crate::EventObject),
| ~~~~~~~~~~~~~~~~~~
and the new line which makes it work (by adding the "connect" feature which will re-export the AccountCapabilities struct):
async-stripe = { version = "0.15", default-features = false, features = ["runtime-tokio-hyper-rustls", "billing", "webhook-events", "checkout", "connect"] }
I also bumped into this. I only need the webhook-events
feature in addition to runtime.
In my case this works
async-stripe = { version = "0.15.0", default-features = false, features = ["runtime-tokio-hyper", "webhook-events", "connect", "checkout"]}
It seems like webhook-events
should also activate connect
and checkout
Copying from #238: after updating to 0.15.0
, a set of features that built fine in 0.14.1
now doesn't compile. A minimal Cargo.toml
which compiles for 0.14
but not 0.15.0
:
[dependencies]
async-stripe = {version = "0.15.0", default-features = false, features = ["runtime-tokio-hyper", "webhook-events", "checkout"]}
The compilation error:
error[E0412]: cannot find type `AccountCapabilities` in this scope
--> /Users/matthewzeitlin/.cargo/registry/src/github.com-1ecc6299db9ec823/async-stripe-0.15.0/src/resources/webhook_events.rs:444:25
|
444 | AccountCapabilities(AccountCapabilities),
| ^^^^^^^^^^^^^^^^^^^ not found in this scope
|
help: there is an enum variant `crate::EventObject::AccountCapabilities`; try using the variant's enum
|
444 | AccountCapabilities(crate::EventObject),
| ~~~~~~~~~~~~~~~~~~
Adding the feature connect
fixes this compilation error.
I ran into this today with:
# Cargo.toml
async-stripe = { version = "0.34.1", default-features = false, features = ["runtime-blocking-rustls", "billing"] }
use stripe::{ListSubscriptions, StripeError, Subscription};
const TEST_SECRET_KEY: &str = "sk_test_…";
use stripe::{ListSubscriptions, StripeError, Subscription};
async fn test() -> Result<(), StripeError> {
let client = stripe::Client::new(TEST_SECRET_KEY);
let s = Subscription::list(&client, &ListSubscriptions::default())?;
dbg!(s);
Ok(())
}
This results in:
error[E0432]: unresolved import `crate::resources::CheckoutSessionItem`
--> /…/.cache/cargo/registry/src/index.crates.io-6f17d22bba15001f/async-stripe-0.34.1/src/resources/generated/quote.rs:11:27
|
11 | Account, Application, CheckoutSessionItem, ConnectAccountReference, Currency, Customer,
| ^^^^^^^^^^^^^^^^^^^
| |
| no `CheckoutSessionItem` in `resources`
| help: a similar name exists in the module: `CheckoutSession`
For more information about this error, try `rustc --explain E0432`.
error: could not compile `async-stripe` (lib) due to 1 previous error
I'm using the following line in my
Cargo.toml
:and this is the compile error I get:
As far as I can tell
CheckoutSessionItem
will only be re-exported fromcrate::resources
when thecheckout
Cargo feature is activated. As a quick fix I changed my dependency line to: