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

feat: export checkout_session_ext #615

Merged

Conversation

augustoccesar
Copy link
Contributor

Description

Currently, the checkout_session_ext is not being exported, which makes the RetrieveCheckoutSessionLineItems not being able to be used.

With this change, the following should now be possible:

use std::str::FromStr;

use stripe::{CheckoutSession, CheckoutSessionId, Client, RetrieveCheckoutSessionLineItems};

#[tokio::main]
async fn main() {
    let secret_key = std::env::var("STRIPE_SECRET_KEY").expect("Missing STRIPE_SECRET_KEY in env");
    let client = Client::new(secret_key);

    let _line_items = CheckoutSession::retrieve_line_items(
        &client,
        &CheckoutSessionId::from_str("").unwrap(),
        &RetrieveCheckoutSessionLineItems::default(),
    )
    .await
    .unwrap();
}

Closes #614

Summary

Checklist

@augustoccesar augustoccesar force-pushed the feat/export-checkout-session-ext branch from 2fb5a10 to a652060 Compare September 24, 2024 07:32
@augustoccesar
Copy link
Contributor Author

@arlyon with the new Rust version, Clippy started to error on:

Error:    --> src/client/stripe.rs:182:44
    |
182 |         req.insert_header("authorization", &format!("***", self.secret_key));
    |                                            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: change this to: `format!("***", self.secret_key)`

That is why of the change on the stripe.rs. Is it fine to keep on this PR or prefer the Clippy fix on a different one?

@arlyon
Copy link
Owner

arlyon commented Sep 24, 2024

I can see CI is failing also. I am going to update MSRV and fix any outstanding lints and comment here when you can rebase :)

@arlyon
Copy link
Owner

arlyon commented Sep 24, 2024

#617 should be ready soonish

@arlyon
Copy link
Owner

arlyon commented Sep 24, 2024

Ok! Please rebase when you have the chance

### Description
Currently, the `checkout_session_ext` is not being exported, which makes the `RetrieveCheckoutSessionLineItems` not being able to be used.

With this change, the following should now be possible:
```rust
use std::str::FromStr;

use stripe::{CheckoutSession, CheckoutSessionId, Client, RetrieveCheckoutSessionLineItems};

#[tokio::main]
async fn main() {
    let secret_key = std::env::var("STRIPE_SECRET_KEY").expect("Missing STRIPE_SECRET_KEY in env");
    let client = Client::new(secret_key);

    let _line_items = CheckoutSession::retrieve_line_items(
        &client,
        &CheckoutSessionId::from_str("").unwrap(),
        &RetrieveCheckoutSessionLineItems::default(),
    )
    .await
    .unwrap();
}
```

Closes arlyon#614
@augustoccesar augustoccesar force-pushed the feat/export-checkout-session-ext branch from a652060 to e4e7220 Compare September 25, 2024 11:15
@augustoccesar
Copy link
Contributor Author

Ok! Please rebase when you have the chance

Done! ✅

@arlyon arlyon merged commit 3847e42 into arlyon:master Sep 26, 2024
18 checks passed
@arlyon
Copy link
Owner

arlyon commented Sep 26, 2024

New release coming soon, TY 🎉

@arlyon
Copy link
Owner

arlyon commented Sep 26, 2024

🎉 This PR is included in version 0.40.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

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

Successfully merging this pull request may close these issues.

module resources not public
2 participants