arlyon / async-stripe

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

Add missing prefix for CheckoutSessionItemId #349

Closed eric-seppanen closed 1 year ago

eric-seppanen commented 1 year ago

Summary

Adds the missing "li_" prefix for CheckoutSessionItemId.

This can be seen in the documentation here: https://stripe.com/docs/api/checkout/sessions/line_items

I also see the same prefix with the Stripe CLI, using stripe checkout sessions list --expand data.line_items

Checklist

eric-seppanen commented 1 year ago

I also verified the modified crate against data from a live stripe API:

let expand = ["line_items"];
let result = CheckoutSession::retrieve(&client, &session_id, &expand).await?;
println!("{result:#?}");

and observed within the results:

   line_items: List {
        data: [
            CheckoutSessionItem {
                id: CheckoutSessionItemId(
                    "li_1Mh3pWFf8peiXbpDMszIA8TT",
                ),
...
arlyon commented 1 year ago

Solid, TY. Going to run CI and merge.

codecov[bot] commented 1 year ago

Codecov Report

Merging #349 (c6bdb57) into master (8643cb3) will increase coverage by 0.01%. The diff coverage is n/a.

@@            Coverage Diff            @@
##           master    #349      +/-   ##
=========================================
+ Coverage    6.41%   6.42%   +0.01%     
=========================================
  Files         131     131              
  Lines       20546   20546              
=========================================
+ Hits         1317    1320       +3     
+ Misses      19229   19226       -3     
Impacted Files Coverage Δ
src/ids.rs 56.33% <ø> (ø)
src/resources/generated/subscription.rs 1.50% <0.00%> (+0.32%) :arrow_up:

:mega: We’re building smart automated test selection to slash your CI/CD build times. Learn more