-
Notifications
You must be signed in to change notification settings - Fork 0
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
54 implement payments endpoint #97
Conversation
stellar_rust_sdk/src/models/mod.rs
Outdated
#[derive(Default)] | ||
pub enum IncludeFailed { | ||
True, | ||
#[default] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice!
fn get_query_parameters(&self) -> String { | ||
let mut params = String::new(); | ||
|
||
if let Some(cursor) = self.cursor { | ||
params.push_str(&format!("cursor={}&", cursor)); | ||
} | ||
if let Some(limit) = self.limit { | ||
params.push_str(&format!("limit={}&", limit)); | ||
} | ||
if let Some(order) = &self.order { | ||
params.push_str(&format!("order={}&", order)); | ||
} | ||
params |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Dit is zoals alle andere requests dit doen. Ik zou willen voorstellen hierdezelfde logica aan te houden:
vec![
self.cursor.as_ref().map(|c| format!("cursor={}", c)),
self.limit.as_ref().map(|l| format!("limit={}", l)),
self.order.as_ref().map(|o| format!("order={}", o)),
]
.build_query_parameters()
fn get_query_parameters(&self) -> String { | ||
let mut params = String::new(); | ||
if let Some(cursor) = self.cursor { | ||
params.push_str(&format!("cursor={}&", cursor)); | ||
} | ||
if let Some(limit) = self.limit { | ||
params.push_str(&format!("limit={}&", limit)); | ||
} | ||
if let Some(order) = &self.order { | ||
params.push_str(&format!("order={}&", order)); | ||
} | ||
params.push_str(&format!("include_failed={}", self.include_failed)); | ||
params | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fn get_query_parameters(&self) -> String { | |
let mut params = String::new(); | |
if let Some(cursor) = self.cursor { | |
params.push_str(&format!("cursor={}&", cursor)); | |
} | |
if let Some(limit) = self.limit { | |
params.push_str(&format!("limit={}&", limit)); | |
} | |
if let Some(order) = &self.order { | |
params.push_str(&format!("order={}&", order)); | |
} | |
params.push_str(&format!("include_failed={}", self.include_failed)); | |
params | |
} | |
fn get_query_parameters(&self) -> String { | |
vec![ | |
self.include_failed.as_ref().map(|s| format!("include_failed={}", s)), | |
self.cursor.as_ref().map(|c| format!("cursor={}", c)), | |
self.limit.as_ref().map(|l| format!("limit={}", l)), | |
self.order.as_ref().map(|o| format!("order={}", o)), | |
] | |
.build_query_parameters() | |
} |
fn get_query_parameters(&self) -> String { | ||
let mut params = String::new(); | ||
if let Some(cursor) = self.cursor { | ||
params.push_str(&format!("cursor={}&", cursor)); | ||
} | ||
if let Some(limit) = self.limit { | ||
params.push_str(&format!("limit={}&", limit)); | ||
} | ||
if let Some(order) = &self.order { | ||
params.push_str(&format!("order={}&", order)); | ||
} | ||
params.push_str(&format!("include_failed={}", self.include_failed)); | ||
params | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fn get_query_parameters(&self) -> String { | |
let mut params = String::new(); | |
if let Some(cursor) = self.cursor { | |
params.push_str(&format!("cursor={}&", cursor)); | |
} | |
if let Some(limit) = self.limit { | |
params.push_str(&format!("limit={}&", limit)); | |
} | |
if let Some(order) = &self.order { | |
params.push_str(&format!("order={}&", order)); | |
} | |
params.push_str(&format!("include_failed={}", self.include_failed)); | |
params | |
} | |
fn get_query_parameters(&self) -> String { | |
vec![ | |
self.include_failed.as_ref().map(|s| format!("include_failed={}", s)), | |
self.cursor.as_ref().map(|c| format!("cursor={}", c)), | |
self.limit.as_ref().map(|l| format!("limit={}", l)), | |
self.order.as_ref().map(|o| format!("order={}", o)), | |
] | |
.build_query_parameters() | |
} |
fn get_query_parameters(&self) -> String { | ||
let mut params = String::new(); | ||
if let Some(cursor) = self.cursor { | ||
params.push_str(&format!("cursor={}&", cursor)); | ||
} | ||
if let Some(limit) = self.limit { | ||
params.push_str(&format!("limit={}&", limit)); | ||
} | ||
if let Some(order) = &self.order { | ||
params.push_str(&format!("order={}&", order)); | ||
} | ||
params | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fn get_query_parameters(&self) -> String { | |
let mut params = String::new(); | |
if let Some(cursor) = self.cursor { | |
params.push_str(&format!("cursor={}&", cursor)); | |
} | |
if let Some(limit) = self.limit { | |
params.push_str(&format!("limit={}&", limit)); | |
} | |
if let Some(order) = &self.order { | |
params.push_str(&format!("order={}&", order)); | |
} | |
params | |
} | |
fn get_query_parameters(&self) -> String { | |
vec![ | |
self.cursor.as_ref().map(|c| format!("cursor={}", c)), | |
self.limit.as_ref().map(|l| format!("limit={}", l)), | |
self.order.as_ref().map(|o| format!("order={}", o)), | |
] | |
.build_query_parameters() | |
} |
fe344c8
to
eb590ec
Compare
stellar_rust_sdk/src/models/mod.rs
Outdated
// | ||
// impl AsRef<str> for IncludeFailed { | ||
// fn as_ref(&self) -> &str { | ||
// match self { | ||
// IncludeFailed::True => "true", | ||
// IncludeFailed::False => "false", | ||
// } | ||
// } | ||
// } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This can be removed since we no longer use this.
stellar_rust_sdk/src/lib.rs
Outdated
@@ -15,7 +15,7 @@ | |||
//! stabilization. | |||
//! | |||
//! #### Supported endpoints: | |||
//! ![80%](https://progress-bar.dev/80/?width=200) | |||
//! ![86%](https://progress-bar.dev/67/?width=200) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The path should have the same number as the percentage. 67 > 86
✨ What kind of change does this PR introduce? (Bug fix, feature, docs update...)
Payment endpoints
No payment endpoint functionality
🆕 What is the new behavior (if this is a feature change)?
N/A
💥 Does this PR introduce a breaking change?
no
🐛 Recommendations for testing
N/A
📝 Links to relevant issues/docs
🤔 Checklist before submitting