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

54 implement payments endpoint #97

Merged
merged 14 commits into from
Jul 26, 2024
Merged

Conversation

LeonardTibben
Copy link
Contributor

✨ What kind of change does this PR introduce? (Bug fix, feature, docs update...)

Payment endpoints

⤵️ What is the current behavior?

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

  • All projects build
  • Follows style guide lines
  • Relevant documentation was updated
  • Rebased onto current main

@LeonardTibben LeonardTibben linked an issue Jul 26, 2024 that may be closed by this pull request
Comment on lines 235 to 238
#[derive(Default)]
pub enum IncludeFailed {
True,
#[default]
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice!

Comment on lines 30 to 42
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
Copy link
Collaborator

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()

Comment on lines 60 to 73
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
}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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()
}

Comment on lines 56 to 69
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
}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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()
}

Comment on lines 47 to 59
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
}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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()
}

@LeonardTibben LeonardTibben force-pushed the 54-implement-payments-endpoint branch from fe344c8 to eb590ec Compare July 26, 2024 12:18
Comment on lines 241 to 249
//
// impl AsRef<str> for IncludeFailed {
// fn as_ref(&self) -> &str {
// match self {
// IncludeFailed::True => "true",
// IncludeFailed::False => "false",
// }
// }
// }
Copy link
Collaborator

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.

@@ -15,7 +15,7 @@
//! stabilization.
//!
//! #### Supported endpoints:
//! ![80%](https://progress-bar.dev/80/?width=200)
//! ![86%](https://progress-bar.dev/67/?width=200)
Copy link
Collaborator

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

@tluijken tluijken self-requested a review July 26, 2024 13:48
@tluijken tluijken merged commit a0308c3 into develop Jul 26, 2024
2 checks passed
@tluijken tluijken deleted the 54-implement-payments-endpoint branch July 26, 2024 13:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Implement Payments endpoint
2 participants