arlyon / async-stripe

Async (and blocking!) Rust bindings for the Stripe API
https://payments.rs
Apache License 2.0
436 stars 127 forks source link

Could not find AccountCapabilities in this scope. #462

Closed justanotherbyte closed 8 months ago

justanotherbyte commented 8 months ago

Describe the bug

With the following Cargo.toml:

[dependencies]
async-stripe = { version = "0.26.0", features = ["runtime-tokio-hyper", "checkout", "webhook-events"], default-features = false}

I receive this error when compiling:

cargo run

    Blocking waiting for file lock on build directory
   Compiling async-stripe v0.26.0
error[E0412]: cannot find type `AccountCapabilities` in this scope
   --> /Users/Viswa/.cargo/registry/src/index.crates.io-6f17d22bba15001f/async-stripe-0.26.0/src/resources/webhook_events.rs:428:25
    |
428 |     AccountCapabilities(AccountCapabilities),
    |                         ^^^^^^^^^^^^^^^^^^^ not found in this scope
    |
help: there is an enum variant `crate::EventObject::AccountCapabilities`; try using the variant's enum
    |
428 |     AccountCapabilities(crate::EventObject),
    |                         ~~~~~~~~~~~~~~~~~~

For more information about this error, try `rustc --explain E0412`.
error: could not compile `async-stripe` (lib) due to previous error

I am attempting to use the Webhook::construct_event API, through rocket.rs

To Reproduce

See above's Cargo.toml.

Expected behavior

Compilation to succeed.

Code snippets

No response

OS

macOS

Rust version

1.75.0-nightly

Library version

async-stripe v0.26.0

API version

2023-10-16

Additional context

No response

mzeitlin11 commented 8 months ago

I think this is the same root issue as #137. You might need to add the additional connect feature as a workaround for now

justanotherbyte commented 8 months ago

I see, this managed to fix my issue, thanks for the help!