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(api_models): derive Serialize, Eq, PartialEq, strum::Display on RefundStatus #989

Merged
merged 12 commits into from
May 2, 2023
4 changes: 3 additions & 1 deletion crates/api_models/src/refunds.rs
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,9 @@ pub struct RefundUpdateRequest {
pub metadata: Option<pii::SecretSerdeValue>,
}

#[derive(Default, Debug, Clone, ToSchema, Deserialize)]
#[derive(
Default, Debug, Clone, Copy, ToSchema, Deserialize, Serialize, Eq, PartialEq, strum::Display,
)]
#[serde(rename_all = "snake_case")]
pub enum RefundType {
#[default]
Expand Down
2 changes: 1 addition & 1 deletion crates/router/src/core/refunds.rs
Original file line number Diff line number Diff line change
Expand Up @@ -477,7 +477,7 @@ pub async fn validate_and_create_refund(
let (refund_id, all_refunds, currency, refund_create_req, refund);

// Only for initial dev and testing
let refund_type = req.refund_type.clone().unwrap_or_default();
let refund_type = req.refund_type.unwrap_or_default();

// If Refund Id not passed in request Generate one.

Expand Down