mirror of
https://github.com/juspay/hyperswitch.git
synced 2025-11-02 04:04:43 +08:00
fix(refunds): removed payment_id as mandatory parameter in refund update (#338)
This commit is contained in:
@ -78,11 +78,11 @@ pub async fn refund_update(
|
||||
state: web::Data<routes::AppState>,
|
||||
req: HttpRequest,
|
||||
path: web::Path<String>,
|
||||
form_payload: web::Form<types::StripeCreateRefundRequest>,
|
||||
form_payload: web::Form<types::StripeUpdateRefundRequest>,
|
||||
) -> HttpResponse {
|
||||
let refund_id = path.into_inner();
|
||||
let payload = form_payload.into_inner();
|
||||
let create_refund_update_req: refund_types::RefundRequest = payload.into();
|
||||
let create_refund_update_req: refund_types::RefundUpdateRequest = payload.into();
|
||||
|
||||
wrap::compatibility_api_wrap::<
|
||||
_,
|
||||
|
||||
@ -11,6 +11,11 @@ pub struct StripeCreateRefundRequest {
|
||||
pub reason: Option<String>,
|
||||
}
|
||||
|
||||
#[derive(Clone, Default, Serialize, Deserialize, PartialEq, Eq)]
|
||||
pub struct StripeUpdateRefundRequest {
|
||||
pub metadata: Option<serde_json::Value>,
|
||||
}
|
||||
|
||||
#[derive(Clone, Serialize, PartialEq, Eq)]
|
||||
pub struct StripeCreateRefundResponse {
|
||||
pub id: String,
|
||||
@ -40,6 +45,14 @@ impl From<StripeCreateRefundRequest> for refunds::RefundRequest {
|
||||
}
|
||||
}
|
||||
|
||||
impl From<StripeUpdateRefundRequest> for refunds::RefundUpdateRequest {
|
||||
fn from(req: StripeUpdateRefundRequest) -> Self {
|
||||
Self {
|
||||
metadata: req.metadata,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl From<refunds::RefundStatus> for StripeRefundStatus {
|
||||
fn from(status: refunds::RefundStatus) -> Self {
|
||||
match status {
|
||||
|
||||
Reference in New Issue
Block a user