-
Notifications
You must be signed in to change notification settings - Fork 5
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
Checkout creation not matching docs #4
Comments
Hey @BWStearns I sincerely apologize for the oversight from my end as well as the delayed response. I've been busy with my studies recently, and hence there was a delay in addressing this issue. Below is the code snippet that I believe should work with your project: // imports
use lemonsqueezy::checkout::Checkout;
use lemonsqueezy::types::checkout::*;
// usage
let checkout = checkout
.create(CreateCheckout {
r#type: String::from("checkouts"),
attributes: CreateCheckoutAttributes {
..Default::default()
},
relationships: Some(CreateCheckoutRelationships {
store: lemonsqueezy::types::Data {
data: CreateCheckoutRelationShipData {
r#type: String::from("stores"),
id: String::from("//store id"),
},
},
variant: lemonsqueezy::types::Data {
data: CreateCheckoutRelationShipData {
r#type: String::from("variants"),
id: String::from("// variant id"),
},
},
}),
}).await; Please let me know if it works, if it does I will merge #5 Also a pro tip the entire source code is designed to closely follow the documentation at lemonsqueezy. You can compare the above input with the official docs, which might help develop and debug any oversights from my end. However, if you encounter any more issues, please feel free to open another issue. Thanks and happy hacking! |
Thanks for the help. That got me closer, but now I'm getting This is what my code looks like now. I'm going to poke around the library code to see if I can debug it.
|
According to the docs the following should work but the compiler is unhappy.
Is there some intermediate object needed here? Should I wrap the
store_id
andcustomer_id
in some attributes object?The text was updated successfully, but these errors were encountered: